oracle中$的用法,关于expdp 中query用法小结
今天看到群里有人問到關(guān)于在使用expdp導(dǎo)出數(shù)據(jù)中使用query參數(shù)報(bào)錯(cuò)的解決方法,自己也出于好奇心瞎折騰了一把,現(xiàn)記錄如下
1.第一次嘗試的時(shí)候[oracle@DB?~]$?expdp?scott/scott?tables=emp1?dumpfile=emp1.dmp?logfile=emp1.log?query=emp1:"where?rownum?
Export:?Release?11.2.0.4.0?-?Production?on?星期日?6月?18?01:06:05?2017
Copyright?(c)?1982,?2011,?Oracle?and/or?its?affiliates.??All?rights?reserved.
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
ORA-39001:?參數(shù)值無(wú)效
ORA-39035:?已經(jīng)指定了數(shù)據(jù)過濾器?SUBQUERY。
ORA-39001:?參數(shù)值無(wú)效
ORA-39035:?已經(jīng)指定了數(shù)據(jù)過濾器?SUBQUERY。
上述錯(cuò)誤說(shuō)明query語(yǔ)法寫的有問題
正確寫法要用\轉(zhuǎn)義引號(hào)
于是再次編寫了一下,執(zhí)行,OK![oracle@DB?~]$?expdp?scott/scott?tables=emp1?dumpfile=emp1.dmp?logfile=emp1.log?query=\"where?rownum?\
Export:?Release?11.2.0.4.0?-?Production?on?星期日?6月?18?01:18:52?2017
Copyright?(c)?1982,?2011,?Oracle?and/or?its?affiliates.??All?rights?reserved.
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
啟動(dòng)?"SCOTT"."SYS_EXPORT_TABLE_01":??scott/********?tables=emp1?dumpfile=emp1.dmp?logfile=emp1.log?query="where?rownum?
正在使用?BLOCKS?方法進(jìn)行估計(jì)...
處理對(duì)象類型?TABLE_EXPORT/TABLE/TABLE_DATA
使用?BLOCKS?方法的總估計(jì):?64?KB
處理對(duì)象類型?TABLE_EXPORT/TABLE/TABLE
.?.?導(dǎo)出了?"SCOTT"."EMP1"??????????????????????????????8.179?KB???????4?行
已成功加載/卸載了主表?"SCOTT"."SYS_EXPORT_TABLE_01"
******************************************************************************
SCOTT.SYS_EXPORT_TABLE_01?的轉(zhuǎn)儲(chǔ)文件集為:
/u01/app/oracle/admin/orcl/dpdump/emp1.dmp
作業(yè)?"SCOTT"."SYS_EXPORT_TABLE_01"?已于?星期日?6月?18?01:19:03?2017?elapsed?0?00:00:10?成功完成
通過上面截圖可以看到:1中雙引號(hào)和小于號(hào)前面都要加上反斜線\轉(zhuǎn)義,在實(shí)際oracle中會(huì)把這些反斜線去掉來(lái)執(zhí)行,注意觀察2處。
當(dāng)然結(jié)果是OK的,把原表備份一下然后刪除,導(dǎo)入驗(yàn)證一下,如下:
2.答主突發(fā)奇想又測(cè)試了一種情況,就是當(dāng)query條件中有大于號(hào)的情況。如下:[oracle@DB?~]$?expdp?scott/scott?tables=emp1?dumpfile=emp1_2.dmp?logfile=emp1.log?query=\"where?hiredate?>?to_date\(\'1982/01/02\',\'yyyy/mm/dd\'\)\"
-bash:?to_date('1982/01/02','yyyy/mm/dd')":?No?such?file?or?directory
看到結(jié)果沒,如果條件中有大于號(hào)而又沒有加反斜線,系統(tǒng)把這種大于號(hào)默認(rèn)是重定義符號(hào)。如下所示這種:
更改一下,再次執(zhí)行,就OK了。童鞋們請(qǐng)重點(diǎn)觀察下圖中標(biāo)注的1、2處。[oracle@DB?~]$?expdp?scott/scott?tables=emp1?dumpfile=emp1_2.dmp?logfile=emp1.log?query=\"where?hiredate?\>?to_date\(\'1982/01/02\',\'yyyy/mm/dd\'\)\"
Export:?Release?11.2.0.4.0?-?Production?on?星期日?6月?18?01:59:56?2017
Copyright?(c)?1982,?2011,?Oracle?and/or?its?affiliates.??All?rights?reserved.
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
啟動(dòng)?"SCOTT"."SYS_EXPORT_TABLE_01":??scott/********?tables=emp1?dumpfile=emp1_2.dmp?logfile=emp1.log?query="where?hiredate?>?to_date('1982/01/02','yyyy/mm/dd')"
正在使用?BLOCKS?方法進(jìn)行估計(jì)...
處理對(duì)象類型?TABLE_EXPORT/TABLE/TABLE_DATA
使用?BLOCKS?方法的總估計(jì):?64?KB
處理對(duì)象類型?TABLE_EXPORT/TABLE/TABLE
.?.?導(dǎo)出了?"SCOTT"."EMP1"??????????????????????????????8.125?KB???????3?行
已成功加載/卸載了主表?"SCOTT"."SYS_EXPORT_TABLE_01"
******************************************************************************
SCOTT.SYS_EXPORT_TABLE_01?的轉(zhuǎn)儲(chǔ)文件集為:
/u01/app/oracle/admin/orcl/dpdump/emp1_2.dmp
作業(yè)?"SCOTT"."SYS_EXPORT_TABLE_01"?已于?星期日?6月?18?02:00:01?2017?elapsed?0?00:00:04?成功完成
3.如果有童鞋想一下子導(dǎo)出多張表時(shí),需如下定義:expdp?scott/scott?tables=emp1,emp2?dumpfile=emp.dmp?logfile=emp1.log?query=emp1:\"where?rownum<5\",emp2:\"where?rownum<5\"
總結(jié)
以上是生活随笔為你收集整理的oracle中$的用法,关于expdp 中query用法小结的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 当前计算机领域中 有关计算机的性能指标,
- 下一篇: mysql 行级锁 索引_mysql 行