Oracle database remote Import, export

Source: Internet
Author: User



Exp local Export and imp local import

Exp command:
1 exp username/psw@test file=d:test.dmp full=y
2 exp username/psw@test file=d:test.dmp owner= (ly)
3 exp username/psw@test file= d:test.dmp tables= (GRID1,GRID2)
1 One is the overall export of test (Oracle service name corresponding to a database) database
2 exporting all tables that belong to user ly
3 The table grid1, with GRID2 export
D:test.dmp is the exported file address

IMP command:
1 Imp system/psw@test file=d:test.dmp
2 imp system/psw@test full=y file=d:test.dmp ignore=y
3 imp system/psw@test file=d:test.dmp tables= (grid1) ignore=y indicates that the table is not imported if a table already exists in the database being imported
3 means import only grid1 this table

Test whether the corresponding database is true before importing the export: Tnsping test, the same test is the service name
All commands can be executed under CMD


Remotely manipulate a database with Exp/imp

Remote operation of the Oracle database, assuming that the database is on the 192.168.1.110, the following methods:
First, on the client creation and service-side corresponding service name
Method 1:
modifying Tnsnames.ora files
To join the name of a remote server:

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 named 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 command: tnsping TEST_ORCL.

III. Remote Operations Database
Export:

SQL code
1:exp USERNAME/PASSWORD@TEST_ORCL File=bak_filepath
2:exp USERNAME/PASSWORD@TEST_ORCL full=y File=bak_filepath
Username username, password password, TEST_ORCL customer service name, bak_filepath backup files stored path

Import:

SQL code
1:imp USERNAME/PASSWORD@TEST_ORCL File=bak_filepath full=y
2:imp username/password@test_orcl/database_name File=bak_filepath full=y
3:imp USERNAME/PASSWORD@TEST_ORCL File=bak_filepath fromuser=fromadmin touser=toadmin

Username username, password password, TEST_ORCL customer service name, bak_filepath backup files stored path
Fromadmin the user name of the backup data, toadmin the user name of the restored database. database_name restored to that database.

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

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.