Bo's Oracle Station

查看: 1407|回复: 0

课程第29次

[复制链接]

1005

主题

1469

帖子

1万

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
12012
发表于 2019-7-21 08:47:13 | 显示全部楼层 |阅读模式
2019-07-21

创建RMAN的脚本必需连接recovery catalog:
  1. <p>[oracle@station76 ~]$ rman target /</p><p>Recovery Manager: Release 11.2.0.4.0 - Production on Sun Jul 21 01:44:24 2019</p><p>Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.</p><p>connected to target database: ORCL (DBID=1541741703)</p><p>RMAN> create script backupusers from file '/home/oracle/backupusers.rcv';</p><p>using target database control file instead of recovery catalog
  2. RMAN-00571: ===========================================================
  3. RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
  4. RMAN-00571: ===========================================================
  5. RMAN-03002: failure of create script command at 07/21/2019 01:44:51
  6. RMAN-06002: command not allowed when not connected to a recovery catalog</p><p>RMAN>

复制代码
得出推论:控制文件不能存放太多非物理机构方面的信息
  1. SQL>  show parameter control

  2. NAME                                 TYPE        VALUE
  3. ------------------------------------ ----------- ------------------------------
  4. control_file_record_keep_time        integer     7
复制代码
如果retention policy定位31天,以上参数要跟着改成31
  1. [oracle@station76 ~]$ expdp \'sys/oracle_4U as sysdba\'  directory=dir1 dumpfile=u76.dmp schemas=u76

  2. Export: Release 11.2.0.4.0 - Production on Sun Jul 21 01:58:21 2019

  3. Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.

  4. Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
  5. With the Partitioning, OLAP, Data Mining and Real Application Testing options
  6. Starting "SYS"."SYS_EXPORT_SCHEMA_01":  "sys/******** AS SYSDBA" directory=dir1 dumpfile=u76.dmp schemas=u76
  7. Estimate in progress using BLOCKS method...
  8. Processing object type SCHEMA_EXPORT/TABLE/TABLE_DATA
  9. Total estimation using BLOCKS method: 2.125 MB
  10. Processing object type SCHEMA_EXPORT/USER
  11. Processing object type SCHEMA_EXPORT/ROLE_GRANT
  12. Processing object type SCHEMA_EXPORT/DEFAULT_ROLE
  13. Processing object type SCHEMA_EXPORT/TABLESPACE_QUOTA
  14. Processing object type SCHEMA_EXPORT/PRE_SCHEMA/PROCACT_SCHEMA
  15. Processing object type SCHEMA_EXPORT/TYPE/TYPE_SPEC
  16. Processing object type SCHEMA_EXPORT/SEQUENCE/SEQUENCE
  17. Processing object type SCHEMA_EXPORT/SEQUENCE/GRANT/OWNER_GRANT/OBJECT_GRANT
  18. Processing object type SCHEMA_EXPORT/TABLE/TABLE
  19. Processing object type SCHEMA_EXPORT/PACKAGE/PACKAGE_SPEC
  20. Processing object type SCHEMA_EXPORT/PACKAGE/GRANT/OWNER_GRANT/OBJECT_GRANT
  21. Processing object type SCHEMA_EXPORT/FUNCTION/FUNCTION
  22. Processing object type SCHEMA_EXPORT/FUNCTION/GRANT/OWNER_GRANT/OBJECT_GRANT
  23. Processing object type SCHEMA_EXPORT/PACKAGE/COMPILE_PACKAGE/PACKAGE_SPEC/ALTER_PACKAGE_SPEC
  24. Processing object type SCHEMA_EXPORT/FUNCTION/ALTER_FUNCTION
  25. Processing object type SCHEMA_EXPORT/TABLE/INDEX/INDEX
  26. Processing object type SCHEMA_EXPORT/TABLE/CONSTRAINT/CONSTRAINT
  27. Processing object type SCHEMA_EXPORT/TABLE/INDEX/STATISTICS/INDEX_STATISTICS
  28. Processing object type SCHEMA_EXPORT/VIEW/VIEW
  29. Processing object type SCHEMA_EXPORT/VIEW/GRANT/OWNER_GRANT/OBJECT_GRANT
  30. Processing object type SCHEMA_EXPORT/PACKAGE/PACKAGE_BODY
  31. Processing object type SCHEMA_EXPORT/TYPE/TYPE_BODY
  32. Processing object type SCHEMA_EXPORT/TABLE/CONSTRAINT/REF_CONSTRAINT
  33. Processing object type SCHEMA_EXPORT/TABLE/TRIGGER
  34. Processing object type SCHEMA_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS
  35. . . exported "U76"."ROUT"                                166.8 KB    2131 rows
  36. . . exported "U76"."CFS"                                 89.86 KB     157 rows
  37. . . exported "U76"."AL"                                  15.58 KB       5 rows
  38. . . exported "U76"."BCF"                                 10.50 KB       4 rows
  39. . . exported "U76"."BDF"                                 16.82 KB       5 rows
  40. . . exported "U76"."BP"                                  16.47 KB       9 rows
  41. . . exported "U76"."BS"                                  12.91 KB       9 rows
  42. . . exported "U76"."BSF"                                 7.953 KB       4 rows
  43. . . exported "U76"."CKP"                                 8.875 KB       5 rows
  44. . . exported "U76"."CONF"                                8.109 KB       9 rows
  45. . . exported "U76"."CONFIG"                              5.421 KB       1 rows
  46. . . exported "U76"."DB"                                  5.835 KB       2 rows
  47. . . exported "U76"."DBINC"                               7.515 KB       3 rows
  48. . . exported "U76"."DF"                                  15.76 KB       9 rows
  49. . . exported "U76"."FB"                                   6.25 KB       1 rows
  50. . . exported "U76"."NODE"                                20.73 KB       2 rows
  51. . . exported "U76"."OFFR"                                8.828 KB       5 rows
  52. . . exported "U76"."ORL"                                 8.007 KB       9 rows
  53. . . exported "U76"."RCVER"                               5.015 KB       1 rows
  54. . . exported "U76"."RLH"                                 8.812 KB       5 rows
  55. . . exported "U76"."RSR"                                 22.86 KB      70 rows
  56. . . exported "U76"."RT"                                  7.851 KB       2 rows
  57. . . exported "U76"."SCR"                                  6.25 KB       2 rows
  58. . . exported "U76"."SCRL"                                6.343 KB       2 rows
  59. . . exported "U76"."SITE_DFATT"                          6.273 KB       9 rows
  60. . . exported "U76"."SITE_TFATT"                          8.328 KB       2 rows
  61. . . exported "U76"."TF"                                  8.671 KB       2 rows
  62. . . exported "U76"."TS"                                  9.898 KB      11 rows
  63. . . exported "U76"."TSATT"                               7.648 KB      11 rows
  64. . . exported "U76"."BCB"                                     0 KB       0 rows
  65. . . exported "U76"."BCR"                                     0 KB       0 rows
  66. . . exported "U76"."BRL"                                     0 KB       0 rows
  67. . . exported "U76"."CCB"                                     0 KB       0 rows
  68. . . exported "U76"."CCF"                                     0 KB       0 rows
  69. . . exported "U76"."CDF"                                     0 KB       0 rows
  70. . . exported "U76"."GRSP"                                    0 KB       0 rows
  71. . . exported "U76"."NRSP"                                    0 KB       0 rows
  72. . . exported "U76"."RR"                                      0 KB       0 rows
  73. . . exported "U76"."TEMPRES"                                 0 KB       0 rows
  74. . . exported "U76"."VPC_DATABASES"                           0 KB       0 rows
  75. . . exported "U76"."VPC_USERS"                               0 KB       0 rows
  76. . . exported "U76"."XAL"                                     0 KB       0 rows
  77. . . exported "U76"."XCF"                                     0 KB       0 rows
  78. . . exported "U76"."XDF"                                     0 KB       0 rows
  79. Master table "SYS"."SYS_EXPORT_SCHEMA_01" successfully loaded/unloaded
  80. ******************************************************************************
  81. Dump file set for SYS.SYS_EXPORT_SCHEMA_01 is:
  82.   /home/oracle/datapumpdir/u76.dmp
  83. Job "SYS"."SYS_EXPORT_SCHEMA_01" successfully completed at Sun Jul 21 01:58:59 2019 elapsed 0 00:00:37

