sitemap

RSS地图

收藏本站

设为首页

Oracle研究中心

当前位置:Oracle研究中心 > 运维DBA >

【学习笔记】Oracle迁移 数据库文件迁移方法案例

时间:2016-07-24 21:28   来源:Oracle研究中心   作者:惜分飞   点击:

天萃荷净 运维DBA反映测试环境的Oracle数据库的数据文件需要改变迁移存储位置

1、关闭数据库
shutdown immediate;
2、移动数据文件
mv /u01/ora10g/oradata/oracleplust /u02/ora10g/oradata
3、数据库至于nomount状态
startup nomount;
4、创建pfile
create pfile from spfile;
5、修改pfile中control_files
6、使用pfile把数据库至于mount状态
shutdown immediate;
startup mount pfile=/u01/ora10g/product/10.2.0/db_1/dbs/initoracleplus.ora;
7、修改文件位置

--查询select name from v$datafile;
alter database rename file '/u01/ora10g/oradata/oracleplus/system01.dbf' to '/u02/ora10g/oradata/oracleplus/system01.dbf';
alter database rename file '/u01/ora10g/oradata/oracleplus/undotbs01.dbf' to '/u02/ora10g/oradata/oracleplus/undotbs01.dbf';
alter database rename file '/u01/ora10g/oradata/oracleplus/sysaux01.dbf' to '/u02/ora10g/oradata/oracleplus/sysaux01.dbf';
alter database rename file '/u01/ora10g/oradata/oracleplus/users01.dbf' to '/u02/ora10g/oradata/oracleplus/users01.dbf';
 --查询select member from v$logfile;
alter database rename file '/u01/ora10g/oradata/oracleplus/redo01.log' to '/u02/ora10g/oradata/oracleplus/redo01.log';
alter database rename file '/u01/ora10g/oradata/oracleplus/redo02.log' to '/u02/ora10g/oradata/oracleplus/redo02.log';
--查询select name from v$tempfile;
alter database rename file '/u01/ora10g/oradata/oracleplus/temp01.dbf' to '/u02/ora10g/oradata/oracleplus/temp01.dbf';

8、创建spfile
create spfile to pfile;
9、重启数据库使用spfile启动
shutdown immediate;
startup;


--------------------------------------ORACLE-DBA----------------------------------------

最权威、专业的Oracle案例资源汇总之【学习笔记】Oracle迁移 数据库文件迁移方法案例

本文由大师惜分飞原创分享,网址:http://www.oracleplus.net/arch/869.html

Oracle研究中心

关键词:

Oracle迁移

数据库文件迁移方法案例

改变Oracle数据文件位置方法