RMAN catalog的创建和基本使用

target DB SID=zhong
catalog DB SID=backupdb

创建catalog表空间和用户,并且赋予相应权限

SYS@backupdb:~>create tablespace tbs_catalog datafile '/u01/app/oracle/oradata/backupdb/catalog01.dbf' size 500m;
Tablespace created.

SYS@backupdb:~>create user cataloguser identified by cataloguser default tablespace tbs_catalog temporary tablespace temp;

User created.

SYS@backupdb:~>grant recovery_catalog_owner to cataloguser;

Grant succeeded.

SYS@backupdb:~>alter user cataloguser quota unlimited on tbs_catalog;

User altered.

查看cataloguser当前权限

SYS@backupdb:~>conn cataloguser/cataloguser
Connected.
CATALOGUSER@backupdb:~>select * from session_privs;
PRIVILEGE
----------------------------------------
CREATE SESSION
ALTER SESSION
CREATE TABLE
CREATE CLUSTER
CREATE SYNONYM
CREATE VIEW
CREATE SEQUENCE
CREATE DATABASE LINK
CREATE PROCEDURE
CREATE TRIGGER
CREATE TYPE

11 rows selected.

使用cataloguser用户以catalog方式登录rman,创建catalog tablespace。cataloguser用户一定要具有recovery_catalog_owner角色

[oracle@catalog ~]$ rman catalog cataloguser/cataloguser
Recovery Manager: Release 10.2.0.1.0 - Production on Tue Mar 27 14:21:39 2012

Copyright (c) 1982, 2005, Oracle. All rights reserved.

connected to recovery catalog database

RMAN> create catalog tablespace tbs_catalog;

recovery catalog created

RMAN>

连接到target DB,注册目标数据库

[oracle@catalog ~]$ rman catalog cataloguser/cataloguser target sys/oracle@zhong
Recovery Manager: Release 10.2.0.1.0 - Production on Tue Mar 27 14:34:22 2012

Copyright (c) 1982, 2005, Oracle. All rights reserved.

connected to target database: ZHONG (DBID=1447686871)
connected to recovery catalog database

RMAN> register database;

database registered in recovery catalog
starting full resync of recovery catalog
full resync complete

RMAN>

查看目标数据库的信息

RMAN> list incarnation;
List of Database Incarnations
DB Key Inc Key DB Name DB ID STATUS Reset SCN Reset Time
------- ------- -------- ---------------- --- ---------- ----------
1 8 ZHONG 1447686871 PARENT 1 30-JUN-05
1 2 ZHONG 1447686871 CURRENT 446075 26-MAR-12

RMAN> report schema;

Report of database schema

List of Permanent Datafiles
===========================
File Size(MB) Tablespace RB segs Datafile Name
---- -------- -------------------- ------- ------------------------
1 480 SYSTEM YES /u01/app/oracle/oradata/zhong/system01.dbf
2 45 UNDOTBS1 YES /u01/app/oracle/oradata/zhong/undotbs01.dbf
3 240 SYSAUX NO /u01/app/oracle/oradata/zhong/sysaux01.dbf
4 5 USERS NO /u01/app/oracle/oradata/zhong/users01.dbf
5 100 EXAMPLE NO /u01/app/oracle/oradata/zhong/example01.dbf

List of Temporary Files
=======================
File Size(MB) Tablespace Maxsize(MB) Tempfile Name
---- -------- -------------------- ----------- --------------------
1 20 TEMP 32767 /u01/app/oracle/oradata/zhong/temp01.dbf

RMAN> list copy;

specification does not match any archive log in the recovery catalog

RMAN> list backupset;

RMAN>

full backup演示

RMAN> run
2> {
3> allocate channel c1 device type disk;
4> backup as compressed backupset
5> format='/orabackup/full_%d_%U' tag='fullbak'
6> channel=c1
7> database plus archivelog delete input;
8> release channel c1;
9> }
allocated channel: c1
channel c1: sid=142 devtype=DISK

Starting backup at 27-MAR-12
current log archived
channel c1: starting compressed archive log backupset
channel c1: specifying archive log(s) in backup set
input archive log thread=1 sequence=3 recid=1 stamp=779035902
channel c1: starting piece 1 at 27-MAR-12
channel c1: finished piece 1 at 27-MAR-12
piece handle=/orabackup/full_ZHONG_01n6u97v_1_1 tag=FULLBAK comment=NONE
channel c1: backup set complete, elapsed time: 00:00:04
channel c1: deleting archive log(s)
archive log filename=/arch/1_3_778974618.dbf recid=1 stamp=779035902
Finished backup at 27-MAR-12

