zoukankan      html  css  js  c++  java
  • 在恢复目录中注册和取消数据库

    对于如何建立恢复目录数据库,相信大家都知道, 在此不再重复(建立专用表空间,建立用户,授权recovery_catalog_owner)。


    一、 注册数据库:
    1. 连接到恢复目录:
       C:\>rman catalog rman/rman@rmandb
       Recovery Manager: Release 9.2.0.1.0 - Production
       Copyright (c) 1995, 2002, Oracle Corporation.  All rights reserved.
       connected to recovery catalog database
       RMAN>

    2.连接目标数据库:
       RMAN> connect target sys/oracle@mydata
       connected to target database: MYDATA (DBID=165830944)
       RMAN>

    3. 注册数据库
       RMAN> register database;
       database registered in recovery catalog
       starting full resync of recovery catalog
       full resync complete
       RMAN>

    二、取消数据库的注册
    1.在SQLPLUS使用RMAN用户登录恢复目录
       C:\>sqlplus /nolog
       SQL*Plus: Release 9.2.0.1.0 - Production on Thu May 31 14:47:06 2007
       Copyright (c) 1982, 2002, Oracle Corporation.  All rights reserved.

       SQL> connect rman/rman@rmandb
       Connected.
       SQL>

    2.查找表DB 中的注册记录
        SQL> select db_key,db_id from db;
            DB_KEY      DB_ID
        ---------- ----------
              1224 3761021478
              1844  165830944
        SQL>

    3.注销数据库(DB_ID值从RMAN命令连接目标数据库时可以查到 DBID=165830944,同时选择相应的db_Key)
       PROCEDURE UNREGISTERDATABASE
        Argument Name                  Type                    In/Out Default?
        ------------------------------ ----------------------- ------ --------
        DB_KEY                         NUMBER                  IN   
        DB_ID                          NUMBER                  IN   

       SQL> execute dbms_rcvcat.unregisterdatabase(1844,165830944);
       PL/SQL procedure successfully completed.
       SQL>

    4.验证注销动作
       RMAN> list backup;
       RMAN-00571: ===========================================================
       RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
       RMAN-00571: ===========================================================
       RMAN-03002: failure of list command at 05/31/2007 14:59:43
       RMAN-06004: ORACLE error from recovery catalog database: RMAN-20001: target database not found in recovery catalog
       RMAN>

  • 相关阅读:
    矩阵旋转
    clang-format 规范及 Visual Stido Code 自定义格式化代码风格
    Windows 安装 MinGW-w64
    Linux配置Visual Stdio Code
    Ubuntu中安装eclipse
    Ubuntu安装JDK11
    Ubuntu安装搜狗输入法
    C/C++算术运算(类型使用)的注意事项
    闰年判断与日期计算
    查看变量类型
  • 原文地址:https://www.cnblogs.com/jasonsfu/p/1156065.html
Copyright © 2011-2022 走看看