复制代码
  1. [oracle@station76 ~]$ impdp \'sys/oracle_4U as sysdba\'  directory=dir1 dumpfile=u76.dmp

  2. Import: Release 11.2.0.4.0 - Production on Sun Jul 21 02:02:59 2019

  3. Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.

  4. Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
  5. With the Partitioning, OLAP, Data Mining and Real Application Testing options
  6. Master table "SYS"."SYS_IMPORT_FULL_01" successfully loaded/unloaded
  7. Starting "SYS"."SYS_IMPORT_FULL_01":  "sys/******** AS SYSDBA" directory=dir1 dumpfile=u76.dmp
  8. Processing object type SCHEMA_EXPORT/USER
  9. Processing object type SCHEMA_EXPORT/ROLE_GRANT
  10. Processing object type SCHEMA_EXPORT/DEFAULT_ROLE
  11. Processing object type SCHEMA_EXPORT/TABLESPACE_QUOTA
  12. Processing object type SCHEMA_EXPORT/PRE_SCHEMA/PROCACT_SCHEMA
  13. Processing object type SCHEMA_EXPORT/TYPE/TYPE_SPEC
  14. Processing object type SCHEMA_EXPORT/SEQUENCE/SEQUENCE
  15. Processing object type SCHEMA_EXPORT/SEQUENCE/GRANT/OWNER_GRANT/OBJECT_GRANT
  16. Processing object type SCHEMA_EXPORT/TABLE/TABLE
  17. Processing object type SCHEMA_EXPORT/TABLE/TABLE_DATA
  18. . . imported "U76"."ROUT"                                166.8 KB    2131 rows
  19. . . imported "U76"."CFS"                                 89.86 KB     157 rows
  20. . . imported "U76"."AL"                                  15.58 KB       5 rows
  21. . . imported "U76"."BCF"                                 10.50 KB       4 rows
  22. . . imported "U76"."BDF"                                 16.82 KB       5 rows
  23. . . imported "U76"."BP"                                  16.47 KB       9 rows
  24. . . imported "U76"."BS"                                  12.91 KB       9 rows
  25. . . imported "U76"."BSF"                                 7.953 KB       4 rows
  26. . . imported "U76"."CKP"                                 8.875 KB       5 rows
  27. . . imported "U76"."CONF"                                8.109 KB       9 rows
  28. . . imported "U76"."CONFIG"                              5.421 KB       1 rows
  29. . . imported "U76"."DB"                                  5.835 KB       2 rows
  30. . . imported "U76"."DBINC"                               7.515 KB       3 rows
  31. . . imported "U76"."DF"                                  15.76 KB       9 rows
  32. . . imported "U76"."FB"                                   6.25 KB       1 rows
  33. . . imported "U76"."NODE"                                20.73 KB       2 rows
  34. . . imported "U76"."OFFR"                                8.828 KB       5 rows
  35. . . imported "U76"."ORL"                                 8.007 KB       9 rows
  36. . . imported "U76"."RCVER"                               5.015 KB       1 rows
  37. . . imported "U76"."RLH"                                 8.812 KB       5 rows
  38. . . imported "U76"."RSR"                                 22.86 KB      70 rows
  39. . . imported "U76"."RT"                                  7.851 KB       2 rows
  40. . . imported "U76"."SCR"                                  6.25 KB       2 rows
  41. . . imported "U76"."SCRL"                                6.343 KB       2 rows
  42. . . imported "U76"."SITE_DFATT"                          6.273 KB       9 rows
  43. . . imported "U76"."SITE_TFATT"                          8.328 KB       2 rows
  44. . . imported "U76"."TF"                                  8.671 KB       2 rows
  45. . . imported "U76"."TS"                                  9.898 KB      11 rows
  46. . . imported "U76"."TSATT"                               7.648 KB      11 rows
  47. . . imported "U76"."BCB"                                     0 KB       0 rows
  48. . . imported "U76"."BCR"                                     0 KB       0 rows
  49. . . imported "U76"."BRL"                                     0 KB       0 rows
  50. . . imported "U76"."CCB"                                     0 KB       0 rows
  51. . . imported "U76"."CCF"                                     0 KB       0 rows
  52. . . imported "U76"."CDF"                                     0 KB       0 rows
  53. . . imported "U76"."GRSP"                                    0 KB       0 rows
  54. . . imported "U76"."NRSP"                                    0 KB       0 rows
  55. . . imported "U76"."RR"                                      0 KB       0 rows
  56. . . imported "U76"."TEMPRES"                                 0 KB       0 rows
  57. . . imported "U76"."VPC_DATABASES"                           0 KB       0 rows
  58. . . imported "U76"."VPC_USERS"                               0 KB       0 rows
  59. . . imported "U76"."XAL"                                     0 KB       0 rows
  60. . . imported "U76"."XCF"                                     0 KB       0 rows
  61. . . imported "U76"."XDF"                                     0 KB       0 rows
  62. Processing object type SCHEMA_EXPORT/PACKAGE/PACKAGE_SPEC
  63. Processing object type SCHEMA_EXPORT/PACKAGE/GRANT/OWNER_GRANT/OBJECT_GRANT
  64. Processing object type SCHEMA_EXPORT/FUNCTION/FUNCTION
  65. Processing object type SCHEMA_EXPORT/FUNCTION/GRANT/OWNER_GRANT/OBJECT_GRANT
  66. Processing object type SCHEMA_EXPORT/PACKAGE/COMPILE_PACKAGE/PACKAGE_SPEC/ALTER_PACKAGE_SPEC
  67. Processing object type SCHEMA_EXPORT/FUNCTION/ALTER_FUNCTION
  68. Processing object type SCHEMA_EXPORT/TABLE/INDEX/INDEX
  69. Processing object type SCHEMA_EXPORT/TABLE/CONSTRAINT/CONSTRAINT
  70. Processing object type SCHEMA_EXPORT/TABLE/INDEX/STATISTICS/INDEX_STATISTICS
  71. Processing object type SCHEMA_EXPORT/VIEW/VIEW
  72. Processing object type SCHEMA_EXPORT/VIEW/GRANT/OWNER_GRANT/OBJECT_GRANT
  73. Processing object type SCHEMA_EXPORT/PACKAGE/PACKAGE_BODY
  74. Processing object type SCHEMA_EXPORT/TYPE/TYPE_BODY
  75. Processing object type SCHEMA_EXPORT/TABLE/CONSTRAINT/REF_CONSTRAINT
  76. Processing object type SCHEMA_EXPORT/TABLE/TRIGGER
  77. Processing object type SCHEMA_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS
  78. Job "SYS"."SYS_IMPORT_FULL_01" successfully completed at Sun Jul 21 02:03:32 2019 elapsed 0 00:00:32

  79. [oracle@station76 ~]$
