LOSS OF FULL DATABASE & RECOVERY - RMAN BACKUP.pdf

April 27, 2017 | Author: G.R.THIYAGU ; Oracle DBA | Category: N/A
Share Embed Donate


Short Description

Download LOSS OF FULL DATABASE & RECOVERY - RMAN BACKUP.pdf...

Description

LOSS OF FULL DATABASE AND DATABASE RECOVERY | ORACLE 11g

CONNECT TO TARGET DATABASE USING RMAN $ export ORACLE_SID=crms $ rlrman target / Recovery Manager: Release 11.2.0.1.0 - Production on Sat Jan 31 10:13:56 2015 Copyright (c) 1982, 2009, Oracle and/or its affiliates.

All rights reserved.

connected to target database: CRMS (DBID=1570419964) The SHOW ALL command to display the current value of RMAN configured settings for the target database. Let’s first take a look at RMAN default settings. RMAN> SHOW ALL; using target database control file instead of recovery catalog RMAN configuration parameters for database with db_unique_name CRMS are: CONFIGURE RETENTION POLICY TO REDUNDANCY 2; CONFIGURE BACKUP OPTIMIZATION OFF; # default CONFIGURE DEFAULT DEVICE TYPE TO DISK; # default CONFIGURE CONTROLFILE AUTOBACKUP OFF; # default CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '%F'; # default CONFIGURE DEVICE TYPE DISK BACKUP TYPE TO COMPRESSED BACKUPSET PARALLELISM 1; CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default CONFIGURE MAXSETSIZE TO UNLIMITED; # default CONFIGURE ENCRYPTION FOR DATABASE OFF; # default CONFIGURE ENCRYPTION ALGORITHM 'AES128'; # default CONFIGURE COMPRESSION ALGORITHM 'BASIC' AS OF RELEASE 'DEFAULT' OPTIMIZE FOR LOAD TRUE; # default CONFIGURE ARCHIVELOG DELETION POLICY TO NONE; # default CONFIGURE SNAPSHOT CONTROLFILE NAME TO '/u02/app/.../11.2.0/dbhome_1/dbs/snapcf_crms.f'; #default RMAN> show controlfile autobackup; RMAN configuration parameters for database with db_unique_name CRMS are: CONFIGURE CONTROLFILE AUTOBACKUP OFF; # default If the CONFIGURE CONTROLFILE AUTOBACKUP is set to ON (by default it is OFF), then RMAN automatically backs up the control file & server parameter file for each rman backup. If the database was started with an spfile, but the CONTROLFILE AUTOBACKUP is NOT enabled, then the controlfile & spfile both are automatically included when SYSTEM DATAFILE is backed up. Once we enable CONTROLFILE AUTOBACKUP ON, RMAN writes the control file and SPFILE to a separate autobackup backup set. If CONTROLFILE AUTOBACKUP OFF, RMAN includes the current control file and SPFILE in the same backup set as the datafiles. Oracle recommends enabling CONTROLFILE AUTOBACKUP ON because with a controlfile autobackup, so rman can recover the database even if the current controlfile, recovery catalog & server parameter file are inaccessible.

Exploring the Oracle DBA Technology by Gunasekaran ,Thiyagu

LOSS OF FULL DATABASE AND DATABASE RECOVERY | ORACLE 11g

CONNECTING TARGET DATABASE SYS> select name, dbid from v$database; NAME DBID --------- ---------CRMS 1570419964 SYS> show parameter pfile; NAME TYPE VALUE ------------------------------------ ----------- --------------------------------------------spfile string /u02/app/oracle/../dbhome_1/dbs/spfilecrms.ora SYS> select * from v$block_change_tracking; STATUS

FILENAME

BYTES

---------- -------------------------------------ENABLED

/u02/app/oracle/oradata/crms/track.dbf

-------------------------------11599872

SYS> show parameter db_recovery_file_dest; NAME TYPE VALUE ------------------------------------ ----------- ---------------------------------db_recovery_file_dest

string

/u02/app/oracle/flash_recovery_area

db_recovery_file_dest_size

big integer

8852M

TAKE LEVEL 0 INCREMENTAL BACKUP RMAN> backup incremental level 0 database plus archivelog 2> delete all input tag "LEVEL-0-FULL-BACKUP"; Starting backup at 31-JAN-15 current log archived using channel ORA_DISK_1 channel ORA_DISK_1: starting compressed archived log backup set channel ORA_DISK_1: specifying archived log(s) in backup set input archived log thread=1 sequence=52 RECID=360 STAMP=870438209 channel ORA_DISK_1: starting piece 1 at 31-JAN-15 channel ORA_DISK_1: finished piece 1 at 31-JAN-15 piece handle=/u02/app/oracle/flash_recovery_area/CRMS/backupset/2015_01_31/o1_mf_annnn_LEVEL_0_FULL_BA CKUP_bdryzb5t_.bkp tag=LEVEL-0-FULL-BACKUP comment=NONE channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01 channel ORA_DISK_1: deleting archived log(s) archived log file name=/u02/app/oracle/flash_recovery_area/CRMS/archivelog/2015_01_31/o1_mf_1_52_bdryz9x8_.arc RECID=360 STAMP=870438209 Finished backup at 31-JAN-15 Starting backup at 31-JAN-15 using channel ORA_DISK_1 channel ORA_DISK_1: starting compressed incremental level 0 datafile backup set channel ORA_DISK_1: specifying datafile(s) in backup set

Exploring the Oracle DBA Technology by Gunasekaran ,Thiyagu

LOSS OF FULL DATABASE AND DATABASE RECOVERY | ORACLE 11g

input datafile file number=00003 name=/u02/app/oracle/oradata/crms/undotbs01.dbf input datafile file number=00001 name=/u02/app/oracle/oradata/crms/system01.dbf input datafile file number=00002 name=/u02/app/oracle/oradata/crms/sysaux01.dbf input datafile file number=00004 name=/u02/app/oracle/oradata/crms/users01.dbf input datafile file number=00005 name=/u02/app/oracle/oradata/crms/crms01.dbf input datafile file number=00006 name=/u02/app/oracle/oradata/crms/hrms01.dbf input datafile file number=00007 name=/u02/app/oracle/oradata/crms/bpms01.dbf channel ORA_DISK_1: starting piece 1 at 31-JAN-15 channel ORA_DISK_1: finished piece 1 at 31-JAN-15 piece handle=/u02/app/oracle/flash_recovery_area/CRMS/backupset/2015_01_31/o1_mf_nnnd0_TAG20150131T122 331_bdryzct1_.bkp tag=TAG20150131T122331 comment=NONE channel ORA_DISK_1: backup set complete, elapsed time: 00:00:45 channel ORA_DISK_1: starting compressed incremental level 0 datafile backup set channel ORA_DISK_1: specifying datafile(s) in backup set including current control file in backup set including current SPFILE in backup set channel ORA_DISK_1: starting piece 1 at 31-JAN-15 channel ORA_DISK_1: finished piece 1 at 31-JAN-15 piece handle=/u02/app/oracle/flash_recovery_area/CRMS/backupset/2015_01_31/o1_mf_ncsn0_TAG20150131T122 331_bdrz0t08_.bkp tag=TAG20150131T122331 comment=NONE channel ORA_DISK_1: backup set complete, elapsed time: 00:00:02 Finished backup at 31-JAN-15

Starting backup at 31-JAN-15 current log archived using channel ORA_DISK_1 channel ORA_DISK_1: starting compressed archived log backup set channel ORA_DISK_1: specifying archived log(s) in backup set input archived log thread=1 sequence=53 RECID=361 STAMP=870438259 channel ORA_DISK_1: starting piece 1 at 31-JAN-15 channel ORA_DISK_1: finished piece 1 at 31-JAN-15 piece handle=/u02/app/oracle/flash_recovery_area/CRMS/backupset/2015_01_31/o1_mf_annnn_LEVEL_0_FULL_BA CKUP_bdrz0vhq_.bkp tag=LEVEL-0-FULL-BACKUP comment=NONE channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01 channel ORA_DISK_1: deleting archived log(s) archived log file name=/u02/app/oracle/flash_recovery_area/CRMS/archivelog/2015_01_31/o1_mf_1_53_bdrz0v8k_.arc RECID=361 STAMP=870438259 Finished backup at 31-JAN-15 $ ls -l /u02/app/oracle/flash_recovery_area/CRMS/backupset/2015_01_31/ -rw-r-----

