1.对users表空间执行手动热备
SQL> alter tablespace users begin backup;
Tablespace altered.
SQL> select checkpoint_change# from v$datafile;
CHECKPOINT_CHANGE#
------------------
2924413
2924413
2924413
2925038
2924413
SQL> !cp -v /u01/app/oracle/oradata/orcl/users01.dbf /u03
`/u01/app/oracle/oradata/orcl/users01.dbf' -> `/u03/users01.dbf'
SQL> alter tablespace users end backup;
Tablespace altered.
2.使用rman连接target数据库以及catalog数据库
[oracle@oel ~]$ rman target sys/oracle@orcl catalog cata_user/oracle@catadb
Recovery Manager: Release 11.2.0.1.0 - Production on Tue May 24 14:56:46 2016
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
connected to target database: ORCL (DBID=1437288826)
connected to recovery catalog database
RMAN> list copy of tablespace users;
specification does not match any datafile copy in the repository
3.手动注册刚才的热备文件到catalog
RMAN> catalog datafilecopy '/u03/users01.dbf';
cataloged datafile copy
datafile copy file name=/u03/users01.dbf RECID=2 STAMP=912697893
RMAN> list copy of tablespace users;
List of Datafile Copies
=======================
Key File S Completion Time Ckp SCN Ckp Time
------- ---- - --------------- ---------- ---------------
358 4 A 24-MAY-16 2925038 24-MAY-16
Name: /u03/users01.dbf
4.取消手动备份文件的注册信息
RMAN> change datafilecopy '/u03/users01.dbf' uncatalog;
uncataloged datafile copy
datafile copy file name=/u03/users01.dbf RECID=2 STAMP=912697893
Uncataloged 1 objects
RMAN> list copy of tablespace users;
specification does not match any datafile copy in the repository
SQL> alter tablespace users begin backup;
Tablespace altered.
SQL> select checkpoint_change# from v$datafile;
CHECKPOINT_CHANGE#
------------------
2924413
2924413
2924413
2925038
2924413
SQL> !cp -v /u01/app/oracle/oradata/orcl/users01.dbf /u03
`/u01/app/oracle/oradata/orcl/users01.dbf' -> `/u03/users01.dbf'
SQL> alter tablespace users end backup;
Tablespace altered.
2.使用rman连接target数据库以及catalog数据库
[oracle@oel ~]$ rman target sys/oracle@orcl catalog cata_user/oracle@catadb
Recovery Manager: Release 11.2.0.1.0 - Production on Tue May 24 14:56:46 2016
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
connected to target database: ORCL (DBID=1437288826)
connected to recovery catalog database
RMAN> list copy of tablespace users;
specification does not match any datafile copy in the repository
3.手动注册刚才的热备文件到catalog
RMAN> catalog datafilecopy '/u03/users01.dbf';
cataloged datafile copy
datafile copy file name=/u03/users01.dbf RECID=2 STAMP=912697893
RMAN> list copy of tablespace users;
List of Datafile Copies
=======================
Key File S Completion Time Ckp SCN Ckp Time
------- ---- - --------------- ---------- ---------------
358 4 A 24-MAY-16 2925038 24-MAY-16
Name: /u03/users01.dbf
4.取消手动备份文件的注册信息
RMAN> change datafilecopy '/u03/users01.dbf' uncatalog;
uncataloged datafile copy
datafile copy file name=/u03/users01.dbf RECID=2 STAMP=912697893
Uncataloged 1 objects
RMAN> list copy of tablespace users;
specification does not match any datafile copy in the repository