复制代码

---------------------------------从此线之后做实验要两个catalog:
剪切形式的交换catalog数据:
  1. [oracle@station76 ~]$ rman catalog u76/oracle_4U@rcat

  2. Recovery Manager: Release 11.2.0.4.0 - Production on Sun Jul 21 02:27:15 2019

  3. Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.

  4. connected to recovery catalog database


  5. [oracle@station76 ~]$ rman catalog u76/oracle_4U@rcat

  6. Recovery Manager: Release 11.2.0.4.0 - Production on Sun Jul 21 02:28:14 2019

  7. Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.

  8. connected to recovery catalog database

  9. Recovery Manager complete.
  10. [oracle@station76 ~]$ rman catalog u76/oracle_4U@rcat

  11. Recovery Manager: Release 11.2.0.4.0 - Production on Sun Jul 21 02:28:54 2019

  12. Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.

  13. connected to recovery catalog database

  14. RMAN> import catalog uwin/oracle_4U@winorcl
  15. 2> ;

  16. Starting import catalog at 2019-07-21:02:29:29
  17. connected to source recovery catalog database
  18. import validation complete
  19. database unregistered from the source recovery catalog
  20. Finished import catalog at 2019-07-21:02:29:32

  21. RMAN> exit


  22. Recovery Manager complete.
  23. [oracle@station76 ~]$ rman target /   catalog u76/oracle_4U@rcat

  24. Recovery Manager: Release 11.2.0.4.0 - Production on Sun Jul 21 02:29:48 2019

  25. Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.

  26. connected to target database: ORCL (DBID=1541741703)
  27. connected to recovery catalog database


  28. RMAN>  list incarnation of database;


  29. List of Database Incarnations
  30. DB Key  Inc Key DB Name  DB ID            STATUS  Reset SCN  Reset Time
  31. ------- ------- -------- ---------------- --- ---------- ----------
  32. 842     857     ORCL     1541741703       PARENT  1          2013-08-24:11:37:30
  33. 842     843     ORCL     1541741703       CURRENT 925702     2019-07-18:15:49:31

  34. RMAN> exit


  35. Recovery Manager complete.
  36. [oracle@station76 ~]$ rman target /   catalog uwin/oracle_4U@winorcl

  37. Recovery Manager: Release 11.2.0.4.0 - Production on Sun Jul 21 02:30:22 2019

  38. Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.

  39. connected to target database: ORCL (DBID=1541741703)
  40. connected to recovery catalog database

  41. RMAN> list incarnation of database;


  42. RMAN> list backup;

  43. RMAN-00571: ===========================================================
  44. RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
  45. RMAN-00571: ===========================================================
  46. RMAN-03002: failure of list command at 07/21/2019 02:30:35
  47. RMAN-06004: ORACLE error from recovery catalog database: RMAN-20001: target database not found in recovery catalog

  48. RMAN>
