Specific oracle backup recovery methods

Source: Internet
Author: User

1.1 full database backup of Database Data
Note: This operation requires you to start the database.

Switch to the oracle user and create the backup directory on the OS side:

Mkdir/oracle/backup

Log on to the oracle database and create a backup directory in the database.

Sqlplus/as sysdba

Create directory backupdir as '/oracle/backup ';

After you exit sqlplus, use the oracle user to perform full-database backup. The backup file is generated under/oracle/backup:

Expdp system/System123 DIRECTORY = backupdir DUMPFILE = backup201309XX. dmp logfile = backup. log full = y

1.2 database data recovery

Note: This operation requires you to start the database.

1. log on to the database server with an orale user

2. Delete the user to be restored.

Sqlplus/as sysdba

Drop user USER_NAME cascade;

Exit

3. Execute the recovery command

The following statement restores pgm user data to the backup201309XX. dmp status

Impdp system/System123 DIRECTORY = backupdir DUMPFILE = backup201309XX. dmp schemas = pgm TABLE_EXISTS_ACTION = TRUNCATE logfile = restore. log

Precautions for database recovery:

You cannot delete or modify the database definition (such as the table structure) When backing up and restoring the database in exp/imp mode.

Therefore, if the database table structure changes during restoration, You need to restore the table structure or delete the table before performing the restoration operation. If you do not know which table structures have changed, you can delete the database users that need to be restored before performing the restoration operation.

In addition, it is confirmed that the table is restored after the table is deleted. A problem exists: when the table is deleted, the foreign keys referenced in the table created by other tables are deleted.

The foreign key cannot be restored. In this case, you need to manually create a foreign key constraint after recovery.

Drop table TABLE_NAME cascade constraints;

Impdp system/System123 DIRECTORY = backupdir DUMPFILE = backup201309XX. dmp tables = sdu. E_UC_ENTANN TABLE_EXISTS_ACTION = TRUNCATE logfile = restore_sdu.log

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.