Oracle数据库文件迁移步骤
(1)首先确认需要迁移的数据库文件
SQL> select name from v$controlfile;
NAME
-----------------------------------------
D:\ORACLE\ORADATA\XSFREE\CONTROL01.CTL
D:\ORACLE\ORADATA\XSFREE\CONTROL02.CTL
SQL> select name from v$datafile;
NAME
-----------------------------------------
D:\ORACLE\ORADATA\XSFREE\SYSTEM01.DBF
D:\ORACLE\ORADATA\XSFREE\SYSAUX01.DBF
D:\ORACLE\ORADATA\XSFREE\UNDOTBS01.DBF
D:\ORACLE\ORADATA\XSFREE\USERS01.DBF
SQL> select member from v$logfile;
MEMBER
---------------------------------------------
D:\ORACLE\ORADATA\XSFREE\REDO01.LOG
D:\ORACLE\ORADATA\XSFREE\REDO02.LOG
D:\ORACLE\ORADATA\XSFREE\REDO03.LOG
SQL> select name from v$tempfile;
NAME
--------------------------------------
D:\ORACLE\ORADATA\XSFREE\TEMP01.DBF
(2)创建pfile,备份spfile
SQL> create pfile from spfile;
move SPFILEXSFREE.ORA SPFILEXSFREE.ORA_bak
(3)关闭数据库
SQL> shutdown immediate;
(4)迁移数据库文件
将D:\oracle\oradata下的文件复制到D:\oracle\oradata_bak下(本测试是将oradata目录下的数据库文件迁移至oradata_bak下)
(5)修改pfile中控制文件路径
*.control_files='D:\oracle\oradata_bak\xsfree\control01.ctl','D:\oracle\oradata_bak\xsfree\control02.ctl'
(6)rename文件
SQL> startup mount pfile='D:\oracle\product\11.2.0\dbhome_1\database\INITxsfree.ORA';
SQL> alter database rename file 'D:\ORACLE\ORADATA\XSFREE\SYSTEM01.DBF' to 'D:\ORACLE\ORADATA_BAK\XSFREE\SYSTEM01.DBF';
SQL> alter database rename file 'D:\ORACLE\ORADATA\XSFREE\SYSAUX01.DBF' to 'D:\ORACLE\ORADATA_BAK\XSFREE\SYSAUX01.DBF';
SQL> alter database rename file 'D:\ORACLE\ORADATA\XSFREE\UNDOTBS01.DBF' to 'D:\ORACLE\ORADATA_BAK\XSFREE\UNDOTBS01.DBF';
SQL> alter database rename file 'D:\ORACLE\ORADATA\XSFREE\USERS01.DBF' to 'D:\ORACLE\ORADATA_BAK\XSFREE\USERS01.DBF';
SQL> alter database rename file 'D:\ORACLE\ORADATA\XSFREE\REDO01.LOG' to 'D:\ORACLE\ORADATA_BAK\XSFREE\REDO01.LOG';
SQL> alter database rename file 'D:\ORACLE\ORADATA\XSFREE\REDO02.LOG' to 'D:\ORACLE\ORADATA_BAK\XSFREE\REDO02.LOG';
SQL> alter database rename file 'D:\ORACLE\ORADATA\XSFREE\REDO03.LOG' to 'D:\ORACLE\ORADATA_BAK\XSFREE\REDO03.LOG';
SQL> alter database rename file 'D:\ORACLE\ORADATA\XSFREE\TEMP01.DBF' to 'D:\ORACLE\ORADATA_BAK\XSFREE\TEMP01.DBF';
(7)打开数据库,open和后面的创建spfile 无顺序性 先执行哪个都可
SQL> alter database open;
SQL> create spfile from pfile='D:\oracle\product\11.2.0\dbhome_1\database\INITxsfree.ORA';
create pfile='e:\b.txt' from spfile; --验证新spfile内容已经修改
(8) 使用新spfile重启库
shutdown immediate
startup
网页标题:迁移控制文件方法(二)
网页网址:https://www.cdcxhl.com/article32/jpsgpc.html
成都网站建设公司_创新互联,为您提供云服务器、企业网站制作、网站收录、品牌网站设计、网页设计公司、定制开发
广告
声明:本网站发布的内容(图片、视频和文字)以用户投稿、用户转载内容为主,如果涉及侵权请尽快告知,我们将会在第一时间删除。文章观点不代表本网站立场,如需处理请联系客服。电话:028-86922220;邮箱:631063699@qq.com。内容未经允许不得转载,或转载时需注明来源:
创新互联