1 oracle oinstall

2560 Jan 31 12:23 o1_mf_annnn_LEVEL_0_FULL_BACKUP_bdryzb5t_.bkp

-rw-r-----

1 oracle oinstall

14848 Jan 31 12:24 o1_mf_annnn_LEVEL_0_FULL_BACKUP_bdrz0vhq_.bkp

-rw-r-----

1 oracle oinstall

1294336 Jan 31 12:24 o1_mf_ncsn0_TAG20150131T122331_bdrz0t08_.bkp

-rw-r-----

1 oracle oinstall 274382848 Jan 31 12:24 o1_mf_nnnd0_TAG20150131T122331_bdryzct1_.bkp

Exploring the Oracle DBA Technology by Gunasekaran ,Thiyagu

LOSS OF FULL DATABASE AND DATABASE RECOVERY | ORACLE 11g

Backing up both the database plus archived logs, however, the archived logs will be copied first and the requested tag would be – “LEVEL-0-FULL-BACKUP″, then the archived logs will be deleted as per deletion policy configuration. When the database is backed up, the requested tag is not used, so the actual database backup gets an RMAN generated tag (TAG20150131T122331) and NOT the one we wanted. The current redo log is then archived & backed up – got the requested tag “LEVEL-0-FULL-BACKUP. Finally the controlfile & spfile are backed up according to the autobackup policy and again, got an RMAN generated tag. Requested tag is only applied to the first backupset in the backup. o1_mf_annnn_LEVEL_0_FULL_BACKUP_bdryzb5t_.bkp



LEVEL-0-FULL-BACKUP



Requested Tag

o1_mf_annnn_LEVEL_0_FULL_BACKUP_bdrz0vhq_.bkp



LEVEL-0-FULL-BACKUP



Requested Tag

o1_mf_ncsn0_TAG20150131T122331_bdrz0t08_.bkp



TAG20150131T122331



Rman Generated Tag

o1_mf_nnnd0_TAG20150131T122331_bdryzct1_.bkp



TAG20150131T122331



Rman Generated Tag

I hope you can understand clearly when performing recovery, why we discuss backupsets & tagnames here.

I make some changes in the target database such as creating new users and creating new tables. SYS> grant connect, resource to user1 identified by user1; Grant succeeded. SYS> alter user user1 default tablespace hrms; User altered. SYS> conn user1/user1; Connected. USER1> create table tab1 as select * from user_objects; Table created. USER1> create table tab2 as select * from user_objects; Table created. I have made some changes to tables in the user1 schema. So my database is having newly changed blocks. Now it is ready for incremental level 1 backup. TAKE LEVEL 1 INCREMENTAL BACKUP – 1st TIME RMAN> backup incremental level 1 database tag "LEVEL-1-BACKUP-1"; Starting backup at 31-JAN-15 using channel ORA_DISK_1 channel ORA_DISK_1: starting compressed incremental level 1 datafile backup set channel ORA_DISK_1: specifying datafile(s) in backup set input datafile file number=00003 name=/u02/app/oracle/oradata/crms/undotbs01.dbf input datafile file number=00001 name=/u02/app/oracle/oradata/crms/system01.dbf input datafile file number=00002 name=/u02/app/oracle/oradata/crms/sysaux01.dbf input datafile file number=00004 name=/u02/app/oracle/oradata/crms/users01.dbf input datafile file number=00005 name=/u02/app/oracle/oradata/crms/crms01.dbf input datafile file number=00006 name=/u02/app/oracle/oradata/crms/hrms01.dbf input datafile file number=00007 name=/u02/app/oracle/oradata/crms/bpms01.dbf channel ORA_DISK_1: starting piece 1 at 31-JAN-15

Exploring the Oracle DBA Technology by Gunasekaran ,Thiyagu

LOSS OF FULL DATABASE AND DATABASE RECOVERY | ORACLE 11g

channel ORA_DISK_1: finished piece 1 at 31-JAN-15 piece handle=/u02/app/oracle/flash_recovery_area/CRMS/backupset/2015_01_31/o1_mf_nnnd1_LEVEL_1_BACKUP_ 1_bdrzc4z4_.bkp tag=LEVEL-1-BACKUP-1 comment=NONE channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01 channel ORA_DISK_1: starting compressed incremental level 1 datafile backup set channel ORA_DISK_1: specifying datafile(s) in backup set including current control file in backup set including current SPFILE in backup set channel ORA_DISK_1: starting piece 1 at 31-JAN-15 channel ORA_DISK_1: finished piece 1 at 31-JAN-15 piece handle=/u02/app/oracle/flash_recovery_area/CRMS/backupset/2015_01_31/o1_mf_ncsn1_LEVEL_1_BACKUP_ 1_bdrzc76t_.bkp tag=LEVEL-1-BACKUP-1 comment=NONE channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01 Finished backup at 31-JAN-15

SYS> create user user2 identified by user2 default tablespace hrms; User created. SYS> grant connect, resource to user2; Grant succeeded. SYS> conn user2/user2 Connected. USER2> create table tab1 as select * from user_objects; Table created. USER2> create table tab2 as select * from user_objects; Table created. I have made some changes to tables in the user2 schema. So my database is having newly changed blocks. Now it is ready for incremental level 1 backup. TAKE LEVEL 1 INCREMENTAL BACKUP – (2nd TIME) RMAN> backup incremental level 1 database tag "LEVEL-1-BACKUP-2"; Starting backup at 31-JAN-15 using channel ORA_DISK_1 channel ORA_DISK_1: starting compressed incremental level 1 datafile backup set channel ORA_DISK_1: specifying datafile(s) in backup set input datafile file number=00003 name=/u02/app/oracle/oradata/crms/undotbs01.dbf input datafile file number=00001 name=/u02/app/oracle/oradata/crms/system01.dbf input datafile file number=00002 name=/u02/app/oracle/oradata/crms/sysaux01.dbf input datafile file number=00004 name=/u02/app/oracle/oradata/crms/users01.dbf input datafile file number=00005 name=/u02/app/oracle/oradata/crms/crms01.dbf input datafile file number=00006 name=/u02/app/oracle/oradata/crms/hrms01.dbf input datafile file number=00007 name=/u02/app/oracle/oradata/crms/bpms01.dbf channel ORA_DISK_1: starting piece 1 at 31-JAN-15

Exploring the Oracle DBA Technology by Gunasekaran ,Thiyagu

LOSS OF FULL DATABASE AND DATABASE RECOVERY | ORACLE 11g

channel ORA_DISK_1: finished piece 1 at 31-JAN-15 piece handle=/u02/app/oracle/flash_recovery_area/CRMS/backupset/2015_01_31/o1_mf_nnnd1_LEVEL_1_BACKUP_2 _bdrzt872_.bkp tag=LEVEL-1-BACKUP-2 comment=NONE channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01 channel ORA_DISK_1: starting compressed incremental level 1 datafile backup set channel ORA_DISK_1: specifying datafile(s) in backup set including current control file in backup set including current SPFILE in backup set channel ORA_DISK_1: starting piece 1 at 31-JAN-15 channel ORA_DISK_1: finished piece 1 at 31-JAN-15 piece handle=/u02/app/oracle/flash_recovery_area/CRMS/backupset/2015_01_31/o1_mf_ncsn1_LEVEL_1_BACKUP_ 2_bdrztbhc_.bkp tag=LEVEL-1-BACKUP-2 comment=NONE channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01 Finished backup at 31-JAN-15 Again i make some changes in the target database such as creating new user and creating new tables for next level(cumulative) backup. SYS> create user user3 identified by user3; User created. SYS> grant connect, resource to user3; Grant succeeded. SYS> alter user user3 default tablespace bpms; User altered. SYS> conn user3/user3 Connected. USER3> create table tab1 as select * from user_objects; Table created. USER3> create table tab2 as select * from user_objects; Table created. SYS> select username, default_tablespace from dba_users where username like 'USER%'; USERNAME