Starting backup at 27-MAR-12
channel c1: starting compressed full datafile backupset
channel c1: specifying datafile(s) in backupset
input datafile fno=00001 name=/u01/app/oracle/oradata/zhong/system01.dbf
input datafile fno=00003 name=/u01/app/oracle/oradata/zhong/sysaux01.dbf
input datafile fno=00005 name=/u01/app/oracle/oradata/zhong/example01.dbf
input datafile fno=00002 name=/u01/app/oracle/oradata/zhong/undotbs01.dbf
input datafile fno=00004 name=/u01/app/oracle/oradata/zhong/users01.dbf
channel c1: starting piece 1 at 27-MAR-12
channel c1: finished piece 1 at 27-MAR-12
piece handle=/orabackup/full_ZHONG_02n6u983_1_1 tag=FULLBAK comment=NONE
channel c1: backup set complete, elapsed time: 00:00:45
channel c1: starting compressed full datafile backupset
channel c1: specifying datafile(s) in backupset
including current control file in backupset
including current SPFILE in backupset
channel c1: starting piece 1 at 27-MAR-12
channel c1: finished piece 1 at 27-MAR-12
piece handle=/orabackup/full_ZHONG_03n6u99g_1_1 tag=FULLBAK comment=NONE
channel c1: backup set complete, elapsed time: 00:00:03
Finished backup at 27-MAR-12

Starting backup at 27-MAR-12
current log archived
channel c1: starting compressed archive log backupset
channel c1: specifying archive log(s) in backup set
input archive log thread=1 sequence=4 recid=2 stamp=779035955
channel c1: starting piece 1 at 27-MAR-12
channel c1: finished piece 1 at 27-MAR-12
piece handle=/orabackup/full_ZHONG_04n6u99j_1_1 tag=FULLBAK comment=NONE
channel c1: backup set complete, elapsed time: 00:00:02
channel c1: deleting archive log(s)
archive log filename=/arch/1_4_778974618.dbf recid=2 stamp=779035955
Finished backup at 27-MAR-12

released channel: c1

RMAN>

0级增量备份演示,默认是差异增量备份

RMAN> run
2> {
3> allocate channel c1 device type disk;
4> backup as compressed backupset
5> incremental level=0
6> format='/orabackup/inc0_%d_%U' tag='inc0'
7> channel=c1
8> database;
9> release channel c1;
10> }
released channel: ORA_DISK_1
allocated channel: c1
channel c1: sid=142 devtype=DISK

Starting backup at 27-MAR-12
channel c1: starting compressed incremental level 0 datafile backupset
channel c1: specifying datafile(s) in backupset
input datafile fno=00001 name=/u01/app/oracle/oradata/zhong/system01.dbf
input datafile fno=00003 name=/u01/app/oracle/oradata/zhong/sysaux01.dbf
input datafile fno=00005 name=/u01/app/oracle/oradata/zhong/example01.dbf
input datafile fno=00002 name=/u01/app/oracle/oradata/zhong/undotbs01.dbf
input datafile fno=00004 name=/u01/app/oracle/oradata/zhong/users01.dbf
channel c1: starting piece 1 at 27-MAR-12
channel c1: finished piece 1 at 27-MAR-12
piece handle=/orabackup/inc0_ZHONG_05n6ua6b_1_1 tag=INC0 comment=NONE
channel c1: backup set complete, elapsed time: 00:00:25
Finished backup at 27-MAR-12

Starting Control File and SPFILE Autobackup at 27-MAR-12
piece handle=/orabackup/ctl_c-1447686871-20120327-00 comment=NONE
Finished Control File and SPFILE Autobackup at 27-MAR-12

released channel: c1

RMAN>

在以上0级增量备份的基础上进行一次1级增量备份

RMAN> run
2> {
3> allocate channel c1 device type disk;
4> backup as compressed backupset
5> incremental level=1
6> format='/orabackup/inc1_%d_%U' tag='inc1'
7> channel=c1
8> database;
9> release channel c1;
10> }
allocated channel: c1
channel c1: sid=142 devtype=DISK

