Requirement: migrate the Oracle 9205 database of the original system to a new server and array. The original system has GB of data and needs to stop the services of the original system for cold backup and recovery.
The solution is as follows:
◆ 1. install an oracle 9206 database on the new server and array;
◆ 2. Stop oracle 9205 of the original system;
◆ 3. Cold copy the data from the original system to the new server and restore the data by following the steps below:
(1) Obtain database information
First, check the file content of the database:
Select * from v $ datafile;
Select * from v $ controlfile
Select * from v $ logfile;
Data file:
G: ORADATAWEBOASYSTEM01.DBF
G: ORADATAWEBOAUNDOTBS01.DBF
G: ORADATAWEBOACWMLITE01.DBF
G: ORADATAWEBOADRSYS01.DBF
G: ORADATAWEBOAEXAMPLE01.DBF
G: ORADATAWEBOAINDX01.DBF
G: ORADATAWEBOAODM01.DBF
G: ORADATAWEBOATOOLS01.DBF
G: ORADATAWEBOAUSERS01.DBF
G: ORADATAWEBOAXDB01.DBF
Control file:
G: ORADATAWEBOACONTROL01.CTL
G: ORADATAWEBOACONTROL02.CTL
G: ORADATAWEBOACONTROL03.CTL
Redo log files:
G: ORADATAWEBOAREDO03.LOG
G: ORADATAWEBOAREDO02.LOG
G: ORADATAWEBOAREDO01.LOG
(2) mobile app data files
Shutdown immediate shut down the database and copy the data file to another directory. The files to be copied include:
System01.dbf
Indx01.dbf
Temp01.dbf
Users01.dbf
Application Data File
(3) modify the location of database files
Start MOUNT Mode
Startup mount;
Alter database rename file g: oradataweboaSYSTEM01.DBF to d: oradataweboaSYSTEM01.DBF;
Note that you can only change the moved database files, excluding control files, log files, and TEMP files.
Mobile Control File
(1) backup SPFILE content:
Restart the database again:
Startup;
Create pfile = 'C: init. ora 'from spfile;
(2) modify the content in the init. ora file:
*. Control_files = oradataocpcontrol01.ctl, oradataocpcontrol02.ctl, oradataocpcontrol03.ctl
To change the directory location that has been copied.
Shutdown Database
(3) copy the control file
Move the three control files to the directory modified above.
(4) import the parameter file
Start with the init. ora parameter:
Startup pfile = 'oracleinit. ora ';
Create spfile from pfile = 'oracleinit. ora ';
Shutdown immediate;
Startup; start from spfile.
In this way, the file movement control is over.
Rebuild or relocate LOG files
There are two ways to move log files: one is to move (RENAME) and the other is to re-create.
(1) Move LOG files
The same method is used to move database files again as to move System database files, but the database must be "startup mount.
Startup mount
Alter database rename file g: oradataweboaREDO01.LOG to d: oradataweboaREDO01.LOG;
Alter database rename file g: oradataweboaREDO02.LOG to d: oradataweboaREDO02.LOG;
Alter database rename file g: oradataweboaREDO03.LOG to d: oradataweboaREDO03.LOG;
Iv. Rebuilding the temp File System
When moving the data table space, the TEMP file cannot be moved. You must create a new TEMP tablespace and set it to the default TEMP file system.
Then, remove the original TEMP tablespace to move the tablespace.
Migrate temporary tablespace
◆ 1. startup -- start the database
◆ 2. create temporary tablespace "temp02" tempfile d: oradataweboaemp02.dbf size 500 m extent management local uniform size 10 m; -- create temporary tablespace for transit
◆ 3. alter database default temporary tablespace temp2; -- change the default temporary tablespace to the newly created temporary tablespace temp2
◆ 4. drop tablespace temp including contents and datafiles; -- delete the original temporary tablespace
◆ 5 then delete the original TEMP file.