• rman catalog


    参考文档:Recovery catalog for RMAN backup (Doc ID 452529.1)
    catalog库 : bak,将其他库的备份信息存放在catalog库上

    -- 在cagalog库上创建用户

    1. create tablespace cat_tbs datafile '/oradata/bak/cat_tbs01.dbf' size 200M autoextend on;
    2. CREATE USER catuser IDENTIFIED BY oracle DEFAULT TABLESPACE cat_tbs TEMPORARY TABLESPACE temp QUOTA UNLIMITED ON cat_tbs;
    3. GRANT CONNECT, RECOVERY_CATALOG_OWNER TO catuser;
    4. SYS@bak SQL> create tablespace cat_tbs datafile '/oradata/bak/cat_tbs01.dbf' size 200M autoextend on;
    5. Tablespace created.
    6. SYS@bak SQL> CREATE USER catuser IDENTIFIED BY oracle DEFAULT TABLESPACE cat_tbs TEMPORARY TABLESPACE temp QUOTA UNLIMITED ON cat_tbs;
    7. User created.
    8. SYS@bak SQL> GRANT CONNECT, RECOVERY_CATALOG_OWNER TO catuser;
    9. Grant succeeded.
    10. SYS@bak SQL>

    -- 创建catalog 

    1. % rman catalog <catalog username>/<password> @<catalog db connect string>
    2. rman catalog catuser/oracle@bak
    3. create catalog;
    4. [oracle@19ctest ~]$ rman catalog catuser/oracle@bak
    5. Recovery Manager: Release 19.0.0.0.0 - Production on Fri Nov 17 14:17:07 2023
    6. Version 19.21.0.0.0
    7. Copyright (c) 1982, 2019, Oracle and/or its affiliates. All rights reserved.
    8. connected to recovery catalog database
    9. RMAN> create catalog;
    10. recovery catalog created
    11. RMAN>

    -- 注册database,分别在bak,test,orcl库上执行

    1. % rman TARGET / CATALOG <catalog username>/<password> @<catalog db connect string>
    2. rman target / catalog catuser/oracle@bak
    3. register database;
    4. [oracle@19ctest ~]$ rman target / catalog catuser/oracle@bak
    5. Recovery Manager: Release 19.0.0.0.0 - Production on Fri Nov 17 14:18:29 2023
    6. Version 19.21.0.0.0
    7. Copyright (c) 1982, 2019, Oracle and/or its affiliates. All rights reserved.
    8. connected to target database: BAK (DBID=1552936560)
    9. connected to recovery catalog database
    10. RMAN> register database;
    11. database registered in recovery catalog
    12. starting full resync of recovery catalog
    13. full resync complete
    14. RMAN>
    15. [oracle@19ctest ~]$ rman target / catalog catuser/oracle@bak
    16. Recovery Manager: Release 19.0.0.0.0 - Production on Fri Nov 17 14:19:10 2023
    17. Version 19.21.0.0.0
    18. Copyright (c) 1982, 2019, Oracle and/or its affiliates. All rights reserved.
    19. connected to target database: TEST (DBID=2318641842)
    20. connected to recovery catalog database
    21. RMAN> register database;
    22. database registered in recovery catalog
    23. starting full resync of recovery catalog
    24. full resync complete
    25. RMAN>
    26. [oracle@19ctest ~]$ rman target / catalog catuser/oracle@bak
    27. Recovery Manager: Release 19.0.0.0.0 - Production on Fri Nov 17 14:19:53 2023
    28. Version 19.21.0.0.0
    29. Copyright (c) 1982, 2019, Oracle and/or its affiliates. All rights reserved.
    30. connected to target database: ORCL (DBID=1628558668)
    31. connected to recovery catalog database
    32. RMAN> register database;
    33. database registered in recovery catalog
    34. starting full resync of recovery catalog
    35. full resync complete
    36. RMAN>

    -- 升级catalog
    RMAN>UPGRADE CATALOG;
     
    --remove catalog 
    RMAN> DROP CATALOG; 

    -- unregister database 
    RMAN> UNREGISTER DATABASE ;   <<<< 10g之前的方式

    % sqlplus / @     <<<< 10g及之后的方式
    SQL > DBMS_RCVCAT.UNREGISTERDATABASE(db_key, db_id);

    -- 查看catalog版本

    1. % sqlplus <catalog username>/<password> @<catalog db connect string>
    2. SQL > SELECT * FROM rcver;
    3. sqlplus catuser/oracle@bak
    4. SELECT * FROM rcver;
    5. [oracle@19ctest ~]$ sqlplus catuser/oracle@bak
    6. SQL*Plus: Release 19.0.0.0.0 - Production on Fri Nov 17 14:20:55 2023
    7. Version 19.21.0.0.0
    8. Copyright (c) 1982, 2022, Oracle. All rights reserved.
    9. Last Successful login time: Fri Nov 17 2023 14:19:54 +08:00
    10. Connected to:
    11. Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
    12. Version 19.21.0.0.0
    13. Session altered.
    14. CATUSER@bak SQL> SELECT * FROM rcver;
    15. VERSION
    16. ---------------
    17. 19.21.00.00.00
    18. CATUSER@bak SQL>

    -- 查看在catalog中的库

    1. SYS@bak SQL> select * from catuser.node;
    2. DB_UNIQUE_ DB_KEY INST_STARTUP_STAMP DATABAS SITE_KEY DB_TIMEZONE T
    3. ---------- ---------- ------------------ ------- ---------- ---------------------------------------------------------------- -
    4. BAK 1 1153144098 PRIMARY 3 +08:00 R
    5. TEST 105 1153142785 PRIMARY 107 +08:00 R
    6. ORCL 263 1153142862 PRIMARY 265 +08:00 R
    7. SYS@bak SQL>

    END 

  • 相关阅读:
    使用一段时候,oracle服务在启动时报1053:服务没有及时响应启动或控制请求
    redis应用于微服务缓存的探讨
    JavaScript速成课--面向对象程序设计
    为什么选择clickhouse?
    机器人操作系统ROS2学习—控制小海龟运动
    算法day39|62,63
    万卷书 - 欧洲的门户 [The Gates of Europe]
    git 版本管理
    5个最好的乐高设计软件
    前端生成海报图:html2canvas 生成海报图
  • 原文地址:https://blog.csdn.net/xxzhaobb/article/details/134464819