Bo's Oracle Station

查看: 2725|回复: 0

课程第27次(2017-05-11星期四)Recovery Catalog

[复制链接]

1005

主题

1469

帖子

1万

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
12012
发表于 2017-5-12 08:41:36 | 显示全部楼层 |阅读模式
本帖最后由 botang 于 2017-5-12 09:15 编辑

WINDOWS上创建Recovery Catalog:
  1. Microsoft Windows [版本 6.1.7600]
  2. 版权所有 (c) 2009 Microsoft Corporation。保留所有权利。

  3. C:\Users\Administrator>sqlplus /nolog

  4. SQL*Plus: Release 11.2.0.1.0 Production on 星期四 5月 11 19:40:32 2017

  5. Copyright (c) 1982, 2010, Oracle. All rights reserved.

  6. SQL> conn / as sysdba
  7. 已连接。
  8. SQL> select * from v$version;

  9. BANNER
  10. --------------------------------------------------------------------------------

  11. Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
  12. PL/SQL Release 11.2.0.1.0 - Production
  13. CORE 11.2.0.1.0 Production
  14. TNS for 32-bit Windows: Version 11.2.0.1.0 - Production
  15. NLSRTL Version 11.2.0.1.0 - Production

  16. SQL> select * from v$version;

  17. BANNER
  18. --------------------------------------------------------------------------------

  19. Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
  20. PL/SQL Release 11.2.0.1.0 - Production
  21. CORE 11.2.0.1.0 Production
  22. TNS for 32-bit Windows: Version 11.2.0.1.0 - Production
  23. NLSRTL Version 11.2.0.1.0 - Production

  24. SQL> create tablespace rcattbs datafile 'C:\app\Administrator\oradata\utforcl\
  25. rcattbs.dbf' size 30M autoextend on maxsize 2G ;

  26. 表空间已创建。

  27. SQL> create user u90 identified by oracle_4U tablespace rcattbs quota unlimited
  28. on rcattbs;
  29. create user u90 identified by oracle_4U tablespace rcattbs quota unlimited on rc
  30. attbs
  31. *
  32. 第 1 行出现错误:
  33. ORA-00922: 选项缺失或无效


  34. SQL> create user u90 identified by oracle_4U default tablespace rcattbs quota u
  35. nlimited on rcattbs;

  36. 用户已创建。

  37. SQL> grant recovery_Catalog_owner to u90;

  38. 授权成功。

  39. SQL> exit
  40. 从 Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
  41. With the Partitioning, OLAP, Data Mining and Real Application Testing options 断


  42. C:\Users\Administrator>rman catalog u90/oracle_4U

  43. 恢复管理器: Release 11.2.0.1.0 - Production on 星期四 5月 11 19:53:39 2017

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

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

  46. RMAN> create catalog ;

  47. 恢复目录已创建

  48. RMAN>
复制代码

测试磁带机的CMDFILE(可以变成Stored Script):

  1. run{
  2. set newname for datafile 5 to '/home/oracle/examplettio.dbf';
  3. restore datafile 5;
  4. delete datafilecopy '/home/oracle/examplettio.dbf';
  5. }
复制代码
验证v$backup_datafile和rc_backup_datafile相关的几条SQL语句:
  1. select  * from v$backup_datafile;

  2. create user u90 identified by oracle_4U quota unlimited on users;

  3. grant recovery_catalog_owner to u90;
