All data files of the local disk need to be moved to storage.
Summary of steps:
1.shut Immediate Stop Library
2.host CP dbfile to New Path
3. Modify the position of the controlfile in the parameter to boot the database to mount
4.rename Related Documents
5.alter database open;
This specific implementation steps:
First, check the files that need to be moved to avoid missing.
Sql>
Select name from V$datafile
UNION ALL
Select name from V$controlfile
UNION ALL
Select name from V$tempfile
UNION ALL
Select member from V$logfile;
NAME
--------------------------------------------------
/oracle/oradata/test/system01.dbf
/oracle/oradata/test/undotbs01.dbf
/oracle/oradata/test/sysaux01.dbf
/oracle/oradata/test/users01.dbf
/ORADATA1/TEST01.DBF <--------------Note that the file is not in the default directory.
/oracle/oradata/test/control01.ctl
/oracle/oradata/test/control02.ctl
/oracle/oradata/test/control03.ctl
/oracle/oradata/test/temp01.dbf
/oracle/oradata/test/redo03.log
/oracle/oradata/test/redo02.log
/oracle/oradata/test/redo01.log
Rows selected.
Sql>
Second, use the statement to generate rename statements.
DataFile:
Sql> SELECT ' ALTER DATABASE rename file ' | | Chr (10) | | Chr (39) | | name | | Chr (39) | | Chr | | | ' to ' | | Replace (name, '/oracle/oradata/test ', '/oracle/oradata/u1/test ') | | '; ' AAA from V$datafile;
Aaa
--------------------------------------------------------------------------------------------------------------
ALTER DATABASE Rename file
'/ORACLE/ORADATA/TEST/SYSTEM01.DBF '
To '/oracle/oradata/u1/test/system01.dbf ';
ALTER DATABASE Rename file
'/ORACLE/ORADATA/TEST/UNDOTBS01.DBF '
To '/oracle/oradata/u1/test/undotbs01.dbf ';
ALTER DATABASE Rename file
'/ORACLE/ORADATA/TEST/SYSAUX01.DBF '
To '/oracle/oradata/u1/test/sysaux01.dbf ';
ALTER DATABASE Rename file
'/ORACLE/ORADATA/TEST/USERS01.DBF '
To '/oracle/oradata/u1/test/users01.dbf ';
ALTER DATABASE Rename file
'/ORADATA1/TEST01.DBF '
To '/oracle/oradata/u1/test/test01.dbf '; <------------------------manually modify it.
Controlfile:
Control file location Modification does not need to pass rename, directly modify the parameter file on the line.
Tempfile:
Sql> SELECT ' ALTER DATABASE rename file ' | | Chr (10) | | Chr (39) | | name | | Chr (39) | | Chr | | | ' to ' | | Replace (name, '/oracle/oradata/test ', '/oracle/oradata/u1/test ') | | '; ' AAA from V$tempfile;
Aaa
--------------------------------------------------------------------------------------------------------------
ALTER DATABASE Rename file
'/ORACLE/ORADATA/TEST/TEMP01.DBF '
To '/oracle/oradata/u1/test/temp01.dbf ';
Redolog
Sql> SELECT ' ALTER DATABASE rename file ' | | Chr (10) | | Chr (39) | | Member | | Chr (39) | | Chr | | | ' to ' | | Replace (member, '/oracle/oradata/test ', '/oracle/oradata/u1/test ') | | '; ' AAA from V$logfile
2;
Aaa
--------------------------------------------------------------------------------------------------------------
ALTER DATABASE Rename file
'/oracle/oradata/test/redo03.log '
To '/oracle/oradata/u1/test/redo03.log ';
ALTER DATABASE Rename file
'/oracle/oradata/test/redo02.log '
To '/oracle/oradata/u1/test/redo02.log ';
ALTER DATABASE Rename file
'/oracle/oradata/test/redo01.log '
To '/oracle/oradata/u1/test/redo01.log ';
Third, stop the library, copy files
Sql>shut immediate;
sql>!
cp/oracle/oradata/test/*/oracle/oradata/u1/test/
cp/oradata1/test01.dbf/oracle/oradata/u1/test/
Four, modify the parameter file description of the Controlfile.
V, Sql>startup Mount
Sql> executes the rename statement that is generated in the second step.
Sql>alter database open;
Database file Shift (i)