Starting backup at 27-MAR-12
channel c1: starting compressed incremental level 1 datafile backupset
channel c1: specifying datafile(s) in backupset
input datafile fno=00001 name=/u01/app/oracle/oradata/zhong/system01.dbf
input datafile fno=00003 name=/u01/app/oracle/oradata/zhong/sysaux01.dbf
input datafile fno=00005 name=/u01/app/oracle/oradata/zhong/example01.dbf
input datafile fno=00002 name=/u01/app/oracle/oradata/zhong/undotbs01.dbf
input datafile fno=00004 name=/u01/app/oracle/oradata/zhong/users01.dbf
channel c1: starting piece 1 at 27-MAR-12
channel c1: finished piece 1 at 27-MAR-12
piece handle=/orabackup/inc1_ZHONG_07n6ud0q_1_1 tag=INC1 comment=NONE
channel c1: backup set complete, elapsed time: 00:00:03
Finished backup at 27-MAR-12

Starting Control File and SPFILE Autobackup at 27-MAR-12
piece handle=/orabackup/ctl_c-1447686871-20120327-01 comment=NONE
Finished Control File and SPFILE Autobackup at 27-MAR-12

released channel: c1

RMAN>

查看备份列表

RMAN> list backupset summary;
List of Backups
===============
Key TY LV S Device Type Completion Time #Pieces #Copies Compressed Tag
------- -- -- - ----------- --------------- ------- ------- ---------- ---
39 B A A DISK 27-MAR-12 1 1 YES FULLBAK
40 B F A DISK 27-MAR-12 1 1 YES FULLBAK
41 B F A DISK 27-MAR-12 1 1 YES FULLBAK
65 B A A DISK 27-MAR-12 1 1 YES FULLBAK
114 B 0 A DISK 27-MAR-12 1 1 YES INC0
138 B F A DISK 27-MAR-12 1 1 NO TAG20120327T150821
184 B 1 A DISK 27-MAR-12 1 1 YES INC1
214 B F A DISK 27-MAR-12 1 1 NO TAG20120327T155614

RMAN>
RMAN> list backup by file;
List of Datafile Backups
========================

File Key TY LV S Ckp SCN Ckp Time #Pieces #Copies Compressed Tag
---- ------- - -- - ---------- --------- ------- ------- ---------- ---
1 184 B 1 A 513072 27-MAR-12 1 1 YES INC1
114 B 0 A 511897 27-MAR-12 1 1 YES INC0
40 B F A 511320 27-MAR-12 1 1 YES FULLBAK
2 184 B 1 A 513072 27-MAR-12 1 1 YES INC1
114 B 0 A 511897 27-MAR-12 1 1 YES INC0
40 B F A 511320 27-MAR-12 1 1 YES FULLBAK
3 184 B 1 A 513072 27-MAR-12 1 1 YES INC1
114 B 0 A 511897 27-MAR-12 1 1 YES INC0
40 B F A 511320 27-MAR-12 1 1 YES FULLBAK
4 184 B 1 A 513072 27-MAR-12 1 1 YES INC1
114 B 0 A 511897 27-MAR-12 1 1 YES INC0
40 B F A 511320 27-MAR-12 1 1 YES FULLBAK
5 184 B 1 A 513072 27-MAR-12 1 1 YES INC1
114 B 0 A 511897 27-MAR-12 1 1 YES INC0
40 B F A 511320 27-MAR-12 1 1 YES FULLBAK

List of Archived Log Backups
============================

Thrd Seq Low SCN Low Time BS Key S #Pieces #Copies Compressed Tag
---- ------- ---------- --------- ------- - ------- ------- ---------- ---
1 3 477607 26-MAR-12 39 A 1 1 YES FULLBAK
1 4 511308 27-MAR-12 65 A 1 1 YES FULLBAK

List of Control File Backups
============================

CF Ckp SCN Ckp Time BS Key S #Pieces #Copies Compressed Tag
---------- --------- ------- - ------- ------- ---------- ---
513082 27-MAR-12 214 A 1 1 NO TAG20120327T155614
511914 27-MAR-12 138 A 1 1 NO TAG20120327T150821
511335 27-MAR-12 41 A 1 1 YES FULLBAK
List of SPFILE Backups
======================

Modification Time BS Key S #Pieces #Copies Compressed Tag
----------------- ------- - ------- ------- ---------- ---
26-MAR-12 214 A 1 1 NO TAG20120327T155614
26-MAR-12 138 A 1 1 NO TAG20120327T150821
26-MAR-12 41 A 1 1 YES FULLBAK

RMAN>

可以看到在0级增量备份的基础上,1级增量备份集的大小

