How to Use the oracle impdp network_link Parameter

Source: Internet
Author: User

I. Environment Description
Source database:
IP Address: 192.168.137.100
Sid: catalog
Username: rman
Password: rman
Target database:
IP Address: 192.168.137.101
Sid: orcl
Username: rman
Password: rman

2. Create a tnsname for the source database on the target database
Log on to the target database as an oracle user, modify the $ ORACLE_HOME/network/admin/tnsnames. ora file, and add the following content:
Copy codeThe Code is as follows:
Catalog =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP) (HOST = 192.168.137.100) (PORT = 1521 ))
)
(CONNECT_DATA =
(SID = catalog)
)
)

After modifying the file, run the following command to test whether the created tnsname is correct.
$ Tnsping catalog
If the returned result is OK (0 msec), The tnsname is successfully created and the next operation is performed.

3. Create a dblink
The statement for creating a dblink is
Create database link <database link name> connect to <remote database user name> identified by <remote database password> USING '<tnsname connect to remote>'
Log on to the target database server as an oracle user and perform the following operations:
Copy codeThe Code is as follows:
$ Sqlplus rman/rman
SQL> CREATE DATABASE LINK dmp_link CONNECT TO rman IDENTIFIED BY rman USING 'catalog ';

*************************************
If
Copy codeThe Code is as follows:
ERROR at line 1:
ORA-01031: insufficient privileges

Run the following statement as sysdba to grant the user the permission to create dblink, and then execute the statement to create dblink.
Grant create database link to rman;
*************************************
Run the following statement to test whether dblink is successfully created. The result is returned to prove that dblink is successfully created.
Copy codeThe Code is as follows:
SQL> select tname from tab @ dmp_link;
SQL> exit;


4. Create a directory object on the target database
Log on to the target database as an oracle user
1. Create a directory, which is assumed to be/oracle/dmp, and ensure that the directory can be read and written by oracle users.
2. log on to the database as sysdba, create a directory object, and grant the read and write permissions to the object.
3. log on to the database and run the following statement:
Copy codeThe Code is as follows:
$ Sqlplus/as sysdba
SQL> create or replace directory dmp_dir as '/oracle/dmp ';
SQL> grant read, write on directory dmp_dir to public;
SQL> exit;

5. Execute the impdp command on the target database to import data
Impdp rman/orcl network_link = dmp_link remp_schema = source_schema: target: shcema remap_tablespace = source_tablespace: target: tablespace
If you want to directly import a database without generating the dmp file, you can directly use the impdp with network_link. In this way, you can directly import the database without bypassing the expdp step.

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.