在ASM磁碟組之間移動檔案

jichengjie發表於2015-09-17

RMAN> report schema;

using target database control file instead of recovery catalog
Report of database schema for database with db_unique_name ORAL

List of Permanent Datafiles
===========================
File Size(MB) Tablespace           RB segs Datafile Name
---- -------- -------------------- ------- ------------------------
1    710      SYSTEM               ***     +DATA/oral/datafile/system.287.890652577
2    570      SYSAUX               ***     +DATA/oral/datafile/sysaux.286.890652577
3    110      UNDOTBS1             ***     +DATA/oral/datafile/undotbs1.289.890652609
4    5        USERS                ***     +DATA/oral/datafile/users.291.890652625
5    313      EXAMPLE              ***     +DATA/oral/datafile/example.285.890652577
6    1000     TBS_EPORT            ***     +DATA/oral/datafile/tbs_eport.288.890652577

List of Temporary Files
=======================
File Size(MB) Tablespace           Maxsize(MB) Tempfile Name
---- -------- -------------------- ----------- --------------------
1    100      TEMP                 32767       +DATA/oral/tempfile/temp.295.890661063

RMAN> backup  as copy datafile 4  format '+FRA';

Starting backup at 17-SEP-15
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=68 device type=DISK
channel ORA_DISK_1: starting datafile copy
input datafile file number=00004 name=+DATA/oral/datafile/users.291.890652625
output file name=+FRA/oral/datafile/users.1353.890664349 tag=TAG20150917T144548 RECID=15 STAMP=890664348
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:01
Finished backup at 17-SEP-15
RMAN> sql "alter database datafile 4 offline";

sql statement: alter database datafile 4 offline

RMAN> switch datafile 4 to copy;

datafile 4 switched to datafile copy "+FRA/oral/datafile/users.1353.890664349"

RMAN> recover datafile '+FRA/oral/datafile/users.1353.890664349';

Starting recover at 17-SEP-15
using channel ORA_DISK_1

starting media recovery
media recovery complete, elapsed time: 00:00:00

Finished recover at 17-SEP-15
RMAN> sql "alter database datafile ''+FRA/oral/datafile/users.1353.890664349'' online";

sql statement: alter database datafile ''+FRA/oral/datafile/users.1353.890664349'' online

RMAN> delete datafilecopy  '+DATA/oral/datafile/users.1353.890664349';

released channel: ORA_DISK_1
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=68 device type=DISK
List of Datafile Copies
=======================

Key     File S Completion Time Ckp SCN    Ckp Time      
------- ---- - --------------- ---------- ---------------
17      4    A 17-SEP-15       1109393    17-SEP-15     
        Name: +DATA/oral/datafile/users.1353.890664349
        Tag: TAG20150917T144548


Do you really want to delete the above objects (enter YES or NO)? yes
deleted datafile copy
datafile copy file name=+DATA/oral/datafile/users.1353.890664349 RECID=17 STAMP=890666534
Deleted 1 objects


RMAN>

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/26870952/viewspace-1802266/,如需轉載,請註明出處,否則將追究法律責任。

相關文章