Data Pump with Network import
We need to create a directory first!
Create database directories
Execute the following commands to create a database directory. This directory must point to a valid directory on the same server as the database:
SQL>create directory dmpdir as '/opt/oracle';
Directory created.
SQL>grant read, write on directory dmpdir to scott;
Grant succeeded.
PS: Oracle introduced a default directory from 10g R2, called DATA_PUMP_DIR, that can be used:
SQL>select directory_path from dba_directories where directory_name = 'DATA_PUMP_DIR';
DIRECTORY_PATH
--------------------------------------------------------------------------------
/app/oracle/product/10.2.0/rdbms/log/
Network import
With network mode imports, one doesn't need any intermediate dump files (GREAT, no more FTP'ing of dump files). Data is exported across a and imported directly into the target database.
Example:
SQL> create user new_scott identified by tiger;
User created.
SQL> grant connect, resource to new_scott;
Grant succeeded.
SQL> grant read, write on directory dmpdir to new_scott;
Grant succeeded.
SQL> grant create database link to new_scott;
Grant succeeded.
SQL> conn new_scott/tiger
Connected.
SQL> create database link old_scott connect to scott identified by tiger using 'orcl.oracle.com';
Database link created.
impdp new_scott/tiger DIRECTORY=dmpdir NETWORK_LINK=old_scott remap_schema=scott:new_scott
All work is performed on the target system. The only reference to the source systems is via the database link.
PS:How to Create database link
遠端資料庫全域性名稱可以用以下命令查出:
SELECT * FROM GLOBAL_NAME;
修改可以用以下語句來修改引數值:
ALTER SYSTEM SET GLOBAL_NAME=TRUE/FALSE;
當資料庫引數global_name=false時,不要求資料庫連結名稱跟遠端資料庫名稱一樣。
注意:建立資料庫連結的帳號必須有CREATE DATABASE LINK或CREATE PUBLIC DATABASE LINK的系統許可權,用來登入到遠端資料庫的帳號必須有CREATE SESSION許可權。這兩種許可權都包含在CONNECT角色中(CREATE PUBLIC DATABASE LINK許可權在DBA中)。
如:
sql>create database link old_scott connect to scott identified by tiger
using '主機字串名';
1)dblink名(old_scott)必須與遠端資料庫的全域性資料庫名(global_name)相同;
2)使用者名稱,口令為遠端資料庫使用者名稱,口令;
3)主機字串為本機tnsnames.ora中定義的串;
4)兩個同名的資料庫間不得建立dblink;
然後,你就可以透過dblink訪問遠端資料庫了。
如:
sql>select * from 表名@old_scott;
還可以建立快照(snapshot)透過dblink實現遠端資料自動傳輸.
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/628922/viewspace-714771/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 【Data Pump】Data Pump的並行引數原理並行
- 【Data Pump】expdp/impdp Job基本管理
- Oracle Data Pump 11G 資料泵元件Oracle元件
- Oracle資料泵(Oracle Data Pump) 19cOracle
- 【Data Pump】理解expdp中的ESTIMATE和ESTIMATE_ONLY引數
- require()、import、import()有哪些區別?UIImport
- Python import相關內容區別介紹( import *** as 、from***import )PythonImport
- SCSS @importCSSImport
- CSS @importCSSImport
- export/importExportImport
- eslint-plugin-import 規則之 Import / OrderEsLintPluginImport
- Import Error: cannot import name ‘export_saved_modelImportErrorExport
- 徹底搞懂Python 中的 import 與 from importPythonImport
- @import註解Import
- idea import配置IdeaImport
- vite css importViteCSSImport
- python基礎--自定義模組、import、from......import......PythonImport
- link和@import引入css 區別,不建議使用@importImportCSS
- Simple Neural Network
- Set介面_network
- openGauss lo_importImport
- from bson import ObjectIdImportObject
- from selenium import webdriverImportWeb
- pycharm import 報錯PyCharmImport
- Big Data and Data Warehousing
- Network(POJ-1144)
- POJ 1861 Network (Kruskal)
- Network Embedding_LINE
- docker network之 noneDockerNone
- Network sniffing and identity authenticationIDE
- The Network Diagram on the PVE system
- Siamese network總結
- Python Package Import 之痛PythonPackageImport
- 重構smart-importImport
- China Tightens Recycling Import RulesImport
- nodejs中 import 與 asyncNodeJSImport
- require 和 import 詳解UIImport
- Python __import__() 函式PythonImport函式
- import,export的支援[nodejs]ImportExportNodeJS