[20151022]Create Recovery Catalog.txt
--要测试rman catalog的一些我问题,做一个建立的记录(实际上以前做过):
1.CONNECT sys/password AS SYSDBA
CREATE TABLESPACE rman DATAFILE
'/u01/app/oracle11g/oradata/test/rman01.dbf' SIZE 64M AUTOEXTEND ON NEXT 16M MAXSIZE UNLIMITED
LOGGING
PERMANENT
EXTENT MANAGEMENT LOCAL AUTOALLOCATE
BLOCKSIZE 8K
SEGMENT SPACE MANAGEMENT MANUAL
FLASHBACK ON;
-- Create rman schema owner
CREATE USER rman IDENTIFIED BY rman
TEMPORARY TABLESPACE temp
DEFAULT TABLESPACE rman
QUOTA UNLIMITED ON rman;
GRANT connect, resource, recovery_catalog_owner TO rman;
2.Create the recovery catalog.
===以前建立过1次,版本太低,我升级到11.2.0.3.
$ rlwrap rman catalog=rman/rman
Recovery Manager: Release 11.2.0.3.0 - Production on Thu Oct 22 08:35:04 2015
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
connected to recovery catalog database
PL/SQL package RMAN.DBMS_RCVCAT version 11.02.00.01 in RCVCAT database is not current
PL/SQL package RMAN.DBMS_RCVMAN version 11.02.00.01 in RCVCAT database is not current
RMAN> drop catalog ;
recovery catalog owner is RMAN
enter DROP CATALOG command again to confirm catalog removal
--需要再执行一次。
RMAN> drop catalog
recovery catalog dropped
===========
$ rman catalog=rman/rman
Recovery Manager: Release 11.2.0.3.0 - Production on Wed Nov 30 11:56:59 2011
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
connected to recovery catalog database
RMAN> create catalog tablespace "RMAN";
recovery catalog created
RMAN>
3.Register Database
Each database to be backed up by RMAN must be registered with the catalog.
$ rman catalog=rman/rman@rman target=sys/btbtms
Recovery Manager: Release 11.2.0.3.0 - Production on Wed Nov 30 12:02:41 2011
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
connected to target database: TEST (DBID=2060755746)
connected to recovery catalog database
RMAN> register database;
database registered in recovery catalog
starting full resync of recovery catalog
full resync complete
RMAN>
4.unregister database:
RMAN> unregister database;
database name is "TEST" and DBID is 2060755746
Do you really want to unregister the database (enter YES or NO)? YES
database unregistered from the recovery catalog
--要测试rman catalog的一些我问题,做一个建立的记录(实际上以前做过):
1.CONNECT sys/password AS SYSDBA
CREATE TABLESPACE rman DATAFILE
'/u01/app/oracle11g/oradata/test/rman01.dbf' SIZE 64M AUTOEXTEND ON NEXT 16M MAXSIZE UNLIMITED
LOGGING
PERMANENT
EXTENT MANAGEMENT LOCAL AUTOALLOCATE
BLOCKSIZE 8K
SEGMENT SPACE MANAGEMENT MANUAL
FLASHBACK ON;
-- Create rman schema owner
CREATE USER rman IDENTIFIED BY rman
TEMPORARY TABLESPACE temp
DEFAULT TABLESPACE rman
QUOTA UNLIMITED ON rman;
GRANT connect, resource, recovery_catalog_owner TO rman;
2.Create the recovery catalog.
===以前建立过1次,版本太低,我升级到11.2.0.3.
$ rlwrap rman catalog=rman/rman
Recovery Manager: Release 11.2.0.3.0 - Production on Thu Oct 22 08:35:04 2015
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
connected to recovery catalog database
PL/SQL package RMAN.DBMS_RCVCAT version 11.02.00.01 in RCVCAT database is not current
PL/SQL package RMAN.DBMS_RCVMAN version 11.02.00.01 in RCVCAT database is not current
RMAN> drop catalog ;
recovery catalog owner is RMAN
enter DROP CATALOG command again to confirm catalog removal
--需要再执行一次。
RMAN> drop catalog
recovery catalog dropped
===========
$ rman catalog=rman/rman
Recovery Manager: Release 11.2.0.3.0 - Production on Wed Nov 30 11:56:59 2011
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
connected to recovery catalog database
RMAN> create catalog tablespace "RMAN";
recovery catalog created
RMAN>
3.Register Database
Each database to be backed up by RMAN must be registered with the catalog.
$ rman catalog=rman/rman@rman target=sys/btbtms
Recovery Manager: Release 11.2.0.3.0 - Production on Wed Nov 30 12:02:41 2011
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
connected to target database: TEST (DBID=2060755746)
connected to recovery catalog database
RMAN> register database;
database registered in recovery catalog
starting full resync of recovery catalog
full resync complete
RMAN>
4.unregister database:
RMAN> unregister database;
database name is "TEST" and DBID is 2060755746
Do you really want to unregister the database (enter YES or NO)? YES
database unregistered from the recovery catalog