Database Recovery Instance

Source: Internet
Author: User

As a DBA, the most important job is to keep the data in the database secure, and when a database is down, the restoration of the old becomes a vital thing. The success of the recovery is not in the database down when the recovery strategy, to ensure that the data is foolproof, a complete set of backup plan is necessary. But as a DBA, it is also useful to understand and master what recovery measures should be taken in various situations and to clearly guide the outcome of each type of recovery. Here are a few examples of commonly used backup and recovery methods that the DBA must master.

Example 1: Archived database, full database full library backup, full archive backup, the database is down, leaving only control files and log files available.

1: Safely close the current database. (Make sure the current database is in archive mode).

2:copy all data files, log files and control files into a directory.

3: Open database, build new user User1

Create user user1 identified by AAAAAA;

Grant DBA to User1;

Connect user1/aaaaaa;

4: Build Table T1 under User1, insert 10,000 data into T1.

Begin

For I in 1..100000 loop

Insert into T1 values (i);

End Loop;

Commit;

End;

/

5: Switch logs several times so that all logs have been archived.
Alter system switch log file;

6: Shut down the database normally. Shutdown immediate;

7: Recovery:

Move all files in the current database to a temporary folder, simulating database corruption.

8:copy initially copies all the files of the database, but the control files and log files are used for the current database.

9: Start the database startup

After mount, you will be prompted to restore the system table space. The archive log document that is used for recovery is given.

When you are sure that the archive log location is correct, enter auto.

Oracle Archives a document for one application. Until you are prompted to fully recover successfully.

10: Open databases ALTER DATABASE open;

11: Check the User1 user and the T1 table for the 10,000 records you just inserted.

This completes the full recovery of the full database cold backup using the archive log successfully.


Database Recovery Instance

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.