Oracle only recovers data files

Source: Internet
Author: User
Tags sqlplus

The database version is oracle10g

    1. In a database server operation: will need to transfer the database a cold backup, cold backup, I am very simple.
    2. Start-to-run:
    3. /  as // log in to the database with DBA Authority Sqlplus > shutdown // Close DB instance
    4. After the prompt Oracle routine has been closed, copy the X:\Oracle\oradata\SourDB database directory in the corresponding a database.
    5. 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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.