First ask the table space name and size of the other database, then create the appropriate tablespace in your Oracle, and finally use the command to import and export the data.
Add:
1. To create a new database;
Oracle data import and export imp/exp is equivalent to Oracle data restore and backup. The EXP command can be
To export data from the remote database server to a local DMP file, the IMP command can take the DMP file from the
To a remote database server. With this feature you can build two identical databases, one
Used for testing, one for formal use.
For example: Imp command Imports data:
Imp username/[email protected] file=xxx.dmp fromuser=xxx touser=xxx tables= (xxx,xxx)
Wherein, fromuser refers to the other database user name, touser refers to the user name of your database;
Fromuser If the table space is multiple, use () to enclose it: fromuser= (A, b);
Touser parameter Imitation fromuser parameter;
To import only a subset of tables, use the tables parameter to enclose the table to be imported, and if you want to import all, you do not need to specify the tables parameter
The following is an example of importing and exporting.
Data export:
1 full export of database test, user Name System Password Manager exported to D:\daochu.dmp
Exp system/[email protected] file=d:\daochu.dmp full=y
2 Exporting the system user in the database to the SYS user's table
Exp system/[email protected] file=d:\daochu.dmp owner= (System,sys)
3 Exporting Tables Inner_notify, Notify_staff_relat in the database
Exp aichannel/[email protected] file= d:\data\newsmgnt.dmp tables=
(Inner_notify,notify_staff_relat)
The above is commonly used for the export, for compression, both with WinZip to the DMP file can be very good compression.
It can also be implemented by adding compress=y to the above command.
Import of data
1 Import the data from the D:\DAOCHU.DMP into the test database.
Imp system/[email protected] file=d:\daochu.dmp
Imp aichannel/[email protected] full=y file=file= d:\data\newsmgnt.dmp
Ignore=y
There may be a problem, because some tables already exist, and then it will error, the table will not be guided
Into.
Add Ignore=y to the back.
2 Import the table table1 in D:\daochu.dmp
Imp system/[email protected] file=d:\daochu.dmp tables= (table1)
Basically, the above import and export is enough. In many cases, you must first delete the table and then import it.
Attention:
The operator must have sufficient permissions, and it will prompt for insufficient permissions.
Database, you can connect to the. You can use tnsping test to get the database test to connect.
Appendix I:
Adding permissions to the import data to the user
First, start sql*puls
Second, landing with System/manager
Third, create user username identified by password (if you have already created a user, this step
can be omitted)
IV, GRANT create User,drop user,alter USER, create any VIEW,
DROP any view,exp_full_database,imp_full_database,
Dba,connect,resource,create SESSION to User name
V, run-cmd-into the directory where the DMP file is located,
Imp Userid=system/manager full=y file=*.dmp
or imp Userid=system/manager full=y file=filename.dmp
Example execution:
F:\work\oracle_data\backup>imp userid=test/test full=y
File=inner_notify.dmp
Screen display
Import:release 8.1.7.0.0-production on Thu February 16 16:50:05 2006
(c) Copyright: Oracle Corporation. All rights reserved.
Connected to: Oracle8i Enterprise Edition Release 8.1.7.0.0-production
With the partitioning option
Jserver Release 8.1.7.0.0-production
Export files created by export:v08.01.07 through a regular path
Import is completed in ZHS16GBK character set and ZHS16GBK NCHAR character set
The export server uses the UTF8 NCHAR character set (possible ncharset conversions)
. Importing Aichannel objects into Aichannel
. . Importing table "Inner_notify" 4 rows are imported
Prepare to enable constraints ...
The import was terminated successfully, but a warning appears.
Oracle Database Import Export DMP file