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:
- imp scott/oracle@charge FILE=tab2.dmp TABLES=dept.emp
- 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:
- imp scott/oracle@charge FILE=schema2.dmp
- 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)
- [oracle@ora-asm3 ~]$ imp
Import: Release 10.2.0.1.0-Production on Monday June 16 16:40:10 2008
- Copyright (c) 1982, 2005, Oracle. All rights reserved.
Username: charge enter user name
Password: enter the Password
- Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
- 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.