rman catalog使用测试

更新时间:2019-08-02 09:30:56 点击次数:362次
[oracle@rac1 u01]$ rman target / catalog rman/oracle@cata

Recovery Manager: Release 19.0.0.0.0 - Production on Mon Jul 22 15:07:34 2019
Version 19.3.0.0.0

Copyright (c) 1982, 2019, Oracle and/or its affiliates.  All rights reserved.

connected to target database: ORCL (DBID=1539821669)
connected to recovery catalog database

RMAN> run{
2> allocate channel c1 device type disk;
3> allocate channel c2 device type disk;
4> backup database format '/u01/rman/fulldb_%d_%U_%T.bak' tag 'fulldb';
5> release channel c1;
6> release channel c2;
7> }

allocated channel: c1
channel c1: SID=1712 instance=orcl1 device type=DISK

allocated channel: c2
channel c2: SID=1903 instance=orcl1 device type=DISK

Starting backup at 2019/07/22 15:09:25
channel c1: starting full datafile backup set
channel c1: specifying datafile(s) in backup set
input datafile file number=00006 name=+DATA/ORCL/DATAFILE/benchmarksql.269.1012466397
input datafile file number=00003 name=+DATA/ORCL/DATAFILE/undotbs1.262.1012040961
input datafile file number=00005 name=+DATA/ORCL/DATAFILE/users.265.1012040983
input datafile file number=00007 name=+DATA/ORCL/DATAFILE/admin.288.1014285423
channel c1: starting piece 1 at 2019/07/22 15:09:28
channel c2: starting full datafile backup set
channel c2: specifying datafile(s) in backup set
input datafile file number=00002 name=+DATA/ORCL/DATAFILE/sysaux.261.1012040955
input datafile file number=00001 name=+DATA/ORCL/DATAFILE/system.260.1012040943
input datafile file number=00004 name=+DATA/ORCL/DATAFILE/undotbs2.264.1012040981
channel c2: starting piece 1 at 2019/07/22 15:09:29
channel c1: finished piece 1 at 2019/07/22 15:10:14
piece handle=/u01/rman/fulldb_ORCL_0gu7a3d8_1_1_20190722.bak tag=FULLDB comment=NONE
channel c1: backup set complete, elapsed time: 00:00:46
channel c2: finished piece 1 at 2019/07/22 15:10:14
piece handle=/u01/rman/fulldb_ORCL_0hu7a3d8_1_1_20190722.bak tag=FULLDB comment=NONE
channel c2: backup set complete, elapsed time: 00:00:45
Finished backup at 2019/07/22 15:10:14

Starting Control File and SPFILE Autobackup at 2019/07/22 15:10:14
piece handle=/u01/app/oracle/product/19.0.0/db_1/dbs/c-1539821669-20190722-02 comment=NONE
Finished Control File and SPFILE Autobackup at 2019/07/22 15:10:21

released channel: c1

released channel: c2

RMAN> list backup;


List of Backup Sets
===================


BS Key  Type LV Size       Device Type Elapsed Time Completion Time    
------- ---- -- ---------- ----------- ------------ -------------------
156     Full    18.89M     DISK        00:00:01     2019/07/22 09:25:18
        BP Key: 158   Status: AVAILABLE  Compressed: NO  Tag: TAG20190722T092517
        Piece Name: /u01/app/oracle/product/19.0.0/db_1/dbs/c-1539821669-20190722-00
  SPFILE Included: Modification time: 2019/07/22 09:10:29
  SPFILE db_unique_name: ORCL
  Control File Included: Ckp SCN: 8059924      Ckp time: 2019/07/22 09:25:17

BS Key  Type LV Size       Device Type Elapsed Time Completion Time    
------- ---- -- ---------- ----------- ------------ -------------------
157     Full    18.89M     DISK        00:00:01     2019/07/22 10:05:23
        BP Key: 159   Status: AVAILABLE  Compressed: NO  Tag: TAG20190722T100522
        Piece Name: /u01/app/oracle/product/19.0.0/db_1/dbs/c-1539821669-20190722-01
  SPFILE Included: Modification time: 2019/07/22 10:02:57
  SPFILE db_unique_name: ORCL
  Control File Included: Ckp SCN: 8073057      Ckp time: 2019/07/22 10:05:22

BS Key  Type LV Size       Device Type Elapsed Time Completion Time    
------- ---- -- ---------- ----------- ------------ -------------------
170     Full    2.20G      DISK        00:00:27     2019/07/22 15:09:55
        BP Key: 174   Status: AVAILABLE  Compressed: NO  Tag: FULLDB
        Piece Name: /u01/rman/fulldb_ORCL_0hu7a3d8_1_1_20190722.bak
  List of Datafiles in backup set 170
  File LV Type Ckp SCN    Ckp Time            Abs Fuz SCN Sparse Name
  ---- -- ---- ---------- ------------------- ----------- ------ ----
  1       Full 8136948    2019/07/22 15:09:29              NO    +DATA/ORCL/DATAFILE/system.260.1012040943
  2       Full 8136948    2019/07/22 15:09:29              NO    +DATA/ORCL/DATAFILE/sysaux.261.1012040955
  4       Full 8136948    2019/07/22 15:09:29              NO    +DATA/ORCL/DATAFILE/undotbs2.264.1012040981

