目的:在临时表空间的数据文件损坏的前提下,进行临时文件的恢复,更确切的说是修复
临时数据文件的损坏或丢失会造成需要使用临时表空间的命令执行失败,但不会造成实例崩溃。由于临时表空间存放的是临时数据,RMAN不会对其进行备份,一旦损坏采用的恢复方法是重建或替换
如果在数据库运行过程中,发现临时数据文件损坏或丢失,可以采用 替换的方法恢复,不需要重启数据库:
如出现下列的错误:
恢复步骤如下:
1.向临时表空间中添加新的临时数据文件
2.删除掉损坏的临时文件
3.重新进行一样的查询,来确认是否临时表空间内的数据文件修复成功,从而可以让查询使用临时表空间
4.修复成功
另外,如果在启动实例的情况下,发现临时文件丢失了数据库会自动重建这个临时文件,用户不会有任何的错误信息提示,但是在alert日志中,有相关提示:
如:
启动实例,没有任何的错误提示:
监控警告日志alert_radius.log,如下:
【说明】
Re-creating tempfile /u01/oradata/radius/temp02.dbf 代表了重新创建临时文件
如果,在启动实例时,监测到临时文件损坏,而不是丢失,因为这个文件的存在,不能重新创建同名的文件,启动时没有任何的错误提示,但是在警告日志中,会有下列的提示:
【说明】
临时文件重建失败,为了不在数据库的整个运行过程中,出现问题,需要关闭实例,删除损坏的临时文件,重新启动实例,就会重新创建出一个同名的临时文件,避免在数据库正常运行的过程中,出现问题。
--END--
临时数据文件的损坏或丢失会造成需要使用临时表空间的命令执行失败,但不会造成实例崩溃。由于临时表空间存放的是临时数据,RMAN不会对其进行备份,一旦损坏采用的恢复方法是重建或替换
如果在数据库运行过程中,发现临时数据文件损坏或丢失,可以采用 替换的方法恢复,不需要重启数据库:
如出现下列的错误:
SQL> select * from v$tempfile;
select * from v$tempfile
*
ERROR at line 1:
ORA-00600: internal error code, arguments: [krhcvt_filhdr_v10_01], [], [], [], [], [], [], []
1.向临时表空间中添加新的临时数据文件
SQL> alter tablespace temp add tempfile '/u01/oradata/radius/temp02.dbf' size 100M;
Tablespace altered.
SQL> alter tablespace temp drop tempfile '/u01/oradata/radius/temp01.dbf';
Tablespace altered.
SQL> select file#, name from v$tempfile;
FILE# NAME
---------- ---------------------------------------------
2 /u01/oradata/radius/temp02.dbf
另外,如果在启动实例的情况下,发现临时文件丢失了数据库会自动重建这个临时文件,用户不会有任何的错误信息提示,但是在alert日志中,有相关提示:
如:
启动实例,没有任何的错误提示:
SQL> startup
ORACLE instance started.
Total System Global Area 599785472 bytes
Fixed Size 2085776 bytes
Variable Size 163581040 bytes
Database Buffers 427819008 bytes
Redo Buffers 6299648 bytes
Database mounted.
Database opened.
Wed Sep 3 18:50:01 2014
Re-creating tempfile /u01/oradata/radius/temp02.dbf
Database Characterset is US7ASCII
Opening with internal Resource Manager plan
where NUMA PG = 1, CPUs = 1
replication_dependency_tracking turned off (no async multimaster replication found)
Starting background process QMNC
QMNC started with pid=22, OS id=4637
Wed Sep 3 18:50:06 2014
db_recovery_file_dest_size of 2048 MB is 0.69% used. This is a
user-specified limit on the amount of space that will be used by this
database for recovery-related files, and does not reflect the amount of
space available in the underlying filesystem or ASM diskgroup.
Wed Sep 3 18:50:06 2014
Completed: ALTER DATABASE OPEN
Re-creating tempfile /u01/oradata/radius/temp02.dbf 代表了重新创建临时文件
如果,在启动实例时,监测到临时文件损坏,而不是丢失,因为这个文件的存在,不能重新创建同名的文件,启动时没有任何的错误提示,但是在警告日志中,会有下列的提示:
Cannot re-create tempfile /u01/oradata/radius/temp02.dbf, the same name file exists
Wed Sep 3 18:56:26 2014
Errors in file /u01/app/oracle/admin/radius/bdump/radius_dbw0_4679.trc:
ORA-01157: cannot identify/lock data file 202 - see DBWR trace file
ORA-01110: data file 202: '/u01/oradata/radius/temp02.dbf'
ORA-27046: file size is not a multiple of logical block size
Additional information: 1
Database Characterset is US7ASCII
ARC5 started with pid=21, OS id=4711
Wed Sep 3 18:56:26 2014
Opening with internal Resource Manager plan
where NUMA PG = 1, CPUs = 1
replication_dependency_tracking turned off (no async multimaster replication found)
Starting background process QMNC
QMNC started with pid=22, OS id=4713
Wed Sep 3 18:56:26 2014
db_recovery_file_dest_size of 2048 MB is 0.69% used. This is a
user-specified limit on the amount of space that will be used by this
database for recovery-related files, and does not reflect the amount of
space available in the underlying filesystem or ASM diskgroup.
Wed Sep 3 18:56:26 2014
Completed: ALTER DATABASE OPEN
临时文件重建失败,为了不在数据库的整个运行过程中,出现问题,需要关闭实例,删除损坏的临时文件,重新启动实例,就会重新创建出一个同名的临时文件,避免在数据库正常运行的过程中,出现问题。
--END--