Restore the Oracle database based on user data pump backup

Source: Internet
Author: User
Tags create directory

1. First, explain a few words

directory: The general creation of directory is to use data pump import/export data, in fact, there are many other uses of directory, this article does not elaborate

    schemas: It's easy for you to understand it with user users, and you can have a set of non-interfering objects under each mode. If you want to access objects from other schemas,

You need to specify the name of the schema, which is actually specifying username. For example, you want to access the Mode Scott's Table EMP, and your mode (user) is Tiger,

Then you write this: select * from Scott.emp;

2. Back up the database statement:

Model: EXPDP User name/password @ service name (or SID name)

EXPDP User/[email protected] dumpfile=database.dmp directory=w_dir Schemas=system;

In general, when you use the EXPDP tool to back up a database, you typically use the directory parameter to specify where the backup and log files are stored. In fact, the directory parameter

It's not necessary. We can write directories into the DumpFile parameter and the logfile parameter for the same purpose.

Create directory

Create directory W_dir as ' D:\dumpfile ';

Create a folder under Computer D called DumpFile, used to store the backup files, and the computer will automatically go to the folder to find the. dmp file, after you have created the directory,

Executes the EXPDP BACKUP statement, and the backup file is automatically generated to the directory-specified file.

3. Delete the original user

Because, if you do not delete the original user, when the database restore system encountered the same table will be skipped, can not achieve the purpose of database restore overlay tune

First log in to the database as a Super Administrator:

Sqlplus System/[email protected] as SYSDBA;

true Delete User:

Drop user Dcuser cascade; --cascade represents cascading deletions in the Oracle database.

4. New User

Create Uer Dcuser identified by Dcuser; --Create the database and set the password to: Dcuser

Grant Resource, connect,dba to Dcuser; --Assign permissions to the user you create: resource, link, dba role.

Grant Read,write on directory W_dir to Dcuser; --Gives the user permission to Dcuser read and write operations on the directory.

5. Database restore

After preparing for the above, then start the real database restore

IMPDP Dcuser/[email protected] Directory=w_dir dumpfile=database.dmp schemas=dcuser;

6, to this database backup restore is done!

Restore the Oracle database based on user data pump backup

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.