[oracle@zhong orabackup]$ ll -h
total 260M
-rw-r----- 1 oracle oinstall 6.9M Mar 27 15:08 ctl_c-1447686871-20120327-00
-rw-r----- 1 oracle oinstall 6.9M Mar 27 15:56 ctl_c-1447686871-20120327-01
-rw-r----- 1 oracle oinstall 17M Mar 27 14:51 full_ZHONG_01n6u97v_1_1
-rw-r----- 1 oracle oinstall 114M Mar 27 14:52 full_ZHONG_02n6u983_1_1
-rw-r----- 1 oracle oinstall 1.1M Mar 27 14:52 full_ZHONG_03n6u99g_1_1
-rw-r----- 1 oracle oinstall 3.0K Mar 27 14:52 full_ZHONG_04n6u99j_1_1
-rw-r----- 1 oracle oinstall 114M Mar 27 15:08 inc0_ZHONG_05n6ua6b_1_1
-rw-r----- 1 oracle oinstall 464K Mar 27 15:56 inc1_ZHONG_07n6ud0q_1_1
[oracle@zhong orabackup]$

再看看累积增量备份,1级

RMAN> run
2> {
3> allocate channel c1 device type disk;
4> backup as compressed backupset
5> incremental level=1 cumulative
6> format='/orabackup/cum1_%d_%U' tag='cum1'
7> channel=c1
8> database;
9> release channel c1;
10> }
allocated channel: c1
channel c1: sid=142 devtype=DISK

Starting backup at 27-MAR-12
channel c1: starting compressed incremental level 1 datafile backupset
channel c1: specifying datafile(s) in backupset
input datafile fno=00001 name=/u01/app/oracle/oradata/zhong/system01.dbf
input datafile fno=00003 name=/u01/app/oracle/oradata/zhong/sysaux01.dbf
input datafile fno=00005 name=/u01/app/oracle/oradata/zhong/example01.dbf
input datafile fno=00002 name=/u01/app/oracle/oradata/zhong/undotbs01.dbf
input datafile fno=00004 name=/u01/app/oracle/oradata/zhong/users01.dbf
channel c1: starting piece 1 at 27-MAR-12
channel c1: finished piece 1 at 27-MAR-12
piece handle=/orabackup/cum1_ZHONG_09n6udt7_1_1 tag=CUM1 comment=NONE
channel c1: backup set complete, elapsed time: 00:00:03
Finished backup at 27-MAR-12

Starting Control File and SPFILE Autobackup at 27-MAR-12
piece handle=/orabackup/ctl_c-1447686871-20120327-02 comment=NONE
Finished Control File and SPFILE Autobackup at 27-MAR-12

released channel: c1

RMAN>

可以看到在0级增量备份的基础上,1级累积增量备份集的大小比差异增量备份要大点

[oracle@zhong orabackup]$ ll -h
total 268M
-rw-r----- 1 oracle oinstall 6.9M Mar 27 15:08 ctl_c-1447686871-20120327-00
-rw-r----- 1 oracle oinstall 6.9M Mar 27 15:56 ctl_c-1447686871-20120327-01
-rw-r----- 1 oracle oinstall 6.9M Mar 27 16:11 ctl_c-1447686871-20120327-02
-rw-r----- 1 oracle oinstall 1.2M Mar 27 16:11 cum1_ZHONG_09n6udt7_1_1
-rw-r----- 1 oracle oinstall 17M Mar 27 14:51 full_ZHONG_01n6u97v_1_1
-rw-r----- 1 oracle oinstall 114M Mar 27 14:52 full_ZHONG_02n6u983_1_1
-rw-r----- 1 oracle oinstall 1.1M Mar 27 14:52 full_ZHONG_03n6u99g_1_1
-rw-r----- 1 oracle oinstall 3.0K Mar 27 14:52 full_ZHONG_04n6u99j_1_1
-rw-r----- 1 oracle oinstall 114M Mar 27 15:08 inc0_ZHONG_05n6ua6b_1_1
-rw-r----- 1 oracle oinstall 464K Mar 27 15:56 inc1_ZHONG_07n6ud0q_1_1
[oracle@zhong orabackup]$

表空间备份

RMAN> run
2> {
3> allocate channel c1 device type disk;
4> backup as compressed backupset
5> format='/orabackup/tbs_users_%d_%U' tag='tbs_users_example'
6> channel=c1
7> tablespace users,example;
8> release channel c1;
9> }
allocated channel: c1
channel c1: sid=142 devtype=DISK

Starting backup at 27-MAR-12
channel c1: starting compressed full datafile backupset
channel c1: specifying datafile(s) in backupset
input datafile fno=00005 name=/u01/app/oracle/oradata/zhong/example01.dbf
input datafile fno=00004 name=/u01/app/oracle/oradata/zhong/users01.dbf
channel c1: starting piece 1 at 27-MAR-12
channel c1: finished piece 1 at 27-MAR-12
piece handle=/orabackup/tbs_users_ZHONG_0bn6uech_1_1 tag=TBS_USERS_EXAMPLE comment=NONE
channel c1: backup set complete, elapsed time: 00:00:03
Finished backup at 27-MAR-12

