How to recover an Oracle database from a healthy data file

Source: Internet
Author: User
Tags oracle database

One. Backup of data files, control files, and log files 1. The server has installed the operating system, and Oracle has also been reloading. If the restored Oracle is the exact same structure as the previously corrupted database, then the recovery is relatively simple.

1 Delete all data files, control files, and log files for the new database. Copy the original database data files, control files and log files to the corresponding directory.

2)

Cmd>sqlplus/nolog

Sql>conn as Sysdba

User name: System

Password: (password for new database created here)

Sql>shutdown Immediate

Sql>startup Nomount

Sql>alter Database Mount

At this point to see whether the database can be mount up, sometimes prompted no password file Pwddemo.ora file could not be found. Viewing the corresponding directory (under database), you will find that the file exists. Note that this password file is the password file that was generated when the instance was created after the newly installed database, not the password file of the previously used database, and now we use the control files and data files of the previous database to open the previous database, so we need to re-create a password file at this time.

Sql>shutdown Immediate

Sql>host orapwd File=c:\oracle9i\database\pwddemo.ora password=oracle

ENTRIES=10 (placed in the database directory)

Sql>startup Nomount

Sql>alter Database Mount

Sql>alter Database Open

Open Database

2. If the installation directory of the new database is not the same as the directory of the original database, then the control file can be rebuilt to open the database. Because the data file address recorded in the original control file is not the same as the existing data file location. This is the same as in the second below. Of course, at this point can also create the same directory structure as the original database (if you want to remember the original database directory structure), you need to note that the parameters of the file in the control file location and control files recorded in the data file location.

Description: We need to be clear about the database in the open three phases, need to read the file

Sql>startup Nomount (read the parameter file at this time)

Sql>alter Database Mount (read the control file according to the address of the control file recorded in the parameter file)

Sql>alter database open (read data files, open databases according to the data file addresses recorded in the control file)

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.