复制代码
数据泵备份Recovery Catalog:
  1. [oracle@station90 ~]$ impdp system/oracle_4U directory=mydir dumpfile=u90.dmp schemas=u90

  2. Import: Release 11.2.0.1.0 - Production on Thu May 11 21:41:20 2017

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

  4. Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
  5. With the Partitioning, OLAP, Data Mining and Real Application Testing options
  6. Master table "SYSTEM"."SYS_IMPORT_SCHEMA_01" successfully loaded/unloaded
  7. Starting "SYSTEM"."SYS_IMPORT_SCHEMA_01":  system/******** directory=mydir dumpfile=u90.dmp schemas=u90
  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 "U90"."ROUT"                                34.67 MB  493537 rows
  19. . . imported "U90"."CFS"                                 89.83 KB     157 rows
  20. . . imported "U90"."AL"                                  17.05 KB      14 rows
  21. . . imported "U90"."BCF"                                 10.64 KB       6 rows
  22. . . imported "U90"."BDF"                                 18.71 KB      22 rows
  23. . . imported "U90"."BP"                                  21.57 KB      36 rows
  24. . . imported "U90"."BRL"                                 10.74 KB       8 rows
  25. . . imported "U90"."BS"                                  14.85 KB      36 rows
  26. . . imported "U90"."BSF"                                 8.039 KB       6 rows
  27. . . imported "U90"."CDF"                                 18.51 KB       1 rows
  28. . . imported "U90"."CKP"                                 8.882 KB       5 rows
  29. . . imported "U90"."CONF"                                8.507 KB      16 rows
  30. . . imported "U90"."CONFIG"                              5.421 KB       1 rows
  31. . . imported "U90"."DB"                                  5.835 KB       2 rows
  32. . . imported "U90"."DBINC"                               7.710 KB       8 rows
  33. . . imported "U90"."DF"                                  15.42 KB      10 rows
  34. . . imported "U90"."NODE"                                20.74 KB       2 rows
  35. . . imported "U90"."OFFR"                                9.132 KB      11 rows
  36. . . imported "U90"."ORL"                                 8.007 KB       9 rows
  37. . . imported "U90"."RCVER"                               5.023 KB       1 rows
  38. . . imported "U90"."RLH"                                 13.63 KB     109 rows
  39. . . imported "U90"."RSR"                                 33.75 KB     158 rows
  40. . . imported "U90"."RT"                                  7.859 KB       2 rows
  41. . . imported "U90"."SCR"                                 6.242 KB       2 rows
  42. . . imported "U90"."SCRL"                                6.609 KB      10 rows
  43. . . imported "U90"."SITE_DFATT"                          6.320 KB      10 rows
  44. . . imported "U90"."SITE_TFATT"                          8.398 KB       3 rows
  45. . . imported "U90"."TF"                                  8.304 KB       3 rows
  46. . . imported "U90"."TS"                                  9.507 KB      12 rows
  47. . . imported "U90"."TSATT"                               7.257 KB      12 rows
  48. . . imported "U90"."BCB"                                     0 KB       0 rows
  49. . . imported "U90"."BCR"                                     0 KB       0 rows
  50. . . imported "U90"."CCB"                                     0 KB       0 rows
  51. . . imported "U90"."CCF"                                     0 KB       0 rows
  52. . . imported "U90"."FB"                                      0 KB       0 rows
  53. . . imported "U90"."GRSP"                                    0 KB       0 rows
  54. . . imported "U90"."NRSP"                                    0 KB       0 rows
  55. . . imported "U90"."RR"                                      0 KB       0 rows
  56. . . imported "U90"."TEMPRES"                                 0 KB       0 rows
  57. . . imported "U90"."VPC_DATABASES"                           0 KB       0 rows
  58. . . imported "U90"."VPC_USERS"                               0 KB       0 rows
  59. . . imported "U90"."XAL"                                     0 KB       0 rows
  60. . . imported "U90"."XCF"                                     0 KB       0 rows
  61. . . imported "U90"."XDF"                                     0 KB       0 rows
  62. Processing object type SCHEMA_EXPORT/TABLE/INDEX/INDEX
  63. Processing object type SCHEMA_EXPORT/TABLE/CONSTRAINT/CONSTRAINT
  64. Processing object type SCHEMA_EXPORT/TABLE/INDEX/STATISTICS/INDEX_STATISTICS
  65. Processing object type SCHEMA_EXPORT/PACKAGE/PACKAGE_SPEC
  66. Processing object type SCHEMA_EXPORT/PACKAGE/GRANT/OWNER_GRANT/OBJECT_GRANT
  67. Processing object type SCHEMA_EXPORT/FUNCTION/FUNCTION
  68. Processing object type SCHEMA_EXPORT/FUNCTION/GRANT/OWNER_GRANT/OBJECT_GRANT
  69. Processing object type SCHEMA_EXPORT/PACKAGE/COMPILE_PACKAGE/PACKAGE_SPEC/ALTER_PACKAGE_SPEC
  70. Processing object type SCHEMA_EXPORT/FUNCTION/ALTER_FUNCTION
  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. Job "SYSTEM"."SYS_IMPORT_SCHEMA_01" successfully completed at 21:42:31

  78. [oracle@station90 ~]$ sqlplus /nolog

  79. SQL*Plus: Release 11.2.0.1.0 Production on Thu May 11 21:42:46 2017

  80. Copyright (c) 1982, 2009, Oracle.  All rights reserved.

  81. SQL> conn / as sysdba
  82. Connected.
  83. SQL> alter user u90 identified by oracle_4U;

  84. User altered.

  85. SQL> exit
  86. Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
  87. With the Partitioning, OLAP, Data Mining and Real Application Testing options
  88. [oracle@station90 ~]$
复制代码





回复

使用道具 举报

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

本版积分规则

QQ|手机版|Bo's Oracle Station   

GMT+8, 2024-4-26 02:53 , Processed in 0.036226 second(s), 24 queries .

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