|
本帖最后由 botang 于 2017-5-12 09:15 编辑
WINDOWS上创建Recovery Catalog:
- Microsoft Windows [版本 6.1.7600]
- 版权所有 (c) 2009 Microsoft Corporation。保留所有权利。
- C:\Users\Administrator>sqlplus /nolog
- SQL*Plus: Release 11.2.0.1.0 Production on 星期四 5月 11 19:40:32 2017
- Copyright (c) 1982, 2010, Oracle. All rights reserved.
- SQL> conn / as sysdba
- 已连接。
- SQL> select * from v$version;
- BANNER
- --------------------------------------------------------------------------------
- Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
- PL/SQL Release 11.2.0.1.0 - Production
- CORE 11.2.0.1.0 Production
- TNS for 32-bit Windows: Version 11.2.0.1.0 - Production
- NLSRTL Version 11.2.0.1.0 - Production
- SQL> select * from v$version;
- BANNER
- --------------------------------------------------------------------------------
- Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
- PL/SQL Release 11.2.0.1.0 - Production
- CORE 11.2.0.1.0 Production
- TNS for 32-bit Windows: Version 11.2.0.1.0 - Production
- NLSRTL Version 11.2.0.1.0 - Production
- SQL> create tablespace rcattbs datafile 'C:\app\Administrator\oradata\utforcl\
- rcattbs.dbf' size 30M autoextend on maxsize 2G ;
- 表空间已创建。
- SQL> create user u90 identified by oracle_4U tablespace rcattbs quota unlimited
- on rcattbs;
- create user u90 identified by oracle_4U tablespace rcattbs quota unlimited on rc
- attbs
- *
- 第 1 行出现错误:
- ORA-00922: 选项缺失或无效
- SQL> create user u90 identified by oracle_4U default tablespace rcattbs quota u
- nlimited on rcattbs;
- 用户已创建。
- SQL> grant recovery_Catalog_owner to u90;
- 授权成功。
- SQL> exit
- 从 Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
- With the Partitioning, OLAP, Data Mining and Real Application Testing options 断
- 开
- C:\Users\Administrator>rman catalog u90/oracle_4U
- 恢复管理器: Release 11.2.0.1.0 - Production on 星期四 5月 11 19:53:39 2017
- Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
- 连接到恢复目录数据库
- RMAN> create catalog ;
- 恢复目录已创建
- RMAN>
复制代码
测试磁带机的CMDFILE(可以变成Stored Script):
- run{
- set newname for datafile 5 to '/home/oracle/examplettio.dbf';
- restore datafile 5;
- delete datafilecopy '/home/oracle/examplettio.dbf';
- }
复制代码 验证v$backup_datafile和rc_backup_datafile相关的几条SQL语句:
- select * from v$backup_datafile;
- create user u90 identified by oracle_4U quota unlimited on users;
- grant recovery_catalog_owner to u90;
复制代码 数据泵备份Recovery Catalog:
- [oracle@station90 ~]$ impdp system/oracle_4U directory=mydir dumpfile=u90.dmp schemas=u90
- Import: Release 11.2.0.1.0 - Production on Thu May 11 21:41:20 2017
- Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
- Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
- With the Partitioning, OLAP, Data Mining and Real Application Testing options
- Master table "SYSTEM"."SYS_IMPORT_SCHEMA_01" successfully loaded/unloaded
- Starting "SYSTEM"."SYS_IMPORT_SCHEMA_01": system/******** directory=mydir dumpfile=u90.dmp schemas=u90
- Processing object type SCHEMA_EXPORT/USER
- Processing object type SCHEMA_EXPORT/ROLE_GRANT
- Processing object type SCHEMA_EXPORT/DEFAULT_ROLE
- Processing object type SCHEMA_EXPORT/TABLESPACE_QUOTA
- Processing object type SCHEMA_EXPORT/PRE_SCHEMA/PROCACT_SCHEMA
- Processing object type SCHEMA_EXPORT/TYPE/TYPE_SPEC
- Processing object type SCHEMA_EXPORT/SEQUENCE/SEQUENCE
- Processing object type SCHEMA_EXPORT/SEQUENCE/GRANT/OWNER_GRANT/OBJECT_GRANT
- Processing object type SCHEMA_EXPORT/TABLE/TABLE
- Processing object type SCHEMA_EXPORT/TABLE/TABLE_DATA
- . . imported "U90"."ROUT" 34.67 MB 493537 rows
- . . imported "U90"."CFS" 89.83 KB 157 rows
- . . imported "U90"."AL" 17.05 KB 14 rows
- . . imported "U90"."BCF" 10.64 KB 6 rows
- . . imported "U90"."BDF" 18.71 KB 22 rows
- . . imported "U90"."BP" 21.57 KB 36 rows
- . . imported "U90"."BRL" 10.74 KB 8 rows
- . . imported "U90"."BS" 14.85 KB 36 rows
- . . imported "U90"."BSF" 8.039 KB 6 rows
- . . imported "U90"."CDF" 18.51 KB 1 rows
- . . imported "U90"."CKP" 8.882 KB 5 rows
- . . imported "U90"."CONF" 8.507 KB 16 rows
- . . imported "U90"."CONFIG" 5.421 KB 1 rows
- . . imported "U90"."DB" 5.835 KB 2 rows
- . . imported "U90"."DBINC" 7.710 KB 8 rows
- . . imported "U90"."DF" 15.42 KB 10 rows
- . . imported "U90"."NODE" 20.74 KB 2 rows
- . . imported "U90"."OFFR" 9.132 KB 11 rows
- . . imported "U90"."ORL" 8.007 KB 9 rows
- . . imported "U90"."RCVER" 5.023 KB 1 rows
- . . imported "U90"."RLH" 13.63 KB 109 rows
- . . imported "U90"."RSR" 33.75 KB 158 rows
- . . imported "U90"."RT" 7.859 KB 2 rows
- . . imported "U90"."SCR" 6.242 KB 2 rows
- . . imported "U90"."SCRL" 6.609 KB 10 rows
- . . imported "U90"."SITE_DFATT" 6.320 KB 10 rows
- . . imported "U90"."SITE_TFATT" 8.398 KB 3 rows
- . . imported "U90"."TF" 8.304 KB 3 rows
- . . imported "U90"."TS" 9.507 KB 12 rows
- . . imported "U90"."TSATT" 7.257 KB 12 rows
- . . imported "U90"."BCB" 0 KB 0 rows
- . . imported "U90"."BCR" 0 KB 0 rows
- . . imported "U90"."CCB" 0 KB 0 rows
- . . imported "U90"."CCF" 0 KB 0 rows
- . . imported "U90"."FB" 0 KB 0 rows
- . . imported "U90"."GRSP" 0 KB 0 rows
- . . imported "U90"."NRSP" 0 KB 0 rows
- . . imported "U90"."RR" 0 KB 0 rows
- . . imported "U90"."TEMPRES" 0 KB 0 rows
- . . imported "U90"."VPC_DATABASES" 0 KB 0 rows
- . . imported "U90"."VPC_USERS" 0 KB 0 rows
- . . imported "U90"."XAL" 0 KB 0 rows
- . . imported "U90"."XCF" 0 KB 0 rows
- . . imported "U90"."XDF" 0 KB 0 rows
- Processing object type SCHEMA_EXPORT/TABLE/INDEX/INDEX
- Processing object type SCHEMA_EXPORT/TABLE/CONSTRAINT/CONSTRAINT
- Processing object type SCHEMA_EXPORT/TABLE/INDEX/STATISTICS/INDEX_STATISTICS
- Processing object type SCHEMA_EXPORT/PACKAGE/PACKAGE_SPEC
- Processing object type SCHEMA_EXPORT/PACKAGE/GRANT/OWNER_GRANT/OBJECT_GRANT
- Processing object type SCHEMA_EXPORT/FUNCTION/FUNCTION
- Processing object type SCHEMA_EXPORT/FUNCTION/GRANT/OWNER_GRANT/OBJECT_GRANT
- Processing object type SCHEMA_EXPORT/PACKAGE/COMPILE_PACKAGE/PACKAGE_SPEC/ALTER_PACKAGE_SPEC
- Processing object type SCHEMA_EXPORT/FUNCTION/ALTER_FUNCTION
- Processing object type SCHEMA_EXPORT/VIEW/VIEW
- Processing object type SCHEMA_EXPORT/VIEW/GRANT/OWNER_GRANT/OBJECT_GRANT
- Processing object type SCHEMA_EXPORT/PACKAGE/PACKAGE_BODY
- Processing object type SCHEMA_EXPORT/TYPE/TYPE_BODY
- Processing object type SCHEMA_EXPORT/TABLE/CONSTRAINT/REF_CONSTRAINT
- Processing object type SCHEMA_EXPORT/TABLE/TRIGGER
- Job "SYSTEM"."SYS_IMPORT_SCHEMA_01" successfully completed at 21:42:31
- [oracle@station90 ~]$ sqlplus /nolog
- SQL*Plus: Release 11.2.0.1.0 Production on Thu May 11 21:42:46 2017
- Copyright (c) 1982, 2009, Oracle. All rights reserved.
- SQL> conn / as sysdba
- Connected.
- SQL> alter user u90 identified by oracle_4U;
- User altered.
- SQL> exit
- Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
- With the Partitioning, OLAP, Data Mining and Real Application Testing options
- [oracle@station90 ~]$
复制代码
|
|