ITPub博客

首页 > 数据库 > Oracle > 1Z0-053 V13.02 Q657

1Z0-053 V13.02 Q657

原创 Oracle 作者:cow977 时间:2016-06-21 12:35:04 0 删除 编辑
657.The database is currently open and the temp03.dbf tempfile belonging to the default temporary tablespace TEMP has been corrupted. What steps should you take to recover from this tempfile loss in an efficient manner?
A. Allow the database to continue running, drop the TEMP tablespace, and then re-create it with newtempfiles
B. Shut down the database, restore and recover the tempfile from backup, and then open the database with RESETLOGS
C. Allow the database to continue running, take the TEMP tablespace offline, drop the missing tempfile,and then create a new tempfile
D. Allow the database to continue running, add a new tempfile to TEMP tablespace with a new name, and drop the tempfile that has been corrupted.
Answer: D

SQL> select file#,name from v$tempfile;

     FILE# NAME
---------- --------------------------------------------------
         1 C:\APPS\ORACLE\ORADATA\COW\TEMP01.DBF

SQL> shutdown immediate;
数据库已经关闭。
已经卸载数据库。
ORACLE 例程已经关闭。

停库状态下删除临时文件,系统启动时会自动创建。
SQL> host del C:\APPS\ORACLE\ORADATA\COW\TEMP01.DBF

SQL> startup
ORACLE 例程已经启动。

Total System Global Area 2538741760 bytes
Fixed Size                  2257872 bytes
Variable Size             520096816 bytes
Database Buffers         1996488704 bytes
Redo Buffers               19898368 bytes
数据库装载完毕。
数据库已经打开。
SQL> select file#,name from v$tempfile;

     FILE# NAME
---------- --------------------------------------------------
         1 C:\APPS\ORACLE\ORADATA\COW\TEMP01.DBF

SQL> host dir C:\APPS\ORACLE\ORADATA\COW\TEMP01.DBF
 驱动器 C 中的卷是 OS
 卷的序列号是 12A0-BE69

 C:\APPS\ORACLE\ORADATA\COW 的目录

2016/06/21  12:32        20,979,712 TEMP01.DBF
               1 个文件     20,979,712 字节
               0 个目录  5,250,953,216 可用字节

系统运行状态,删除临时文件,可以通过添加新文件并删除丢失文件的办法来恢复,不需要停库。

SQL> host del C:\APPS\ORACLE\ORADATA\COW\TEMP01.DBF

SQL> host dir C:\APPS\ORACLE\ORADATA\COW\TEMP01.DBF
 驱动器 C 中的卷是 OS
 卷的序列号是 12A0-BE69

 C:\APPS\ORACLE\ORADATA\COW 的目录

找不到文件

SQL> alter tablespace temp add tempfile 'C:\APPS\ORACLE\ORADATA\COW\TEMP02.DBF' size 10m;

表空间已更改。

SQL> select file#,name from v$tempfile;

     FILE# NAME
---------- --------------------------------------------------
         1 C:\APPS\ORACLE\ORADATA\COW\TEMP01.DBF
         2 C:\APPS\ORACLE\ORADATA\COW\TEMP02.DBF

SQL> alter tablespace temp drop tempfile 'C:\APPS\ORACLE\ORADATA\COW\TEMP01.DBF';

表空间已更改。

SQL> select file#,name from v$tempfile;

     FILE# NAME
---------- --------------------------------------------------
         2 C:\APPS\ORACLE\ORADATA\COW\TEMP02.DBF

SQL> host dir C:\APPS\ORACLE\ORADATA\COW\TEMP*.*
 驱动器 C 中的卷是 OS
 卷的序列号是 12A0-BE69

 C:\APPS\ORACLE\ORADATA\COW 的目录

2016/06/21  12:35        10,493,952 TEMP02.DBF
               1 个文件     10,493,952 字节
               0 个目录  5,028,155,392 可用字节

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/81227/viewspace-2120593/ ,如需转载,请注明出处,否则将追究法律责任。

上一篇: 1Z0-053 V13.02 Q651
下一篇: 1Z0-053 V13.02 Q658
请登录后发表评论 登录
全部评论

注册时间:2011-03-02

  • 博文量
    698
  • 访问量
    893909