Beruflich Dokumente
Kultur Dokumente
FILENAME
BYTES
---------- -------------------------------------ENABLED
/u02/app/oracle/oradata/crms/track.dbf
-------------------------------11599872
string
/u02/app/oracle/flash_recovery_area
db_recovery_file_dest_size
big integer
8852M
1 oracle oinstall
-rw-r-----
1 oracle oinstall
-rw-r-----
1 oracle oinstall
-rw-r-----
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
o1_mf_nnnd0_TAG20150131T122331_bdryzct1_.bkp
TAG20150131T122331
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
DEFAULT_TABLESPACE
------------------------------ -------------------USER2
HRMS
USER1
CRMS
USER3
BPMS
DEFAULT_TABLESPACE
------------------------------ -----------------------------SCOTT
USERS
Key
TY LV S Device Type Completion Time #Pieces #Copies Compressed Tag
------- -- -- - ----------- --------------- ------- ------- ---------- --431
A DISK
31-JAN-15
YES
LEVEL-0-FULL-BACKUP
432
A DISK
31-JAN-15
YES
TAG20150131T122331
433
A DISK
31-JAN-15
YES
LEVEL-1-BACKUP-1
434
A DISK
31-JAN-15
YES
TAG20150131T122331
435
A DISK
31-JAN-15
YES
LEVEL-1-CUMULATIVE-I
436
A DISK
31-JAN-15
YES
LEVEL-1-CUMULATIVE-I
437
A DISK
31-JAN-15
YES
LEVEL-1-BACKUP-2
438
A DISK
31-JAN-15
YES
LEVEL-1-BACKUP-1
439
A DISK
31-JAN-15
YES
LEVEL-1-BACKUP-2
440
A DISK
31-JAN-15
YES
LEVEL-0-FULL-BACKUP
441
A DISK
31-JAN-15
YES
LEVEL-1-BACKUP-3
442
A DISK
31-JAN-15
YES
LEVEL-1-BACKUP-3
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
ryzb5t_.bkp
List of Archived Logs in backup set 431
Thrd Seq
Low SCN
Low Time
Next SCN
Next Time
BS Key
Type LV Size
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
Incr 2552156
31-JAN-15 /u02/app/oracle/oradata/crms/system01.dbf
Incr 2552156
31-JAN-15 /u02/app/oracle/oradata/crms/sysaux01.dbf
Incr 2552156
31-JAN-15 /u02/app/oracle/oradata/crms/undotbs01.dbf
Incr 2552156
31-JAN-15 /u02/app/oracle/oradata/crms/users01.dbf
Incr 2552156
31-JAN-15 /u02/app/oracle/oradata/crms/crms01.dbf
Incr 2552156
31-JAN-15 /u02/app/oracle/oradata/crms/hrms01.dbf
Incr 2552156
31-JAN-15 /u02/app/oracle/oradata/crms/bpms01.dbf
BS Key
Type LV Size
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
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
BS Key
Type LV Size
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
Incr 2553420
31-JAN-15 /u02/app/oracle/oradata/crms/system01.dbf
Incr 2553420
31-JAN-15 /u02/app/oracle/oradata/crms/sysaux01.dbf
Incr 2553420
31-JAN-15 /u02/app/oracle/oradata/crms/undotbs01.dbf
Incr 2553420
31-JAN-15 /u02/app/oracle/oradata/crms/users01.dbf
Incr 2553420
31-JAN-15 /u02/app/oracle/oradata/crms/crms01.dbf
Incr 2553420
31-JAN-15 /u02/app/oracle/oradata/crms/hrms01.dbf
Incr 2553420
31-JAN-15 /u02/app/oracle/oradata/crms/bpms01.dbf
BS Key
Type LV Size
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
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
Incr 2553122
31-JAN-15 /u02/app/oracle/oradata/crms/system01.dbf
Incr 2553122
31-JAN-15 /u02/app/oracle/oradata/crms/sysaux01.dbf
Incr 2553122
31-JAN-15 /u02/app/oracle/oradata/crms/undotbs01.dbf
Incr 2553122
31-JAN-15 /u02/app/oracle/oradata/crms/users01.dbf
Incr 2553122
31-JAN-15 /u02/app/oracle/oradata/crms/crms01.dbf
Incr 2553122
31-JAN-15 /u02/app/oracle/oradata/crms/hrms01.dbf
Incr 2553122
31-JAN-15 /u02/app/oracle/oradata/crms/bpms01.dbf
BS Key
Type LV Size
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
Incr 2552389
31-JAN-15 /u02/app/oracle/oradata/crms/system01.dbf
Incr 2552389
31-JAN-15 /u02/app/oracle/oradata/crms/sysaux01.dbf
Incr 2552389
31-JAN-15 /u02/app/oracle/oradata/crms/undotbs01.dbf
Incr 2552389
31-JAN-15 /u02/app/oracle/oradata/crms/users01.dbf
Incr 2552389
31-JAN-15 /u02/app/oracle/oradata/crms/crms01.dbf
Incr 2552389
31-JAN-15 /u02/app/oracle/oradata/crms/hrms01.dbf
Incr 2552389
31-JAN-15 /u02/app/oracle/oradata/crms/bpms01.dbf
BS Key
Type LV Size
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
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
53
2552146
Type LV Size
31-JAN-15 2552190
31-JAN-15
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
BS Key
Type LV Size
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
Incr 3280744
31-JAN-15 /u02/app/oracle/oradata/crms/system01.dbf
Incr 3280744
31-JAN-15 /u02/app/oracle/oradata/crms/sysaux01.dbf
Incr 3280744
31-JAN-15 /u02/app/oracle/oradata/crms/undotbs01.dbf
Incr 3280744
31-JAN-15 /u02/app/oracle/oradata/crms/users01.dbf
Incr 3280744
31-JAN-15 /u02/app/oracle/oradata/crms/crms01.dbf
Incr 3280744
31-JAN-15 /u02/app/oracle/oradata/crms/hrms01.dbf
Incr 3280744
31-JAN-15 /u02/app/oracle/oradata/crms/bpms01.dbf
680
SYSTEM
***
/u02/app/oracle/oradata/crms/system01.dbf
540
SYSAUX
***
/u02/app/oracle/oradata/crms/sysaux01.dbf
1690
UNDOTBS1
***
/u02/app/oracle/oradata/crms/undotbs01.dbf
487
USERS
***
/u02/app/oracle/oradata/crms/users01.dbf
50
CRMS
***
/u02/app/oracle/oradata/crms/crms01.dbf
50
HRMS
***
/u02/app/oracle/oradata/crms/hrms01.dbf
50
BPMS
***
/u02/app/oracle/oradata/crms/bpms01.dbf
20
TEMP
32767
/u02/app/oracle/oradata/crms/temp01.dbf
/u02/app/oracle/flash_recovery_area/crms/
$ rm *
$ cd /u02/app/oracle/oradata/crms
$ rm *
$ 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.
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.
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
TYPE
-------string
VALUE
-----------------------------------------------------------/u02/app/oracle/product/11.2.0/dbhome_1/dbs/spfilecrms.ora
$ 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.
1 oracle oinstall
-rw-r-----
1 oracle oinstall
-rw-r-----
1 oracle oinstall
-rw-r-----
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
files.txt
CRITICAL
OPEN
01-FEB-15
19344
CRITICAL
OPEN
01-FEB-15
7988
HIGH
OPEN
01-FEB-15
CRITICAL
OPEN
01-FEB-15
19344
CRITICAL OPEN
01-FEB-15
7988
HIGH
01-FEB-15
OPEN
[Trimmed]
Media Recovery Log
/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.
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
A DISK
01-FEB-15
NO
LEVEL-0-FULL-BKP
656
A DISK
01-FEB-15
NO
TAG20150201T211333
657
A DISK
01-FEB-15
NO
LEVEL-1-BACKUP-I
658
A DISK
01-FEB-15
NO
LEVEL-0-FULL-BKP
659
A DISK
01-FEB-15
NO
LEVEL-1-BACKUP-II
660
A DISK
01-FEB-15
NO
LEVEL-1-BACKUP-I
661
A DISK
01-FEB-15
NO
LEVEL-1-BACKUP-II
662
A DISK
01-FEB-15
NO
LEVEL-1-CUMULATIVE-I
663
A DISK
01-FEB-15
NO
TAG20150201T211333
664
A DISK
01-FEB-15
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
13828096 Feb
1 21:14 o1_mf_ncsn0_TAG20150201T211333_bdwlg0g9_.bkp
-rw-r-----
-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
1 21:13 o1_mf_nnnd0_TAG20150201T211333_bdwlf661_.bkp
MAXVALUE
..
...
[Trimmed]
MAXVALUE, MAXVALUE,
917071677, MAXVALUE<
917071677, MAXVALUE<
917071677, MAXVALUE,
917071677, MAXVALUE<
917071677, MAXVALUE,