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;
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;
--------------------------------------
D:\ORACLE\ORADATA\XSFREE\TEMP01.DBF
(2)创建pfile,备份spfile
sql> create pfile from spfile;
move SPFILEXSFREE.ORA SPFILEXSFREE.ORA_bak
sql> shutdown immediate;
将D:\oracle\oradata下的文件复制到D:\oracle\oradata_bak下(本测试是将oradata目录下的数据库文件迁移至oradata_bak下)
*.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)打开数据库
sql> alter database open;
sql> create spfile from pfile='D:\oracle\product\11.2.0\dbhome_1\database\INITxsfree.ORA';
原文链接:https://www.f2er.com/oracle/206805.html