rman使用catalog备份的演示(一)

2014-11-24 16:18:26 · 作者: · 浏览: 0
rman使用catalog备份的演示
介绍了如何使用catalog方式做RMAN备份,以及如何取消以catalog方式做备份。
第一步:创建RMAN CATALOG表空间及用户。
[oracle@oel-01 ~]$ sqlplus / as sysdba
SQL> create tablespace catalog1 datafile '/u01/app/oracle/oradata/bys001/catalog1.dbf' size 50m ;
Tablespace created.
SQL> create user rmanuser identified by rmanuser default tablespace catalog1;
User created.
SQL> grant connect,resource,recovery_catalog_owner to rmanuser;
Grant succeeded.
SQL> select * from role_sys_privs where role='RECOVERY_CATALOG_OWNER';
ROLE                           PRIVILEGE                                ADM
------------------------------ ---------------------------------------- ---
RECOVERY_CATALOG_OWNER         CREATE SYNONYM                           NO
RECOVERY_CATALOG_OWNER         CREATE CLUSTER                           NO
RECOVERY_CATALOG_OWNER         ALTER SESSION                            NO
RECOVERY_CATALOG_OWNER         CREATE DATABASE LINK                     NO
RECOVERY_CATALOG_OWNER         CREATE SESSION                           NO
RECOVERY_CATALOG_OWNER         CREATE TABLE                             NO
RECOVERY_CATALOG_OWNER         CREATE SEQUENCE                          NO
RECOVERY_CATALOG_OWNER         CREATE PROCEDURE                         NO
RECOVERY_CATALOG_OWNER         CREATE VIEW                              NO
RECOVERY_CATALOG_OWNER         CREATE TYPE                              NO
RECOVERY_CATALOG_OWNER         CREATE TRIGGER                           NO
11 rows selected.

第二步:注册数据库到RMAN CATALOG
[oracle@oel-01 ~]$ rman target sys/sys@192.168.1.212:1521/bys001 catalog rmanuser/rmanuser
Recovery Manager: Release 11.2.0.1.0 - Production on Wed Jun 19 14:28:59 2013
Copyright (c) 1982, 2009, 
Oracle
and/or its affiliates. All rights reserved. connected to target database: BYS001 (DBID=2041679290) connected to recovery catalog database RMAN> register database; database registered in recovery catalog starting full resync of recovery catalog full resync complete 第三步:查看是否注册 SQL> conn rmanuser/rmanuser Connected. SQL> select * from rc_database; DB_KEY DBINC_KEY DBID NAME RESETLOGS_CHANGE# RESETLOGS ---------- ---------- ---------- -------- ----------------- --------- 2 4 2041679290 BYS001 1143629 16-JUN-13 第四步:到RMAN中执行全备备份 [oracle@oel-01 ~]$ rman target sys/sys@192.168.1.212:1521/bys001 catalog rmanuser/rmanuser Recovery Manager: Release 11.2.0.1.0 - Production on Wed Jun 19 14:28:59 2013 Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved. connected to target database: BYS001 (DBID=2041679290) connected to recovery catalog database RMAN> register database; database registered in recovery catalog starting full resync of recovery catalog full resync complete RMAN> backup database; Starting backup at 19-JUN-13 allocated channel: ORA_DISK_1 channel ORA_DISK_1: SID=38 device type=DISK channel ORA_DISK_1: starting full datafile backup set channel ORA_DISK_1: specifying datafile(s) in backup set input datafile file number=00001 name=/u01/app/oracle/oradata/bys001/system01.dbf input datafile file number=00002 name=/u01/app/oracle/oradata/bys001/sysaux01.dbf input datafile file number=00005 name=/u01/app/oracle/oradata/bys001/example01.dbf input datafile file number=00003 name=/u01/app/oracle/oradata/bys001/undotbs01.dbf input datafile file number=00006 name=/u01/app/oracle/oradata/bys001/catalog1.dbf input datafile file number=00004 name=/u01/app/oracle/oradata/bys001/users01.dbf channel ORA_DISK_1: starting piece 1 at 19-JUN-13 channel ORA_DISK_1: finished piece 1 at 19-JUN-13 piece handle=/u01/app/oracle/flash_recovery_area/BYS001/backups