复制代码
复制形式的交换catalog数据:
  1. C:\WINDOWS\system32>rman catalog uwin/oracle_4U@winorcl

  2. 恢复管理器: Release 11.2.0.4.0 - Production on 星期日 7月 21 09:40:40 2019

  3. Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.

  4. 连接到恢复目录数据库

  5. RMAN> import catalog u76/oracle_4U@rcat dbid=1541741703  no unregister;

  6. 启动 import catalog 于 21-7月 -19
  7. 连接到源恢复目录数据库
  8. 导入验证完成
  9. 完成 import catalog 于 21-7月 -19

  10. RMAN> exit


  11. 恢复管理器完成。
复制代码
结果:
  1. [oracle@station76 ~]$ rman target /   catalog uwin/oracle_4U@winorcl

  2. Recovery Manager: Release 11.2.0.4.0 - Production on Sun Jul 21 02:41:53 2019

  3. Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.

  4. connected to target database: ORCL (DBID=1541741703)
  5. connected to recovery catalog database

  6. RMAN> list incarnation of database;


  7. List of Database Incarnations
  8. DB Key  Inc Key DB Name  DB ID            STATUS  Reset SCN  Reset Time
  9. ------- ------- -------- ---------------- --- ---------- ----------
  10. 1023    1038    ORCL     1541741703       PARENT  1          2013-08-24:11:37:30
  11. 1023    1024    ORCL     1541741703       CURRENT 925702     2019-07-18:15:49:31

  12. RMAN> exit


  13. Recovery Manager complete.
  14. [oracle@station76 ~]$ rman target /   catalog u76/oracle_4U@rcat

  15. Recovery Manager: Release 11.2.0.4.0 - Production on Sun Jul 21 02:42:08 2019

  16. Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.

  17. connected to target database: ORCL (DBID=1541741703)
  18. connected to recovery catalog database

  19. RMAN> list incarnation of database;


  20. List of Database Incarnations
  21. DB Key  Inc Key DB Name  DB ID            STATUS  Reset SCN  Reset Time
  22. ------- ------- -------- ---------------- --- ---------- ----------
  23. 842     857     ORCL     1541741703       PARENT  1          2013-08-24:11:37:30
  24. 842     843     ORCL     1541741703       CURRENT 925702     2019-07-18:15:49:31

  25. RMAN>
