tnames.ora增加
[html]
view plain
copy
orcl
= (description
= (address_list
= (address
= (protocol
= tcp
)(host
= 遠端主機ip)(
port
= 1521
))
) (connect_data
= (service_name
= 遠端服務名)
) )
[html]
view plain
copy
sql>
create public database link oradb(db_link名)connect to userneme(遠端登入使用者名稱) identified by password(遠端資料庫使用者密碼) using 'oradb';
database link created.
sql>
select * from test.db@oradb;
id name
---------- --------------------
1 zhangsan
2 lisi
[html]
view plain
copy
sql>
create or replace directory dumpdir as '/oradata/dump';
directory created.
[html]
view plain
copy
sql>
grant read,write on directory dumpdir to hr;
grant succeeded.
sql>
conn zhangsan/zhangsan
connected.
sql>
select * from test.db@oradb;
id name
---------- --------------------
1 zhangsan
2 lisi
1 wangwu
sql>
quit
[html]
view plain
copy
[oracle@ora11g-dg1 ~]$ expdp 本地登入庫的使用者名稱密碼(system/orcl)
network_link
=oradb
directory
=dumpdir
dumpfile
=test
.dmp
logfile
=test
.log
schemas
=test
(1):問題1:
export: release 11.2.0.4.0 - production on wed dec 10 07:50:25 2014
connected to: oracle database 11g enterprise edition release 11.2.0.4.0 - 64bit production
ora-31631: privileges are required
ora-39109: unprivileged users may not operate upon other users' schemas
問題解決辦法
sql*plus: release 11.2.0.4.0 production on wed dec 10 07:52:01 2014
connected to:
oracle database 11g enterprise edition release 11.2.0.4.0 - 64bit production
sql>
grant exp_full_database to zhangsan;
grant succeeded.
sql>
quit
(2):問題2:
ora-31631: privileges are required
ora-39149: cannot link privileged user to non-privileged user
解決辦法
連線到:
oracle database 11g enterprise edition release 11.2.0.1.0 - 64bit production
sql>
grant exp_full_database to test;
授權成功。
以上是匯出步驟。
[html]
view plain
copy
impdp utest/utest@orcl
directory
=dmpdir
schemas
=e01
network_link
=sourcedatabase
remap_schema
=e01
:e0311
job_name
=impjob
impdp和expdp使用總結
今天在專案中遇到了如下情況 備份恢復一張資料量比較大 大約200w條記錄,約119m大小 的表時,使用慣用的exp imp工具進行操作時,工具直接卡死 或是操作時間過長 於是想起之前使用過的impdp expdp資料幫浦工具,其優點在於大資料量匯入匯出時高效快捷。使用資料幫浦後,漫長的大表匯出過程變...
oracle使用expdp和impdp搭建資料庫
檢視幫助 expdp help parallel 是並行數,expdp和impdp都可以使用這個引數 expdp匯出 1.建立資料幫浦路徑 sql create or replace directory imostdb as opt oracle imost directory created.需確...
oracle的expdp和impdp命令研究
建立遠端資料連線 create database link db mzdb11 connect to ytmztwo identified by ytmztwo909 using mzdb11 建立本地目錄 create directory db mz as c 授權使用者讀寫 grant read...