数据文件位置调整

联系:手机/微信(+86 17813235971) QQ(107644445)QQ咨询惜分飞

标题:数据文件位置调整

作者:惜分飞©版权所有[未经本人同意,不得以任何形式转载,否则有进一步追究法律责任的权利.]

1、关闭数据库
shutdown immediate;
2、移动数据文件
mv /u01/ora10g/oradata/ggtarget /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/initggtarge.ora;
7、修改文件位置

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

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

此条目发表在 Oracle备份恢复 分类目录。将固定链接加入收藏夹。

评论功能已关闭。