复制代码
-------------------------------------------从此线开始 rcat是虚拟专用catalog,winorcl和orcl都是它的target , 务必重在rcat上新建用户做实验:

  1. [oracle@station76 ~]$ . oraenv
  2. ORACLE_SID = [rcat] ?
  3. The Oracle base remains unchanged with value /u01/app/oracle
  4. [oracle@station76 ~]$ sqlplus /nolog

  5. SQL*Plus: Release 11.2.0.4.0 Production on Sun Jul 21 02:51:34 2019

  6. Copyright (c) 1982, 2013, Oracle.  All rights reserved.

  7. SQL> conn / as sysdba
  8. Connected.
  9. SQL> create user ucatalog identified by oracle_4U default tablespace rcat quota unlimited on rcat ;

  10. User created.

  11. SQL>  create user vcatalog1  identified by oracle_4U default tablespace rcat quota unlimited on rcat ;

  12. User created.

  13. SQL>  create user vcatalog2 identified by oracle_4U default tablespace rcat quota unlimited on rcat ;

  14. User created.

复制代码
一样地授权:
  1. SQL> grant recovery_Catalog_owner to ucatalog;

  2. Grant succeeded.

  3. SQL> grant recovery_catalog_owner to vcatalog1;

  4. Grant succeeded.


  5. SQL>  grant recovery_catalog_owner to vcatalog2;

  6. Grant succeeded.