Starting Control File and SPFILE Autobackup at 27-MAR-12
piece handle=/orabackup/ctl_c-1447686871-20120327-03 comment=NONE
Finished Control File and SPFILE Autobackup at 27-MAR-12

released channel: c1

RMAN>

数据文件的备份

RMAN> run
2> {
3> allocate channel c1 device type disk;
4> backup as compressed backupset
5> format='/orabackup/d1_%d_%U' tag='dfile1'
6> channel=c1
7> datafile 1;
8> release channel c1;
9> }
allocated channel: c1
channel c1: sid=142 devtype=DISK

Starting backup at 27-MAR-12
channel c1: starting compressed full datafile backupset
channel c1: specifying datafile(s) in backupset
input datafile fno=00001 name=/u01/app/oracle/oradata/zhong/system01.dbf
channel c1: starting piece 1 at 27-MAR-12
channel c1: finished piece 1 at 27-MAR-12
piece handle=/orabackup/d1_ZHONG_0dn6ueo6_1_1 tag=DFILE1 comment=NONE
channel c1: backup set complete, elapsed time: 00:00:15
Finished backup at 27-MAR-12

Starting Control File and SPFILE Autobackup at 27-MAR-12
piece handle=/orabackup/ctl_c-1447686871-20120327-04 comment=NONE
Finished Control File and SPFILE Autobackup at 27-MAR-12

released channel: c1

RMAN>

备份archivelog

RMAN> sql 'alter system switch logfile';
sql statement: alter system switch logfile

RMAN> crosscheck archivelog all;

released channel: ORA_DISK_1
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=142 devtype=DISK
validation succeeded for archived log
archive log filename=/arch/1_5_778974618.dbf recid=3 stamp=779041682
validation succeeded for archived log
archive log filename=/arch/1_6_778974618.dbf recid=4 stamp=779041819
validation succeeded for archived log
archive log filename=/arch/1_7_778974618.dbf recid=5 stamp=779041826
Crosschecked 3 objects

RMAN> list archivelog all;

List of Archived Log Copies
Key Thrd Seq S Low Time Name
------- ---- ------- - --------- ----
568 1 5 A 27-MAR-12 /arch/1_5_778974618.dbf
601 1 6 A 27-MAR-12 /arch/1_6_778974618.dbf
634 1 7 A 27-MAR-12 /arch/1_7_778974618.dbf

RMAN>
RMAN> list backupset;
List of Backup Sets
===================

BS Key Size Device Type Elapsed Time Completion Time
------- ---------- ----------- ------------ ---------------
39 16.83M DISK 00:00:03 27-MAR-12
BP Key: 42 Status: AVAILABLE Compressed: YES Tag: FULLBAK
Piece Name: /orabackup/full_ZHONG_01n6u97v_1_1

List of Archived Logs in backup set 39
Thrd Seq Low SCN Low Time Next SCN Next Time
---- ------- ---------- --------- ---------- ---------
1 3 477607 26-MAR-12 511308 27-MAR-12

BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
40 Full 113.56M DISK 00:00:37 27-MAR-12
BP Key: 43 Status: AVAILABLE Compressed: YES Tag: FULLBAK
Piece Name: /orabackup/full_ZHONG_02n6u983_1_1
List of Datafiles in backup set 40
File LV Type Ckp SCN Ckp Time Name
---- -- ---- ---------- --------- ----
1 Full 511320 27-MAR-12 /u01/app/oracle/oradata/zhong/system01.dbf
2 Full 511320 27-MAR-12 /u01/app/oracle/oradata/zhong/undotbs01.dbf
3 Full 511320 27-MAR-12 /u01/app/oracle/oradata/zhong/sysaux01.dbf
4 Full 511320 27-MAR-12 /u01/app/oracle/oradata/zhong/users01.dbf
5 Full 511320 27-MAR-12 /u01/app/oracle/oradata/zhong/example01.dbf

BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
41 Full 1.03M DISK 00:00:02 27-MAR-12
BP Key: 44 Status: AVAILABLE Compressed: YES Tag: FULLBAK
Piece Name: /orabackup/full_ZHONG_03n6u99g_1_1
Control File Included: Ckp SCN: 511335 Ckp time: 27-MAR-12
SPFILE Included: Modification time: 26-MAR-12

