RMAN學習筆記_Catalog 安裝與御載

gdutllf2006發表於2010-03-06

在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 使用者,表空間
:~> sqlplus " 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> 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 來連線
Catalog Schema 只需建立一次,而所有想使用此Catalog的資料庫只需連線到Catalog Schema所在Database上,並向其註冊即可.

如10.230.17.34想使用此Catalog
# rman target / catalog


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
delete backup device type disk;
-- delete backup device type sbt;


4.2 找到DB_ID對應的DB_KEY;
sqlplus ""

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)       

再次嘗試連線
:~> rman target / catalog

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
DROP CATALOG;

 

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/10248702/viewspace-628774/,如需轉載,請註明出處,否則將追究法律責任。

相關文章