在10.230.17.29 使用10.230.17.33上的数据库作为Catalogdb
1 配置TNSname
catalogdb =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 10.230.17.33)(PORT = 1521))
)
(CONNECT_DATA =
(SID = mydb)
)
)
2 建立catalog 用户,表空间
oracle@Z810:~> sqlplus "sys/sys@catalogdb as sysdba"
SQL*Plus: Release 9.2.0.4.0 - Production on Thu Feb 4 17:56:54 2010
Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
Connected to:
Oracle9i Enterprise Edition Release 9.2.0.8.0 - 64bit Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.8.0 - Production
SQL> create tablespace catalog datafile '/opt/oracle/oradata/mydb/catalog01.dbf' size 50M;
Tablespace created.
SQL> Create user rman identified by rmanpwd default tablespace catalog temporary tablespace temp;
User created.
SQL> grant connect,resource,recovery_catalog_owner to rman;
Grant succeeded.
3 建立catalog和注册数据库
rman target / catalog rman/rmanpwd@catalogdb
RMAN> create catalog tablespace catalog;
recovery catalog created
RMAN> register database;
database registered in recovery catalog
starting full resync of recovery catalog
full resync complete
注意Catalog Schema 必须先连接,再建立,即使在10.230.17.33本机上也必须通过
RMAN target / catalog rman/rmanpwd@catalogdb来连接
Catalog Schema 只需建立一次,而所有想使用此Catalog的数据库只需连接到Catalog Schema所在Database上,并向其注册即可.
如10.230.17.34想使用此Catalog
# rman target / catalog rman/rmanpwd@catalogdb
RMAN> register database;
database registered in recovery catalog
starting full resync of recovery catalog
full resync complete
4 Unregistering a Target Database from the Recovery Catalog 如何取消注册.
4.1 删除所有的备份
rman target / catalog rman/rmanpwd@catalogdb
delete backup device type disk;
-- delete backup device type sbt;
4.2 找到DB_ID对应的DB_KEY;
sqlplus "rman/rmanpwd@catalogdb"
SQL> select db_key, db_id from db where db_id=2621354619;
DB_KEY DB_ID
---------- ----------
97 2621354619
4.3 Unregister catalog (只是单一个)
#EXECUTE dbms_rcvcat.unregisterdatabase(db_key, db_id);
EXECUTE dbms_rcvcat.unregisterdatabase(97, 2621354619)
再次尝试连接
oracle@Z814:~> rman target / catalog rman/rmanpwd@catalogdb
Recovery Manager: Release 9.2.0.4.0 - 64bit Production
Copyright (c) 1995, 2002, Oracle Corporation. All rights reserved.
connected to target database: MYDB (DBID=2621354619)
connected to recovery catalog database
RMAN> report schema;
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of report command at 02/04/2010 19:39:30
RMAN-06004: ORACLE error from recovery catalog database: RMAN-20001: target database not found in recovery catalog
仍能连接上,但找不到任何信息.
5 DROP CATALOG;(删掉所有信息)
rman target / catalog rman/rmanpwd@catalogdb
DROP CATALOG;
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/10248702/viewspace-628774/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/10248702/viewspace-628774/