Oracle创建恢复目录
1.在catalog数据库上创建cat用户的表空间
SQL> create tablespace cat datafile '/home/oracle/oradata/orcl/cat.dbf' size 512M;
2.创建cat用户
SQL> Create user cat identified by cat temporary tablespace temp default tablespace cat Quota unlimited on cat;
3.授权给cat用户
SQL> grant connect,resource to cat;
SQL> grant recovery_catalog_owner to cat;
4. 连接到catalog数据库
[oracle@orcl admin]$ rman catalog cat/cat@cat
5.创建恢复目录
RMAN> create catalog;
6. 在catalog中注册target数据库
[oracle@orcl admin]$ rman catalog cat/cat@cat target sys/xyc@rac;
RMAN> register database;
------------------------------------------------------------------------------------------------
7.注销target数据库
[oracle@orcl admin]$ rman catalog cat/cat@cat target sys/xyc@rac;
RMAN> unregister database;
或
为了能注销数据库,需要获得数据库的标识码(DB_ID)和数据库键值(DB_KEY)。其中连接目标数据库时将会获得DB_ID
连接到目标数据库,查询db表:
SQL> select * from db;
DB_KEY DB_ID CURR_DBINC_KEY
---------- ---------- --------------
1 3021445076 2
SQL> execute dbms_rcvcat.unregisterdatabase(1,3021445076);