Oracle (EXP/IMP) Import and Export

Source: Internet
Author: User
Tags name database

I. EXP local export with IMP local import

Run directly into the system command line.

Exp command:
1 exp username/[email protected] file=d:test.dmp full=y
2 exp username/[email protected] file=d:test.dmp owner= (ly)
3 exp username/[email protected] file= d:test.dmp tables= (GRID1,GRID2)
1 One is to export the test (the Oracle service name database corresponding to a database) as a whole
2 Export all tables that belong to user ly
3 table Grid1, export with Grid2
D:test.dmp is the exported file address

IMP command:
1 imp system/[email protected] file=d:test.dmp
2 imp system/[email protected] full=y file=d:test.dmp ignore=y
3 imp system/[email protected] file=d:test.dmp tables= (grid1) ignore=y indicates that if a table already exists in the imported database, it is ignored to import that table
3 means only import grid1 this table

Before importing the export, test whether the corresponding database is pass: tnsping test, and the same test is the service name.
All commands can be executed under CMD


second, remote operation database with Exp/imp

Remote operation of the Oracle database, assuming that the database is on 192.168.1.110, as follows:
One, the service name corresponding to the client creation and the service side
Method 1:
Modify the Tnsnames.ora file
To join the remote server naming:

SQL code
TEST_ORCL =
(DESCRIPTION =
(Address_list =
(ADDRESS = (PROTOCOL = TCP) (HOST = 192.168.1.110) (PORT = 1521))
)
(Connect_data =
(service_name = ORCL)
)
)

Method 2:

On the Oracle client, open Net Manager.

Create a service naming TEST_ORCL, host IP: 192.168.1.110, service name ORCL, Port 1521


Second, test whether the remote server is unblocked

After entering CMD, execute the command: tnsping TEST_ORCL.

Third, remote operation database
Export:

SQL code
1:exp username/[email protected]_ORCL File=bak_filepath
2:exp username/[email protected]_ORCL full=y File=bak_filepath
Username user name, password password, TEST_ORCL customer service name, Bak_filepath backup file storage path

Import:

SQL code
1:imp username/[email protected]_ORCL file=bak_filepath full=y
2:imp username/[email protected]_orcl/database_name file=bak_filepath full=y
3:imp username/[email protected]_ORCL file=bak_filepath fromuser=fromadmin touser=toadmin

Username user name, password password, TEST_ORCL customer service name, Bak_filepath backup file storage path
Fromadmin the user name of the backup data, toadmin restore the user name of the database. database_name Restore to that database

Full=y exports the database as a whole, including the table structure.

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.