复制代码
创建base catalog:
  1. [oracle@station76 ~]$ rman catalog ucatalog/oracle_4U@rcat

  2. Recovery Manager: Release 11.2.0.4.0 - Production on Sun Jul 21 02:56:24 2019

  3. Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.

  4. connected to recovery catalog database

  5. RMAN> create catalog;

  6. recovery catalog created

  7. RMAN>
复制代码
--------------让vcatalog1/2自行去注册的分支(3b):
  1. Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
  2. With the Partitioning, OLAP, Data Mining and Real Application Testing options
  3. [oracle@station76 ~]$ rman catalog ucatalog/oracle_4U@rcat

  4. Recovery Manager: Release 11.2.0.4.0 - Production on Sun Jul 21 02:56:24 2019

  5. Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.

  6. connected to recovery catalog database

  7. RMAN> create catalog;

  8. recovery catalog created

  9. RMAN> grant catalog for database 1541741703 to vcatalog1;

  10. Grant succeeded.

  11. RMAN> grant catalog for database 2162311502  to vcatalog2;

  12. Grant succeeded.
复制代码
  1. [oracle@station76 ~]$ rman catalog vcatalog1/oracle_4U@rcat

  2. Recovery Manager: Release 11.2.0.4.0 - Production on Sun Jul 21 03:14:25 2019

  3. Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.

  4. connected to recovery catalog database

  5. RMAN> create virtual catalog;

  6. found ineligible base catalog owned by U76
  7. found eligible base catalog owned by UCATALOG
  8. created virtual catalog against base catalog owned by UCATALOG

  9. RMAN> exit


  10. Recovery Manager complete.
  11. [oracle@station76 ~]$ rman catalog vcatalog2/oracle_4U@rcat

  12. Recovery Manager: Release 11.2.0.4.0 - Production on Sun Jul 21 03:14:40 2019

  13. Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.

  14. connected to recovery catalog database

  15. RMAN> create virtual catalog;

  16. found ineligible base catalog owned by U76
  17. found eligible base catalog owned by UCATALOG
  18. created virtual catalog against base catalog owned by UCATALOG

  19. RMAN>