DEFAULT_TABLESPACE

------------------------------ -------------------USER2

HRMS

USER1

CRMS

USER3

BPMS

SYS> conn user1/user1 Connected. USER1> create table tab3 as select * from user_objects; Table created. SYS> conn user2/user2 Connected.

Exploring the Oracle DBA Technology by Gunasekaran ,Thiyagu

LOSS OF FULL DATABASE AND DATABASE RECOVERY | ORACLE 11g

USER2> create table tab3 as select * from user_objects; Table created. SYS> conn user3/user3 Connected. USER3> create table tab3 as select * from user_objects; Table created.

TAKE LEVEL 1 CUMULATIVE BACKUP Now I am ready to take a cumulative incremental backup, which will create a new backup consisting of all the blocks that changed since the previous level zero backup. RMAN> backup incremental level 1 cumulative database tag "LEVEL-1-CUMULATIVE-I"; Starting backup at 31-JAN-15 using channel ORA_DISK_1 channel ORA_DISK_1: starting compressed incremental level 1 datafile backup set channel ORA_DISK_1: specifying datafile(s) in backup set input datafile file number=00003 name=/u02/app/oracle/oradata/crms/undotbs01.dbf input datafile file number=00001 name=/u02/app/oracle/oradata/crms/system01.dbf input datafile file number=00002 name=/u02/app/oracle/oradata/crms/sysaux01.dbf input datafile file number=00004 name=/u02/app/oracle/oradata/crms/users01.dbf input datafile file number=00005 name=/u02/app/oracle/oradata/crms/crms01.dbf input datafile file number=00006 name=/u02/app/oracle/oradata/crms/hrms01.dbf input datafile file number=00007 name=/u02/app/oracle/oradata/crms/bpms01.dbf channel ORA_DISK_1: starting piece 1 at 31-JAN-15 channel ORA_DISK_1: finished piece 1 at 31-JAN-15 piece handle=/u02/app/oracle/flash_recovery_area/CRMS/backupset/2015_01_31/o1_mf_nnnd1__LEVEL_1_CUMULA TIVE__bds062s1_.bkp tag= LEVEL-1-CUMULATIVE-I comment=NONE channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01 channel ORA_DISK_1: starting compressed incremental level 1 datafile backup set channel ORA_DISK_1: specifying datafile(s) in backup set including current control file in backup set including current SPFILE in backup set channel ORA_DISK_1: starting piece 1 at 31-JAN-15 channel ORA_DISK_1: finished piece 1 at 31-JAN-15 piece handle=/u02/app/oracle/flash_recovery_area/CRMS/backupset/2015_01_31/o1_mf_ncsn1__LEVEL_1_CUMULA TIVE__bds064x2_.bkp tag= LEVEL-1-CUMULATIVE-I comment=NONE channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01 Finished backup at 31-JAN-15 SYS> select username, default_tablespace from dba_users where username='SCOTT'; USERNAME

DEFAULT_TABLESPACE

------------------------------ -----------------------------SCOTT

USERS

Exploring the Oracle DBA Technology by Gunasekaran ,Thiyagu

LOSS OF FULL DATABASE AND DATABASE RECOVERY | ORACLE 11g

SYS> conn scott/tiger Connected. SCOTT> create table tab1(id number, name varchar2(15), salary number, mobile number, city varchar2(15)); Table created. SCOTT> BEGIN 2 for i in 1..200000 loop 3 insert into tab1 values(i ,'sam',30000,9999999999,'calcutta'); 4 commit; 5 end loop; 6 end; 7 / PL/SQL procedure successfully completed. SCOTT> select count(*) from tab1; COUNT(*) --------200000 Now I can take another level 1 differential backup, I’ll get only the changed blocks since from last level 1 cumulative backup. Let’s start. TAKE LEVEL 1 INCREMENTAL BACKUP – 3rd TIME

RMAN> backup incremental level 1 database tag "LEVEL-1-BACKUP-3"; Starting backup at 31-JAN-15 using channel ORA_DISK_1 channel ORA_DISK_1: starting compressed incremental level 1 datafile backup set channel ORA_DISK_1: specifying datafile(s) in backup set input datafile file number=00003 name=/u02/app/oracle/oradata/crms/undotbs01.dbf input datafile file number=00001 name=/u02/app/oracle/oradata/crms/system01.dbf input datafile file number=00002 name=/u02/app/oracle/oradata/crms/sysaux01.dbf input datafile file number=00004 name=/u02/app/oracle/oradata/crms/users01.dbf input datafile file number=00005 name=/u02/app/oracle/oradata/crms/crms01.dbf input datafile file number=00006 name=/u02/app/oracle/oradata/crms/hrms01.dbf input datafile file number=00007 name=/u02/app/oracle/oradata/crms/bpms01.dbf channel ORA_DISK_1: starting piece 1 at 31-JAN-15 channel ORA_DISK_1: finished piece 1 at 31-JAN-15 piece handle=/u02/app/oracle/flash_recovery_area/CRMS/backupset/2015_01_31/o1_mf_nnnd1_LEVEL_1_BACKUP_ 3_bds0x448_.bkp tag=LEVEL-1-BACKUP-3 comment=NONE channel ORA_DISK_1: backup set complete, elapsed time: 00:00:07 channel ORA_DISK_1: starting compressed incremental level 1 datafile backup set channel ORA_DISK_1: specifying datafile(s) in backup set including current control file in backup set

Exploring the Oracle DBA Technology by Gunasekaran ,Thiyagu

LOSS OF FULL DATABASE AND DATABASE RECOVERY | ORACLE 11g

including current SPFILE in backup set channel ORA_DISK_1: starting piece 1 at 31-JAN-15 channel ORA_DISK_1: finished piece 1 at 31-JAN-15 piece handle=/u02/app/oracle/flash_recovery_area/CRMS/backupset/2015_01_31/o1_mf_ncsn1_LEVEL_1_BACKUP_ 3_bds0xddz_.bkp tag=LEVEL-1-BACKUP-3 comment=NONE channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01 Finished backup at 31-JAN-15 After Level 1 incremental backup i am updating few transactions in scott schema but I do NOT have any rman backup for latest transactions. SCOTT> update tab1 set name='SAMUELS'; 200000 rows updated. SCOTT> commit; Commit complete. SCOTT> create table tab2 as select * from tab1; Table created. LETS CHECK ALL BACKUP DETAILS RMAN> list backup summary; List of Backups ===============

Key TY LV S Device Type Completion Time #Pieces #Copies Compressed Tag ------- -- -- - ----------- --------------- ------- ------- ---------- --431

B

A

A DISK

31-JAN-15

1

1

YES

LEVEL-0-FULL-BACKUP

432

B

0

A DISK

31-JAN-15

1

1

YES

TAG20150131T122331

433

B

1

A DISK

31-JAN-15

1

1

YES

LEVEL-1-BACKUP-1

434

B

0

A DISK

31-JAN-15

1

1

YES

TAG20150131T122331

435

B

1

A DISK

31-JAN-15

1

1

YES

LEVEL-1-CUMULATIVE-I

436

B

1

A DISK

31-JAN-15

1

1

YES

LEVEL-1-CUMULATIVE-I

437

B

1

A DISK

31-JAN-15

1

1

YES

LEVEL-1-BACKUP-2

438

B

1

A DISK

31-JAN-15

1

1

YES

LEVEL-1-BACKUP-1

439

B

1

A DISK

31-JAN-15

1

1

YES

LEVEL-1-BACKUP-2

440

B

A

A DISK

31-JAN-15

1

1

YES

LEVEL-0-FULL-BACKUP

441

B

1

A DISK

31-JAN-15

1

1

YES

LEVEL-1-BACKUP-3

442

B

1

A DISK

31-JAN-15

1

1

