zoukankan      html  css  js  c++  java
  • OCP-1Z0-053-V13.02-625题

    625.Your database is running in ARCHIVELOG mode. One of the data files, USERDATA01.dbf, in the

    USERS tablespace is damaged and you need to recover the file until the point of failure. The backup for

    the datafile is available.

    Which three files would be used in the user-managed recovery process performed by the database administrator (DBA)? (Choose Three)

    A. Redo logs

    B. Control file

    C. The latest backup of only the damaged data file

    D. The latest backup of all the data file in the USERS tablespace

    E. Temporary files of temporary tablespace

    F. Archive Logs since the latest backup to point of failure

    Answer: ACF


    答案解析:

    对比507题:http://blog.csdn.net/rlhua/article/details/16943999

     

    从以下实验看出,redo log是用来介质恢复用的。

    the latest backup of only the damaged data file用来做转储用。

    Archive Logs since the latest backup to point of failure应用归档日志恢复到故障点

    这里要求选三个,从用排除法,DE是不需要用到的。


    故正确答案为ACF

    实验参考:

    sys@TEST1107> !cat /u01/app/oracle/bak/hot_bak.sql

    set echo off trimspool off heading off feedback off verify off time off

    set pagesize 0 linesize 200

    define bakdir='/u01/app/oracle/bak/hot_bak'

    define bakscp='/u01/app/oracle/bak/hot_cmd.sql'

    set serveroutput on

    spool &bakscp

    prompt alter system switch logfile;;

    declare

            cursor cu_tablespace is

                    select tablespace_name from dba_tablespaces

                    where contents not like 'TEMP%'  and status='ONLINE';

            cursor cu_datafile(name varchar2) is

                    select file_name from dba_data_files where tablespace_name=name;

    begin

            for i in cu_tablespace loop

                    dbms_output.put_line('alter tablespace '|| i.tablespace_name||' begin backup;');

                    for j in cu_datafile(i.tablespace_name) loop

                            dbms_output.put_line('host cp '||j.file_name||' &bakdir');

                    end loop;

                    dbms_output.put_line('alter tablespace '|| i.tablespace_name||' end backup;');

            end loop;

            dbms_output.put_line('alter database backup controlfile to trace;');

            dbms_output.put_line('alter database backup controlfile to ''&bakdir/control01.ctl'';');

    end;

    /


    spool off

    @&bakscp


    sys@TEST1107> @/u01/app/oracle/bak/hot_bak.sql

    alter system switch logfile;

    alter tablespace SYSTEM begin backup;

    host cp /u01/app/oracle/oradata/test1107/system01.dbf /u01/app/oracle/bak/hot_bak

    alter tablespace SYSTEM end backup;

    alter tablespace SYSAUX begin backup;

    host cp /u01/app/oracle/oradata/test1107/sysaux01.dbf /u01/app/oracle/bak/hot_bak

    alter tablespace SYSAUX end backup;

    alter tablespace UNDOTBS1 begin backup;

    host cp /u01/app/oracle/oradata/test1107/undotbs01.dbf /u01/app/oracle/bak/hot_bak

    alter tablespace UNDOTBS1 end backup;

    alter tablespace USERS begin backup;

    host cp /u01/app/oracle/oradata/test1107/users01.dbf /u01/app/oracle/bak/hot_bak

    alter tablespace USERS end backup;

    alter tablespace EXAMPLE begin backup;

    host cp /u01/app/oracle/oradata/test1107/example01.dbf /u01/app/oracle/bak/hot_bak

    alter tablespace EXAMPLE end backup;

    alter tablespace FLA_TBS1 begin backup;

    host cp /u01/app/oracle/oradata/test1107/fla_tbs01.dbf /u01/app/oracle/bak/hot_bak

    alter tablespace FLA_TBS1 end backup;

    alter database backup controlfile to trace;

    alter database backup controlfile to '/u01/app/oracle/bak/hot_bak/control01.ctl';


    [oracle@rtest hot_bak]$ ls

    control01.ctl  example01.dbf  fla_tbs01.dbf  sysaux01.dbf  system01.dbf  undotbs01.dbf  users01.dbf


    删除数据文件

    [oracle@rtest ~]$ rm /u01/app/oracle/oradata/test1107/users01.dbf

    [oracle@rtest ~]$ ls /u01/app/oracle/oradata/test1107/users01.dbf

    ls: /u01/app/oracle/oradata/test1107/users01.dbf: No such file or directory


    模拟断电,重启,报错。

    sys@TEST1107> shutdown abort;

    ORACLE instance shut down.

    sys@TEST1107> startup

    ORACLE instance started.

    Total System Global Area 1252663296 bytes

    Fixed Size                  2227944 bytes

    Variable Size            1006633240 bytes

    Database Buffers          234881024 bytes

    Redo Buffers                8921088 bytes

    Database mounted.

    ORA-01157: cannot identify/lock data file 4 - see DBWR trace file

    ORA-01110: data file 4: '/u01/app/oracle/oradata/test1107/users01.dbf'



    [oracle@rtest trace]$ tail -f alert_test1107.log

    ORA-01110: data file 4: '/u01/app/oracle/oradata/test1107/users01.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/test1107/test1107/trace/test1107_ora_5648.trc:

    ORA-01157: cannot identify/lock data file 4 - see DBWR trace file

    ORA-01110: data file 4: '/u01/app/oracle/oradata/test1107/users01.dbf'



    热备转储

    [oracle@rtest ~]$ cp /u01/app/oracle/bak/hot_bak/users01.dbf /u01/app/oracle/oradata/test1107/users01.dbf


    恢复,并打开数据库

    sys@TEST1107> recover datafile 4;

    Media recovery complete.

    sys@TEST1107> alter database open;

    Database altered.



    ALTER DATABASE RECOVER  datafile 4  

    Media Recovery Start

    Serial Media Recovery started

    Recovery of Online Redo Log: Thread 1 Group 2 Seq 149 Reading mem 0

      Mem# 0: /u01/app/oracle/oradata/test1107/redo02.log

      Mem# 1: /u01/app/oracle/oradata/test1107/redo02a.log

    Media Recovery Complete (test1107)

    Completed: ALTER DATABASE RECOVER  datafile 4  

    Mon Nov 25 11:32:08 2013

    alter database open

    Beginning crash recovery of 1 threads

     parallel recovery started with 7 processes

    Started redo scan

    Mon Nov 25 11:32:20 2013

    Completed redo scan

     read 366 KB redo, 178 data blocks need recovery

    Started redo application at

     Thread 1: logseq 149, block 31395

    Recovery of Online Redo Log: Thread 1 Group 2 Seq 149 Reading mem 0

      Mem# 0: /u01/app/oracle/oradata/test1107/redo02.log

      Mem# 1: /u01/app/oracle/oradata/test1107/redo02a.log

    Completed redo application of 0.14MB

    Completed crash recovery at

     Thread 1: logseq 149, block 32127, scn 3604684

     178 data blocks read, 178 data blocks written, 366 redo k-bytes read

    Mon Nov 25 11:32:24 2013

    LGWR: STARTING ARCH PROCESSES

    Mon Nov 25 11:32:24 2013

    ARC0 started with pid=27, OS id=7305 

    ARC0: Archival started

    LGWR: STARTING ARCH PROCESSES COMPLETE

    ARC0: STARTING ARCH PROCESSES

    Mon Nov 25 11:32:25 2013

    ARC1 started with pid=28, OS id=7317 

    Mon Nov 25 11:32:25 2013

    ARC2 started with pid=29, OS id=7319 

    ARC1: Archival started

    ARC2: Archival started

    Mon Nov 25 11:32:25 2013

    ARC3 started with pid=30, OS id=7321 

    ARC1: Becoming the 'no FAL' ARCH

    ARC1: Becoming the 'no SRL' ARCH

    ARC2: Becoming the heartbeat ARCH

    Thread 1 advanced to log sequence 150 (thread open)

    ARC3: Archival started

    ARC0: STARTING ARCH PROCESSES COMPLETE

    Thread 1 opened at log sequence 150

      Current log# 3 seq# 150 mem# 0: /u01/app/oracle/oradata/test1107/redo03a.log

      Current log# 3 seq# 150 mem# 1: /u01/app/oracle/oradata/test1107/redo03.log

    Successful open of redo thread 1

    Mon Nov 25 11:32:31 2013

    MTTR advisory is disabled because FAST_START_MTTR_TARGET is not set

    Mon Nov 25 11:32:33 2013

    SMON: enabling cache recovery

    Mon Nov 25 11:32:37 2013

    Archived Log entry 169 added for thread 1 sequence 149 ID 0x8b48e999 dest 1:

    [5648] Successfully onlined Undo Tablespace 2.

    Undo initialization finished serial:0 start:1028413304 end:1028413834 diff:530 (5 seconds)

    Verifying file header compatibility for 11g tablespace encryption..

    Verifying 11g file header compatibility for tablespace encryption completed

    SMON: enabling tx recovery

    Database Characterset is AL32UTF8

    No Resource Manager plan active

    Starting background process FBDA

    Mon Nov 25 11:32:41 2013

    FBDA started with pid=31, OS id=7378 

    Mon Nov 25 11:32:42 2013

    replication_dependency_tracking turned off (no async multimaster replication found)

    Starting background process QMNC

    Mon Nov 25 11:32:47 2013

    QMNC started with pid=32, OS id=7382 

    Mon Nov 25 11:32:52 2013

    Completed: alter database open

    Mon Nov 25 11:32:57 2013

    Starting background process SMCO

    Mon Nov 25 11:32:57 2013

    SMCO started with pid=38, OS id=7418 

    Mon Nov 25 11:33:01 2013

    db_recovery_file_dest_size of 4122 MB is 34.02% 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.

    Mon Nov 25 11:33:04 2013

    Starting background process CJQ0

    Mon Nov 25 11:33:05 2013

    CJQ0 started with pid=39, OS id=7436 



    参考:http://blog.csdn.net/rlhua/article/details/12682217


  • 相关阅读:
    面试-Hash是怎么实现的?
    教程-在Delphi中怎么查看是否有内存泄漏(Delphi2007)+WIN7
    面试-SizeOf一个对象会得到什么?
    Unity-Animator深入系列---录制与回放
    Animation.Sample用法介绍
    Unity-Animator深入系列---StateMachineBehaviour状态机脚本学习
    Unity-Animator深入系列---deltaPosition&deltaRotation
    Unity-Animato深入系列---FloatValue阻尼
    Animation在每一帧中的执行顺序测试
    Unity脚本在层级面板中的执行顺序测试2
  • 原文地址:https://www.cnblogs.com/hzcya1995/p/13315972.html
Copyright © 2011-2022 走看看