Thứ Hai, 19 tháng 1, 2026

Using the NETWORK_LINK Parameter with Oracle Data Pump

Mô tả hoạt động:
Nhập bảng từ cơ sở dữ liệu này sang cơ sở dữ liệu khác bằng tham số Network_Link qua mạng mà không cần sao lưu dữ liệu xuất.


Lưu ý: Đảm bảo người dùng được đề cập trong DB Link có các quyền sau để xuất/nhập dữ liệu:

DATAPUMP_EXP_FULL_DATABASE
DATAPUMP_IMP_FULL_DATABASE


Nếu không, vui lòng cấp quyền này cho người dùng này.

SQL> grant DATAPUMP_EXP_FULL_DATABASE to rupesh;
SQL> grant DATAPUMP_IMP_FULL_DATABASE to rupesh;

SQL> select * from dba_role_privs where grantee ='RUPESH';

GRANTEE         GRANTED_ROLE       ADM DEF
------------------------------ ------------------------------ --- ---
RUPESH        DATAPUMP_EXP_FULL_DATABASE     NO  YES
RUPESH        DATAPUMP_IMP_FULL_DATABASE     NO  YES
RUPESH        CONNECT       NO  YES
RUPESH        RESOURCE        NO  YES



POA:
  • Add tns and listener entry on target database. Test the tns entry.
  • Create DB link in source database using target database credentials. Test db link connectivity.
  • Execute import command on source DB server.

DB Server details: 
Source Database: DC
Source DB Server: dc.localdomain

Target Database: DEMO
Target DB Server: dr.localdomain


Step 1: Add tns and listener entry on target database. Test the tns entry.

[oracle@dc admin]$ cat tnsnames.ora
DEMO =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = dc.localdomain)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = demo)
    )
  )

[oracle@dc admin]$ cat listener.ora
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME = dr.oracle.com)
(ORACLE_HOME = /u01/app/oracle/product/11.2.0/dbhome_1)
(SID_NAME = DC))
)


[oracle@dc admin]$ tnsping demo

TNS Ping Utility for Linux: Version 11.2.0.4.0 - Production on 03-APR-2018 12:15:42

Copyright (c) 1997, 2013, Oracle.  All rights reserved.

Used parameter files:

Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = dc.localdomain)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = demo)))
OK (10 msec)



Step 2: Create DB link in source database using target database credentials. Test db link connectivity.


SQL> create public database link DR_to_DC connect to rupesh identified by rupesh using 'dc.localdomain:1521/DC';

Database link created.

SQL> select * from dba_db_links;

OWNER      DB_LINK     USERNAME  HOST      CREATED
------------ -------------- ------------ ----------------------------------- ---------
PUBLIC      DR_TO_DC     RUPESH  dc.localdomain:1521/DC      03-APR-18

SQL> select sysdate from dual@DR_TO_DC;

SYSDATE
---------
03-APR-18

SQL> select name from rupesh.my_test@DR_TO_DC;

NAME
----------
Donnie


Create new user in source DB(DEMO) as target user RUPESH doesn't exist in source database.


SQL> create user vipul identified by vipul;

User created.

SQL> grant connect,resource to vipul;

Grant succeeded.


Create logical directory in the source database(DEMO):

SQL> create directory BKP as '/u01/';

Directory created.

SQL> grant read,write on directory BKP to public;

Grant succeeded.


Step 3: Execute import command on source DB server.

[oracle@dr ~]$ impdp directory=BKP tables=rupesh.V1 logfile=net_dump.log remap_schema=rupesh:vipul network_link=DR_TO_DC

Import: Release 11.2.0.4.0 - Production on Tue Apr 3 12:03:07 2018

Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.

