当前位置: DBARoad > 备份恢复 > 文章正文

RMAN注销数据库

                    作者 :OoNiceDream【转载时请务必以超链接形式标明文章原始出处和作者信息】
                    链接:http://www.dbaroad.me/archives/2009/08/rman_unregister_database.html

RMAN中注销数据库,9i中可以使用dbms_rcvcat.unregisterdatabase(DB_KEY,DB_ID):

PROCEDURE UNREGISTERDATABASE
 Argument Name                  Type                    In/Out Default?
 ------------------------------ ----------------------- ------ --------
 DB_KEY                         NUMBER                  IN
 DB_ID                          NUMBER                  IN

DB_KEY和DB_ID的查询,可以使用list incarnation命令:

RMAN> register database;
 
database registered in recovery catalog
starting full resync of recovery catalog
full resync complete
 
RMAN> list incarnation;
 
 
List of Database Incarnations
DB Key  Inc Key DB Name  DB ID            CUR Reset SCN  Reset Time
------- ------- -------- ---------------- --- ---------- ----------
4773    4774    TADBA    3382467590       YES 1          24-JUN-08

也可以查询表db(这里要用rman用户连接):

$ sqlplus rman/rman@rman              
 
SQL*Plus: Release 9.2.0.8.0 - Production on Thu Aug 27 16:32:13 2009
 
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> select * from db;
 
    DB_KEY      DB_ID HIGH_CONF_RECID LAST_KCCDIVTS CURR_DBINC_KEY
---------- ---------- --------------- ------------- --------------
      4773 3382467590               0     658259526           4774
 
SQL> execute dbms_rcvcat.unregisterdatabase(4773,3382467590);
 
PL/SQL procedure successfully completed.

10G中简化为unregister database命令:

RMAN> register database;
 
database registered in recovery catalog
starting full resync of recovery catalog
full resync complete
 
RMAN> list incarnation;
 
 
List of Database Incarnations
DB Key  Inc Key DB Name  DB ID            STATUS  Reset SCN  Reset Time
------- ------- -------- ---------------- --- ---------- ----------
9543    9551    EMREP    3891917657       PARENT  1          21-JUL-05
9543    9544    EMREP    3891917657       CURRENT 556298     23-OCT-08
 
RMAN> unregister database;
 
database name is "EMREP" and DBID is 3891917657
 
Do you really want to unregister the database (enter YES or NO)? y
database unregistered from the recovery catalog
 
RMAN> list incarnation;
 
 
RMAN>

— The End —

关键字:
喜欢DBARoad的文章,那就通过 RSS Feed 功能订阅阅读吧!

我要评论

*

* 绝不会泄露


  • 订阅


      抓虾
      google reader
      my yahoo
      bloglines
      鲜果
      有道

站内搜索



返回首页 | 关于我 | 联系我 | 广告合作 | 网站地图 | 友情链接 | 版权声明 |