1.Your multitenant container (CDB) contains two pluggable databases (PDB), HR_PDB and
ACCOUNTS_PDB, both of which use the CDB tablespace. The temp file is called
temp01.tmp.
A user issues a query on a table on one of the PDBs and receives the following error:
ERROR at line 1:
ORA-01565: error in identifying file ‘/u01/app/oracle/oradata/CDB1/temp01.tmp’
ORA-27037: unable to obtain file status
Identify two ways to rectify the error.
A. Add a new temp file to the temporary tablespace and drop the temp file that that
produced the error.
B. Shut down the database instance, restore the temp01.tmp file from the backup, and then
restart the database.
C. Take the temporary tablespace offline, recover the missing temp file by applying redo
logs, and then bring the temporary tablespace online.
D. Shutdown the database instance, restore and recover the temp file from the backup, and
then open the database with RESETLOGS.
E. Shut down the database instance and then restart the CDB and PDBs.
Answer: A,E
Explanation: * Because temp files cannot be backed up and because no redo is ever
generated for them, RMAN never restores or recovers temp files. RMAN does track the
names of temp files, but only so that it can automatically re-create them when needed.
* If you use RMAN in a Data Guard environment, then RMAN transparently converts
primary control files to standby control files and vice versa. RMAN automatically updates
file names for data files, online redo logs, standby redo logs, and temp files when you issue
RESTORE and RECOVER.
Oracle在使用rman进行数据库备份的时候,并不会去备份temp文件,所以,也就没有restore,recover这个说法
B,C,D错误
我们常见的恢复的temp文件丢失的就是两种方法,
第一种是重新添加一个temp文件,然后在删除掉原来的temp文件
02:54:42 idle> ALTER TABLESPACE TEMP ADD TEMPFILE '/u01/app/oracle/oradata/prodcdb/temp02.dbf' size 50m autoextend on;
Tablespace altered.
Elapsed: 00:00:00.12
02:56:53 idle> ALTER TABLESPACE TEMP DROP TEMPFILE '/u01/app/oracle/oradata/prodcdb/temp01.dbf';
ORA-01157: cannot identify/lock data file 201 - see DBWR trace file
ORA-01110: data file 201: '/u01/app/oracle/oradata/prodcdb/temp01.dbf'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
Errors in file /u01/app/oracle/diag/rdbms/prodcdb/prodcdb/trace/prodcdb_dbw0_3318.trc:
ORA-01186: file 201 failed verification tests
ORA-01157: cannot identify/lock data file 201 - see DBWR trace file
ORA-01110: data file 201: '/u01/app/oracle/oradata/prodcdb/temp01.dbf'
File 201 not verified due to error ORA-01157
Starting background process SMCO
Re-creating tempfile /u01/app/oracle/oradata/prodcdb/temp01.dbf
ACCOUNTS_PDB, both of which use the CDB tablespace. The temp file is called
temp01.tmp.
A user issues a query on a table on one of the PDBs and receives the following error:
ERROR at line 1:
ORA-01565: error in identifying file ‘/u01/app/oracle/oradata/CDB1/temp01.tmp’
ORA-27037: unable to obtain file status
Identify two ways to rectify the error.
A. Add a new temp file to the temporary tablespace and drop the temp file that that
produced the error.
B. Shut down the database instance, restore the temp01.tmp file from the backup, and then
restart the database.
C. Take the temporary tablespace offline, recover the missing temp file by applying redo
logs, and then bring the temporary tablespace online.
D. Shutdown the database instance, restore and recover the temp file from the backup, and
then open the database with RESETLOGS.
E. Shut down the database instance and then restart the CDB and PDBs.
Answer: A,E
Explanation: * Because temp files cannot be backed up and because no redo is ever
generated for them, RMAN never restores or recovers temp files. RMAN does track the
names of temp files, but only so that it can automatically re-create them when needed.
* If you use RMAN in a Data Guard environment, then RMAN transparently converts
primary control files to standby control files and vice versa. RMAN automatically updates
file names for data files, online redo logs, standby redo logs, and temp files when you issue
RESTORE and RECOVER.
Oracle在使用rman进行数据库备份的时候,并不会去备份temp文件,所以,也就没有restore,recover这个说法
B,C,D错误
我们常见的恢复的temp文件丢失的就是两种方法,
第一种是重新添加一个temp文件,然后在删除掉原来的temp文件
02:54:42 idle> ALTER TABLESPACE TEMP ADD TEMPFILE '/u01/app/oracle/oradata/prodcdb/temp02.dbf' size 50m autoextend on;
Tablespace altered.
Elapsed: 00:00:00.12
02:56:53 idle> ALTER TABLESPACE TEMP DROP TEMPFILE '/u01/app/oracle/oradata/prodcdb/temp01.dbf';
Tablespace altered.
第二种是我们在重新启动的时候,会自动的重新创建我们的temp文件,我们可以在重新启动的过程中通过分析报警日志看到我们想要的结果。
Errors in file /u01/app/oracle/diag/rdbms/prodcdb/prodcdb/trace/prodcdb_dbw0_3318.trc:ORA-01157: cannot identify/lock data file 201 - see DBWR trace file
ORA-01110: data file 201: '/u01/app/oracle/oradata/prodcdb/temp01.dbf'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
Errors in file /u01/app/oracle/diag/rdbms/prodcdb/prodcdb/trace/prodcdb_dbw0_3318.trc:
ORA-01186: file 201 failed verification tests
ORA-01157: cannot identify/lock data file 201 - see DBWR trace file
ORA-01110: data file 201: '/u01/app/oracle/oradata/prodcdb/temp01.dbf'
File 201 not verified due to error ORA-01157
Starting background process SMCO
Re-creating tempfile /u01/app/oracle/oradata/prodcdb/temp01.dbf