Bo's Oracle Station

查看: 1079|回复: 0

课程第33次(2017-01-04星期三)

[复制链接]

1005

主题

1469

帖子

1万

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
12012
发表于 2017-1-5 09:38:11 | 显示全部楼层 |阅读模式
上完1Z0-053第3章(Recovery Catalog和虚拟专用Recovery Catalog)
(052共19章,053共21章,063多租户共9章,49-19)
  1. [oracle@station90 ~]$ expdp system/oracle_4U directory=dir1  dumpfile=u90.dmp schemas=u90

  2. Export: Release 11.2.0.1.0 - Production on Sat Jan 7 22:35:26 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. Starting "SYSTEM"."SYS_EXPORT_SCHEMA_01":  system/******** directory=dir1 dumpfile=u90.dmp schemas=u90
  7. Estimate in progress using BLOCKS method...
  8. Processing object type SCHEMA_EXPORT/TABLE/TABLE_DATA
  9. Total estimation using BLOCKS method: 2.5 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/TABLE/INDEX/INDEX
  20. Processing object type SCHEMA_EXPORT/TABLE/CONSTRAINT/CONSTRAINT
  21. Processing object type SCHEMA_EXPORT/TABLE/INDEX/STATISTICS/INDEX_STATISTICS
  22. Processing object type SCHEMA_EXPORT/PACKAGE/PACKAGE_SPEC
  23. Processing object type SCHEMA_EXPORT/PACKAGE/GRANT/OWNER_GRANT/OBJECT_GRANT
  24. Processing object type SCHEMA_EXPORT/FUNCTION/FUNCTION
  25. Processing object type SCHEMA_EXPORT/FUNCTION/GRANT/OWNER_GRANT/OBJECT_GRANT
  26. Processing object type SCHEMA_EXPORT/PACKAGE/COMPILE_PACKAGE/PACKAGE_SPEC/ALTER_PACKAGE_SPEC
  27. Processing object type SCHEMA_EXPORT/FUNCTION/ALTER_FUNCTION
  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. . . exported "U90"."ROUT"                                384.9 KB    5293 rows
  35. . . exported "U90"."CFS"                                 89.83 KB     157 rows
  36. . . exported "U90"."RSR"                                 79.72 KB     520 rows
  37. . . exported "U90"."AL"                                  16.14 KB       9 rows
  38. . . exported "U90"."BCF"                                 10.35 KB       2 rows
  39. . . exported "U90"."BDF"                                 17.10 KB       7 rows
  40. . . exported "U90"."BP"                                  16.91 KB      12 rows
  41. . . exported "U90"."BRL"                                 11.32 KB      16 rows
  42. . . exported "U90"."BS"                                  13.07 KB      11 rows
  43. . . exported "U90"."BSF"                                 7.882 KB       2 rows
  44. . . exported "U90"."CDF"                                 19.43 KB       6 rows
  45. . . exported "U90"."CKP"                                 8.718 KB       2 rows
  46. . . exported "U90"."CONF"                                8.257 KB      12 rows
  47. . . exported "U90"."CONFIG"                              5.421 KB       1 rows
  48. . . exported "U90"."DB"                                  5.820 KB       1 rows
  49. . . exported "U90"."DBINC"                               7.851 KB      12 rows
  50. . . exported "U90"."DF"                                  15.07 KB       5 rows
  51. . . exported "U90"."NODE"                                20.60 KB       1 rows
  52. . . exported "U90"."OFFR"                                8.898 KB       6 rows
  53. . . exported "U90"."ORL"                                 7.796 KB       6 rows
  54. . . exported "U90"."RCVER"                               5.023 KB       1 rows
  55. . . exported "U90"."RLH"                                 15.01 KB     137 rows
  56. . . exported "U90"."RT"                                  7.835 KB       1 rows
  57. . . exported "U90"."SCR"                                 6.226 KB       1 rows
  58. . . exported "U90"."SCRL"                                6.929 KB      11 rows
  59. . . exported "U90"."SITE_DFATT"                          6.062 KB       5 rows
  60. . . exported "U90"."SITE_TFATT"                          8.265 KB       1 rows
  61. . . exported "U90"."TF"                                  8.226 KB       1 rows
  62. . . exported "U90"."TS"                                  9.257 KB       6 rows
  63. . . exported "U90"."TSATT"                               7.125 KB       6 rows
  64. . . exported "U90"."BCB"                                     0 KB       0 rows
  65. . . exported "U90"."BCR"                                     0 KB       0 rows
  66. . . exported "U90"."CCB"                                     0 KB       0 rows
  67. . . exported "U90"."CCF"                                     0 KB       0 rows
  68. . . exported "U90"."FB"                                      0 KB       0 rows
  69. . . exported "U90"."GRSP"                                    0 KB       0 rows
  70. . . exported "U90"."NRSP"                                    0 KB       0 rows
  71. . . exported "U90"."RR"                                      0 KB       0 rows
  72. . . exported "U90"."TEMPRES"                                 0 KB       0 rows
  73. . . exported "U90"."VPC_DATABASES"                           0 KB       0 rows
  74. . . exported "U90"."VPC_USERS"                               0 KB       0 rows
  75. . . exported "U90"."XAL"                                     0 KB       0 rows
  76. . . exported "U90"."XCF"                                     0 KB       0 rows
  77. . . exported "U90"."XDF"                                     0 KB       0 rows
  78. Master table "SYSTEM"."SYS_EXPORT_SCHEMA_01" successfully loaded/unloaded
  79. ******************************************************************************
  80. Dump file set for SYSTEM.SYS_EXPORT_SCHEMA_01 is:
  81.   /home/oracle/myrcatbackup/u90.dmp
  82. Job "SYSTEM"."SYS_EXPORT_SCHEMA_01" successfully completed at 22:36:00

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

  84. SQL*Plus: Release 11.2.0.1.0 Production on Sat Jan 7 22:36:48 2017

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

  86. SQL> drop user u90 cascade ;
  87. SP2-0640: Not connected
  88. SQL> conn / as sysdba
  89. Connected.
  90. SQL> drop user u90 cascade ;

  91. User dropped.

  92. SQL> exit
  93. Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
  94. With the Partitioning, OLAP, Data Mining and Real Application Testing options
  95. [oracle@station90 ~]$ impdp system/oracle_4U directory=dir1  dumpfile=u90.dmp schemas=u90

  96. Import: Release 11.2.0.1.0 - Production on Sat Jan 7 22:37:52 2017

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

  98. Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
  99. With the Partitioning, OLAP, Data Mining and Real Application Testing options
  100. Master table "SYSTEM"."SYS_IMPORT_SCHEMA_01" successfully loaded/unloaded
  101. Starting "SYSTEM"."SYS_IMPORT_SCHEMA_01":  system/******** directory=dir1 dumpfile=u90.dmp schemas=u90
  102. Processing object type SCHEMA_EXPORT/USER
  103. Processing object type SCHEMA_EXPORT/ROLE_GRANT
  104. Processing object type SCHEMA_EXPORT/DEFAULT_ROLE
  105. Processing object type SCHEMA_EXPORT/TABLESPACE_QUOTA
  106. Processing object type SCHEMA_EXPORT/PRE_SCHEMA/PROCACT_SCHEMA
  107. Processing object type SCHEMA_EXPORT/TYPE/TYPE_SPEC
  108. Processing object type SCHEMA_EXPORT/SEQUENCE/SEQUENCE
  109. Processing object type SCHEMA_EXPORT/SEQUENCE/GRANT/OWNER_GRANT/OBJECT_GRANT
  110. Processing object type SCHEMA_EXPORT/TABLE/TABLE
  111. Processing object type SCHEMA_EXPORT/TABLE/TABLE_DATA
  112. . . imported "U90"."ROUT"                                384.9 KB    5293 rows
  113. . . imported "U90"."CFS"                                 89.83 KB     157 rows
  114. . . imported "U90"."RSR"                                 79.72 KB     520 rows
  115. . . imported "U90"."AL"                                  16.14 KB       9 rows
  116. . . imported "U90"."BCF"                                 10.35 KB       2 rows
  117. . . imported "U90"."BDF"                                 17.10 KB       7 rows
  118. . . imported "U90"."BP"                                  16.91 KB      12 rows
  119. . . imported "U90"."BRL"                                 11.32 KB      16 rows
  120. . . imported "U90"."BS"                                  13.07 KB      11 rows
  121. . . imported "U90"."BSF"                                 7.882 KB       2 rows
  122. . . imported "U90"."CDF"                                 19.43 KB       6 rows
  123. . . imported "U90"."CKP"                                 8.718 KB       2 rows
  124. . . imported "U90"."CONF"                                8.257 KB      12 rows
  125. . . imported "U90"."CONFIG"                              5.421 KB       1 rows
  126. . . imported "U90"."DB"                                  5.820 KB       1 rows
  127. . . imported "U90"."DBINC"                               7.851 KB      12 rows
  128. . . imported "U90"."DF"                                  15.07 KB       5 rows
  129. . . imported "U90"."NODE"                                20.60 KB       1 rows
  130. . . imported "U90"."OFFR"                                8.898 KB       6 rows
  131. . . imported "U90"."ORL"                                 7.796 KB       6 rows
  132. . . imported "U90"."RCVER"                               5.023 KB       1 rows
  133. . . imported "U90"."RLH"                                 15.01 KB     137 rows
  134. . . imported "U90"."RT"                                  7.835 KB       1 rows
  135. . . imported "U90"."SCR"                                 6.226 KB       1 rows
  136. . . imported "U90"."SCRL"                                6.929 KB      11 rows
  137. . . imported "U90"."SITE_DFATT"                          6.062 KB       5 rows
  138. . . imported "U90"."SITE_TFATT"                          8.265 KB       1 rows
  139. . . imported "U90"."TF"                                  8.226 KB       1 rows
  140. . . imported "U90"."TS"                                  9.257 KB       6 rows
  141. . . imported "U90"."TSATT"                               7.125 KB       6 rows
  142. . . imported "U90"."BCB"                                     0 KB       0 rows
  143. . . imported "U90"."BCR"                                     0 KB       0 rows
  144. . . imported "U90"."CCB"                                     0 KB       0 rows
  145. . . imported "U90"."CCF"                                     0 KB       0 rows
  146. . . imported "U90"."FB"                                      0 KB       0 rows
  147. . . imported "U90"."GRSP"                                    0 KB       0 rows
  148. . . imported "U90"."NRSP"                                    0 KB       0 rows
  149. . . imported "U90"."RR"                                      0 KB       0 rows
  150. . . imported "U90"."TEMPRES"                                 0 KB       0 rows
  151. . . imported "U90"."VPC_DATABASES"                           0 KB       0 rows
  152. . . imported "U90"."VPC_USERS"                               0 KB       0 rows
  153. . . imported "U90"."XAL"                                     0 KB       0 rows
  154. . . imported "U90"."XCF"                                     0 KB       0 rows
  155. . . imported "U90"."XDF"                                     0 KB       0 rows
  156. Processing object type SCHEMA_EXPORT/TABLE/INDEX/INDEX
  157. Processing object type SCHEMA_EXPORT/TABLE/CONSTRAINT/CONSTRAINT
  158. Processing object type SCHEMA_EXPORT/TABLE/INDEX/STATISTICS/INDEX_STATISTICS
  159. Processing object type SCHEMA_EXPORT/PACKAGE/PACKAGE_SPEC
  160. Processing object type SCHEMA_EXPORT/PACKAGE/GRANT/OWNER_GRANT/OBJECT_GRANT
  161. Processing object type SCHEMA_EXPORT/FUNCTION/FUNCTION
  162. Processing object type SCHEMA_EXPORT/FUNCTION/GRANT/OWNER_GRANT/OBJECT_GRANT
  163. Processing object type SCHEMA_EXPORT/PACKAGE/COMPILE_PACKAGE/PACKAGE_SPEC/ALTER_PACKAGE_SPEC
  164. Processing object type SCHEMA_EXPORT/FUNCTION/ALTER_FUNCTION
  165. Processing object type SCHEMA_EXPORT/VIEW/VIEW
  166. Processing object type SCHEMA_EXPORT/VIEW/GRANT/OWNER_GRANT/OBJECT_GRANT
  167. Processing object type SCHEMA_EXPORT/PACKAGE/PACKAGE_BODY
  168. Processing object type SCHEMA_EXPORT/TYPE/TYPE_BODY
  169. Processing object type SCHEMA_EXPORT/TABLE/CONSTRAINT/REF_CONSTRAINT
  170. Processing object type SCHEMA_EXPORT/TABLE/TRIGGER
  171. Job "SYSTEM"."SYS_IMPORT_SCHEMA_01" successfully completed at 22:38:13

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

  173. SQL*Plus: Release 11.2.0.1.0 Production on Sat Jan 7 23:04:00 2017

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

  175. SQL> conn u90/oracle_4U
  176. Connected.
  177. SQL> select  * from db;

  178.     DB_KEY        DB_ID CURR_DBINC_KEY
  179. ---------- ---------- --------------
  180.          2 1343950367                   4

  181. SQL> exit
  182. Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
  183. With the Partitioning, OLAP, Data Mining and Real Application Testing options
  184. [oracle@station90 ~]$ rman catalog u90/oracle_4U

  185. Recovery Manager: Release 11.2.0.1.0 - Production on Sat Jan 7 23:05:39 2017

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

  187. connected to recovery catalog database

  188. RMAN> import catalog u90/oracle_4U@utforcl;

  189. Starting import catalog at 2017-01-07:23:06:35
  190. connected to source recovery catalog database
  191. import validation complete
  192. RMAN-00571: ===========================================================
  193. RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
  194. RMAN-00571: ===========================================================
  195. RMAN-03002: failure of import catalog command at 01/07/2017 23:06:36
  196. RMAN-06004: ORACLE error from recovery catalog database: RMAN-20512: source database already registered in recovery catalog

  197. RMAN> import catalog u90/oracle_4U@utforcl dbid=1347195613;

  198. Starting import catalog at 2017-01-07:23:08:28
  199. connected to source recovery catalog database
  200. import validation complete
  201. database unregistered from the source recovery catalog
  202. Finished import catalog at 2017-01-07:23:08:31

  203. RMAN> exit


  204. Recovery Manager complete.
  205. [oracle@station90 ~]$ sqlplus /nolog

  206. SQL*Plus: Release 11.2.0.1.0 Production on Sat Jan 7 23:12:53 2017

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

  208. SQL> conn u90/oracle_4U
  209. Connected.
  210. SQL> select  * from db;

  211.     DB_KEY        DB_ID CURR_DBINC_KEY
  212. ---------- ---------- --------------
  213.          2 1343950367                   4
  214.       3575 1347195613                3576

  215. SQL> conn / as sysdba
  216. Connected.
  217. SQL> drop user u90 cascade;
  218. drop user u90 cascade
  219. *
  220. ERROR at line 1:
  221. ORA-01940: cannot drop a user that is currently connected


  222. SQL> drop user u90 cascade;

  223. User dropped.

  224. SQL> create user u90 identified by oracle_4U  default tablespace rcat quota unlimited on rcat ;

  225. User created.

  226. SQL> grant recovery_catalog_owner to u90;

  227. Grant succeeded.

  228. SQL> exit
  229. Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
  230. With the Partitioning, OLAP, Data Mining and Real Application Testing options
  231. [oracle@station90 ~]$ rman catalog u90/oracle_4U

  232. Recovery Manager: Release 11.2.0.1.0 - Production on Sat Jan 7 23:20:20 2017

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

  234. connected to recovery catalog database

  235. RMAN> create catalog ;

  236. recovery catalog created

  237. RMAN> exit


  238. Recovery Manager complete.
  239. [oracle@station90 ~]$ sqlplus /nolog

  240. SQL*Plus: Release 11.2.0.1.0 Production on Sat Jan 7 23:21:06 2017

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

  242. SQL> conn / as sysdba
  243. Connected.
  244. SQL> create user v901 identified by oracle_4U default tablespace rcat quota unlimited on rcat ;

  245. User created.

  246. SQL> create user v902 identified by oracle_4U default tablespace rcat quota unlimited on rcat ;

  247. User created.

  248. SQL> grant recovery_catalog_owner to v901;

  249. Grant succeeded.

  250. SQL> grant recovery_catalog_owner to v902;

  251. Grant succeeded.

  252. SQL>
  253. SQL>
复制代码




回复

使用道具 举报

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

本版积分规则

QQ|手机版|Bo's Oracle Station   

GMT+8, 2024-4-20 18:58 , Processed in 0.037863 second(s), 24 queries .

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