YES

LEVEL-1-BACKUP-3

RMAN> list backup; List of Backup Sets =================== BS Key Size Device Type Elapsed Time Completion Time ------- ---------- ----------- ------------ --------------431 2.00K DISK 00:00:00 31-JAN-15 BP Key: 442

Status: AVAILABLE

Compressed: YES

Tag: LEVEL-0-FULL-BACKUP

Exploring the Oracle DBA Technology by Gunasekaran ,Thiyagu

LOSS OF FULL DATABASE AND DATABASE RECOVERY | ORACLE 11g

Piece Name: /u02/app/oracle/flash_recovery_area/CRMS/backupset/2015_01_31/o1_mf_annnn_LEVEL_0_FULL_BACKUP_bd ryzb5t_.bkp List of Archived Logs in backup set 431 Thrd Seq

Low SCN

Low Time

Next SCN

Next Time

---- ------- ---------- --------- ---------- --------1 52 2552104 31-JAN-15 2552146 31-JAN-15

BS Key

Type LV Size

Device Type Elapsed Time Completion Time

------- ---- -- ---------- ----------- ------------ --------------432

Incr 0

261.66M

BP Key: 443

DISK

00:00:41

Status: AVAILABLE

31-JAN-15

Compressed: YES

Tag: TAG20150131T122331

Piece Name: /u02/app/oracle/flash_recovery_area/CRMS/backupset/2015_01_31/o1_mf_nnnd0_TAG20150131T122331_bdr yzct1_.bkp List of Datafiles in backup set 432 File LV Type Ckp SCN

Ckp Time

Name

---- -- ---- ---------- --------- ---1

0

Incr 2552156

31-JAN-15 /u02/app/oracle/oradata/crms/system01.dbf

2

0

Incr 2552156

31-JAN-15 /u02/app/oracle/oradata/crms/sysaux01.dbf

3

0

Incr 2552156

31-JAN-15 /u02/app/oracle/oradata/crms/undotbs01.dbf

4

0

Incr 2552156

31-JAN-15 /u02/app/oracle/oradata/crms/users01.dbf

5

0

Incr 2552156

31-JAN-15 /u02/app/oracle/oradata/crms/crms01.dbf

6

0

Incr 2552156

31-JAN-15 /u02/app/oracle/oradata/crms/hrms01.dbf

7

0

Incr 2552156

31-JAN-15 /u02/app/oracle/oradata/crms/bpms01.dbf

BS Key

Type LV Size

Device Type Elapsed Time Completion Time

------- ---- -- ---------- ----------- ------------ --------------433

Incr 1

1.22M

BP Key: 444

DISK

00:00:00

Status: AVAILABLE

31-JAN-15

Compressed: YES

Tag: LEVEL-1-BACKUP-1

Piece Name: /u02/app/oracle/flash_recovery_area/CRMS/backupset/2015_01_31/o1_mf_ncsn1_LEVEL_1_BACKUP_1_bdrzc 76t_.bkp SPFILE Included: Modification time: 31-JAN-15 SPFILE db_unique_name: CRMS Control File Included: Ckp SCN: 2552391

BS Key

Type LV Size

Ckp time: 31-JAN-15

Device Type Elapsed Time Completion Time

------- ---- -- ---------- ----------- ------------ --------------434

Incr 0

1.22M

BP Key: 445

DISK

00:00:00

Status: AVAILABLE

31-JAN-15

Compressed: YES

Tag: TAG20150131T122331

Piece Name: /u02/app/oracle/flash_recovery_area/CRMS/backupset/2015_01_31/o1_mf_ncsn0_TAG20150131T122331_bdr z0t08_.bkp SPFILE Included: Modification time: 31-JAN-15 SPFILE db_unique_name: CRMS Control File Included: Ckp SCN: 2552184

Ckp time: 31-JAN-15

Exploring the Oracle DBA Technology by Gunasekaran ,Thiyagu

LOSS OF FULL DATABASE AND DATABASE RECOVERY | ORACLE 11g

BS Key

Type LV Size

Device Type Elapsed Time Completion Time

------- ---- -- ---------- ----------- ------------ --------------435

Incr 1

1.58M

BP Key: 446

DISK

00:00:00

Status: AVAILABLE

31-JAN-15

Compressed: YES

Tag:

LEVEL-1-CUMULATIVE-I

Piece Name: /u02/app/oracle/flash_recovery_area/CRMS/backupset/2015_01_31/o1_mf_nnnd1__LEVEL_1_CUMULATIVE__b ds062s1_.bkp List of Datafiles in backup set 435 File LV Type Ckp SCN

Ckp Time

Name

---- -- ---- ---------- --------- ---1

1

Incr 2553420

31-JAN-15 /u02/app/oracle/oradata/crms/system01.dbf

2

1

Incr 2553420

31-JAN-15 /u02/app/oracle/oradata/crms/sysaux01.dbf

3

1

Incr 2553420

31-JAN-15 /u02/app/oracle/oradata/crms/undotbs01.dbf

4

1

Incr 2553420

31-JAN-15 /u02/app/oracle/oradata/crms/users01.dbf

5

1

Incr 2553420

31-JAN-15 /u02/app/oracle/oradata/crms/crms01.dbf

6

1

Incr 2553420

31-JAN-15 /u02/app/oracle/oradata/crms/hrms01.dbf

7

1

Incr 2553420

31-JAN-15 /u02/app/oracle/oradata/crms/bpms01.dbf

BS Key

Type LV Size

Device Type Elapsed Time Completion Time

------- ---- -- ---------- ----------- ------------ --------------436

Incr 1

1.22M

BP Key: 447

DISK

00:00:00

Status: AVAILABLE

31-JAN-15

Compressed: YES

Tag:

LEVEL-1-CUMULATIVE-I

Piece Name: /u02/app/oracle/flash_recovery_area/CRMS/backupset/2015_01_31/o1_mf_ncsn1__LEVEL_1_CUMULATIVE__b ds064x2_.bkp SPFILE Included: Modification time: 31-JAN-15 SPFILE db_unique_name: CRMS Control File Included: Ckp SCN: 2553421

BS Key

Type LV Size

Ckp time: 31-JAN-15

Device Type Elapsed Time Completion Time

------- ---- -- ---------- ----------- ------------ --------------437

Incr 1

1.48M

BP Key: 448

DISK

00:00:00

Status: AVAILABLE

31-JAN-15

Compressed: YES

Tag: LEVEL-1-BACKUP-2

Piece Name: /u02/app/oracle/flash_recovery_area/CRMS/backupset/2015_01_31/o1_mf_nnnd1_LEVEL_1_BACKUP_2_bdrzt 872_.bkp List of Datafiles in backup set 437 File LV Type Ckp SCN

Ckp Time

Name

---- -- ---- ---------- --------- ---1

1

Incr 2553122

31-JAN-15 /u02/app/oracle/oradata/crms/system01.dbf

2

1

Incr 2553122

31-JAN-15 /u02/app/oracle/oradata/crms/sysaux01.dbf

3

1

Incr 2553122

31-JAN-15 /u02/app/oracle/oradata/crms/undotbs01.dbf

4

1

Incr 2553122

31-JAN-15 /u02/app/oracle/oradata/crms/users01.dbf

5

1

Incr 2553122

31-JAN-15 /u02/app/oracle/oradata/crms/crms01.dbf

6

1

Incr 2553122

31-JAN-15 /u02/app/oracle/oradata/crms/hrms01.dbf

7

1

Incr 2553122

31-JAN-15 /u02/app/oracle/oradata/crms/bpms01.dbf

Exploring the Oracle DBA Technology by Gunasekaran ,Thiyagu

LOSS OF FULL DATABASE AND DATABASE RECOVERY | ORACLE 11g

BS Key

Type LV Size

Device Type Elapsed Time Completion Time

------- ---- -- ---------- ----------- ------------ --------------438

Incr 1

632.00K

BP Key: 449

DISK

00:00:00

Status: AVAILABLE

31-JAN-15

Compressed: YES

Tag: LEVEL-1-BACKUP-1