BS Key Size Device Type Elapsed Time Completion Time
------- ---------- ----------- ------------ ---------------
65 2.50K DISK 00:00:01 27-MAR-12
BP Key: 68 Status: AVAILABLE Compressed: YES Tag: FULLBAK
Piece Name: /orabackup/full_ZHONG_04n6u99j_1_1

List of Archived Logs in backup set 65
Thrd Seq Low SCN Low Time Next SCN Next Time
---- ------- ---------- --------- ---------- ---------
1 4 511308 27-MAR-12 511339 27-MAR-12

BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
114 Incr 0 113.60M DISK 00:00:19 27-MAR-12
BP Key: 116 Status: AVAILABLE Compressed: YES Tag: INC0
Piece Name: /orabackup/inc0_ZHONG_05n6ua6b_1_1
List of Datafiles in backup set 114
File LV Type Ckp SCN Ckp Time Name
---- -- ---- ---------- --------- ----
1 0 Incr 511897 27-MAR-12 /u01/app/oracle/oradata/zhong/system01.dbf
2 0 Incr 511897 27-MAR-12 /u01/app/oracle/oradata/zhong/undotbs01.dbf
3 0 Incr 511897 27-MAR-12 /u01/app/oracle/oradata/zhong/sysaux01.dbf
4 0 Incr 511897 27-MAR-12 /u01/app/oracle/oradata/zhong/users01.dbf
5 0 Incr 511897 27-MAR-12 /u01/app/oracle/oradata/zhong/example01.dbf

BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
138 Full 6.80M DISK 00:00:00 27-MAR-12
BP Key: 144 Status: AVAILABLE Compressed: NO Tag: TAG20120327T150821
Piece Name: /orabackup/ctl_c-1447686871-20120327-00
Control File Included: Ckp SCN: 511914 Ckp time: 27-MAR-12
SPFILE Included: Modification time: 26-MAR-12

BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
184 Incr 1 456.00K DISK 00:00:03 27-MAR-12
BP Key: 187 Status: AVAILABLE Compressed: YES Tag: INC1
Piece Name: /orabackup/inc1_ZHONG_07n6ud0q_1_1
List of Datafiles in backup set 184
File LV Type Ckp SCN Ckp Time Name
---- -- ---- ---------- --------- ----
1 1 Incr 513072 27-MAR-12 /u01/app/oracle/oradata/zhong/system01.dbf
2 1 Incr 513072 27-MAR-12 /u01/app/oracle/oradata/zhong/undotbs01.dbf
3 1 Incr 513072 27-MAR-12 /u01/app/oracle/oradata/zhong/sysaux01.dbf
4 1 Incr 513072 27-MAR-12 /u01/app/oracle/oradata/zhong/users01.dbf
5 1 Incr 513072 27-MAR-12 /u01/app/oracle/oradata/zhong/example01.dbf

BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
214 Full 6.80M DISK 00:00:00 27-MAR-12
BP Key: 220 Status: AVAILABLE Compressed: NO Tag: TAG20120327T155614
Piece Name: /orabackup/ctl_c-1447686871-20120327-01
Control File Included: Ckp SCN: 513082 Ckp time: 27-MAR-12
SPFILE Included: Modification time: 26-MAR-12

BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
270 Incr 1 1.18M DISK 00:00:02 27-MAR-12
BP Key: 273 Status: AVAILABLE Compressed: YES Tag: CUM1
Piece Name: /orabackup/cum1_ZHONG_09n6udt7_1_1
List of Datafiles in backup set 270
File LV Type Ckp SCN Ckp Time Name
---- -- ---- ---------- --------- ----
1 1 Incr 513523 27-MAR-12 /u01/app/oracle/oradata/zhong/system01.dbf
2 1 Incr 513523 27-MAR-12 /u01/app/oracle/oradata/zhong/undotbs01.dbf
3 1 Incr 513523 27-MAR-12 /u01/app/oracle/oradata/zhong/sysaux01.dbf
4 1 Incr 513523 27-MAR-12 /u01/app/oracle/oradata/zhong/users01.dbf
5 1 Incr 513523 27-MAR-12 /u01/app/oracle/oradata/zhong/example01.dbf

BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
305 Full 6.80M DISK 00:00:00 27-MAR-12
BP Key: 311 Status: AVAILABLE Compressed: NO Tag: TAG20120327T161123
Piece Name: /orabackup/ctl_c-1447686871-20120327-02
Control File Included: Ckp SCN: 513534 Ckp time: 27-MAR-12
SPFILE Included: Modification time: 26-MAR-12

BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
368 Full 12.52M DISK 00:00:01 27-MAR-12
BP Key: 371 Status: AVAILABLE Compressed: YES Tag: TBS_USERS_EXAMPLE
Piece Name: /orabackup/tbs_users_ZHONG_0bn6uech_1_1
List of Datafiles in backup set 368
File LV Type Ckp SCN Ckp Time Name
---- -- ---- ---------- --------- ----
4 Full 513822 27-MAR-12 /u01/app/oracle/oradata/zhong/users01.dbf
5 Full 513822 27-MAR-12 /u01/app/oracle/oradata/zhong/example01.dbf

BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
402 Full 6.80M DISK 00:00:00 27-MAR-12
BP Key: 405 Status: AVAILABLE Compressed: NO Tag: TAG20120327T161932
Piece Name: /orabackup/ctl_c-1447686871-20120327-03
Control File Included: Ckp SCN: 513832 Ckp time: 27-MAR-12
SPFILE Included: Modification time: 26-MAR-12

BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
466 Full 80.53M DISK 00:00:12 27-MAR-12
BP Key: 469 Status: AVAILABLE Compressed: YES Tag: DFILE1
Piece Name: /orabackup/d1_ZHONG_0dn6ueo6_1_1
List of Datafiles in backup set 466
File LV Type Ckp SCN Ckp Time Name
---- -- ---- ---------- --------- ----
1 Full 513993 27-MAR-12 /u01/app/oracle/oradata/zhong/system01.dbf

BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
501 Full 6.80M DISK 00:00:01 27-MAR-12
BP Key: 503 Status: AVAILABLE Compressed: NO Tag: TAG20120327T162557
Piece Name: /orabackup/ctl_c-1447686871-20120327-04
Control File Included: Ckp SCN: 514007 Ckp time: 27-MAR-12
SPFILE Included: Modification time: 26-MAR-12

RMAN>
RMAN> run
2> {
3> allocate channel c1 device type disk;
4> backup as compressed backupset
5> format='/orabackup/arch_%d_%U' tag='arch'
6> channel=c1
7> archivelog from scn 513523;
8> release channel c1;
9> }
released channel: ORA_DISK_1
allocated channel: c1
channel c1: sid=142 devtype=DISK

Starting backup at 27-MAR-12
current log archived
channel c1: starting compressed archive log backupset
channel c1: specifying archive log(s) in backup set
input archive log thread=1 sequence=5 recid=3 stamp=779041682
input archive log thread=1 sequence=6 recid=4 stamp=779041819
input archive log thread=1 sequence=7 recid=5 stamp=779041826
input archive log thread=1 sequence=8 recid=6 stamp=779042475
channel c1: starting piece 1 at 27-MAR-12
channel c1: finished piece 1 at 27-MAR-12
piece handle=/orabackup/arch_ZHONG_0fn6uflc_1_1 tag=ARCH comment=NONE
channel c1: backup set complete, elapsed time: 00:00:02
Finished backup at 27-MAR-12

Starting Control File and SPFILE Autobackup at 27-MAR-12
piece handle=/orabackup/ctl_c-1447686871-20120327-05 comment=NONE
Finished Control File and SPFILE Autobackup at 27-MAR-12

released channel: c1

RMAN>

备份镜像拷贝

RMAN> run
2> {
3> allocate channel c1 device type disk;
4> backup as copy
5> format='/orabackup/copy_%d_%U' tag='copy'
6> channel=c1
7> database;
8> release channel c1;
9> }
allocated channel: c1
channel c1: sid=142 devtype=DISK

