Oracle Database exp and IMP usage

Source: Internet
Author: User

Import and Export imp/exp of the Oracle database is equivalent to backing up and restoring the Oracle database. The exp command can export data from a remote database server to a local DMP file; the IMP command is used to import the DMP file from the local machine to the remote database server.

Example:

Exp command:

1. Exp username/password storage location of the DMP file. Enter sqlplus simmspstest/simmspstest file = 'C: \ simmspstest_20120714.dmp 'in the DOS window below'

It is to import the user database information that the user is named simmspstest and the password is simmspstest into the simmspstest_20120714.dmp file of drive C.

2. Exp system/password owner = (user 1, user 2) storage location of the DMP file, for example, exp system/system owner = (Scott, HMPL) file = 'C: /db_001.dmp 'indicates that the exp command exports only the objects owned by the Scott and HMPL users. If a user does not exist, a warning is given, but the export of another user is not affected.

3. Exp username/password tables = (table 1, Table 2) DMP file storage location, for example: EXP Scott/Scott tables = (Dept, EMP) file = 'C: /db_tables.dmp 'indicates that the exp command exports only the dept and EMP tables of the Scott user. If the exported table does not exist, a warning is given, but the export of other tables is not affected.

Run the following command: Drop user simmspstest cascade to delete user simmspstest. cascade to delete all tables, views, and stored procedures under simmspstest.

Create a user and authorize the user,

Create temporary tablespace
Create temporary tablespace neocms30temp tempfile 'C: \ oracle \ product \ 10.2.0 \ oradata \ orcl \ neocms30temp. dbf'size 200 m;

Create and authorize a user
Create user simmspstest identified by simmspstest default tablespace simmspstest quota unlimited on simmspstest temporary tablespace simmspstesttemp;

Grant resource to simmspstest;
Grant connect to simmspstest;
Grant create view to simmspstest;
Grant create trigger to simmspstest;
Grant create synonym to simmspstest;

Then, use the IMP command to import the DMP file exported through exp.

IMP simmspstest/simmspstest file = 'C: \ simmspstest_20120714.dmp 'Log = 'C: \ simmspstest_20120714log.log 'fromuser = simmspstest touser = simmspstest

 

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.