The actual usage of the Oracle data import tool IMP

Source: Internet
Author: User

The following articles mainly introduce the Oracle data import tool IMP. We all know that the import table is the tool IMP used to reload the table structure and related data of the file in EXP to the Oracle database, the TABLES option is used to import TABLES.

Normal users can directly import tables they own. To import tables to other users, the user must have the IMP_FULL_DATABASE role or DBA role. Note: to import a table to another user, you must specify the FROMUSER and TOUSER options, as shown in the following example:

 
 
  1. imp scott/oracle@charge FILE=tab2.dmp TABLES=dept.emp  
  2. imp system/oracle@charge FILE=tab2.dmp TABLES=dept.emp FROMUSER=scott TOUSER=system 

As shown above, the first example imports the structure and Oracle Data of the DEPT and EMP tables in the file tab2.dmp to the SCOTT user; the second example indicates that the DEPT and EMP tables of SCOTT users in the tab2.dmp file are imported to the SYSTEM users.

2) Import Solution

An import scheme is to use the tool IMP to repost all objects and data of a specific scheme in the EXP file to the database.

Normal users can directly import their own solutions, and provide the USERID and FILE options during the import. If you want to import all objects in a scheme to other schemes, you must have the IMP_FULL_DATABASE role and provide the FROMUSER and TOUSER options. Example:

 
 
  1. imp scott/oracle@charge FILE=schema2.dmp  
  2. imp system/oracle@charge FILE=schema2.dmp FROMUSER=scott TOUSER=system 

As shown above, the first example shows the file schema 2. all SCOTT objects and Oracle Data in dmp are imported to SCOTT users. The second example shows the file schema 2. all the objects and data of SCOTT in dmp are imported into the SYSTEM user.
The above is the command line method for data export. The EXP tool can also export data in interactive mode.

1) Import table Interaction Mode)

 
 
  1. [oracle@ora-asm3 ~]$ imp 

Import: Release 10.2.0.1.0-Production on Monday June 16 16:40:10 2008

 
 
  1. Copyright (c) 1982, 2005, Oracle. All rights reserved. 

Username: charge enter user name

Password: enter the Password

 
 
  1. Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production  
  2. With the Partitioning, OLAP and Data Mining options  

Import file: expdat. dmp> charge. dmp: Enter the data file to be imported.

Enter insert buffer size (minimum is 8192) 30720> the input buffer size can be customized by default.

The above content is an introduction to the Oracle data import tool IMP. I hope you will have some gains.

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.