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;