千家信息网

12c datagurad 创建临时表空间遇到的问题

发表于:2025-02-06 作者:千家信息网编辑
千家信息网最后更新 2025年02月06日,1.主库添加临时文件SQL> create temporary tablespace temp_1 tempfile '+datadg' size 10m;Tablespace created.SQL
千家信息网最后更新 2025年02月06日12c datagurad 创建临时表空间遇到的问题
1.主库添加临时文件SQL> create temporary tablespace temp_1 tempfile '+datadg' size 10m;Tablespace created.SQL> alter system archive log current;System altered.col file_name for a50;set lines 150select file_name,tablespace_name from dba_temp_files;FILE_NAME                                          TABLESPACE_NAME-------------------------------------------------- ------------------------------+DATADG/ORCL/TEMPFILE/temp.265.954623079           TEMP+DATADG/ORCL/TEMPFILE/temp_1.605.963692313         TEMP_1SQL> 
2.查看备库SQL> select open_mode from v$database;OPEN_MODE--------------------READ ONLY WITH APPLYSQL> col file_name for a50;SQL> set lines 150SQL> select file_name,tablespace_name from dba_temp_files;FILE_NAME                                          TABLESPACE_NAME-------------------------------------------------- ------------------------------+DATADG/ORCLDG/TEMPFILE/temp.406.962961491         TEMPSQL> --查看备库日志*********************************************************************WARNING: The following temporary tablespaces contain no files.         This condition can occur when a backup controlfile has         been restored.  It may be necessary to add files to these         tablespaces.  That can be done using the SQL statement:         ALTER TABLESPACE  ADD TEMPFILE         Alternatively, if these temporary tablespaces are no longer         needed, then they can be dropped.           Empty temporary tablespace: TEMP_1*********************************************************************
解决方法备库直接添加一个临时文件3.备库执行SQL> alter tablespace temp_1 add tempfile '+datadg' size 10m;Tablespace altered.SQL> col file_name for a50;SQL> set lines 150SQL> select file_name,tablespace_name from dba_temp_files;FILE_NAME                                          TABLESPACE_NAME-------------------------------------------------- ------------------------------+DATADG/ORCLDG/TEMPFILE/temp.406.962961491         TEMP+DATADG/ORCLDG/TEMPFILE/temp_1.342.963694567       TEMP_1重启备库,查看告警日志,无报错。

小结
1.主库添加临时表空间,备库数据字典存在表空间信息。
2.备库dba_temp_files数据字典不存在临时文件记录。
3.备库open状态直接添加一个临时文件即可。
4.ADG的文件管理方式和单机、RAC管理方式不同,需要大家多去测试。

0