BS Key  Type LV Size       Device Type Elapsed Time Completion Time    
------- ---- -- ---------- ----------- ------------ -------------------
171     Full    1.56G      DISK        00:00:29     2019/07/22 15:09:57
        BP Key: 175   Status: AVAILABLE  Compressed: NO  Tag: FULLDB
        Piece Name: /u01/rman/fulldb_ORCL_0gu7a3d8_1_1_20190722.bak
  List of Datafiles in backup set 171
  File LV Type Ckp SCN    Ckp Time            Abs Fuz SCN Sparse Name
  ---- -- ---- ---------- ------------------- ----------- ------ ----
  3       Full 8136947    2019/07/22 15:09:29              NO    +DATA/ORCL/DATAFILE/undotbs1.262.1012040961
  5       Full 8136947    2019/07/22 15:09:29              NO    +DATA/ORCL/DATAFILE/users.265.1012040983
  6       Full 8136947    2019/07/22 15:09:29              NO    +DATA/ORCL/DATAFILE/benchmarksql.269.1012466397
  7       Full 8136947    2019/07/22 15:09:29              NO    +DATA/ORCL/DATAFILE/admin.288.1014285423

BS Key  Type LV Size       Device Type Elapsed Time Completion Time    
------- ---- -- ---------- ----------- ------------ -------------------
187     Full    18.89M     DISK        00:00:01     2019/07/22 15:10:19
        BP Key: 192   Status: AVAILABLE  Compressed: NO  Tag: TAG20190722T151018
        Piece Name: /u01/app/oracle/product/19.0.0/db_1/dbs/c-1539821669-20190722-02
  SPFILE Included: Modification time: 2019/07/22 10:02:57
  SPFILE db_unique_name: ORCL
  Control File Included: Ckp SCN: 8137846      Ckp time: 2019/07/22 15:10:18

  [grid@rac1 ~]$ strings Current.257.1012040937 |grep rman
/u01/rman/fulldb_ORCL_0hu7a3d8_1_1_20190722.bak
/u01/rman/fulldb_ORCL_0gu7a3d8_1_1_20190722.bak
/u01/rman/fulldb_ORCL_0hu7a3d8_1_1_20190722.bak
/u01/rman/fulldb_ORCL_0gu7a3d8_1_1_20190722.bak

查看catalog rman备份信息

set pagesize 300 linesize 300
col HANDLE for a30
col controlfile_included for a20
col DEVICE_TYPE for a10
col TAG for a20
col BS_KEY for 9999
col RECID for 9999


select a.db_id,a.bs_key,a.device_type,a.handle,a.start_time,a.completion_time,a.elapsed_seconds,bytes/1024/1024 mb,b.controlfile_included from RCI_BACKUP_PIECE a inner join RC_BACKUP_SET b on a.bs_key=b.bs_key;

DB_ID BS_KEY DEVICE_TYP HANDLE        START_TIME          COMPLETION_TIME     ELAPSED_SECONDS         MB CONTROLFILE_INCLUDED
---------- ------ ---------- ------------------------------ ------------------- ------------------- --------------- ---------- 
1539821669    281 DISK       /u01/rman/full2_20190722_0nu7a 2019-07-22 16:52:49 2019-07-22 16:54:32   103 3855.69531 NONE
                             9f0_1_1.bak

1539821669    303 DISK       /u01/app/oracle/product/19.0.0 2019-07-22 16:54:38 2019-07-22 16:54:39     1  18.890625 BACKUP
                             /db_1/dbs/c-1539821669-2019072
                             2-05

1539821669    242 DISK       /u01/rman/full1_20190722_0lu7a 2019-07-22 16:48:47 2019-07-22 16:49:50    63 3855.60938 NONE
                             97e_1_1.bak

1539821669    259 DISK       /u01/app/oracle/product/19.0.0 2019-07-22 16:49:57 2019-07-22 16:49:57     0  18.890625 BACKUP
                             /db_1/dbs/c-1539821669-2019072
                             2-04

测试发现即便rman使用catalog连接,备份信息还是会写入目标库(需要备份的数据库)控制文件,在catalog库查询rman备份信息需要登录catalog用户所在实例。

本站文章版权归原作者及原出处所有 。内容为作者个人观点, 并不代表本站赞同其观点和对其真实性负责,本站只提供参考并不构成任何投资及应用建议。本站是一个个人学习交流的平台,网站上部分文章为转载,并不用于任何商业目的,我们已经尽可能的对作者和来源进行了通告,但是能力有限或疏忽,造成漏登,请及时联系我们,我们将根据著作权人的要求,立即更正或者删除有关内容。本站拥有对此声明的最终解释权。

回到顶部
嘿,我来帮您!