Username: / as sysdba

Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
Starting "SYS"."SYS_IMPORT_TABLE_01":  /******** AS SYSDBA directory=BKP tables=rupesh.V1 logfile=net_dump.log remap_schema=rupesh:vipul network_link=DR_TO_DC
Estimate in progress using BLOCKS method...
Processing object type TABLE_EXPORT/TABLE/TABLE_DATA
Total estimation using BLOCKS method: 128 KB
Processing object type TABLE_EXPORT/TABLE/TABLE
. . imported "VIPUL"."V1"                                    10 rows
Processing object type TABLE_EXPORT/TABLE/INDEX/INDEX
Processing object type TABLE_EXPORT/TABLE/CONSTRAINT/CONSTRAINT
Processing object type TABLE_EXPORT/TABLE/INDEX/STATISTICS/INDEX_STATISTICS
Job "SYS"."SYS_IMPORT_TABLE_01" successfully completed at Tue Apr 3 12:03:20 2018 elapsed 0 00:00:10


You have successfully imported table from source DB into target DB using Network Link.
=============================
TƯ VẤN: Click hoặc Hotline/Zalo 090.29.12.888
=============================
Website không chứa bất kỳ quảng cáo nào, mọi đóng góp để duy trì phát triển cho website (donation) xin vui lòng gửi về STK 90.2142.8888 - Ngân hàng Vietcombank Thăng Long - TRAN VAN BINH
=============================
Nếu bạn không muốn bị AI thay thế và tiết kiệm 3-5 NĂM trên con đường trở thành DBA chuyên nghiệp hay làm chủ Database thì hãy đăng ký ngay KHOÁ HỌC ORACLE DATABASE A-Z ENTERPRISE, được Coaching trực tiếp từ tôi với toàn bộ bí kíp thực chiến, thủ tục, quy trình của gần 20 năm kinh nghiệm (mà bạn sẽ KHÔNG THỂ tìm kiếm trên Internet/Google) từ đó giúp bạn dễ dàng quản trị mọi hệ thống Core tại Việt Nam và trên thế giới, đỗ OCP.
- CÁCH ĐĂNG KÝ: Gõ (.) hoặc để lại số điện thoại hoặc inbox https://m.me/tranvanbinh.vn hoặc Hotline/Zalo 090.29.12.888
- Chi tiết tham khảo:
https://bit.ly/oaz_w
=============================
2 khóa học online qua video giúp bạn nhanh chóng có những kiến thức nền tảng về Linux, Oracle, học mọi nơi, chỉ cần có Internet/4G:
- Oracle cơ bản: https://bit.ly/admin_1200
- Linux: https://bit.ly/linux_1200
=============================
KẾT NỐI VỚI CHUYÊN GIA TRẦN VĂN BÌNH:
📧 Mail: binhoracle@gmail.com
☎️ Mobile/Zalo: 0902912888
👨 Facebook: https://www.facebook.com/BinhOracleMaster
👨 Inbox Messenger: https://m.me/101036604657441 (profile)
👨 Fanpage: https://www.facebook.com/tranvanbinh.vn
👨 Inbox Fanpage: https://m.me/tranvanbinh.vn
👨👩 Group FB: https://www.facebook.com/groups/DBAVietNam
👨 Website: https://www.tranvanbinh.vn
👨 Blogger: https://tranvanbinhmaster.blogspot.com
🎬 Youtube: https://www.youtube.com/@binhguru
👨 Tiktok: https://www.tiktok.com/@binhguru
👨 Linkin: https://www.linkedin.com/in/binhoracle
👨 Twitter: https://twitter.com/binhguru
👨 Podcast: https://www.podbean.com/pu/pbblog-eskre-5f82d6
👨 Địa chỉ: Tòa nhà Sun Square - 21 Lê Đức Thọ - Phường Mỹ Đình 1 - Quận Nam Từ Liêm - TP.Hà Nội

=============================
cơ sở dữ liệu, cơ sở dữ liệu quốc gia, database, AI, trí tuệ nhân tạo, artificial intelligence, machine learning, deep learning, LLM, ChatGPT, DeepSeek, Grok, oracle tutorial, học oracle database, Tự học Oracle, Tài liệu Oracle 12c tiếng Việt, Hướng dẫn sử dụng Oracle Database, Oracle SQL cơ bản, Oracle SQL là gì, Khóa học Oracle Hà Nội, Học chứng chỉ Oracle ở đầu, Khóa học Oracle online,sql tutorial, khóa học pl/sql tutorial, học dba, học dba ở việt nam, khóa học dba, khóa học dba sql, tài liệu học dba oracle, Khóa học Oracle online, học oracle sql, học oracle ở đâu tphcm, học oracle bắt đầu từ đâu, học oracle ở hà nội, oracle database tutorial, oracle database 12c, oracle database là gì, oracle database 11g, oracle download, oracle database 19c/21c/23c/23ai, oracle dba tutorial, oracle tunning, sql tunning , oracle 12c, oracle multitenant, Container Databases (CDB), Pluggable Databases (PDB), oracle cloud, oracle security, oracle fga, audit_trail,oracle RAC, ASM, oracle dataguard, oracle goldengate, mview, oracle exadata, oracle oca, oracle ocp, oracle ocm , oracle weblogic, postgresql tutorial, mysql tutorial, mariadb tutorial, ms sql server tutorial, nosql, mongodb tutorial, oci, cloud, middleware tutorial, docker, k8s, micro service, hoc solaris tutorial, hoc linux tutorial, hoc aix tutorial, unix tutorial, securecrt, xshell, mobaxterm, putty

ĐỌC NHIỀU

Trần Văn Bình - Oracle Database Master