复制代码
  1. [oracle@station76 ~]$ rman target /  catalog vcatalog1/oracle_4U@rcat

  2. Recovery Manager: Release 11.2.0.4.0 - Production on Sun Jul 21 03:16:48 2019

  3. Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.

  4. connected to target database: ORCL (DBID=1541741703)
  5. connected to recovery catalog database

  6. RMAN> register database;

  7. database registered in recovery catalog
  8. starting full resync of recovery catalog
  9. full resync complete

  10. RMAN>
复制代码
  1. C:\WINDOWS\system32>rman target / catalog vcatalog2/oracle_4U@rcat

  2. 恢复管理器: Release 11.2.0.4.0 - Production on 星期日 7月 21 10:17:11 2019

  3. Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.

  4. 已连接到目标数据库: WINORCL (DBID=2162311502)
  5. 连接到恢复目录数据库

  6. RMAN> register database;

  7. 注册在恢复目录中的数据库
  8. 正在启动恢复目录的全部重新同步
  9. 完成全部重新同步
复制代码
  1. [oracle@station76 ~]$ rman target /  catalog ucatalog/oracle_4U@rcat

  2. Recovery Manager: Release 11.2.0.4.0 - Production on Sun Jul 21 03:18:18 2019

  3. Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.

  4. connected to target database: ORCL (DBID=1541741703)
  5. connected to recovery catalog database

  6. RMAN> list incarnation of database;


  7. List of Database Incarnations
  8. DB Key  Inc Key DB Name  DB ID            STATUS  Reset SCN  Reset Time
  9. ------- ------- -------- ---------------- --- ---------- ----------
  10. 1       16      ORCL     1541741703       PARENT  1          2013-08-24:11:37:30
  11. 1       2       ORCL     1541741703       CURRENT 925702     2019-07-18:15:49:31
复制代码
  1. C:\WINDOWS\system32>rman target / catalog ucatalog/oracle_4U@rcat

  2. 恢复管理器: Release 11.2.0.4.0 - Production on 星期日 7月 21 10:19:12 2019

  3. Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.

  4. 已连接到目标数据库: WINORCL (DBID=2162311502)
  5. 连接到恢复目录数据库

  6. RMAN> list incarnation of database;


  7. 数据库原型列表
  8. DB 关键字  Inc 关键字 DB 名  DB ID            STATUS  重置 SCN  重置时间
  9. ------- ------- -------- ---------------- --- ---------- ----------
  10. 186     187     WINORCL  2162311502       CURRENT 1          21-7月 -19
复制代码

-------------------------------------------------------------------------------------试试维护性通道
  1. RMAN> allocate channel  for maintenance device type sbt;

  2. using target database control file instead of recovery catalog
  3. allocated channel: ORA_MAINT_SBT_TAPE_1
  4. channel ORA_MAINT_SBT_TAPE_1: SID=23 device type=SBT_TAPE
  5. channel ORA_MAINT_SBT_TAPE_1: Oracle Secure Backup

  6. RMAN> allocate channel  for maintenance device type sbt;

  7. allocated channel: ORA_MAINT_SBT_TAPE_2
  8. channel ORA_MAINT_SBT_TAPE_2: SID=45 device type=SBT_TAPE
  9. channel ORA_MAINT_SBT_TAPE_2: Oracle Secure Backup

  10. RMAN> delete noprompt backup;


  11. List of Backup Pieces
  12. BP Key  BS Key  Pc# Cp# Status      Device Type Piece Name
  13. ------- ------- --- --- ----------- ----------- ----------
  14. 40      35      1   1   AVAILABLE   SBT_TAPE    15u73al9_1_1
  15. 41      36      1   1   AVAILABLE   SBT_TAPE    c-1541741703-20190720-03
  16. 42      37      1   1   AVAILABLE   SBT_TAPE    17u73aqt_1_1
  17. 43      38      1   1   AVAILABLE   SBT_TAPE    c-1541741703-20190720-04
  18. 44      39      1   1   AVAILABLE   SBT_TAPE    19u73b0g_1_1
  19. 45      40      1   1   AVAILABLE   SBT_TAPE    c-1541741703-20190720-05
  20. 46      41      1   1   AVAILABLE   SBT_TAPE    1bu760di_1_1
  21. 47      42      1   1   AVAILABLE   SBT_TAPE    c-1541741703-20190721-00
  22. deleted backup piece
  23. backup piece handle=15u73al9_1_1 RECID=40 STAMP=1014082217
  24. deleted backup piece
  25. backup piece handle=c-1541741703-20190720-03 RECID=41 STAMP=1014082244
  26. deleted backup piece
  27. backup piece handle=17u73aqt_1_1 RECID=42 STAMP=1014082397
  28. deleted backup piece
  29. backup piece handle=c-1541741703-20190720-04 RECID=43 STAMP=1014082426
  30. deleted backup piece
  31. backup piece handle=19u73b0g_1_1 RECID=44 STAMP=1014082576
  32. deleted backup piece
  33. backup piece handle=c-1541741703-20190720-05 RECID=45 STAMP=1014082604
  34. deleted backup piece
  35. backup piece handle=1bu760di_1_1 RECID=46 STAMP=1014170034
  36. deleted backup piece
  37. backup piece handle=c-1541741703-20190721-00 RECID=47 STAMP=1014170050
  38. Deleted 8 objects


  39. RMAN>
