zhouyi 发表于 2015-11-8 17:59:50

OCP-1Z0-053-V12.02-178题

  178.If a log file becomes corrupted, it may cause the database to stall. How would you correct such a situation?
  A. Recover the online redo log from backup.
  B. Delete and re-create the log file.
  C. Use the alter database clear logfile command to clear the log file.
  D. Shut down the database and restart it.
  E. Shut down the database and then mount it. Clear the log file with the alter database clear logfile
  command and then restart the database with alter database open resetlogs.
Answer: C 答案解析:参考:http://blog.iyunv.com/rlhua/article/details/14226571http://blog.iyunv.com/rlhua/article/details/12343983
sys@TEST1107> select * from v$log;
    GROUP#    THREAD#SEQUENCE#      BYTESBLOCKSIZE    MEMBERS ARC STATUS         FIRST_CHANGE#---------- ---------- ---------- ---------- ---------- ---------- --- ---------------- -------------FIRST_TIME         NEXT_CHANGE# NEXT_TIME------------------ ------------ ------------------         1          1          0   52428800      512          2 YES UNUSED               138712907-NOV-13               1387224 07-NOV-13
         2          1         26   52428800      512          2 YES INACTIVE               138722407-NOV-13               1387262 07-NOV-13
         3          1         27   52428800      512          2 NOCURRENT                138726207-NOV-13            2.8147E+14
$ rm -f /u01/app/oracle/oradata/test1107/redo02.log
sys@TEST1107> alter database clear logfile group 2;
Database altered.

----如果没有执行上面这个语句,在再次启动数据库时 被删掉的日志会变成INVALID状态。执行alter database clear logfile group 2,再次启动数据库时,日志都是正常的。所以可以直接在线清除日志信息,E答案不用resetlogs打开数据库,错误。D答案,再次启动,日志会变成INVALID状态。B答案,需要关闭再起库到mount状态。A答案,直接清除就可以,不需要恢复。
以下关闭再启库,只是测试日志是否正常。
sys@TEST1107> shutdown immediateDatabase closed.Database dismounted.ORACLE instance shut down.sys@TEST1107> startupORACLE instance started.
Total System Global Area 1269366784 bytesFixed Size                  2227984 bytesVariable Size             872415472 bytesDatabase Buffers          385875968 bytesRedo Buffers                8847360 bytesDatabase mounted.Database opened.sys@TEST1107> select * from v$logfile;
    GROUP# STATUSTYPE    MEMBER                                             IS_---------- ------- ------- -------------------------------------------------- ---         3         ONLINE/u01/app/oracle/oradata/test1107/redo03.log      NO         2         ONLINE/u01/app/oracle/oradata/test1107/redo02.log      NO         1         ONLINE/u01/app/oracle/oradata/test1107/redo01.log      NO         1         ONLINE/u01/app/oracle/oradata/test1107/redo01a.log       NO         2         ONLINE/u01/app/oracle/oradata/test1107/redo02a.log       NO         3         ONLINE/u01/app/oracle/oradata/test1107/redo03a.log       NO
6 rows selected.
         版权声明:本文为博主原创文章,未经博主允许不得转载。
页: [1]
查看完整版本: OCP-1Z0-053-V12.02-178题