oracle 控制文件迁移,Oracle控制文件日志文件数据文件迁移

Oracle控制文件日志文件数据文件迁移

时间:2017-10-19

共 986 人浏览

1.查看表空间对应关系

d:

cd D:appadministratorproduct11.2.0dbhome_1BIN

sqlplus sys/infinitt@spectra as sysdba

select * from v$tablespace;

2.关闭数据库

shutdown immediate;

3.复制数据文件到新的位置

4.启动数据库到mount状态

startup mount;

5.重命名数据文件

alter database rename file 'H:oradataspectraRISDAT01.DBF' to 'L:oradataspectraRISDAT01.DBF';

alter database rename file 'H:oradataspectraRISDAT02.DBF' to 'L:oradataspectraRISDAT02.DBF';

alter database rename file 'H:oradataspectraSPDAT01.DBF' to 'L:oradataspectraSPDAT01.DBF';

alter database rename file 'H:oradataspectraSPDAT02.DBF' to 'L:oradataspectraSPDAT02.DBF';

alter database rename file 'H:oradataspectraSPIDX01.DBF' to 'L:oradataspectraSPIDX01.DBF';

alter database rename file 'H:oradataspectraSPIDX02.DBF' to 'L:oradataspectraSPIDX02.DBF';

alter database rename file 'H:oradataspectraSYSAUX01.DBF' to 'L:oradataspectraSYSAUX01.DBF';

alter database rename file 'H:oradataspectraSYSTEM01.DBF' to 'L:oradataspectraSYSTEM01.DBF';

alter database rename file 'H:oradataspectraTEMP01.DBF' to 'L:oradataspectraTEMP01.DBF';

alter database rename file 'H:oradataspectraUNDOTBS01.DBF' to 'L:oradataspectraUNDOTBS01.DBF';

alter database rename file 'H:oradataspectraUSERS01.DBF' to 'L:oradataspectraUSERS01.DBF';

5.重命名日志文件

alter database rename file 'H:oradataspectraREDO01.LOG' to 'L:oradataspectraREDO01.LOG';

alter database rename file 'H:oradataspectraREDO02.LOG' to 'L:oradataspectraREDO02.LOG';

alter database rename file 'H:oradataspectraREDO03.LOG' to 'L:oradataspectraREDO03.LOG';

6.打开数据库并查看状态

alter database open;

shutdown immediate;

startup;

select * from v$logfile;

select a.group#, a.status, b.member,a.bytes/1024/1024 sizeM from v$log a ,v$logfile b where a.group#=b.group#;

alter system switch logfile;//切换日志

===========================================================

7.查看控制文件

select name from v$controlfile;

8.恢复控制文件

shutdown immediate;

startup nomount;

quit

rmant target /

restore controlfile to 'L:oradataspectraCONTROL01.CTL' from 'H:oradataspectraCONTROL01.CTL' ;

restore controlfile to 'L:oradataspectraCONTROL02.CTL' from 'H:oradataspectraCONTROL02.CTL' ;

restore controlfile to 'L:oradataspectraCONTROL03.CTL' from 'H:oradataspectraCONTROL03.CTL' ;

quit //退出rman

9..修改控制文件位置

sqlplus / as sysdba

alter system set control_files='L:oradataspectraCONTROL01.CTL','L:oradataspectraCONTROL02.CTL','L:oradataspectraCONTROL03.CTL'  scope=spfile;

10.启动数据库

startup mount force;

select * from v$controlfile;

alter database open;

select * from spectra.version;

11.查看数据库以上更改的信息 select name from v$controlfile;

select * from v$logfile;

select * from v$tablespace;

来源:本文为线上采编,如涉及作品内容、版权和其它问题,请及时与本网联系,我们将在第一时间删除!

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值