Piece Name: /u02/app/oracle/flash_recovery_area/CRMS/backupset/2015_01_31/o1_mf_nnnd1_LEVEL_1_BACKUP_1_bdrzc 4z4_.bkp List of Datafiles in backup set 438 File LV Type Ckp SCN

Ckp Time

Name

---- -- ---- ---------- --------- ---1

1

Incr 2552389

31-JAN-15 /u02/app/oracle/oradata/crms/system01.dbf

2

1

Incr 2552389

31-JAN-15 /u02/app/oracle/oradata/crms/sysaux01.dbf

3

1

Incr 2552389

31-JAN-15 /u02/app/oracle/oradata/crms/undotbs01.dbf

4

1

Incr 2552389

31-JAN-15 /u02/app/oracle/oradata/crms/users01.dbf

5

1

Incr 2552389

31-JAN-15 /u02/app/oracle/oradata/crms/crms01.dbf

6

1

Incr 2552389

31-JAN-15 /u02/app/oracle/oradata/crms/hrms01.dbf

7

1

Incr 2552389

31-JAN-15 /u02/app/oracle/oradata/crms/bpms01.dbf

BS Key

Type LV Size

Device Type Elapsed Time Completion Time

------- ---- -- ---------- ----------- ------------ --------------439

Incr 1

1.22M

BP Key: 450

DISK

00:00:00

Status: AVAILABLE

31-JAN-15

Compressed: YES

Tag: LEVEL-1-BACKUP-2

Piece Name: /u02/app/oracle/flash_recovery_area/CRMS/backupset/2015_01_31/o1_mf_ncsn1_LEVEL_1_BACKUP_2_bdrzt bhc_.bkp SPFILE Included: Modification time: 31-JAN-15 SPFILE db_unique_name: CRMS Control File Included: Ckp SCN: 2553124

BS Key

Size

Ckp time: 31-JAN-15

Device Type Elapsed Time Completion Time

------- ---------- ----------- ------------ --------------440

14.00K

DISK

BP Key: 451

00:00:00

31-JAN-15

Status: AVAILABLE

Compressed: YES

Tag: LEVEL-0-FULL-BACKUP

Piece Name: /u02/app/oracle/flash_recovery_area/CRMS/backupset/2015_01_31/o1_mf_annnn_LEVEL_0_FULL_BACKUP_bd rz0vhq_.bkp List of Archived Logs in backup set 440 Thrd Seq

Low SCN

Low Time

Next SCN

Next Time

---- ------- ---------- --------- ---------- --------1 BS Key

53

2552146

Type LV Size

31-JAN-15 2552190

31-JAN-15

Device Type Elapsed Time Completion Time

------- ---- -- ---------- ----------- ------------ --------------441

Incr 1

1.22M

BP Key: 452

DISK Status: AVAILABLE

00:00:00

31-JAN-15

Compressed: YES

Tag: LEVEL-1-BACKUP-3

Piece Name: /u02/app/oracle/flash_recovery_area/CRMS/backupset/2015_01_31/o1_mf_ncsn1_LEVEL_1_BACKUP_3_bds0x ddz_.bkp

Exploring the Oracle DBA Technology by Gunasekaran ,Thiyagu

LOSS OF FULL DATABASE AND DATABASE RECOVERY | ORACLE 11g

SPFILE Included: Modification time: 31-JAN-15 SPFILE db_unique_name: CRMS Control File Included: Ckp SCN: 3280747

BS Key

Type LV Size

Ckp time: 31-JAN-15

Device Type Elapsed Time Completion Time

------- ---- -- ---------- ----------- ------------ --------------442

Incr 1

24.21M

BP Key: 453

DISK

00:00:00

Status: AVAILABLE

31-JAN-15

Compressed: YES

Tag: LEVEL-1-BACKUP-3

Piece Name: /u02/app/oracle/flash_recovery_area/CRMS/backupset/2015_01_31/o1_mf_nnnd1_LEVEL_1_BACKUP_3_bds0x 448_.bkp List of Datafiles in backup set 442 File LV Type Ckp SCN

Ckp Time

Name

---- -- ---- ---------- --------- ---1

1

Incr 3280744

31-JAN-15 /u02/app/oracle/oradata/crms/system01.dbf

2

1

Incr 3280744

31-JAN-15 /u02/app/oracle/oradata/crms/sysaux01.dbf

3

1

Incr 3280744

31-JAN-15 /u02/app/oracle/oradata/crms/undotbs01.dbf

4

1

Incr 3280744

31-JAN-15 /u02/app/oracle/oradata/crms/users01.dbf

5

1

Incr 3280744

31-JAN-15 /u02/app/oracle/oradata/crms/crms01.dbf

6

1

Incr 3280744

31-JAN-15 /u02/app/oracle/oradata/crms/hrms01.dbf

7

1

Incr 3280744

31-JAN-15 /u02/app/oracle/oradata/crms/bpms01.dbf

RMAN> report schema; Report of database schema for database with db_unique_name CRMS List of Permanent Datafiles =========================== File Size(MB) Tablespace

RB segs Datafile Name

---- -------- -------------------- ------- -----------------------1

680

SYSTEM

***

/u02/app/oracle/oradata/crms/system01.dbf

2

540

SYSAUX

***

/u02/app/oracle/oradata/crms/sysaux01.dbf

3

1690

UNDOTBS1

***

/u02/app/oracle/oradata/crms/undotbs01.dbf

4

487

USERS

***

/u02/app/oracle/oradata/crms/users01.dbf

5

50

CRMS

***

/u02/app/oracle/oradata/crms/crms01.dbf

6

50

HRMS

***

/u02/app/oracle/oradata/crms/hrms01.dbf

7

50

BPMS

***

/u02/app/oracle/oradata/crms/bpms01.dbf

List of Temporary Files ======================= File Size(MB) Tablespace

Maxsize(MB) Tempfile Name

---- -------- -------------------- ----------- -------------------1

20

TEMP

32767

/u02/app/oracle/oradata/crms/temp01.dbf

DELETING ALL FILES AT OS LEVEL MANUALLY $ cd

/u02/app/oracle/flash_recovery_area/crms/

$ rm * $ cd /u02/app/oracle/oradata/crms $ rm *

Exploring the Oracle DBA Technology by Gunasekaran ,Thiyagu

LOSS OF FULL DATABASE AND DATABASE RECOVERY | ORACLE 11g

$ export ORACLE_SID=crms $ rlrman target / Recovery Manager: Release 11.2.0.1.0 - Production on Sat Jan 31 13:18:47 2015 Copyright (c) 1982, 2009, Oracle and/or its affiliates.

All rights reserved.

RMAN-00571: =========================================================== RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS =============== RMAN-00571: =========================================================== RMAN-00554: initialization of internal recovery manager package failed RMAN-06003: ORACLE error from target database: ORA-00210: cannot open the specified control file ORA-00202: control file: '/u02/app/oracle/oradata/crms/control01.ctl' ORA-27041: unable to open file Linux Error: 2: No such file or directory Additional information: 3 STARTING DATABASE RECOVERY THROUGH RMAN BACKUP $ export ORACLE_SID=crms $ rlsqlplus "/as sysdba" SQL*Plus: Release 11.2.0.1.0 Production on Sat Jan 31 13:27:50 2015 Copyright (c) 1982, 2009, Oracle.

All rights reserved.

Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production With the Partitioning, OLAP, Data Mining and Real Application Testing options SYS> shut abort; ORACLE instance shut down. STARTING THE TARGET DATABASE INSTANCE AT NOMOUNT STAGE SYS> startup nomount; ORACLE instance started. Total System Global Area 1255473152 bytes Fixed Size

1336232 bytes

Variable Size

788532312 bytes

Database Buffers

452984832 bytes

Redo Buffers

12619776 bytes

SYS> select status from v$instance; STATUS -------STARTED SYS> show parameter pfile; NAME --------spfile

TYPE -------string

VALUE -----------------------------------------------------------/u02/app/oracle/product/11.2.0/dbhome_1/dbs/spfilecrms.ora

