Oracle中exp的使用2
在使用exp的時(shí)候,需要注意以下幾點(diǎn)
當(dāng)前客戶端版本、目標(biāo)客戶端的版本、注意需要設(shè)置字符集,也就是NLS_LANG?
參考o(jì)racle字符集的設(shè)置
NLS_LANG格式為:
[NLS_LANGUAGE]_[NLS_TERRITORY].[NLS_CHARACTERSET].
NLS_LANGUAGE指的是Oracle消息使用的語(yǔ)言,日期中月分和日顯示
NLS_TERRITORY指的是貨比和數(shù)字格式,地區(qū)和計(jì)算星期及日期的習(xí)慣
NLS_CHARACTERSET指的是控制客戶端應(yīng)用程序使用的字符集
select* from nls_database_parameters ;
如:NLS_LANG=AMERICAN_AMERICA.ZHS16GBK
SQL>SELECT USERENV ('language') FROM DUAL;?
USERENV('LANGUAGE')
----------------------------------------------------
AMERICAN_AMERICA.ZHS16GBK
http://docs.oracle.com/cd/E12102_01/books/AnyInstAdm784/AnyInstAdmPreInstall18.html
邏輯導(dǎo)出
exp user1/password@db1 file=TABLE1.dmp log=TABLE1.log?
tables=table1 buffer=10485760 constraints=n compress=n statistics=none?
indexes=n triggers=n grants=n
1.表模式導(dǎo)出
exp hr/hr file=hr.dmp tables=employees,locations log=hr.log
exp hr/hr file=hr.dmp tables=\(employees,locations\) log=hr.log
exp hr/hr file=hr.dmp tables=scott.emp log=scott.log
(需要exp_full_database權(quán)限)
grant exp_full_database to hr ;
2.用戶模式導(dǎo)出
exp hr/hr file=hr_all.dmp owner=hr log=hr_all.log
exp hr/hr file=hr_scott.dmp owner=\(hr,scott\) log=hr_scott.log
3.數(shù)據(jù)庫(kù)模式導(dǎo)出
需要exp_full_database權(quán)限)
exp hr/hr file=full.dmp full=y log=full.log
4.可傳輸表空間模式
待補(bǔ)充
其他參數(shù)使用:
不導(dǎo)出索引、約束、授權(quán)和觸發(fā)器
exp hr/hr file=all.dmp indexes=n constraints=n grants=n triggers=n
文件大小限制?估算導(dǎo)出數(shù)據(jù)大小
select sum(bytes)/1024/1024 from user_segments;
預(yù)計(jì)導(dǎo)出的dmp文件大小,不能超出系統(tǒng)限制(fat32單個(gè)文件不能超過(guò)4G,ntfs單個(gè)文件不能超過(guò)2T,ext3理想情況下不能超過(guò)2T)
exp hr/hr file=limits1.dmp,limits2.dmp filesize=2048M log=limits.log
exp hr/hr file=limits1.dmp,limits2.dmp filesize=130K log=limits.log
如果指定filesize的大小,必須為file參數(shù)指定文件名,多個(gè)之間使用逗號(hào)分隔,如果指定的文件多于實(shí)際產(chǎn)生的文件,多余指定的文件不會(huì)生成。如果少于實(shí)際產(chǎn)生的文件,那么在導(dǎo)出的過(guò)程中會(huì)提示輸入新的文件名,如Export file: expdat.dmp >
參數(shù)文件使用
cat parameter.txt
userid=scott/tiger
file=scott.dmp
tables=emp
log=scott.log
exp parfile=parameter.txt
按照條件導(dǎo)出
cat parameter.txt
userid=scott/tiger
file=scott.dmp
tables=emp
query='whereempno = 7369'
log=scott.log
exp parfile=parameter.txt
或者
exp scott/tiger file=scott.dmp tables=emp query="'where empno=7369'" log=scott.log
條件中存在字符串
cat parameter.txt
userid=scott/tiger
file=scott.dmp
tables=emp
query='wheresal < 8000 and job = ''SALESMAN'''
log=scott.log
exp parfile=parameter.txt
只導(dǎo)出表結(jié)構(gòu)
expscott/tiger file=scott.dmp rows=n owner=scott log=scott.log
direct參數(shù)
如果導(dǎo)出的對(duì)象中存在blob,clob,采用直接路徑導(dǎo)出會(huì)報(bào)錯(cuò)
8i,9i中特別注意,一般單個(gè)表加direct=y,按照用戶或數(shù)據(jù)庫(kù)一般不使用直接方式
個(gè)人在使用的使用一般常用system進(jìn)行操作。
轉(zhuǎn)載于:https://blog.51cto.com/sugarlovecxq/1686752
總結(jié)
以上是生活随笔為你收集整理的Oracle中exp的使用2的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: Linux中断(interrupt)子系
- 下一篇: andriod 新建 Activity_