Starting backup at 27-MAR-12
channel c1: starting datafile copy
input datafile fno=00001 name=/u01/app/oracle/oradata/zhong/system01.dbf
output filename=/orabackup/copy_ZHONG_data_D-ZHONG_I-1447686871_TS-SYSTEM_FNO-1_0hn6ug8s tag=COPY recid=2 stamp=779043108
channel c1: datafile copy complete, elapsed time: 00:00:15
channel c1: starting datafile copy
input datafile fno=00003 name=/u01/app/oracle/oradata/zhong/sysaux01.dbf
output filename=/orabackup/copy_ZHONG_data_D-ZHONG_I-1447686871_TS-SYSAUX_FNO-3_0in6ug9b tag=COPY recid=3 stamp=779043117
channel c1: datafile copy complete, elapsed time: 00:00:03
channel c1: starting datafile copy
input datafile fno=00005 name=/u01/app/oracle/oradata/zhong/example01.dbf
output filename=/orabackup/copy_ZHONG_data_D-ZHONG_I-1447686871_TS-EXAMPLE_FNO-5_0jn6ug9e tag=COPY recid=4 stamp=779043122
channel c1: datafile copy complete, elapsed time: 00:00:07
channel c1: starting datafile copy
input datafile fno=00002 name=/u01/app/oracle/oradata/zhong/undotbs01.dbf
output filename=/orabackup/copy_ZHONG_data_D-ZHONG_I-1447686871_TS-UNDOTBS1_FNO-2_0kn6ug9l tag=COPY recid=5 stamp=779043126
channel c1: datafile copy complete, elapsed time: 00:00:01
channel c1: starting datafile copy
input datafile fno=00004 name=/u01/app/oracle/oradata/zhong/users01.dbf
output filename=/orabackup/copy_ZHONG_data_D-ZHONG_I-1447686871_TS-USERS_FNO-4_0ln6ug9m tag=COPY recid=6 stamp=779043127
channel c1: datafile copy complete, elapsed time: 00:00:02
Finished backup at 27-MAR-12

Starting Control File and SPFILE Autobackup at 27-MAR-12
piece handle=/orabackup/ctl_c-1447686871-20120327-06 comment=NONE
Finished Control File and SPFILE Autobackup at 27-MAR-12

released channel: c1

RMAN>

使用list命令查看备份

RMAN> list copy;
List of Datafile Copies
Key File S Completion Time Ckp SCN Ckp Time Name
------- ---- - --------------- ---------- --------------- ----
830 1 A 27-MAR-12 514701 27-MAR-12 /orabackup/copy_ZHONG_data_D-ZHONG_I-1447686871_TS-SYSTEM_FNO-1_0hn6ug8s
833 2 A 27-MAR-12 514713 27-MAR-12 /orabackup/copy_ZHONG_data_D-ZHONG_I-1447686871_TS-UNDOTBS1_FNO-2_0kn6ug9l
831 3 A 27-MAR-12 514707 27-MAR-12 /orabackup/copy_ZHONG_data_D-ZHONG_I-1447686871_TS-SYSAUX_FNO-3_0in6ug9b
834 4 A 27-MAR-12 514714 27-MAR-12 /orabackup/copy_ZHONG_data_D-ZHONG_I-1447686871_TS-USERS_FNO-4_0ln6ug9m
832 5 A 27-MAR-12 514709 27-MAR-12 /orabackup/copy_ZHONG_data_D-ZHONG_I-1447686871_TS-EXAMPLE_FNO-5_0jn6ug9e

List of Archived Log Copies
Key Thrd Seq S Low Time Name
------- ---- ------- - --------- ----
568 1 5 A 27-MAR-12 /arch/1_5_778974618.dbf
601 1 6 A 27-MAR-12 /arch/1_6_778974618.dbf
634 1 7 A 27-MAR-12 /arch/1_7_778974618.dbf
670 1 8 A 27-MAR-12 /arch/1_8_778974618.dbf

RMAN> list backupset summary;

List of Backups
===============
Key TY LV S Device Type Completion Time #Pieces #Copies Compressed Tag
------- -- -- - ----------- --------------- ------- ------- ---------- ---
39 B A A DISK 27-MAR-12 1 1 YES FULLBAK
40 B F A DISK 27-MAR-12 1 1 YES FULLBAK
41 B F A DISK 27-MAR-12 1 1 YES FULLBAK
65 B A A DISK 27-MAR-12 1 1 YES FULLBAK
114 B 0 A DISK 27-MAR-12 1 1 YES INC0
138 B F A DISK 27-MAR-12 1 1 NO TAG20120327T150821
184 B 1 A DISK 27-MAR-12 1 1 YES INC1
214 B F A DISK 27-MAR-12 1 1 NO TAG20120327T155614
270 B 1 A DISK 27-MAR-12 1 1 YES CUM1
305 B F A DISK 27-MAR-12 1 1 NO TAG20120327T161123
368 B F A DISK 27-MAR-12 1 1 YES TBS_USERS_EXAMPLE
402 B F A DISK 27-MAR-12 1 1 NO TAG20120327T161932
466 B F A DISK 27-MAR-12 1 1 YES DFILE1
501 B F A DISK 27-MAR-12 1 1 NO TAG20120327T162557
706 B A A DISK 27-MAR-12 1 1 YES ARCH
749 B F A DISK 27-MAR-12 1 1 NO TAG20120327T164118
873 B F A DISK 27-MAR-12 1 1 NO TAG20120327T165209

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值