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

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 2208|回复: 0
打印 上一主题 下一主题

[Oracle] 在ASM磁盘组之间移动文件

[复制链接]
跳转到指定楼层
楼主
发表于 2020-11-12 13:41:06 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
本帖最后由 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>
                                                   

分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏 支持支持 反对反对
回复

使用道具 举报

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

本版积分规则

QQ|手机版|小黑屋|重庆思庄Oracle、Redhat认证学习论坛 ( 渝ICP备12004239号-4 )

GMT+8, 2024-11-26 16:46 , Processed in 0.078131 second(s), 21 queries .

重庆思庄学习中心论坛-重庆思庄科技有限公司论坛

© 2001-2020

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