Exploring the Oracle DBA Technology by Gunasekaran ,Thiyagu

LOSS OF FULL DATABASE AND DATABASE RECOVERY | ORACLE 11g

$ rlrman target / Recovery Manager: Release 11.2.0.1.0 - Production on Sat Jan 31 13:28:58 2015 Copyright (c) 1982, 2009, Oracle and/or its affiliates.

All rights reserved.

connected to target database: CRMS (not mounted) RMAN> restore controlfile from autobackup; Starting restore at 31-JAN-15 using target database control file instead of recovery catalog allocated channel: ORA_DISK_1 channel ORA_DISK_1: SID=20 device type=DISK recovery area destination: /u02/app/oracle/flash_recovery_area database name (or database unique name) used for search: CRMS channel ORA_DISK_1: no AUTOBACKUPS found in the recovery area AUTOBACKUP search with format "%F" not attempted because DBID was not set RMAN-00571: =========================================================== RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS =============== RMAN-00571: =========================================================== RMAN-03002: failure of restore command at 01/31/2015 13:29:15 RMAN-06172: no AUTOBACKUP found or specified handle is not a valid copy or piece RMAN> show controlfile autobackup; RMAN configuration parameters for database with db_unique_name CRMS are: CONFIGURE CONTROLFILE AUTOBACKUP OFF; # default I remember Even though CONTROLFILE AUTOBACKUP is NOT enabled, the controlfile & spfile both are automatically included when SYSTEM DATAFILE is backed up. CHECKING LEVEL 0 INCREMENTAL BACKUPSETS $ ls -l /u02/app/oracle/flash_recovery_area/CRMS/backupset/2015_01_31/ -rw-r-----

1 oracle oinstall

2560 Jan 31 12:23 o1_mf_annnn_LEVEL_0_FULL_BACKUP_bdryzb5t_.bkp

-rw-r-----

1 oracle oinstall

14848 Jan 31 12:24 o1_mf_annnn_LEVEL_0_FULL_BACKUP_bdrz0vhq_.bkp

-rw-r-----

1 oracle oinstall

1294336 Jan 31 12:24 o1_mf_ncsn0_TAG20150131T122331_bdrz0t08_.bkp

-rw-r-----

1 oracle oinstall 274382848 Jan 31 12:24 o1_mf_nnnd0_TAG20150131T122331_bdryzct1_.bkp

