重庆思庄Oracle、Redhat认证学习论坛

标题: 在ASM磁盘组之间移动文件 [打印本页]

作者: jiawang    时间: 2020-11-12 13:41
标题: 在ASM磁盘组之间移动文件
本帖最后由 jiawang 于 2020-11-12 13:42 编辑

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-20
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-20

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-20
using channel ORA_DISK_1
starting media recovery
media recovery complete, elapsed time: 00:00:00
Finished recover at 17-SEP-20

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-20      
        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>
                                                   






欢迎光临 重庆思庄Oracle、Redhat认证学习论坛 (http://bbs.cqsztech.com/) Powered by Discuz! X3.2