Top Banner

of 28

2013196antunezppr-130411234317-phpapp01

Jun 02, 2018

Download

Documents

pravin2projects
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
  • 8/10/2019 2013196antunezppr-130411234317-phpapp01

    1/28

  • 8/10/2019 2013196antunezppr-130411234317-phpapp01

    2/28

    Backup and Recovery

    The first thing that we have to do, is understand what RMAN is and how RMAN works. Recovery Manager or betterknown as RMAN, is an Oracle client utility that is installed with the Enterprise or Standard edition, you can also find itwith the Admin option when installing the Oracle Client.

    In it's most basic form, the RMAN client connects, an it needs to be with a " sysdba " privileged user, to the databasethat is being backed up, called a TARGET database, this client, is an executable that is normally found in$ORACLE_HOME/bin.

    By being a client side utility, it allows you to use one RMAN executable version to backup current and previousversions of the Oracle Database; there are some restrictions to this though, which can be verified in MOS documentRMAN Compatibility Matrix [ID 73431.1].

    This RMAN executable uses a file called recover.bsq, this file is located in $ORACLE_HOME/rdbms/admin ,basically what the executable does, is to interpret the commands you give it , direct server sessions to execute thosecommands, and record its activity in the TARGET database control file that is being backed up.

    There are two main SYS packages that do the work of backup and recovery, which are DBMS_RCVMAN, this hasthe procedures which list your database incarnations, the set until time recovery window, list your backups, to name afew, and DBMS_BACKUP_RESTORE , which as you might have guessed is the one who does the backup and recoveryoperations, like create the control file snapshot , backup the datafiles , backup the spfile to name some.

    As mentioned above, the way that the RMAN client directs the server sessions to execute the commands are throughchannels, a channel represents one stream of data to a device, and corresponds to one database server session. Thechannel reads data into PGA memory, processes it, and writes it to the output device.

    The work of each channel, whether of type disk or System Backup Tape (SBT), is subdivided into the followingdistinct phases:

    Read Phase

    A channel reads blocks from disk into input I/O buffers. The allocation of these buffers depends on the number of

    datafiles being read simultaneously from disk and written to the same backup piece. One way to control the numbersof files is the backup parameter FILESPERSET Copy Phase

    A channel copies blocks from input buffers to output buffers and performs additional processing on the blocks,like the validation of the data blocks, as it verifies that it's not backing up corrupt data blocks, it's also the phasewhere it does the binary compression and the backup encryption Write Phase

    A channel writes the blocks from output buffers to storage media. The write phase can be either to SBT or todisk, and these are mutually exclusive, meaning you write to one or the other, not both.As you can see by the phases above, and what distinguishes RMAN from any other method, is that the backup is at

    the block level, as to the user managed backups, it brings great advantages, as it wont have to backup empty blocks.

    When you decide to write to SBT, Oracle uses its Media Manager Layer (MML) to allow RMAN tocommunicate with 3 rd party vendors and write the resulting backup piece to the sequential media device. Oracle uses alibrary, which is really a symbolic link to the actual 3 rd party media manager, located in $ORACLE_HOME/lib, calledlibobk.so (orasbt.dll in Windows), for example if you were to setup Oracle RMAN 11.2.0.3 in RHEL 5 64-bit versionwith Veritas Netbackup, you would have to do the following:

    cd $ORACLE_HOME/lib

    mv libobk.so libobk.so.orig

    2 Session # 196

  • 8/10/2019 2013196antunezppr-130411234317-phpapp01

    3/28

    Backup and Recovery

    ln -s /

  • 8/10/2019 2013196antunezppr-130411234317-phpapp01

    4/28

    Backup and Recovery

    BENEFITS OF THE RMAN C ATALOG

    When using Oracles RMAN backup utility, all of the backup metadata regarding the database files and thebackups that have been taken is stored in the RMAN Repository; By default, this repository is its own control file, butthere is also another way to store this metadata, it is an RMAN Recovery Catalog, this catalog is a schema an typically ina Database by itself, though there is the inconvenience that you have to maintain another database, the benefits normallyoutweigh the disadvantages of this.

    By having an RMAN recovery catalog, it creates a redundancy for the RMAN repository that is stored in thecontrol file, so if you were to lose all of your control files, the metadata of your backups will still exist in this catalog. Arecovery catalog also centralizes this metadata for all the Oracle databases that you backup in your organization, makingbackup reporting and administration tasks easier to perform.

    One of the greatest benefits of having an RMAN recovery catalog is that it keeps backup history longer than thecontrol file can keep it. If you ever have to change the DBID of your Database, all the backup information belonging tothe current and previous parent incarnation 2 would be lost, the only way to have a history of your backups, would be ifyou have an RMAN recovery catalog. In this same topic, setting CONTROL_FILE_RECORD_TIME_KEEP to a lowvalue, will mean that the control file records can be lost if Oracle needs the space in the control file, as the backup recordsare reusable records

    RMA&! list back#p s#mmar?=

    List o; 3ack#ps

    444444444444444

    "? * L 2 ,"vic" *?p" Compl"tion *im" D0i"c"s DCopi"s Compr"ss"d *ag

    ------- -- -- - ----------- -------------------- ------- ------- ---------- ---+ 3 A , 2 + - E3-'B+) B%@88@+% + + &O *AF'B+)B'+ *B%8%8'

    ' 3 A , 2 + - E3-'B+) B8@B'@BG + + E2 5LL_3AC 50

    ) 3 A A , 2 + - E3-'B+) B8@B'@'G + + E2 ARCH_3AC 50

    % 3 A , 2 + - E3-'B+) B8@B'@%% + + &O C*L_3AC 50

    8 3 A , 2 + - E3-'B+) B8@B'@8 + + &O *AF'B+)B'+ *B8B'%G

    RMA&! s #tdo9n imm"diat"

    oracl" s"rvidor+.localdomain I*E2*,3+J / om"/oracl"/,"sktop

    oracl" $ nid targ"t4s?s/oracl" *E2*,3

    Conn"ct"d to databas" *E2*,3 7,3 ,4'8KBGK + :

    Conn"ct"d to s"rv"r v"rsion ++.'.B

    Control il"s in databas"@ ,3_,A*A/t"stdb/control;il"/controlB+.ctl

    ,3_,A*A/t"stdb/control;il"/controlB'.ctl

    C ang" databas" , o; databas" *E2*,3 7 /I&J: 4! ?

    N

    2 A separate version of a database. The incarnation of the database changes when you open it with the RESETLOGS option, but you can recover backups froma prior incarnation as long as the necessary redo is available.

    4 Session # 196

  • 8/10/2019 2013196antunezppr-130411234317-phpapp01

    5/28

    Backup and Recovery

    N

    ,atabas" , ;or databas" *E2*,3 c ang"d to '8KB %%%B .

    All pr"vio#s back#ps and arc iv"d r"do logs ;or t is databas" ar" #n#sabl".,atabas" is not a9ar" o; pr"vio#s back#ps and arc iv"d logs in R"cov"r? Ar"a.

    ,atabas" as b""n s #tdo9n6 op"n databas" 9it RE2E*LOF2 option.

    2#cc"s;#ll? c ang"d databas" ,.

    ,3&E , - Compl"t"d s#cc"s;#ll?.

    oracl" s"rvidor+.localdomain I*E2*,3+J / om"/oracl"/,"sktop

    oracl" $ sPlpl#s

    *E2*,3+! start#p mo#nt

    ORACLE instanc" start"d.

    ,atabas" mo#nt"d.

    *E2*,3+! alt"r databas" op"n r"s"tlogs=

    ,atabas" alt"r"d.

    oracl" s"rvidor+.localdomain I*E2*,3+J / om"/oracl"/,"sktop

    oracl" $ rman targ"t /

    conn"ct"d to targ"t databas"@ *E2*,3 7,3 ,4'8KB %%%B :

    RMA&! list incarnation=

    List o; ,atabas" ncarnations

    ,3 "? nc "? ,3 &am" ,3 , 2*A*52 R"s"t 2C& R"s"t *im"

    ------- ------- -------- ---------------- --- ---------- ----------

    + + *E2*,3 '8KB %%%B 0ARE&* G)8')+ + - E3-'B+) B%@8)@B8

    ' ' *E2*,3 '8KB %%%B C5RRE&* G)GB)G + - E3-'B+) B8@B8@%G

    RMA&! list back#p s#mmar?=

    #sing targ"t databas" control ;il" inst"ad o; r"cov"r? catalog

    List o; 3ack#ps

    444444444444444

    "? * L 2 ,"vic" *?p" Compl"tion *im" D0i"c"s DCopi"s Compr"ss"d *ag

    ------- -- -- - ----------- -------------------- ------- ------- ---------- ---

    + 3 A , 2 + - E3-'B+) B8@B @BB + + &O *AF'B+)B'+ *B8BG)K

    C ONSIDERATIONS BEFORE CONFIGURING YOUR RMAN BACKUPS

    As we talked above there are several considerations before you even start taking your first RMAN backup1. ARCHIVELOG vs. NOARCHIVELOG

    When deciding if you are going to take a cold (Consistent) or hot (Inconsistent) backup, you have verifythe LOG_MODE of your database, as you cant run a hot backup in a database running inNOARCHIVELOG mode

    5 Session # 196

  • 8/10/2019 2013196antunezppr-130411234317-phpapp01

    6/28

    Backup and Recovery

    2. Use of an RMAN Recovery CatalogDo you have enough databases to require a centralized reporting schema? Do you have a problemmaintaining another high availability database? Do you require a secondary backup metadata repository?

    *E2*,3+! CREA*E *A3LE20ACE catalog=*abl"spac" cr"at"d.

    *E2*,3+! CREA*E 52ER cat_#s"r ,E&* E, 3 cat_#s"r_pass9ord

    ' ,E A5L* *A3LE20ACE catalog=

    5s"r cr"at"d.

    *E2*,3+! FRA&* conn"ct6 r"so#rc"6 r"cov"r?_catalog_o9n"r *O cat_#s"r=

    Frant s#cc""d"d.

    oracl" s"rvidor+.localdomain I*E2*,3+J / om"/oracl"/,"sktop

    oracl" $ rman catalog4cat_#s"r/cat_#s"r_pass9ord

    RMA&! CREA*E CA*ALOF=

    r"cov"r? catalog cr"at"d

    3. Full or Incremental backupsa. Full Backup

    Includes every allocated block in the file being backed upb. Incremental Backups

    Level 0 is the base for subsequent incremental backups Level 1 incremental backup can be either of the following types:

    i. Differential incremental backup. - Backs up all blocks changed after the most recentincremental backup at level 1 or 0.

    ii. Cumulative incremental backup. - Backs up all blocks changed after the most recentincremental backup at level 0.

    6 Session # 196

  • 8/10/2019 2013196antunezppr-130411234317-phpapp01

    7/28

    Backup and Recovery

    4. Value of CONTROL_FILE_RECORD_TIME_KEEPConsider the minimum time you require to have information in your Recovery Catalog, if you were to setit to a lower value, you can lose the capacity to recover your database to the desired time.

    5. Set NLS parameters accordinglyMake sure your environment variables are set accordingly to the values of V$NLS_PARAMETERS inyour database.

    6. Image Copy or Backupset output

    a. Image copy is an exact copy of a data file, control file or archived redo log, with this type ofbackup, you will have to use an external method of compression if you want to reduce the size ofthe backup.

    b. Backupset

    A backupset is the smallest unit of an RMAN backup and it is the only form in which RMAN canwrite backups to SBT. When using a backupset as your output method you can also configurethem to be:

    i. CompressedWhich all but the BASIC option requires the Advanced Compression Option enabled

    1. BASIC. - This does not require the Advanced Compression Option2. LOW. - Least effect on backup throughput.3. MEDIUM. - Recommended for most environments. Good combination of

    compression ratios and speed4. HIGH. - Best suited for backups over slower networks where the limiting factor

    is network speed.

    ii. Encrypted1. Transparent. - Default mode if using encryption and uses Oracle Encryption

    Wallet2. Password-protected. - This mode uses only password protection. You must

    provide a password when creating and restoring encrypted backups3. Dual-mode. - This mode requires either the wallet or a password

    You can also control them to be of a certain size with the configuration option of MAXSETSIZEand MAXPIECESIZE.

    7 Session # 196

  • 8/10/2019 2013196antunezppr-130411234317-phpapp01

    8/28

  • 8/10/2019 2013196antunezppr-130411234317-phpapp01

    9/28

    Backup and Recovery

    At the end, you will have to make a decision on your backup settings and strategy based on your business anddata availability necessities, as most of the configurations above, will impact the Mean Time To Recover (MTTR) in caseof a disaster.

    C ONFIGURING RMAN D EFAULT SETTINGS

    To facilitate the daily use of RMAN for your backup and recovery, it lets you set a number of persistentconfiguration settings for each target database. There are several configurations that if set incorrectly or not accordinglyyou might not be able to meet your recovery necessities. You can view your RMAN settings with the SHOW ALL or yourpolicy settings with the SHOW RETENTION POLICY commands

    CONFIGURE DEFAULT DEVICE TYPE TO DISK;

    When formatting your output, be sure to always include the DBID, below are a couple of wildcards thatwill always include your DBID.

    a. %d_%I_%s_%T_%tb. %U

    CONFIGURE CONTROLFILE AUTOBACKUP ON;

    This will make sure that you always have a secondary option CONFIGURE ARCHIVELOG DELETION POLICY TO BACKED UP 3 TIMES TO DISK; Retention policy settings

    Your retention policy can either be based on the redundancy of backups you have taken (a), or thenumber of days before your backup becomes obsolete (b), these options are mutually exclusive

    a. CONFIGURE RETENTION POLICY TO 3;b. CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 8 DAYS;

    There must always exist one backup of each data file that satisfies SYSDATE - BACKUPCHECKPOINT TIME >= 8

    c. CONFIGURE ARCHIVELOG DELETION POLICY TO BACKED UP 3 TIMES TO DISK;

    This is critical when it is set to be equal or above the redundant retention policy you have, aslosing even one archived redo log, will compromise your recoverability.

    CONTROL_FILE_RECORD_TIME_KEEP

    Make sure that this database parameter is equal to or higher than your retention policy.

    RMA&! CO& F5RE CHA&&EL ,E CE * 0E , 2 ORMA* 1/mo#nt/cop?B+/*E2*,3/ d_,3_35_ _ s_ *_ t1=

    n"9 RMA& con;ig#ration param"t"rs@

    CO& F5RE CHA&&EL ,E CE * 0E , 2 ORMA* 1/mo#nt/cop?B+/*E2*,3/ d_,3_35_ _ s_ *_ t1=

    n"9 RMA& con;ig#ration param"t"rs ar" s#cc"ss;#ll? stor"d

    RMA&! 2HO ALL=

    #sing targ"t databas" control ;il" inst"ad o; r"cov"r? catalog

    RMA& con;ig#ration param"t"rs ;or databas" 9it db_#niP#"_nam" *E2*,3 ar"@

    CO& F5RE RE*E&* O& 0OL C *O RECO ER &,O O ,A 2=

    CO& F5RE 3AC 50 O0* M SA* O& O&=

    CO& F5RE ,E A5L* ,E CE * 0E *O , 2 = D d";a#lt

    CO& F5RE CO&*ROL LE A5*O3AC 50 O&=

    CO& F5RE CO&*ROL LE A5*O3AC 50 ORMA* OR ,E CE * 0E , 2 *O 1/mo#nt/cop?B+/*E2*,3/ 1=

    CO& F5RE ,E CE * 0E , 2 0ARALLEL 2M + 3AC 50 * 0E *O 3AC 502E*= D d";a#lt

    CO& F5RE ,A*A LE 3AC 50 CO0 E2 OR ,E CE * 0E , 2 *O += D d";a#lt

    9 Session # 196

  • 8/10/2019 2013196antunezppr-130411234317-phpapp01

    10/28

    Backup and Recovery

    CO& F5RE ARCH ELOF 3AC 50 CO0 E2 OR ,E CE * 0E , 2 *O += D d";a#lt

    CO& F5RE CHA&&EL ,E CE * 0E , 2 ORMA* 1/mo#nt/cop?B+/*E2*,3/ d_,3_35_ _ s_ *_ t1=

    CO& F5RE MA 2E*2 SE *O 5&L M *E,= D d";a#lt

    CO& F5RE E&CR 0* O& OR ,A*A3A2E O = D d";a#lt

    CO& F5RE E&CR 0* O& ALFOR *HM 1AE2+' 1= D d";a#lt

    CO& F5RE COM0RE22 O& ALFOR *HM 13A2 C1 A2 O RELEA2E 1,E A5L*1 O0* M SE OR LOA, *R5E =Dd";a#lt

    CO& F5RE ARCH ELOF ,ELE* O& 0OL C *O &O&E= D d";a#lt

    CO& F5RE 2&A02HO* CO&*ROL LE &AME *O 1/mo#nt/cop?B+/control_snaps/snapc;_*E2*,3+.;1=

    BACKING UP YOUR DATABASE

    The main objectives of taking a physical backup of your database is data protection in case of media failure anddata preservation in case you need preserve a copy of a database as it existed before a major release. Oracle RMAN utilityuses the command BACKUP to accomplish this objective.

    You can run this command in one line, and as you can see it has the ease and simplicity for any beginners tobackup a database:

    RMA&! 3AC 50 ,A*A3A2E 0L52 ARCH ELOF =

    2tarting back#p at +G- E3-'B+) BB@% @+

    c#rr"nt log arc iv"d

    #sing c ann"l ORA_, 2 _+

    #sing c ann"l ORA_, 2 _'

    #sing c ann"l ORA_, 2 _)

    skipping arc iv"d logs o; t r"ad + ;rom s"P#"nc" + to )= alr"ad? back"d #p

    c ann"l ORA_, 2 _+@ starting arc iv"d log back#p s"t

    c ann"l ORA_, 2 _+@ sp"ci;?ing arc iv"d log7s: in back#p s"t

    inp#t arc iv"d log t r"ad4+ s"P#"nc"4% REC ,4% 2*AM04 BG8 )8 B

    N

    c ann"l ORA_, 2 _+@ ;inis "d pi"c" + at +G- E3-'B+) BB@%G@BB

    pi"c" andl"4/mo#nt/cop?B+/*E2*,3/*E2*,3_,3_35_'8KB %%%B _) _'B+)B'+G_ BG8 ) +tag4*AF'B+)B'+G*BB% '% comm"nt4&O&E

    c ann"l ORA_, 2 _+@ back#p s"t compl"t"6 "laps"d tim"@ BB@BB@B)

    inis "d back#p at +G- E3-'B+) BB@%G@BB

    2tarting back#p at +G- E3-'B+) BB@%G@BB

    c#rr"nt log arc iv"d

    #sing c ann"l ORA_, 2 _+

    #sing c ann"l ORA_, 2 _'

    #sing c ann"l ORA_, 2 _)

    c ann"l ORA_, 2 _+@ starting arc iv"d log back#p s"t

    c ann"l ORA_, 2 _+@ sp"ci;?ing arc iv"d log7s: in back#p s"t

    inp#t arc iv"d log t r"ad4+ s"P#"nc"48 REC ,48 2*AM04 BG8 ) ''

    c ann"l ORA_, 2 _+@ starting pi"c" + at +G- E3-'B+) BB@%G@B%

    c ann"l ORA_, 2 _+@ ;inis "d pi"c" + at +G- E3-'B+) BB@%G@B8

    pi"c" andl"4/mo#nt/cop?B+/*E2*,3/*E2*,3_,3_35_'8KB %%%B _)K_'B+)B'+G_ BG8 ) '%tag4*AF'B+)B'+G*BB%GB) comm"nt4&O&E

    c ann"l ORA_, 2 _+@ back#p s"t compl"t"6 "laps"d tim"@ BB@BB@B+

    inis "d back#p at +G- E3-'B+) BB@%G@B8

    2tarting Control il" and 20 LE A#toback#p at +G- E3-'B+) BB@%G@B

    10 Session # 196

  • 8/10/2019 2013196antunezppr-130411234317-phpapp01

    11/28

    Backup and Recovery

    pi"c" andl"4/mo#nt/cop?B+/*E2*,3/c-'8KB %%%B -'B+)B'+G-BB comm"nt4&O&E

    inis "d Control il" and 20 LE A#toback#p at +G- E3-'B+) BB@%G@'+

    Or have it in a run block command, adding complexity and the manageability that we have been talking about, asit will help you identify which backups are for what type of file and in a disaster this will help you recognize what isneeded to have your data available as soon as possible, and also override certain persistent configurations you have setwith RMAN.

    In the example below, we are using a PARALELLISM of 2 instead of the 3 we have set in our configuration andwe are defining within the command backup, the destination and format the backup piece we will have and as well wewill delete any archived redo logs that we are backing up:

    RMA&! R5&

    '! (

    )! 2E* COMMA&, , *O 13AC 50_2E22 O&1=

    %! ALLOCA*E CHA&&EL CH+ ,E CE * 0E , 2 =

    8! ALLOCA*E CHA&&EL CH' ,E CE * 0E , 2 =

    ! 3AC 50 A2 COM0RE22E, 3AC 502E* ,A*A3A2E ORMA* 1/MO5&*/CO0 B+/*E2*,3/ d_,3_35_ _ s_ *_ t1

    *AF 1 5LL_3AC 501=G! 3AC 50 A2 COM0RE22E, 3AC 502E* ARCH ELOF ALL ORMA* 1/MO5&*/CO0 B+/*E2*,3/ d_ARCH_35_ _

    s_ *_ t1 *AF 1ARCH_3AC 501 ,ELE*E &05* =

    ! 3AC 50 C5RRE&* CO&*ROL LE ORMA* 1/MO5&*/CO0 B+/*E2*,3/ d_C*L_35_ _ s_ *_ t1 *AF1C*L_3AC 501=

    K! >

    "Q"c#ting command@ 2E* COMMA&, ,

    #sing targ"t databas" control ;il" inst"ad o; r"cov"r? catalog

    allocat"d c ann"l@ CH+

    c ann"l CH+@ 2 ,48 d"vic" t?p"4, 2

    allocat"d c ann"l@ CH'

    c ann"l CH'@ 2 ,48B d"vic" t?p"4, 2

    2tarting back#p at +G- E3-'B+) B+@BB@'

    c ann"l CH+ @ starting compr"ss"d ;#ll data;il" back#p s"t

    c ann"l CH+@ sp"ci;?ing data;il"7s: in back#p s"t

    inp#t data;il" ;il" n#mb"r4BBBB' nam"4 ,3_,A*A/t"stdb/data;il"/s?sa#Q.'8G.GK ')B )G

    inp#t data;il" ;il" n#mb"r4BBBB) nam"4 ,3_,A*A/t"stdb/data;il"/#ndotbs+.'8 .GK ')B %+

    inp#t data;il" ;il" n#mb"r4BBBB8 nam"4 ,3_,A*A/t"stdb/data;il"/#ndotbs'.' .GK ')%'%8

    c ann"l CH+@ starting pi"c" + at +G- E3-'B+) B+@BB@'

    c ann"l CH' @ starting compr"ss"d ;#ll data;il" back#p s"t

    c ann"l CH'@ sp"ci;?ing data;il"7s: in back#p s"t

    inp#t data;il" ;il" n#mb"r4BBBB+ nam"4 ,3_,A*A/t"stdb/data;il"/s?st"m.' B.GK ')B 'K

    inp#t data;il" ;il" n#mb"r4BBBB% nam"4 ,3_,A*A/t"stdb/data;il"/#s"rs.' %.GK ')B %8

    c ann"l CH'@ starting pi"c" + at +G- E3-'B+) B+@BB@'K

    c ann"l CH+@ ;inis "d pi"c" + at +G- E3-'B+) B+@B+@B%

    pi"c" andl"4/mo#nt/cop?B+/*E2*,3/*E2*,3_,3_35_'8KB %%%B _% _'B+)B'+G_ BG8 %%'G tag4 5LL_3AC 50comm"nt4&O&E

    N

    c#rr"nt log arc iv"d

    c ann"l CH+@ starting compr"ss"d arc iv"d log back#p s"t

    c ann"l CH+@ sp"ci;?ing arc iv"d log7s: in back#p s"t

    inp#t arc iv"d log t r"ad4+ s"P#"nc"4G REC ,4G 2*AM04 BG8 %%G

    11 Session # 196

  • 8/10/2019 2013196antunezppr-130411234317-phpapp01

    12/28

    Backup and Recovery

    c ann"l CH+@ starting pi"c" + at +G- E3-'B+) B+@B+@+K

    c ann"l CH+@ ;inis "d pi"c" + at +G- E3-'B+) B+@B+@'B

    pi"c" andl"4/mo#nt/cop?B+/*E2*,3/*E2*,3_ARCH_35_'8KB %%%B _8+_'B+)B'+G_ BG8 %%GKtag4 ARCH_3AC 50 comm"nt4&O&E

    c ann"l CH+@ back#p s"t compl"t"6 "laps"d tim"@ BB@BB@B+

    c ann"l CH+@ d"l"ting arc iv"d log7s:arc iv"d log ;il"

    nam"4/mo#nt/oracl"/cop?B+/;las _r"cov"r?_ar"a/*E2*,3/*E2*,3/arc iv"log/'B+)_B'_+G/o+_m;_+_G_ lB9k;st_.arc REC ,4G 2*AM04 BG8 %%G

    inis "d back#p at +G- E3-'B+) B+@B+@'+

    2tarting back#p at +G- E3-'B+) B+@B+@'

    c ann"l CH+@ starting ;#ll data;il" back#p s"t

    c ann"l CH+@ sp"ci;?ing data;il"7s: in back#p s"t

    incl#ding c#rr"nt control ;il" in back#p s"t

    c ann"l CH+@ starting pi"c" + at +G- E3-'B+) B+@B+@)

    c ann"l CH+@ ;inis "d pi"c" + at +G- E3-'B+) B+@B+@)K

    pi"c" andl"4/mo#nt/cop?B+/*E2*,3/*E2*,3_C*L_35_'8KB %%%B _8'_'B+)B'+G_ BG8 %% K tag4C*L_3AC 50comm"nt4&O&E

    c ann"l CH+@ back#p s"t compl"t"6 "laps"d tim"@ BB@BB@B)

    inis "d back#p at +G- E3-'B+) B+@B+@)K

    2tarting Control il" and 20 LE A#toback#p at +G- E3-'B+) B+@B+@)K

    pi"c" andl"4/mo#nt/cop?B+/*E2*,3/c-'8KB %%%B -'B+)B'+G-B' comm"nt4&O&E

    inis "d Control il" and 20 LE A#toback#p at +G- E3-'B+) B+@B+@88

    r"l"as"d c ann"l@ CH+

    r"l"as"d c ann"l@ CH'

    As we mentioned at the considerations section of this document, with a backup set we can send a backup set to

    SBT, this you can accomplish it with the BACKUP command.

    In the example below, we are emulating an SBT and sending the backup sets we have in disk to this media:

    RMA&! R5& (

    '! ALLOCA*E CHA&&EL CH+ * 0E 123*_*A0E1

    )! 0ARM24T23*_L 3RAR 4oracl".disksbt6

    %! E& 473AC 50_, R4/MO5&*/CO0 B+/23*:T=

    8! 3AC 50 3AC 502E* ALL=

    ! >

    #sing targ"t databas" control ;il" inst"ad o; r"cov"r? catalog

    allocat"d c ann"l@ c +c ann"l c +@ 2 ,48 d"vic" t?p"423*_*A0E

    c ann"l c +@ AR& &F@ Oracl" *"st ,isk A0

    2tarting back#p at +G- E3-'B+) B+@''@)K

    c ann"l c +@ inp#t back#p s"t@ co#nt4)'6 stamp4 BG8 )%K86 pi"c"4+

    c ann"l c +@ starting pi"c" + at +G- E3-'B+) B+@''@%%

    c ann"l c +@ back#p pi"c" /mo#nt/cop?B+/*E2*,3/*E2*,3_,3_35_'8KB %%%B _)'_'B+)B'+G_ BG8 )%K8

    pi"c" andl"4+Bo'8;oG_+_' comm"nt4A0 "rsion '.B6MM2 "rsion .+.).B

    c ann"l c +@ ;inis "d pi"c" + at +G- E3-'B+) B+@''@%G

    12 Session # 196

  • 8/10/2019 2013196antunezppr-130411234317-phpapp01

    13/28

    Backup and Recovery

    ...

    c ann"l c +@ back#p pi"c" /mo#nt/cop?B+/*E2*,3/c-'8KB %%%B -'B+)B'+G-B'

    pi"c" andl"4c-'8KB %%%B -'B+)B'+G-B' comm"nt4A0 "rsion '.B6MM2 "rsion .+.).B

    c ann"l c +@ ;inis "d pi"c" + at +G- E3-'B+) B+@'%@'B

    c ann"l c +@ back#p pi"c" compl"t"6 "laps"d tim"@ BB@BB@BG

    inis "d back#p at +G- E3-'B+) B+@'%@'B

    2tarting Control il" and 20 LE A#toback#p at +G- E3-'B+) B+@'%@'+

    pi"c" andl"4c-'8KB %%%B -'B+)B'+G-B) comm"nt4A0 "rsion '.B6MM2 "rsion .+.).B

    inis "d Control il" and 20 LE A#toback#p at +G- E3-'B+) B+@'%@)

    r"l"as"d c ann"l@ c +

    M ONITORING BACKUPS

    Once you have launched a backup, you can monitor the progress of this backup with the V$SESSION,

    V$PROCESS and V$SESSION_LONGOPS in the target database.oracl" s"rvidor+.localdomain I*E2*,3+J / om"/oracl"/scriptsoracl" $ cat monitor.sPl

    COL5M& CL E&*_ & O ORMA* a)B

    COL5M& 2 , ORMA* KKK

    COL5M& 20 , ORMA* KKKK

    2ELEC* 2 ,6 20 ,6 CL E&*_ & O

    ROM $0ROCE22 p6 $2E22 O& s

    HERE p.A,,R 4 s.0A,,R

    A&, CL E&*_ & O L E 1 3ack#p_2"ssion 1=

    2E* 0AFE2 SE KKKK L &E2 SE 'BB

    COL O0&AME ORMA* A%BCOL *ARFE* ORMA* A+8

    COL 5& *2 ORMA* A+B

    COL * ME_REMA & &F ORMA* KKKKB.KK HEA, &F REMA & &FI2J

    COL 302 ORMA* KKKB.KK HEA, &F I5& *2/2J

    COL ER* F ORMA* KB.KK HEA, &F TCOM0LE*EI JT

    2ELEC* 2 ,6 O0&AME6 *ARFE*6 2O AR6 *O*AL OR 6 5& *26

    7*O*AL OR -2O AR:/* ME_REMA & &F 3026 7* ME_REMA & &F/) BB: * ME_REMA & &F6

    2O AR/*O*AL OR U+BB ER* F

    ROM $2E22 O&_LO&FO02

    HERE 2 ,4V2 ,_&5M3ER=

    *E2*,3+! monitor.sPl2 , 20 , CL E&*_ & O

    ---- ------------------------ ------------------------------

    K 'B 8% id43ack#p_2"ssion

    Ent"r val#" ;or sid_n#mb"r@ K

    old ++@ HERE sid in 7Vsid_n#mb"r:

    n"9 ++@ HERE sid in 7 K:

    13 Session # 196

  • 8/10/2019 2013196antunezppr-130411234317-phpapp01

    14/28

    Backup and Recovery

    2 , O0&AME *ARFE* 2O AR *O*AL OR 5& *2I5nits/sJ R"mainingIsJ compl"t"I J

    ---- ---------------------------------------- --------------- ---------- ---------- --------------------- ------------ -----------

    K RMA&@ aggr"gat" inp#t )) 8 KBK G 8% 3locks)% K+. + B.B .8K

    When doing a backup to SBT, you can monitor the SBT with the following SQL query:

    *E2*,3+ !COL5M& E E&* ORMA* a+G

    *E2*,3+ !COL5M& 2ECO&,2_ &_ A * ORMA* KKK

    *E2*,3+ !COL5M& 2*A*E ORMA* a+8

    *E2*,3+ !COL5M& CL E&*_ & O ORMA* a)B

    *E2*,3+ !

    *E2*,3+ !2ELEC* p.20 ,6 s.E E&*6 s9.2ECO&,2_ &_ A * A2 2EC_ A *6

    ' s9.2*A*E6 CL E&*_ & O

    ) ROM $2E22 O&_ A * s96 $2E22 O& s6 $0ROCE22 p

    % HERE s9.E E&* L E 1 MML 1

    8 A&, s.2 ,4s9.2 ,

    A&, s.0A,,R4p.A,,R=

    20 , E E&* 2EC_ A * 2*A*E CL E&*_ & O

    ------------------------ ----------------- ---------- --------------- --------------

    GB)G 3ack#p@ MML P#"r? +%G A * &F rman c ann"l4CH8

    back#p pi"c"

    BACKUP R EPORTS Now that you have taken a backup, how do you know which backups you have and which datafiles need backupbased on your retention period? RMAN provides two commands to do just this LIST and REPORT.

    The LIST command displays backups and information about other objects recorded in the RMAN repository. LIST EXPIRED COPY; LIST EXPIRED BACKUP; LIST BACKUP SUMMARY; LIST BACKUP TAG TAG20130211T035650; LIST RECOVERABLE BACKUP OF DATABASE; LIST BACKUP OF DATAFILE 1 COMPLETED BETWEEN '03-FEB-2013' and '11-FEB-2013; LIST INCARNATION;

    In the example below you can see that Backup with key 58 is a Full backup that is present in both SBT andDisk, backup with key 60 is a backup set that contains archived redo logs, backup with key 62 is a Level 0backup and backup with key 65 is a Level 1 backup belonging to an incremental backup strategy.

    RMA&! L 2* 3AC 50 25MMAR =

    List o; 3ack#ps444444444444444

    "? * L 2 ,"vic" *?p" Compl"tion *im" D0i"c"s DCopi"s Compr"ss"d *ag

    14 Session # 196

  • 8/10/2019 2013196antunezppr-130411234317-phpapp01

    15/28

    Backup and Recovery

    ------- -- -- - ----------- -------------------- ------- ------- ---------- ---...8 3 A U ++- E3-'B+) +B@+B@B + ' E2 *AF'B+)B'++*BB)%8G8K 3 A U ++- E3-'B+) +B@+B@B + ' E2 *AF'B+)B'++*BB)%8G

    B 3 A A U ++- E3-'B+) +B@+B@B + ' E2 *AF'B+)B'++*BB)8'G+ 3 A A , 2 ++- E3-'B+) +'@B%@88 + + &O *AF'B+)B'++*B)88''' 3 B A , 2 ++- E3-'B+) +'@B%@88 + + &O *AF'B+)B'++*B)88'%) 3 B A , 2 ++- E3-'B+) +'@B%@88 + + &O *AF'B+)B'++*B)88'%% 3 A A , 2 ++- E3-'B+) +'@B%@88 + + &O *AF'B+)B'++*B)888%8 3 + A , 2 ++- E3-'B+) +'@B%@88 + + &O *AF'B+)B'++*B)8 BK

    NKK 3 A , 2 +)- E3-'B+) B @8)@8) + + E2 5LL_3AC 50+B+ 3 A , 2 +)- E3-'B+) B @8)@8K + + E2 5LL_3AC 50+B' 3 A A , 2 +)- E3-'B+) B @8%@B% + + E2 ARCH_3AC 50+B) 3 A , 2 +)- E3-'B+) B @8%@+' + + &O C*L_3AC 50+B% 3 A , 2 +)- E3-'B+) B @8%@+G + + &O *AF'B+)B'+)*B 8%+'

    The REPORT command provides certain information on database backups, such as, which files need abackup? Which backups are obsolete and can be deleted? Which files have not been backed up recently?

    REPORT NEED BACKUP; REPORT SCHEMA; REPORT NEED BACKUP RECOVERY WINDOW OF 2 DAYS; REPORT OBSOLETE; REPORT SCHEMA AT TIME 'SYSDATE-7'; (Only with recovery catalog)

    In the example below you can see which data files in your database require a backup based on your retentionpolicy

    RMA&! RE0OR* &EE, 3AC 50=RMA& r"t"ntion polic? 9ill b" appli"d to t " commandRMA& r"t"ntion polic? is s"t to r"d#ndanc? +

    R"port o; ;il"s 9it l"ss t an + r"d#ndant back#psil" Dbkps &am"

    ---- ----- ----------------------------------------------------- B ,3_,A*A/t"stdb/data ;il"/r"n".' K. BG+'B %+

    RMA&! RE0OR* &EE, 3AC 50 RE,5&,A&C )=R"port o; ;il"s 9it l"ss t an ) r"d#ndant back#ps

    il" Dbkps &am"---- ----- -----------------------------------------------------+ ,3_,A*A/t"stdb/data ;il"/s?st"m.' B.GK ')B 'K' G ,3_,A*A/t"stdb/data ;il"/s?sa#Q.'8G.GK ')B )G) G ,3_,A*A/t"stdb/data ;il"/#ndotbs+.'8 .GK ')B %+% G ,3_,A*A/t"stdb/data ;il"/#s"rs.' %.GK ')B %88 G ,3_,A*A/t"stdb/data ;il"/#ndotbs'.' .GK ')%'%8

    B ,3_,A*A/t"stdb/data ;il"/r"n".' K. BG+'B %+

    R ESTORING AND R ECOVERING FROM FAILURE

    Restoring data files is retrieving them from a valid backup and putting them in a disk location, this can be thesame place where it resided before the failure or a different location. Media recovery is the application of changes fromredo logs and incremental backups to a restored data file to bring the data file forward to a desired SCN or point in time.When doing media recovery, there are two types of recovery depending on the backup you took:

    15 Session # 196

  • 8/10/2019 2013196antunezppr-130411234317-phpapp01

    16/28

    Backup and Recovery

    Complete recovery. - All changes in the redo logs are applied, this is only takes place when recovering from aconsistent backup (Cold Backup)

    Incomplete recovery. - Only changes up to a specified point in time are applied, this is normally done whenrecovering from an inconsistent backup (Hot Backup). There are three ways to set the time or SCN until you want

    to do your media recovery:o SCN

    o Time

    o Sequence

    In case of a disaster, how would you even know which backup is needed for your restore and recovery operations,RMAN has an option with the RESTORE command to preview the needed backups without actually doing the restore, itwill help you see if you have the appropriate backup to be able to do your actual restore.

    RMA&! R5&'! (

    )! 2E* 5&* L 2EW5E&CE =%! ALLOCA*E CHA&&EL CH+ ,E CE * 0E , 2 =8! RE2*ORE ,A*A3A2E 0RE E 25MMAR =

    ! >

    "Q"c#ting command@ 2E* #ntil cla#s"#sing targ"t databas" control ;il" inst"ad o; r"cov"r? catalogallocat"d c ann"l@ c +c ann"l c +@ 2 ,4G instanc"4*E2*,3+ d"vic" t?p"4, 2

    2tarting r"stor" at ++- E3-'B+) B @%%@)'data;il" 9ill b" cr"at"d a#tomaticall? d#ring r"stor" op"ration

    List o; ,ata;il" Copi"s44444444444444444444444

    "? il" 2 Compl"tion *im" Ckp 2C& Ckp *im"------- ---- - -------------------- ---------- --------------------

    + + A ++- E3-'B+) BK@8%@BG K+ 'G ++- E3-'B+) BK@8%@BG &am"@ /mo#nt/cop?B+/*E2*,3/*E2*,3_'8 +8' 8)8_G8_'B+)B'++_ BGBK B%G *ag @ *AF'B+)B'++*BBBG'N+G ' A ++- E3-'B+) BK@8%@BG K+ )) ++- E3-'B+) BK@8%@BG &am"@ /mo#nt/cop?B+/*E2*,3/*E2*,3_'8 +8' 8)8_G _'B+)B'++_ BGBK B%G *ag@ *AF'B+)B'++*BBBG'+ ) A ++- E3-'B+) BK@8%@BG K+ %' ++- E3-'B+) BK@8%@BG &am"@ /mo#nt/cop?B+/*E2*,3/*E2*,3_'8 +8' 8)8_GG_'B+)B'++_ BGBK B%G *ag@ *AF'B+)B'++*BBBG'NList o; 3ack#ps444444444444444

    "? * L 2 ,"vic" *?p" Compl"tion *im" D0i"c"s DCopi"s Compr"ss"d *ag------- -- -- - ----------- -------------------- ------- ------- ---------- ---

    K 3 A A , 2 ++- E3-'B+) B @)K@8G + + E2 *AF'B+)B'++*B ) +BM"dia r"cov"r? start 2C& is K+ '+R"cov"r? m#st b" don" b"?ond 2C& +B )) 8 to cl"ar data;il" ;#XXin"ss

    inis "d r"stor" at ++- E3-'B+) B @%%@)r"l"as"d c ann"l@ c +

    The RESTORE command in RMAN has a VALIDATE option to help you corroborate if your backups are notcorrupt. This should be part of your backup strategy, checking periodically whether you have an integral set of backupsthat can meet your recoverability objectives. RMAN reads the selected backups in their entirety to confirm that they arenot corrupt, but does not produce output files. This will never replace the real restore/recovery scenario, but its as closeas you can get.

    16 Session # 196

  • 8/10/2019 2013196antunezppr-130411234317-phpapp01

    17/28

    Backup and Recovery

    RESTORE DATABASE VALIDATE; RESTORE CONTROLFILE VALIDATE; RESTORE ARCHIVELOG FROM TIME 'SYSDATE-nn' VALIDATE;

    RMA&! R5&('! 2E* 5&* L 2EW5E&CE G=)! ALLOCA*E CHA&&EL CH+ ,E CE * 0E , 2 =%! RE2*ORE ,A*A3A2E AL ,A*E =8! RE2*ORE CO&*ROL LE AL ,A*E =

    !>"Q"c#ting command@ 2E* #ntil cla#s"N

    2tarting r"stor" at ++- E3-'B+) '+@8B@%Gc ann"l c +@ starting validation o; data;il" back#p s"tc ann"l c +@ r"ading ;rom back#p pi"c" /mo#nt/cop?B+/*E2*,3/*E2*,3_'8 +8' 8)8_++8_'B+)B'++_ BG+)K %'c ann"l c +@ pi"c" andl"4/mo#nt/cop?B+/*E2*,3/*E2*,3_'8 +8' 8)8_++8_'B+)B'++_ BG+)K %'tag4*AF'B+)B'++*'+'G''

    c ann"l c +@ r"stor"d back#p pi"c" +Nc ann"l c +@ pi"c" andl"4/mo#nt/cop?B+/*E2*,3/*E2*,3_'8 +8' 8)8_++ _'B+)B'++_ BG+)K Gtag4*AF'B+)B'++*'+'G''c ann"l c +@ r"stor"d back#p pi"c" +c ann"l c +@ validation compl"t" 6 "laps"d tim"@ BB@BB@B+

    inis "d r"stor" at ++- E3-'B+) '+@8+@'%r"l"as"d c ann"l@ c +

    As we have talked, the great importance of knowing your DBID is when you are faced with the total loss of yourcontrol files. In a case like that, you would need to set your DBID so that you can recover your control files, be able torecover your database and open your database, as you did a recovery you would need to open your database with theresetlogs option and would create a new incarnation of your database.

    *E2*,3+! start#p

    ORACLE instanc" start"d.

    *otal 2?st"m Flobal Ar"a +B K)G'+ b?t"s

    iQ"d 2iX" '')8'B b?t"s

    ariabl" 2iX" K '88 G' b?t"s

    ,atabas" 3#;;"rs ) %KB%%% b?t"s

    R"do 3#;;"rs 88%+ b?t"s

    ORA-BB'B8@ "rror in id"nti;?ing control ;il"6 c "ck al"rt log ;or mor" in;o

    oracl" s"rvidor+.localdomain I*E2*,3+J /mo#nt/oracl"/d#mpB+/*E2*,3/diag/rdbms/t"stdb/*E2*,3+/trac"

    oracl" $ tail -+8 al"rt_*E2*,3+.log

    25CCE22@ diskgro#p ,3_,A*A 9as mo#nt"d

    2#n "b +G +G@BK@)' 'B+)

    ORA-BB'+B@ cannot op"n t " sp"ci;i"d control ;il"

    ORA-BB'B'@ control ;il"@ 1 ,3_,A*A/t"stdb/control;il"/controlB'.ctl1

    ORA-+G8B)@ ks;dopn@' ail"d to op"n ;il" ,3_,A*A/t"stdb/control;il"/controlB'.ctl

    ORA-+8+G)@ "ntr? 1control;il"1 do"s not "Qist in dir"ctor? 1t"stdb1

    ORA-BB'+B@ cannot op"n t " sp"ci;i"d control ;il"

    ORA-BB'B'@ control ;il"@ 1 ,3_,A*A/t"stdb/control;il"/controlB+.ctl1

    ORA-+G8B)@ ks;dopn@' ail"d to op"n ;il" ,3_,A*A/t"stdb/control;il"/controlB+.ctl

    17 Session # 196

  • 8/10/2019 2013196antunezppr-130411234317-phpapp01

    18/28

    Backup and Recovery

    ORA-+8+G)@ "ntr? 1control;il"1 do"s not "Qist in dir"ctor? 1t"stdb1

    ORA-'B8 signall"d d#ring@ AL*ER ,A*A3A2E MO5&*...

    2#n "b +G BG@BK@)) 'B+)

    C "ck"r r#n ;o#nd ' n"9 p"rsist"nt data ;ail#r"s

    25CCE22@ diskgro#p ,3_,A*A 9as dismo#nt"d

    oracl" s"rvidor+.localdomain I*E2*,3+J /mo#nt/oracl"/d#mpB+/*E2*,3/diag/rdbms/t"stdb/*E2*,3+/trac"

    oracl" $ rman targ"t /

    conn"ct"d to targ"t databas" 7not start"d:

    RMA&! s"t ,3 ,4'8KB %%%B =

    "Q"c#ting command@ 2E* ,3 ,

    RMA&! start#p nomo#nt=

    Oracl" instanc" start"d

    *otal 2?st"m Flobal Ar"a +B K)G'+ b?t"s

    iQ"d 2iX" '')8'B b?t"s

    ariabl" 2iX" GB ) 8 % b?t"s

    ,atabas" 3#;;"rs )8')'+8) b?t"s

    R"do 3#;;"rs 88%+ b?t"s

    RMA&! r"stor" control;il" ;rom a#toback#p=

    2tarting r"stor" at +G- E3-'B+) BG@+)@%B

    #sing targ"t databas" control ;il" inst"ad o; r"cov"r? catalog

    allocat"d c ann"l@ ORA_, 2 _+

    c ann"l ORA_, 2 _+@ 2 ,4)B d"vic" t?p"4, 2

    r"cov"r? ar"a d"stination@ /mo#nt/oracl"/cop?B+/;las _r"cov"r?_ar"a/*E2*,3

    databas" nam" 7or databas" #niP#" nam": #s"d ;or s"arc @ *E2*,3

    c ann"l ORA_, 2 _+@ A5*O3AC 50/mo#nt/oracl"/cop?B+/;las _r"cov"r?_ar"a/*E2*,3/*E2*,3/a#toback#p/'B+)_B'_+ /o+_m;_s_ BG8+' B_ k?pmr?X_.bkp;o#nd in t " r"cov"r? ar"a

    c ann"l ORA_, 2 _+@ looking ;or A5*O3AC 50 on da?@ 'B+)B'+G

    c ann"l ORA_, 2 _+@ looking ;or A5*O3AC 50 on da?@ 'B+)B'+

    c ann"l ORA_, 2 _+@ r"storing control ;il" ;rom A5*O3AC 50/mo#nt/oracl"/cop?B+/;las _r"cov"r?_ar"a/*E2*,3/*E2*,3/a#toback#p/'B+)_B'_+ /o+_m;_s_ BG8+' B_ k?pmr?X_.bkp

    c ann"l ORA_, 2 _+@ control ;il" r"stor" ;rom A5*O3AC 50 compl"t"

    o#tp#t ;il" nam"4 ,3_,A*A/t"stdb/control;il"/controlB+.ctl

    o#tp#t ;il" nam"4 ,3_,A*A/t"stdb/control;il"/controlB'.ctl

    inis "d r"stor" at +G- E3-'B+) BG@+%@)

    RMA&! alt"r databas" mo#nt=databas" mo#nt"d

    r"l"as"d c ann"l@ ORA_, 2 _+

    RMA&! r"cov"r databas"=

    2tarting r"cov"r at +G- E3-'B+) BG@+ @+B

    2tarting implicit crossc "ck back#p at +G- E3-'B+) BG@+ @++

    allocat"d c ann"l@ ORA_, 2 _+

    c ann"l ORA_, 2 _+@ 2 ,4)8 d"vic" t?p"4, 2

    inis "d implicit crossc "ck back#p at +G- E3-'B+) BG@+ @+'

    18 Session # 196

  • 8/10/2019 2013196antunezppr-130411234317-phpapp01

    19/28

    Backup and Recovery

    2tarting implicit crossc "ck cop? at +G- E3-'B+) BG@+ @+'

    #sing c ann"l ORA_, 2 _+

    inis "d implicit crossc "ck cop? at +G- E3-'B+) BG@+ @+)

    s"arc ing ;or all ;il"s in t " r"cov"r? ar"acataloging ;il"s...

    cataloging don"

    List o; Catalog"d il"s

    il" &am"@/mo#nt/oracl"/cop?B+/;las _r"cov"r?_ar"a/*E2*,3/*E2*,3/a#toback#p/'B+)_B'_+ /o+_m;_s_ BG8+' B_ k?pmr?X_.bkp

    il" &am"@/mo#nt/oracl"/cop?B+/;las _r"cov"r?_ar"a/*E2*,3/*E2*,3/arc iv"log/'B+)_B'_+ /o+_m;_+_+_ k?mdXom_.arc

    il" &am"@/mo#nt/oracl"/cop?B+/;las _r"cov"r?_ar"a/*E2*,3/*E2*,3/arc iv"log/'B+)_B'_+ /o+_m;_+_'_ k?m;+ b_.arc

    #sing c ann"l ORA_, 2 _+

    starting m"dia r"cov"r?

    arc iv"d log ;or t r"ad + 9it s"P#"nc" +B is alr"ad? on disk as ;il",3_,A*A/t"stdb/onlin"log/gro#p_'.' +. BG8% G G

    arc iv"d log ;il" nam"4 ,3_,A*A/t"stdb/onlin"log/gro#p_'.' +. BG8% G G t r"ad4+ s"P#"nc"4+B

    m"dia r"cov"r? compl"t"6 "laps"d tim"@ BB@BB@B+

    inis "d r"cov"r at + - E3-+) BG@+G@'G

    RMA&! alt"r databas" op"n r"s"tlogs=

    databas" op"n"d

    RMA&! list incarnation=

    List o; ,atabas" ncarnations

    ,3 "? nc "? ,3 &am" ,3 , 2*A*52 R"s"t 2C& R"s"t *im"

    ------- ------- -------- ---------------- --- ---------- ----------

    + + *E2*,3 '8KB %%%B 0ARE&* + B+-&O -'B+' 'B@++@)+

    ' ' *E2*,3 '8KB %%%B 0ARE&* G)8')+ + - E3-'B+) B%@8)@B8

    ) ) *E2*,3 '8KB %%%B C5RRE&* GK K % +G- E3-'B+) BG@+G@%)

    If you were to lose every file from your database and you are not using a recovery catalog, you would need tomanually identify which are the last backups you took, if you have been following this document, you would have namedwith a format of %d_DB_BU_%I_%s_%T_%t , which would allow you to quickly identify that this is a Databasebackup and %d_ARCH_BU_%I_%s_%T_%t to let you identify your archive backups and if you have autocontrolbackup on, you see the last controlfile that was backed up as well.

    RMA&! s o9 CO&*ROL LE A5*O3AC 50=

    RMA& con;ig#ration param"t"rs ;or databas" 9it db_#niP#"_nam" *E2*,3 ar"@

    CO& F5RE CO&*ROL LE A5*O3AC 50 O&=

    RMA&! s o9 CO&*ROL LE A5*O3AC 50 ;ormat=

    RMA& con;ig#ration param"t"rs ;or databas" 9it db_#niP#"_nam" *E2*,3 ar"@

    CO& F5RE CO&*ROL LE A5*O3AC 50 ORMA* OR ,E CE * 0E , 2 *O 1/mo#nt/cop?B+/*E2*,3/ 1=

    RMA&! 3AC 50 A2 COM0RE22E, 3AC 502E* ,A*A3A2E ORMA* 1/MO5&*/CO0 B+/*E2*,3/ d_,3_35_ _ s_ *_ t1 *AF1 5LL_3AC 501=

    19 Session # 196

  • 8/10/2019 2013196antunezppr-130411234317-phpapp01

    20/28

    Backup and Recovery

    RMA&! 3AC 50 A2 COM0RE22E, 3AC 502E* ARCH ELOF ALL ORMA* 1/MO5&*/CO0 B+/*E2*,3/ d_ARCH_35_ _ s_ *_t1 *AF 1ARCH_3AC 501 ,ELE*E &05*=

    With the above configuration settings and backup format, we can now restore and recover our database

    oracl" s"rvidor+.localdomain I*E2*,3+J /mo#nt/cop?B+/*E2*,3

    oracl" $ ls -ltr Y tail -+8

    -r9-r----- + oracl" asmadmin )%GKK + "b +G BG@B *E2*,3_C*L_35_'8KB %%%B _ B_'B+)B'+G_ BG %')G'

    -r9-r----- + oracl" asmadmin )% )') % "b +G BG@B c-'8KB %%%B -'B+)B'+G-B%

    -r9-r----- + oracl" asmadmin )% )') % "b +G BG@% c-'8KB %%%B -'B+)B'+G-B8

    -r9-r----- + oracl" asmadmin +K)K 8 "b +G BG@8) *E2*,3_,3_35_ 2590844408 _ %_'B+)B'+G_ BG BK+K+

    -r9-r----- + oracl" asmadmin %%BKG8) "b +G BG@8) *E2*,3_,3_35_'8KB %%%B _ 8_'B+)B'+G_ BG BK+K+

    -r9-r----- + oracl" asmadmin +B K8) "b +G BG@8) *E2*,3_,3_35_'8KB %%%B _ _'B+)B'+G_ BG BK'+

    -r9-r----- + oracl" asmadmin 'BBGB% "b +G BG@8) *E2*,3_ARCH_35_'8KB %%%B _ G_'B+)B'+G_ BG BK')

    -r9-r----- + oracl" asmadmin +K8' "b +G BG@8) *E2*,3_ARCH_35_'8KB %%%B _ _'B+)B'+G_ BG BK')G

    -r9-r----- + oracl" asmadmin )%GKK + "b +G BG@8% *E2*,3_C*L_35_'8KB %%%B _ K_'B+)B'+G_ BG BK'%K-r9-r----- + oracl" asmadmin )% )') % "b +G BG@8% c-'8KB %%%B -'B+)B'+G-B

    -r9-r----- + oracl" asmadmin +BK% 8 "b +G BG@8K *E2*,3_ARCH_35_'8KB %%%B _G+_'B+)B'+G_ BG BK8)K

    -r9-r----- + oracl" asmadmin )% )') % "b +G BG@8K c-'8KB %%%B -'B+)B'+G-BG

    -r9-r----- + oracl" asmadmin )%GKK + "b +G BG@8K *E2*,3_C*L_35_'8KB %%%B _G)_'B+)B'+G_ BG BK8GK

    -r9-r----- + oracl" asmadmin )% )') % "b +G BG@8K c-'8KB %%%B -'B+)B'+G-B

    oracl" s"rvidor+.localdomain I*E2*,3+J / om"/oracl"

    oracl" $ "Qport ORA_RMA&_2FA_*ARFE*4+BBB

    oracl" s"rvidor+.localdomain I*E2*,3+J / om"/oracl"

    oracl" $ rman targ"t /

    R"cov"r? Manag"r@ R"l"as" ++.'.B.).B - 0rod#ction on 2#n "b +G B @'G@'K 'B+)

    Cop?rig t 7c: +K '6 'B++6 Oracl" and/or its a;;iliat"s. All rig ts r"s"rv"d.

    conn"ct"d to targ"t databas" 7not start"d:

    RMA&! s"t dbid4 2590844408 =

    "Q"c#ting command@ 2E* ,3 ,

    RMA&! start#p nomo#nt=

    start#p ;ail"d@ ORA-B+BG @ ;ail#r" in proc"ssing s?st"m param"t"rs

    ORA-B+8 8@ "rror in id"nti;?ing ;il" 1 ,3_,A*A/*E2*,3/sp;il"*E2*,3.ora1

    ORA-+G8B)@ ks;dopn@' ail"d to op"n ;il" ,3_,A*A/*E2*,3/sp;il"*E2*,3.ora

    ORA-+8B8 @ additional "rror m"ssag"

    ORA-+G8B)@ ks;dopn@' ail"d to op"n ;il" ,3_,A*A/t"stdb/sp;il"t"stdb.ora

    ORA-+8+G)@ "ntr? 1sp;il"t"stdb.ora1 do"s not "Qist in dir"ctor? 1t"stdb1

    ORA-B 8+'@ at lin" %

    starting Oracl" instanc" 9it o#t param"t"r ;il" ;or r"tri"val o; sp;il"

    Oracl" instanc" start"d

    *otal 2?st"m Flobal Ar"a +B%) B B b?t"s

    iQ"d 2iX" '')%K B b?t"s

    ariabl" 2iX" 'G '88'B b?t"s

    ,atabas" 3#;;"rs G8K+ KB'% b?t"s

    20 Session # 196

  • 8/10/2019 2013196antunezppr-130411234317-phpapp01

    21/28

    Backup and Recovery

    R"do 3#;;"rs 8 8 8G b?t"s

    RMA&! r"stor" sp;il" ;rom a#toback#p=

    2tarting r"stor" at +G- E3-'B+) B @'K@)K

    #sing targ"t databas" control ;il" inst"ad o; r"cov"r? catalog

    allocat"d c ann"l@ ORA_, 2 _+

    c ann"l ORA_, 2 _+@ 2 ,4'8 d"vic" t?p"4, 2

    c ann"l ORA_, 2 _+@ looking ;or A5*O3AC 50 on da?@ 'B+)B'+G

    N

    c ann"l ORA_, 2 _+@ no A5*O3AC 50 in G da?s ;o#nd

    RMA&-BB8G+@ 44444444444444444444444444444444444444444444444444444444444

    RMA&-BB8 K@ 444444444444444 ERROR ME22AFE 2*AC OLLO 2 444444444444444

    RMA&-BB8G+@ 44444444444444444444444444444444444444444444444444444444444

    RMA&-B)BB'@ ;ail#r" o; r"stor" command at B'/+G/'B+) B @'K@%B

    RMA&-B +G'@ no A5*O3AC 50 ;o#nd or sp"ci;i"d andl" is not a valid cop? or pi"c"

    RMA&! r"stor" sp;il" ;rom 1/mo#nt/cop?B+/*E2*,3/c-'8KB %%%B -'B+)B'+G-B 1=

    2tarting r"stor" at +G- E3-'B+) B @)B@B%

    #sing c ann"l ORA_, 2 _+

    c ann"l ORA_, 2 _+@ r"storing sp;il" ;rom A5*O3AC 50 /mo#nt/cop?B+/*E2*,3/c-'8KB %%%B -'B+)B'+G-B

    c ann"l ORA_, 2 _+@ 20 LE r"stor" ;rom A5*O3AC 50 compl"t"

    inis "d r"stor" at +G- E3-'B+) B @)B@BG

    RMA&! s #tdo9n imm"diat"=

    Oracl" instanc" s #t do9n

    RMA&! start#p nomo#nt=

    conn"ct"d to targ"t databas" 7not start"d:

    Oracl" instanc" start"d

    *otal 2?st"m Flobal Ar"a +B K)G'+ b?t"s

    iQ"d 2iX" '')8'B b?t"s

    ariabl" 2iX" GB ) 8 % b?t"s

    ,atabas" 3#;;"rs )8')'+8) b?t"s

    R"do 3#;;"rs 88%+ b?t"s

    RMA&! r"stor" control;il" ;rom 1/mo#nt/cop?B+/*E2*,3/c-'8KB %%%B -'B+)B'+G-B 1=

    2tarting r"stor" at +G- E3-'B+) B @)+@'8

    allocat"d c ann"l@ ORA_, 2 _+

    c ann"l ORA_, 2 _+@ 2 ,4)B d"vic" t?p"4, 2

    c ann"l ORA_, 2 _+@ r"storing control ;il"

    c ann"l ORA_, 2 _+@ r"stor" compl"t"6 "laps"d tim"@ BB@BB@88

    o#tp#t ;il" nam"4 ,3_,A*A/t"stdb/control;il"/controlB+.ctlo#tp#t ;il" nam"4 ,3_,A*A/t"stdb/control;il"/controlB'.ctl

    inis "d r"stor" at +G- E3-'B+) B @)'@'B

    RMA&! alt"r databas" mo#nt=

    databas" mo#nt"d

    r"l"as"d c ann"l@ ORA_, 2 _+

    RMA&! r"stor" databas"=

    2tarting r"stor" at +G- E3-'B+) B @))@+G

    21 Session # 196

  • 8/10/2019 2013196antunezppr-130411234317-phpapp01

    22/28

    Backup and Recovery

    N

    c ann"l ORA_, 2 _+@ starting data;il" back#p s"t r"stor"

    c ann"l ORA_, 2 _+@ sp"ci;?ing data;il"7s: to r"stor" ;rom back#p s"t

    c ann"l ORA_, 2 _+@ r"storing data;il" BBBB' to ,3_,A*A/t"stdb/data;il"/s?sa#Q.'8G.GK ')B )G

    N

    c ann"l ORA_, 2 _'@ r"stor" compl"t"6 "laps"d tim"@ BB@B'@8inis "d r"stor" at +G- E3-'B+) B @)G@B'

    RMA&! r"cov"r databas"=

    2tarting r"cov"r at +G- E3-'B+) B @)G@+'

    starting m"dia r"cov"r?

    c ann"l ORA_, 2 _+@ starting arc iv"d log r"stor" to d";a#lt d"stination

    c ann"l ORA_, 2 _+@ r"storing arc iv"d log

    arc iv"d log t r"ad4+ s"P#"nc"4+

    c ann"l ORA_, 2 _+@ r"ading ;rom back#p pi"c"/mo#nt/cop?B+/*E2*,3/*E2*,3_ARCH_35_'8KB %%%B _ _'B+)B'+G_ BG BK')G

    N

    c ann"l d";a#lt@ d"l"ting arc iv"d log7s:arc iv"d log ;il"

    nam"4/mo#nt/oracl"/cop?B+/;las _r"cov"r?_ar"a/*E2*,3/*E2*,3/arc iv"log/'B+)_B'_+G/o+_m;_+_'_ l+P rmZ_.arcREC ,4+K 2*AM04 BG ++ %K

    #nabl" to ;ind arc iv"d log

    arc iv"d log t r"ad4+ s"P#"nc"4)

    RMA&-BB8G+@ 44444444444444444444444444444444444444444444444444444444444

    RMA&-BB8 K@ 444444444444444 ERROR ME22AFE 2*AC OLLO 2 444444444444444

    RMA&-BB8G+@ 44444444444444444444444444444444444444444444444444444444444

    RMA&-B)BB'@ ;ail#r" o; r"cov"r command at B'/+G/'B+) B @)G@8G

    RMA&-B B8%@ m"dia r"cov"r? r"P#"sting #nkno9n arc iv"d log ;or t r"ad + 9it s"P#"nc" ) and starting 2C&o; GKG8%

    RMA&! alt"r databas" op"n r"s"tlogs=

    databas" op"n"d

    RMA&! list incarnation=

    List o; ,atabas" ncarnations

    ,3 "? nc "? ,3 &am" ,3 , 2*A*52 R"s"t 2C& R"s"t *im"

    ------- ------- -------- ---------------- --- ---------- ----------

    + + *E2*,3 '8KB %%%B 0ARE&* + B+-&O -'B+' 'B@++@)+

    ' ' *E2*,3 '8KB %%%B 0ARE&* G)8')+ + - E3-'B+) B%@8)@B8

    ) ) *E2*,3 '8KB %%%B C5RRE&* GK K % +G- E3-'B+) BG@+G@%)

    % % *E2*,3 '8KB %%%B C5RRE&* GKG8%K +G- E3-'B+) B @) @+K

    W HAT TO DO IF I DON T KNOW WHAT TO DO ?

    Oracle has a utility within RMAN that is part of Oracles Fault Diagnosability Infrastructure, which automaticallydiagnoses data failures, determines and presents appropriate repair options, and executes repairs at the user's request. Itcan help you and guide you in diagnosing and repairing a media failure thus helping you reduce your MTTR.

    The workflow begins when you either suspect or discover a failure LIST FAILURE. - Method to obtain information regarding failures if you suspect one has occurred.

    22 Session # 196

  • 8/10/2019 2013196antunezppr-130411234317-phpapp01

    23/28

    Backup and Recovery

    VALIDATE DATABASE. - If you suspect that a failure has occurred but not detected, this will help you validatecorrupt blocks and missing data files.

    ADVISE FAILURE. - Will advise you on repair options based on open database failures REPAIR FAILURE. - Automatically will fix failures suggested in the most recent ADVISE FAILURE, you

    should first try any manual repairs before trying to automatically repair failures. Return to the first step if other failures exist

    ,atabas" mo#nt"d.

    ORA-B++8G@ cannot id"nti;?/lock data ;il" - s"" ,3 R trac" ;il"

    ORA-B+++B@ data ;il" @ 1 ,3_,A*A/t"stdb/data;il"/r"n".' K. BG+'B %+[

    RMA&! validat" databas"=

    RMA&-B)BB'@ ;ail#r" o; validat" command at B'/++/'B+) ')@)+@)

    RMA&-B B8 @ co#ld not acc"ss data;il"

    RMA&! list ;ail#r"=

    List o; ,atabas" ail#r"s

    4444444444444444444444444

    ail#r" , 0riorit? 2tat#s *im" ,"t"ct"d 2#mmar?

    ---------- -------- --------- -------------------- -------

    %''' H FH O0E& ++- E3-'B+) ')@)+@B' On" or mor" non-s?st"m data;il"s ar" missing

    RMA&! list ;ail#r" %''' d"tail=

    N

    mpact@ 2"" impact ;or individ#al c ild ;ail#r"s

    List o; c ild ;ail#r"s ;or par"nt ;ail#r" , %'''

    ail#r" , 0riorit? 2tat#s *im" ,"t"ct"d 2#mmar?

    ---------- -------- --------- ---------------- ---- -------

    %''8 H FH O0E& ++- E3-'B+) ')@)+@B' ,ata;il" @1 ,3_,A*A/t"stdb/data;il"/r"n".' K. BG+'B %+1 is missing

    mpact@ 2om" obZ"cts in tabl"spac" RE&E mig t b" #navailabl"

    RMA&! advis" ;ail#r" %'''=

    N

    Optional Man#al Actions

    44444444444444444444444

    +. ; ;il" ,3_,A*A/t"stdb/data;il"/r"n".' K. BG+'B %+ 9as #nint"ntionall? r"nam"d or mov"d6 r"stor" it

    A#tomat"d R"pair Options

    444444444444444444444444

    Option R"pair ,"scription

    ------ ------------------

    + R"stor" and r"cov"r data;il"

    2trat"g?@ * " r"pair incl#d"s compl"t" m"dia r"cov"r? 9it no data loss

    R"pair script@ /mo#nt/oracl"/d#mpB+/*E2*,3/diag/rdbms/t"stdb/*E2*,3+/ m/r"co_)KB)G+8+'K. m

    RMA&! r"pair ;ail#r"=

    N

    cont"nts o; r"pair script@

    23 Session # 196

  • 8/10/2019 2013196antunezppr-130411234317-phpapp01

    24/28

    Backup and Recovery

    D r"stor" and r"cov"r data;il"

    r"stor" data;il" =

    r"cov"r data;il" =

    sPl 1alt"r databas" data;il" onlin"1=

    2tarting r"stor" at ++- E3-'B+) ')@)G@B#sing c ann"l ORA_, 2 _+

    N

    inis "d r"stor" at ++- E3-'B+) ')@)G@+%

    2tarting r"cov"r at ++- E3-'B+) ')@)G@+%

    #sing c ann"l ORA_, 2 _+

    starting m"dia r"cov"r?

    N

    inis "d r"cov"r at ++- E3-'B+) ')@)G@+

    sPl stat"m"nt@ alt"r databas" data;il" onlin"

    r"pair ;ail#r" compl"t"

    ,o ?o# 9ant to op"n t " databas" 7"nt"r E2 or &O: ?"s

    databas" op"n"d

    F LASHBACK T ECHNOLOGY

    Even though flashback features are not part of the RMAN utility, this Oracle element will help you to reduceyour MTTR in case of human error, which normally is not a media failure and not detected as a database error, forexample dropping a table.

    There are four main methods of the flashback feature Flashback Query

    Provides the ability to view the data as it existed in the past by using undo segments to obtain metadata andhistorical data for transactions.

    *E2*,3+! s"l"ct ;irst_nam"6last_nam" ;rom "mplo?""s as o; tim"stamp

    ' to_tim"stamp71'B+)- B'-++ + @+8@BB161 -MM-,, HH'%@M @221:

    ) 9 "r" EM0LO EE_ ,4+BB=

    R2*_&AME LA2*_&AME

    -------------------- -------------------------

    2t"v"n ing

    Flashback Table

    Recovers a table to a previous point in time. Both Flashback Query and Table use undo segments.*E2*,3+! 2ELEC* c#rr"nt_scn ROM v$databas"=

    C5RRE&*_2C&

    -----------

    BB 8

    24 Session # 196

  • 8/10/2019 2013196antunezppr-130411234317-phpapp01

    25/28

    Backup and Recovery

    *E2*,3+! s"l"ct co#nt7+: ;rom t"st.r"n"=

    CO5&*7+:

    ----------

    +

    *E2*,3+! d"l"t" ;rom t"st.r"n"=

    + ro9s d"l"t"d.

    *E2*,3+! commit=

    Commit compl"t".

    *E2*,3+! s"l"ct co#nt7+: ;rom t"st.r"n"=

    CO5&*7+:

    ----------

    B

    *E2*,3+! LA2H3AC *A3LE t"st.r"n" *O 2C& BB 8=

    las back compl"t".

    *E2*,3+! s"l"ct co#nt7+: ;rom t"st.r"n"=

    CO5&*7+:

    ----------

    +

    Flashback Drop

    Virtual container where all dropped objects reside. When you drop a table, it is automatically placed into theRecycle Bin if it is turned on with the parameter RECYCLEBIN=ON

    *E2*,3+! s o9 param"t"r r"c?cl"bin

    &AME * 0E AL5E

    ------------------------------------ ----------- ------------------------------

    r"c?cl"bin string on

    *E2*,3+! drop tabl" t"st.r"n"=

    *abl" dropp"d.

    *E2*,3+! s"l"ct co#nt7+: ;rom t"st.r"n"=s"l"ct co#nt7+: ;rom t"st.r"n"

    ERROR at lin" +@

    ORA-BBK%'@ tabl" or vi"9 do"s not "Qist

    *E2*,3+! 2ELEC* O3\EC*_&AME A2 REC CLE_&AME6 OR F &AL_&AME6 * 0E6,RO0* ME

    ' ROM REC CLE3 & HERE OR F &AL_&AME41RE&E1=

    REC CLE_&AME OR F &AL_&AME * 0E ,RO0* ME

    ------------------------------ -------------------------------- --------------------------------

    25 Session # 196

  • 8/10/2019 2013196antunezppr-130411234317-phpapp01

    26/28

    Backup and Recovery

    3 &$+"%Xkk& Mv;gWBc%PMAFSW44$B RE&E *A3LE 'B+)-B'-+G@+B@'%@+8

    3 &$+"8c/ck M+rgWBc%PMAd A44$B RE&E *A3LE 'B+)-B'-+G@+B@)8@8+

    *E2*,3+! LA2H3AC *A3LE T3 &$+"8c/ck M+rgWBc%PMAd A44$BT *O 3E ORE ,RO0=

    las back compl"t".

    *E2*,3+! s"l"ct co#nt7+: ;rom t"st.r"n"=

    CO5&*7+:

    ----------

    +

    Flashback Database

    Provides a more efficient alternative to database point-in-time recovery, this flashback feature is very usefulwhen you are doing upgrades or have the need to restore the database to a point in time without doing a media

    recovery. It uses Flashback Logs so the FRA and DB_FLASHBACK_RETENTION_TARGET have to be set,also you will also have to turn it on with the database in ARCHIVELOG mode.There are some restrictions to using this feature:

    o No current data files are lost or damaged. You can only use FLASHBACK DATABASE to rewindchanges to a data file made by an Oracle database, not to repair media failures.

    o You are not trying to recover from accidental deletion of data files, undo a shrink data file operation, orundo a change to the database name.

    o You are not trying to use FLASHBACK DATABASE to return to a point in time before the restore or re-creation of a control file.

    o You are not trying to use FLASHBACK DATABASE to undo a compatibility change.

    *E2*,3+! s"l"ct LA2H3AC _O& ;rom v$databas"=

    LA2H3AC _O&

    ------------------

    &O

    *E2*,3+! s #tdo9n imm"diat"

    ,atabas" clos"d.

    ,atabas" dismo#nt"d.

    ORACLE instanc" s #t do9n.

    *E2*,3+! start#p mo#nt=

    ORACLE instanc" start"d.

    *otal 2?st"m Flobal Ar"a +B K)G'+ b?t"s

    iQ"d 2iX" '')8'B b?t"s

    ariabl" 2iX" GB ) 8 % b?t"s

    ,atabas" 3#;;"rs )8')'+8) b?t"s

    R"do 3#;;"rs 88%+ b?t"s

    ,atabas" mo#nt"d.

    *E2*,3+! alt"r databas" ;las back on=

    ,atabas" alt"r"d.

    26 Session # 196

  • 8/10/2019 2013196antunezppr-130411234317-phpapp01

    27/28

    Backup and Recovery

    *E2*,3+! alt"r databas" op"n=

    ,atabas" alt"r"d.

    *E2*,3+! s"l"ct ;las back_on6log_mod" ;rom v$databas"=

    LA2H3AC _O& LOF_MO,E

    ------------------ ------------

    E2 ARCH ELOF

    *E2*,3+! CREA*E RE2*ORE 0O &* b";or"_damag"=

    R"stor" point cr"at"d.

    *E2*,3+! drop #s"r RE&E cascad"=

    5s"r dropp"d.

    *E2*,3+! s"l"ct co#nt7+: ;rom dba_#s"rs 9 "r" #s"rnam"41RE&E1=

    CO5&*7+:

    ----------

    B

    *E2*,3+! s #tdo9n imm"diat"

    ,atabas" clos"d.

    ,atabas" dismo#nt"d.

    ORACLE instanc" s #t do9n.

    *E2*,3+! start#p mo#nt

    ORACLE instanc" start"d.

    *otal 2?st"m Flobal Ar"a +B K)G'+ b?t"s

    iQ"d 2iX" '')8'B b?t"s

    ariabl" 2iX" GB ) 8 % b?t"s

    ,atabas" 3#;;"rs )8')'+8) b?t"s

    R"do 3#;;"rs 88%+ b?t"s

    ,atabas" mo#nt"d.

    *E2*,3+! ;las back databas" to r"stor" point b";or"_damag"=

    las back compl"t".

    *E2*,3+! alt"r databas" op"n r"s"tlogs=

    ,atabas" alt"r"d.

    *E2*,3+! s"l"ct co#nt7+: ;rom dba_#s"rs 9 "r" #s"rnam"41RE&E1=

    CO5&*7+:

    ----------

    +

    27 Session # 196

  • 8/10/2019 2013196antunezppr-130411234317-phpapp01

    28/28

    Backup and Recovery

    C ONCLUSION

    If the time ever comes when you need to recover from a disaster, it is very critical knowing the DBID of yourdatabase; you can always get the DBID from

    Backup logs RMAN Catalog Backup Pieces if formatted to have it in the backup piece

    Get to know your RMAN configurations and where your backups reside, SBT or DISK. Always have a backup ofyour ORACLE_HOME/GRID_HOME to the last current patch applied, and last but not least have as many Level 0backups as your retention period/storage capacities allow.

    Knowing and having these settings/configurations will allow you to reduce your MTTR and reduce the costs ofhaving the data unavailable for your organization or client.

    R EFERENCES a. Oracle Database Backup and Recovery User's Guide 11g Release 2 (11.2)

    from http://docs.oracle.com/cd/E11882_01/backup.112/e10642/toc.htmb. Oracle RMAN 11g Backup and Recovery

    Robert G. Freeman & Matthew Hart (2010) McGraw-Hillc. RMAN Recipes for Oracle Database 11g:A Problem-Solution Approach

    Darl Kuhn, Sam Alapati, & Arup Nanda (2007) Apressd. 10 Problems with your backup script

    from http://www.slideshare.net/yvelikanov/10-problems-with-your-rman-backup-scripte. Dont Forget the Basics

    from http://www.pythian.com/blog/wp-content/uploads/Michael_Abbey_OOW_2012_UGF6458.pdf f. RMAN | Pythian - Data Experts Blog

    from http://www.pythian.com/blog/tag/rman/

    http://docs.oracle.com/cd/E11882_01/backup.112/e10642/toc.htmhttp://www.slideshare.net/yvelikanov/10-problems-with-your-rman-backup-scripthttp://www.pythian.com/blog/wp-content/uploads/Michael_Abbey_OOW_2012_UGF6458.pdfhttp://www.pythian.com/blog/tag/rman/http://docs.oracle.com/cd/E11882_01/backup.112/e10642/toc.htmhttp://www.slideshare.net/yvelikanov/10-problems-with-your-rman-backup-scripthttp://www.pythian.com/blog/wp-content/uploads/Michael_Abbey_OOW_2012_UGF6458.pdfhttp://www.pythian.com/blog/tag/rman/