复制代码

--------做实验之前,请按以下设置标准的show all:
  1. RMAN> show all;

  2. RMAN configuration parameters for database with db_unique_name ORCL are:
  3. CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 1 DAYS;
  4. CONFIGURE BACKUP OPTIMIZATION ON;
  5. CONFIGURE DEFAULT DEVICE TYPE TO 'SBT_TAPE';
  6. CONFIGURE CONTROLFILE AUTOBACKUP ON;
  7. CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE SBT_TAPE TO '%F'; # default
  8. CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '%F'; # default
  9. CONFIGURE DEVICE TYPE 'SBT_TAPE' PARALLELISM 2 BACKUP TYPE TO BACKUPSET;
  10. CONFIGURE DEVICE TYPE DISK PARALLELISM 8 BACKUP TYPE TO BACKUPSET;
  11. CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE SBT_TAPE TO 1; # default
  12. CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
  13. CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE SBT_TAPE TO 1; # default
  14. CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
  15. CONFIGURE CHANNEL 1 DEVICE TYPE 'SBT_TAPE' PARMS  'ENV=(OB_MEDIA_FAMILY=station76)' MAXPIECESIZE 250 M;
  16. CONFIGURE CHANNEL 2 DEVICE TYPE 'SBT_TAPE' PARMS  'ENV=(OB_MEDIA_FAMILY=station76)' MAXPIECESIZE 250 M;
  17. CONFIGURE CHANNEL DEVICE TYPE DISK MAXPIECESIZE 250 M;
  18. CONFIGURE CHANNEL DEVICE TYPE 'SBT_TAPE' PARMS  'ENV=(OB_MEDIA_FAMILY=station76)' MAXPIECESIZE 250 M;
  19. CONFIGURE MAXSETSIZE TO UNLIMITED; # default
  20. CONFIGURE ENCRYPTION FOR DATABASE OFF; # default
  21. CONFIGURE ENCRYPTION ALGORITHM 'AES128'; # default
  22. CONFIGURE COMPRESSION ALGORITHM 'BASIC' AS OF RELEASE 'DEFAULT' OPTIMIZE FOR LOAD TRUE ; # default
  23. CONFIGURE ARCHIVELOG DELETION POLICY TO NONE; # default
  24. CONFIGURE SNAPSHOT CONTROLFILE NAME TO '/u01/app/oracle/product/11.2.0/dbhome_1/dbs/snapcf_orcl.f'; # default
复制代码
218.jpg










回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|手机版|Bo's Oracle Station   

GMT+8, 2024-5-10 02:48 , Processed in 0.043380 second(s), 27 queries .

快速回复 返回顶部 返回列表