The database version is oracle10g
- In a database server operation: will need to transfer the database a cold backup, cold backup, I am very simple.
- Start-to-run:
/ as // log in to the database with DBA Authority Sqlplus > shutdown // Close DB instance
- After the prompt Oracle routine has been closed, copy the X:\Oracle\oradata\SourDB database directory in the corresponding a database.
- My database directory contains REDO01.LOG, REDO02. LOG, REDO03. log,sysaux01. Dbf,system01. Dbf,temp01. Dbf,undotbs01. Dbf,users01. Dbf,test. DBF CONTROL01. Ctl,control02. Ctl,control03. Ctl
In the B database (instance DESTDB) My program is installed in the X:\oracle\product\10.1.0\db_1\ data directory in X:\oracle\database\DestDB (no subdirectories)
A. Start and run the control file for backup database B:
Sqlplussqlplus>Conn DETDB Sys asSysdba//connects to the specified Detdb instance sqlplus>Alter Database BackupControlfile toTrace as 'D:\ctlbak.ctl' //Backup controller into file Sqlplus>Show parameter SPFile;//Show SPFile Path Sqlplus>CreatePfile fromSPFile//Backing up control files for database B
Generate the file under X:\oracle\product\10.1.0\db_1\database\ Initdestdb.ora, and back it up.
b, sqlplus>shutdown immediate \ \ Close the DB instance
Delete the data directory in the X:\oracle\database\DestDB directory of data files, control files and log files, anyway I am the directory is deleted.
The Sourdb of the database A is backed up by *.log, *. DBF copied in.
Delete the X:\oracle\product\10.1.0\db_1\database\SPFILEDestDB.ORA control file in database B
Modify the Initdestdb.ora file to delete the *.control_files corresponding string
C. Start database B to Nomount State
Start-to-run:
sqlplus / nolog sqlplus > conn destdb as SYSDBA Sqlplus > startup Nomount the ORACLE routine has been started. Total System Global area 171966464 bytes Fixed Size 787988 bytes Variable Size 144964076 bytes database buffers 25165824 bytes Redo buffers 1048576 bytes
Use the following statement to generate a new control file for database B, and the destdb to get rid of the directory's database name. (Do not add a temporary tablespace into the controller)
Sql>CREATEControlfileSET DATABASE"Destdb" Resetlogs ARCHIVELOG maxlogfiles -maxlogmembers3Maxdatafiles -maxinstances8maxloghistory454LOGFILEGROUP 1 'x:\oracle\database\DestDB\REDO01. LOG'SIZE 10M,GROUP 2 'x:\oracle\database\DestDB\REDO02. LOG'SIZE 10M,GROUP 3 'x:\oracle\database\DestDB\REDO03. LOG'SIZE 10M datafile'x:\oracle\database\DestDB\SYSTEM01. DBF', 'x:\oracle\database\DestDB\UNDOTBS01. DBF', 'x:\oracle\database\DestDB\SYSAUX01. DBF', 'x:\oracle\database\DestDB\USERS01. DBF', 'X:\oracle\database\DestDB\ZJTEST. DBF' CHARACTER SETZHS16GBK;
Close Database Sql>shutdown Immediate
D, add (refer to backup Initsourdb.ora) *.control_files= ' x:\oracle\database\DestDB\control01.ctl ', ' x:\oracle\database\DestDB\ Control02.ctl ', ' x:\oracle\database\DestDB\control03.ctl ' new control file, generate to directory X:\oracle\database\DestDB, modify x:\oracle\ Product\10.1.0\db_1 \database\ under the Initsourdb.ora, I saw in my directory generated 3 control files, so add 3.
E, specify the Pfile parameter to start, and generate SPFile to complete the recovery work.
Sql>Startup Pfile="X:\oracle\product\10.1.0\db_1\Database\initsourdb.ora "; The ORACLE routine has been started. Total System Global Area171966464bytes Fixed Size787988bytes Variable Size144964076bytesDatabaseBuffers25165824bytes Redo Buffers1048576The bytes database is loaded.
ORA-01589: To open a database you must use the Resetlogs or Noresetlogs option
sql> ALTER DATABASE open resetlogs; The database has changed.
Sql> create SPFile from Pfile; The file was created.
Sql> Select COUNT (*) from dba_users; COUNT (*)----------30
Oracle only recovers data files