As I said above, the controlfile & spfile are backed up according to the backup policy and got an RMAN generated tag (TAG20150131T122331. RMAN includes the current control file and SPFILE in the same backup set as the datafiles. We can skip requested tag (LEVEL-0-FULL-BACKUP). RMAN> restore controlfile from '/u02/app/oracle/flash_recovery_area/CRMS/backupset/2015_01_31/ o1_mf_ncsn0_TAG20150131T122331_bdrz0t08_.bkp'; Starting restore at 01-FEB-15 using channel ORA_DISK_1 channel ORA_DISK_1: restoring control file channel ORA_DISK_1: restore complete, elapsed time: 00:00:17 output file name=/u02/app/oracle/oradata/crms/control01.ctl output file name=/u02/app/oracle/flash_recovery_area/crms/control02.ctl Finished restore at 01-FEB-15

Exploring the Oracle DBA Technology by Gunasekaran ,Thiyagu

LOSS OF FULL DATABASE AND DATABASE RECOVERY | ORACLE 11g

RMAN> alter database mount; database mounted RMAN> validate database; Starting validate at 01-FEB-15 Starting implicit crosscheck backup at 01-FEB-15 allocated channel: ORA_DISK_1 channel ORA_DISK_1: SID=19 device type=DISK Crosschecked 2 objects Finished implicit crosscheck backup at 01-FEB-15 Starting implicit crosscheck copy at 01-FEB-15 using channel ORA_DISK_1 Crosschecked 4 objects Finished implicit crosscheck copy at 01-FEB-15 searching for all files in the recovery area cataloging files... cataloging done List of Cataloged Files =======================

files.txt

using channel ORA_DISK_1 RMAN-06169: could not read file header for datafile 1 error reason 4 RMAN-00571: =========================================================== RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS =============== RMAN-00571: =========================================================== RMAN-03002: failure of validate command at 02/01/2015 10:49:00 RMAN-06056: could not access datafile 1 RMAN> list failure; List of Database Failures ========================= Failure ID Priority Status

Time Detected Summary

---------- -------- ------- ------------- ------19347

CRITICAL

OPEN

01-FEB-15

System datafile 1: '/u02/../../system01.dbf' is missing

19344

CRITICAL

OPEN

01-FEB-15

Control file needs media recovery

7988

HIGH

OPEN

01-FEB-15

One or more non-system datafiles are missing

RMAN> advise failure; List of Database Failures ========================= Failure ID Priority Status Time Detected Summary ---------- -------- ------- ------------- ------19347

CRITICAL

OPEN

01-FEB-15

System datafile 1: '/u02/../../system01.dbf' is missing

Exploring the Oracle DBA Technology by Gunasekaran ,Thiyagu

LOSS OF FULL DATABASE AND DATABASE RECOVERY | ORACLE 11g

19344

CRITICAL OPEN

01-FEB-15

Control file needs media recovery

7988

HIGH

01-FEB-15

One or more non-system datafiles are missing

OPEN

analyzing automatic repair options; this may take some time using channel ORA_DISK_1 analyzing automatic repair options complete Mandatory Manual Actions ======================== no manual actions available Optional Manual Actions ======================= 1. If you have the correct version of the control file, then shutdown the database and replace the old control file 2. If file /u02/app/oracle/oradata/crms/system01.dbf was unintentionally renamed or moved, restore it 3. If file /u02/app/oracle/oradata/crms/sysaux01.dbf was unintentionally renamed or moved, restore it 4. If file /u02/app/oracle/oradata/crms/undotbs01.dbf was unintentionally renamed or moved, restore it 5. If file /u02/app/oracle/oradata/crms/users01.dbf was unintentionally renamed or moved, restore it 6. If file /u02/app/oracle/oradata/crms/crms01.dbf was unintentionally renamed or moved, restore it 7. If file /u02/app/oracle/oradata/crms/hrms01.dbf was unintentionally renamed or moved, restore it 8. If file /u02/app/oracle/oradata/crms/bpms01.dbf was unintentionally renamed or moved, restore it Automated Repair Options ======================== Option Repair Description ------ -----------------1

Perform incomplete database recovery Strategy: The repair includes point-in-time recovery with some data loss Repair script: /u02/app/oracle/diag/rdbms/crms/crms/hm/reco_2134091970.hm

RMAN> repair failure; Strategy: The repair includes point-in-time recovery with some data loss Repair script: /u02/app/oracle/diag/rdbms/crms/crms/hm/reco_2134091970.hm contents of repair script: # database point-in-time recovery until a missing log restore database until scn 3281792; recover database until scn 3281792; alter database open resetlogs; Do you really want to execute the above repair (enter YES or NO)? yes executing repair script

Exploring the Oracle DBA Technology by Gunasekaran ,Thiyagu

LOSS OF FULL DATABASE AND DATABASE RECOVERY | ORACLE 11g

Starting restore at 01-FEB-15 using channel ORA_DISK_1 channel ORA_DISK_1: starting datafile backup set restore channel ORA_DISK_1: specifying datafile(s) to restore from backup set channel ORA_DISK_1: restoring datafile 00001 to /u02/app/oracle/oradata/crms/system01.dbf channel ORA_DISK_1: restoring datafile 00002 to /u02/app/oracle/oradata/crms/sysaux01.dbf channel ORA_DISK_1: restoring datafile 00003 to /u02/app/oracle/oradata/crms/undotbs01.dbf channel ORA_DISK_1: restoring datafile 00004 to /u02/app/oracle/oradata/crms/users01.dbf channel ORA_DISK_1: restoring datafile 00005 to /u02/app/oracle/oradata/crms/crms01.dbf channel ORA_DISK_1: restoring datafile 00006 to /u02/app/oracle/oradata/crms/hrms01.dbf channel ORA_DISK_1: restoring datafile 00007 to /u02/app/oracle/oradata/crms/bpms01.dbf channel ORA_DISK_1: reading from backup piece /u02/app/oracle/flash_recovery_area/CRMS/backupset/2015_01_31/o1_mf_nnnd0_TAG20150131T122331_bdr yzct1_.bkp channel ORA_DISK_1: piece handle=/u02/app/oracle/flash_recovery_area/CRMS/backupset/2015_01_31/o1_mf_nnnd0_TAG20150131T122 331_bdryzct1_.bkp tag=TAG20150131T122331 channel ORA_DISK_1: restored backup piece 1 channel ORA_DISK_1: restore complete, elapsed time: 00:06:17 Finished restore at 01-FEB-15 Starting recover at 01-FEB-15 using channel ORA_DISK_1 channel ORA_DISK_1: starting incremental datafile backup set restore channel ORA_DISK_1: specifying datafile(s) to restore from backup set destination for restore of datafile 00001: /u02/app/oracle/oradata/crms/system01.dbf destination for restore of datafile 00002: /u02/app/oracle/oradata/crms/sysaux01.dbf destination for restore of datafile 00003: /u02/app/oracle/oradata/crms/undotbs01.dbf destination for restore of datafile 00004: /u02/app/oracle/oradata/crms/users01.dbf destination for restore of datafile 00005: /u02/app/oracle/oradata/crms/crms01.dbf destination for restore of datafile 00006: /u02/app/oracle/oradata/crms/hrms01.dbf destination for restore of datafile 00007: /u02/app/oracle/oradata/crms/bpms01.dbf channel ORA_DISK_1: reading from backup piece /u02/app/oracle/flash_recovery_area/CRMS/backupset/2015_01_31/o1_mf_nnnd1__LEVEL_1_CUMULATIVE__b ds062s1_.bkp channel ORA_DISK_1: piece handle=/u02/app/oracle/flash_recovery_area/CRMS/backupset/2015_01_31/o1_mf_nnnd1__LEVEL_1_CUMULA TIVE__bds062s1_.bkp tag= LEVEL-1-CUMULATIVE-I channel ORA_DISK_1: restored backup piece 1 channel ORA_DISK_1: restore complete, elapsed time: 00:00:03 channel ORA_DISK_1: starting incremental datafile backup set restore channel ORA_DISK_1: specifying datafile(s) to restore from backup set destination for restore of datafile 00001: /u02/app/oracle/oradata/crms/system01.dbf destination for restore of datafile 00002: /u02/app/oracle/oradata/crms/sysaux01.dbf destination for restore of datafile 00003: /u02/app/oracle/oradata/crms/undotbs01.dbf destination for restore of datafile 00004: /u02/app/oracle/oradata/crms/users01.dbf destination for restore of datafile 00005: /u02/app/oracle/oradata/crms/crms01.dbf destination for restore of datafile 00006: /u02/app/oracle/oradata/crms/hrms01.dbf

Exploring the Oracle DBA Technology by Gunasekaran ,Thiyagu

LOSS OF FULL DATABASE AND DATABASE RECOVERY | ORACLE 11g

destination for restore of datafile 00007: /u02/app/oracle/oradata/crms/bpms01.dbf channel ORA_DISK_1: reading from backup piece /u02/app/oracle/flash_recovery_area/CRMS/backupset/2015_01_31/o1_mf_nnnd1_LEVEL_1_BACKUP_3_bds0x 448_.bkp channel ORA_DISK_1: piece handle=/u02/app/oracle/flash_recovery_area/CRMS/backupset/2015_01_31/o1_mf_nnnd1_LEVEL_1_BACKUP_ 3_bds0x448_.bkp tag=LEVEL-1-BACKUP-3 channel ORA_DISK_1: restored backup piece 1 channel ORA_DISK_1: restore complete, elapsed time: 00:00:15 starting media recovery archived log for thread 1 with sequence 54 is already on disk as file /u02/app/oracle/flash_recovery_area/CRMS/archivelog/2015_01_31/o1_mf_1_54_bds0gp0f_.arc archived log for thread 1 with sequence 55 is already on disk as file /u02/app/oracle/flash_recovery_area/CRMS/archivelog/2015_01_31/o1_mf_1_55_bds0gxhk_.arc archived log for thread 1 with sequence 56 is already on disk as file /u02/app/oracle/flash_recovery_area/CRMS/archivelog/2015_01_31/o1_mf_1_56_bds0jyq5_.arc archived log for thread 1 with sequence 57 is already on disk as file /u02/app/oracle/flash_recovery_area/CRMS/archivelog/2015_01_31/o1_mf_1_57_bds0k8ms_.arc archived log for thread 1 with sequence 58 is already on disk as file /u02/app/oracle/flash_recovery_area/CRMS/archivelog/2015_01_31/o1_mf_1_58_bds0knfm_.arc archived log for thread 1 with sequence 59 is already on disk as file /u02/app/oracle/flash_recovery_area/CRMS/archivelog/2015_01_31/o1_mf_1_59_bds0m4nd_.arc archived log for thread 1 with sequence 60 is already on disk as file /u02/app/oracle/flash_recovery_area/CRMS/archivelog/2015_01_31/o1_mf_1_60_bds0mjgx_.arc archived log for thread 1 with sequence 61 is already on disk as file /u02/app/oracle/flash_recovery_area/CRMS/archivelog/2015_01_31/o1_mf_1_61_bds0mwor_.arc archived log for thread 1 with sequence 62 is already on disk as file /u02/app/oracle/flash_recovery_area/CRMS/archivelog/2015_01_31/o1_mf_1_62_bds0o13m_.arc archived log for thread 1 with sequence 63 is already on disk as file /u02/app/oracle/flash_recovery_area/CRMS/archivelog/2015_01_31/o1_mf_1_63_bds0p5ph_.arc archived log for thread 1 with sequence 64 is already on disk as file /u02/app/oracle/flash_recovery_area/CRMS/archivelog/2015_01_31/o1_mf_1_64_bds0zjvq_.arc archived log for thread 1 with sequence 65 is already on disk as file /u02/app/oracle/flash_recovery_area/CRMS/archivelog/2015_01_31/o1_mf_1_65_bds0zm3d_.arc channel ORA_DISK_1: starting archived log restore to default destination channel ORA_DISK_1: restoring archived log archived log thread=1 sequence=53 channel ORA_DISK_1: reading from backup piece /u02/app/oracle/flash_recovery_area/CRMS/backupset/2015_01_31/o1_mf_annnn_LEVEL_0_FULL_BACKUP_bd rz0vhq_.bkp channel ORA_DISK_1: piece handle=/u02/app/oracle/flash_recovery_area/CRMS/backupset/2015_01_31/o1_mf_annnn_LEVEL_0_FULL_BA CKUP_bdrz0vhq_.bkp tag=LEVEL-0-FULL-BACKUP channel ORA_DISK_1: restored backup piece 1 channel ORA_DISK_1: restore complete, elapsed time: 00:00:01 archived log file name=/u02/app/oracle/flash_recovery_area/CRMS/archivelog/2015_01_31/o1_mf_1_54_bds0gp0f_.arc thread=1 sequence=54

Exploring the Oracle DBA Technology by Gunasekaran ,Thiyagu

LOSS OF FULL DATABASE AND DATABASE RECOVERY | ORACLE 11g

archived log file name=/u02/app/oracle/flash_recovery_area/CRMS/archivelog/2015_01_31/o1_mf_1_55_bds0gxhk_.arc thread=1 sequence=55 archived log file name=/u02/app/oracle/flash_recovery_area/CRMS/archivelog/2015_01_31/o1_mf_1_56_bds0jyq5_.arc thread=1 sequence=56 archived log file name=/u02/app/oracle/flash_recovery_area/CRMS/archivelog/2015_01_31/o1_mf_1_57_bds0k8ms_.arc thread=1 sequence=57 archived log file name=/u02/app/oracle/flash_recovery_area/CRMS/archivelog/2015_01_31/o1_mf_1_58_bds0knfm_.arc thread=1 sequence=58 archived log file name=/u02/app/oracle/flash_recovery_area/CRMS/archivelog/2015_01_31/o1_mf_1_59_bds0m4nd_.arc thread=1 sequence=59 archived log file name=/u02/app/oracle/flash_recovery_area/CRMS/archivelog/2015_01_31/o1_mf_1_60_bds0mjgx_.arc thread=1 sequence=60 archived log file name=/u02/app/oracle/flash_recovery_area/CRMS/archivelog/2015_01_31/o1_mf_1_61_bds0mwor_.arc thread=1 sequence=61 archived log file name=/u02/app/oracle/flash_recovery_area/CRMS/archivelog/2015_01_31/o1_mf_1_62_bds0o13m_.arc thread=1 sequence=62 archived log file name=/u02/app/oracle/flash_recovery_area/CRMS/archivelog/2015_01_31/o1_mf_1_63_bds0p5ph_.arc thread=1 sequence=63 archived log file name=/u02/app/oracle/flash_recovery_area/CRMS/archivelog/2015_01_31/o1_mf_1_64_bds0zjvq_.arc thread=1 sequence=64 archived log file name=/u02/app/oracle/flash_recovery_area/CRMS/archivelog/2015_01_31/o1_mf_1_65_bds0zm3d_.arc thread=1 sequence=65 media recovery complete, elapsed time: 00:00:43 Finished recover at 01-FEB-15 database opened repair failure complete archived log file name=/u02/app/oracle/flash_recovery_area/CRMS/archivelog/2015_02_01/o1_mf_1_53_bdvk30dq_.arc thread=1 sequence=53 channel default: deleting archived log(s) archived log file name=/u02/app/oracle/flash_recovery_area/CRMS/archivelog/2015_02_01/o1_mf_1_53_bdvk30dq_.arc RECID=373 STAMP=870522296 $ tail -f /u02/app/oracle/diag/rdbms/crms/crms/trace/alert_crms.log .. ...

[Trimmed] Media Recovery Log

Exploring the Oracle DBA Technology by Gunasekaran ,Thiyagu

LOSS OF FULL DATABASE AND DATABASE RECOVERY | ORACLE 11g

/u02/app/oracle/flash_recovery_area/CRMS/archivelog/2015_01_31/o1_mf_1_65_bds0zm3d_.arc Incomplete Recovery applied until change 3281792 time 01/31/2015 12:57:47 Media Recovery Complete (crms) Completed: alter database recover logfile '/u02/app/oracle/flash_recovery_area/CRMS/archivelog/2015_01_31/o1_mf_1_65_bds0zm3d_.arc' alter database open resetlogs CONNECT TARGET DATABASE $ rlsqlplus "/as sysdba" SQL*Plus: Release 11.2.0.1.0 Production on Sun Feb 1 11:57:52 2015 Copyright (c) 1982, 2009, Oracle.

All rights reserved.

Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production With the Partitioning, OLAP, Data Mining and Real Application Testing options SYS> select status from v$instance; STATUS -----------OPEN SYS> archive log list; Database log mode

Archive Mode

Automatic archival

Enabled

Archive destination

USE_DB_RECOVERY_FILE_DEST

Oldest online log sequence

1

Next log sequence to archive

2

Current log sequence

2

SYS> conn scott/tiger Connected. SCOTT> select count(*) from tab1; COUNT(*) -------200000 SCOTT> select count(*) from tab2; select count(*) from tab2 * ERROR at line 1: ORA-00942: table or view does not exist

WHY WE HAVE PERFORMED INCOMPLETE RECOVERY? After level 1 incremental backup (3rd - tag name is LEVEL-1-BACKUP-3), i made some transactions in the target database but NOT committed. While performing database recovery Oracle never allowed uncommitted transactions in the database. So we cannot perform complete recovery.

Exploring the Oracle DBA Technology by Gunasekaran ,Thiyagu

LOSS OF FULL DATABASE AND DATABASE RECOVERY | ORACLE 11g

HOW TO FIND DBID ? Sometimes you need to SET DBID before you RESTORE CONTROLFILE because Oracle uses the DBID to verify if the controlfile is for the same database. Let’s try how to find DBID? If the target database backup as compressed then following method NOT able to find DBID and backup is NOT compressed one, you can use this method. File name should contain system data file. $ strings backup_piece_file_name | grep MAXVALUE RMAN> list backup summary; using target database control file instead of recovery catalog List of Backups =============== Key

TY LV S Device Type Completion Time #Pieces #Copies Compressed Tag

------- -- -- - ----------- --------------- ------- ------- ---------- --655

B

A

A DISK

01-FEB-15

1

1

NO

LEVEL-0-FULL-BKP

656

B

0

A DISK

01-FEB-15

1

1

NO

TAG20150201T211333

657

B

1

A DISK

01-FEB-15

1

1

NO

LEVEL-1-BACKUP-I

658

B

A

A DISK

01-FEB-15

1

1

NO

LEVEL-0-FULL-BKP

659

B

1

A DISK

01-FEB-15

1

1

NO

LEVEL-1-BACKUP-II

660

B

1

A DISK

01-FEB-15

1

1

NO

LEVEL-1-BACKUP-I

661

B

1

A DISK

01-FEB-15

1

1

NO

LEVEL-1-BACKUP-II

662

B

1

A DISK

01-FEB-15

1

1

NO

LEVEL-1-CUMULATIVE-I

663

B

0

A DISK

01-FEB-15

1

1

NO

TAG20150201T211333

664

B

1

A DISK

01-FEB-15

1

1

NO

LEVEL-1-CUMULATIVE-I

$ ls -l /u02/app/oracle/flash_recovery_area/HRMS/backupset/2015_02_01/ total 1160884 -rw-r-----

1 oracle oinstall

2560 Feb

1 21:13 o1_mf_annnn_LEVEL_0_FULL_BKP_bdwlf4nt_.bkp

-rw-r-----

1 oracle oinstall

6656 Feb

1 21:14 o1_mf_annnn_LEVEL_0_FULL_BKP_bdwlg20n_.bkp

-rw-r-----

1 oracle oinstall

-rw-r-----

1 oracle oinstall

13828096 Feb

1 21:20 o1_mf_ncsn1_LEVEL_1_BACKUP_I_bdwlt3dl_.bkp

-rw-r-----

1 oracle oinstall

13828096 Feb

1 21:24 o1_mf_ncsn1_LEVEL_1_BACKUP_II_bdwm1pd7_.bkp

-rw-r----- 1 oracle oinstall

13828096 Feb

1 21:14 o1_mf_ncsn0_TAG20150201T211333_bdwlg0g9_.bkp

13828096 Feb 1 21:27 o1_mf_ncsn1_LEVEL_1_CUMULATIVE_I_bdwm7tvc_.bkp

-rw-r-----

1 oracle oinstall 1123893248 Feb

-rw-r-----

1 oracle oinstall

2088960 Feb

1 21:20 o1_mf_nnnd1_LEVEL_1_BACKUP_I_bdwlt1jz_.bkp

-rw-r-----

1 oracle oinstall

1687552 Feb

1 21:24 o1_mf_nnnd1_LEVEL_1_BACKUP_II_bdwm1n70_.bkp

-rw-r----- 1 oracle oinstall

1 21:13 o1_mf_nnnd0_TAG20150201T211333_bdwlf661_.bkp

4546560 Feb 1 21:27 o1_mf_nnnd1_LEVEL_1_CUMULATIVE_I_bdwm7rwl_.bkp

$ strings o1_mf_nnnd0_TAG20150201T211333_bdwlf661_.bkp | grep

MAXVALUE

.. ... [Trimmed] MAXVALUE, MAXVALUE, 917071677, MAXVALUE< 917071677, MAXVALUE< 917071677, MAXVALUE, 917071677, MAXVALUE< 917071677, MAXVALUE,

Exploring the Oracle DBA Technology by Gunasekaran ,Thiyagu

View more...

Comments

Copyright ©2017 KUPDF Inc.
SUPPORT KUPDF