oracle数据泵导入提示00972,oracle数据库使用expdp指定FLASHBACK_TIME遇到ORA-39150错误 | 信春哥,系统稳,闭眼上线不回滚!...
目前正在做一個(gè)數(shù)據(jù)庫(kù)合并的項(xiàng)目,有一套系統(tǒng)使用分庫(kù)分表并且讀寫分離的架構(gòu),訂單系統(tǒng)和用戶系統(tǒng)都是6個(gè)寫庫(kù)和6個(gè)讀庫(kù),目前訂單系統(tǒng)已經(jīng)由6個(gè)寫庫(kù)合并為3個(gè)寫庫(kù),馬上要做用戶系統(tǒng)的數(shù)據(jù)庫(kù)合并工作,用戶系統(tǒng)使用到了OGG,在搭建測(cè)試環(huán)境時(shí),也要搭建OGG環(huán)境。
再搭建用戶系統(tǒng)的測(cè)試數(shù)據(jù)庫(kù)時(shí),使用了數(shù)據(jù)泵的方式,因?yàn)橐M量保證所有數(shù)據(jù)庫(kù)的數(shù)據(jù)盡量接近同一時(shí)間,指定了FLASHBACK_TIME選項(xiàng),再導(dǎo)出數(shù)據(jù)時(shí),遇到了ORA-39150錯(cuò)誤。
[oracle@SL010M6-DB-USER1 ~]$ expdp MEDA_USER1/xxxxxxxxxx DIRECTORY=expbak DUMPFILE=user1.dmp FLASHBACK_TIME=\"TO_TIMESTAMP\('2017-03-20 10:25:00', 'YYYY-MM-DD HH24:MI:SS'\)\"
Export: Release 11.2.0.4.0 - Production on Mon Mar 20 10:36:32 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: invalid argument value
ORA-39150: bad flashback time
ORA-01841: (full) year must be between -4713 and +9999, and not be 0
ORA-00907: missing right parenthesis
使用parfile的方式同樣也遇到這個(gè)錯(cuò)誤。
[oracle@SL010M6-DB-USER1 ~]$ vi p1.par
DIRECTORY=expbak
DUMPFILE=user1.dmp
FLASHBACK_TIME=TO_TIMESTAMP"('2017-03-20 10:10:00','YYYY-MM-DD HH24:MI:SS')"
[oracle@SL010M6-DB-USER1 ~]$ expdp MEDA_USER1/xxxxxxxxxxx parfile=p1.par
Export: Release 11.2.0.4.0 - Production on Mon Mar 20 10:17:57 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: invalid argument value
ORA-39150: bad flashback time
ORA-01841: (full) year must be between -4713 and +9999, and not be 0
ORA-00972: identifier is too long
查了下資料,發(fā)現(xiàn)使用expdp指定FLASHBACK_TIME選項(xiàng)的時(shí)候,絕大多數(shù)情況都會(huì)遇到這個(gè)問(wèn)題,而且沒(méi)有找到好一些的解決方法,因?yàn)槲业男枨笫?個(gè)數(shù)據(jù)庫(kù)都要指定相同的時(shí)間,所以使用FLASHBACK_TIME=to_timestamp(localtimestamp)和FLASHBACK_TIME=to_timestamp_tz(systimestamp)的方法是不行的,這都不能保證6個(gè)數(shù)據(jù)庫(kù)指定的都是同一時(shí)間,所以將FLASHBACK_TIME的方式改成了FLASHBACK_SCN的方式,這樣就需要在6個(gè)數(shù)據(jù)庫(kù)查到同一時(shí)間的SCN,然后分別按照對(duì)應(yīng)的SCN導(dǎo)出數(shù)據(jù)就可以了。
可以通過(guò)timestamp_to_scn函數(shù)來(lái)查看具體的時(shí)間對(duì)應(yīng)的SCN值。
SQL> col scn for 9999999999999999
SQL> select timestamp_to_scn(to_timestamp('2017-03-20 10:25:00','yyyy-mm-dd hh24.mi.ss')) as scn from dual;
SCN
------------------
149893337269
然后在通過(guò)FLASHBACK_SCN的方式導(dǎo)出數(shù)據(jù),再測(cè)試數(shù)據(jù)庫(kù)中導(dǎo)入就可以了。
[oracle@SL010M6-DB-USER1 ~]$ expdp MEDA_USER1/xxxxxxxxx DIRECTORY=expbak DUMPFILE=user6.dmp FLASHBACK_SCN=149893337269
Export: Release 11.2.0.4.0 - Production on Mon Mar 20 10:31:32 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
FLASHBACK automatically enabled to preserve database integrity.
Starting "MEDA_USER1"."SYS_EXPORT_SCHEMA_01": MEDA_USER1/******** DIRECTORY=expbak DUMPFILE=user6.dmp FLASHBACK_SCN=149893337269
Estimate in progress using BLOCKS method...
Processing object type SCHEMA_EXPORT/TABLE/TABLE_DATA
Total estimation using BLOCKS method: 2.499 GB
Processing object type SCHEMA_EXPORT/PRE_SCHEMA/PROCACT_SCHEMA
Processing object type SCHEMA_EXPORT/SEQUENCE/SEQUENCE
Processing object type SCHEMA_EXPORT/TABLE/TABLE
Processing object type SCHEMA_EXPORT/TABLE/GRANT/OWNER_GRANT/OBJECT_GRANT
Processing object type SCHEMA_EXPORT/TABLE/COMMENT
Processing object type SCHEMA_EXPORT/FUNCTION/FUNCTION
Processing object type SCHEMA_EXPORT/PROCEDURE/PROCEDURE
Processing object type SCHEMA_EXPORT/FUNCTION/ALTER_FUNCTION
Processing object type SCHEMA_EXPORT/PROCEDURE/ALTER_PROCEDURE
Processing object type SCHEMA_EXPORT/TABLE/INDEX/INDEX
Processing object type SCHEMA_EXPORT/TABLE/CONSTRAINT/CONSTRAINT
Processing object type SCHEMA_EXPORT/TABLE/INDEX/STATISTICS/INDEX_STATISTICS
Processing object type SCHEMA_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS
. . exported "MEDA_USER1"."ZT_USR_M" 546.0 MB 2442145 rows
. . exported "MEDA_USER1"."ZT_USR_M_0928" 516.8 MB 2442145 rows
. . exported "MEDA_USER1"."APP_SIGN_HISTORY" 451.6 MB 13544918 rows
. . exported "MEDA_USER1"."ZT_USR_SHIPPING_INFO_20170222" 206.2 MB 951391 rows
. . exported "MEDA_USER1"."ZT_USR_SHIPPING_INFO" 168.0 MB 784397 rows
. . exported "MEDA_USER1"."ZT_USR_UGO_E" 115.1 MB 2442145 rows
. . exported "MEDA_USER1"."IF_USER_TICKETS" 45.59 MB 755073 rows
. . exported "MEDA_USER1"."ZT_SHOW_USRSIGN" 40.03 MB 108375 rows
. . exported "MEDA_USER1"."ZT_USR_REGIS" 22.40 MB 472984 rows
. . exported "MEDA_USER1"."ZT_USR_KEY" 20.33 MB 883720 rows
. . exported "MEDA_USER1"."IF_USER_POINT" 9.007 MB 191636 rows
. . exported "MEDA_USER1"."ZT_USR_IDCARD" 3.753 MB 36596 rows
. . exported "MEDA_USER1"."ZT_USR_MOBILE_FEEDBACK" 3.337 MB 17573 rows
. . exported "MEDA_USER1"."ZT_USR_NEW_FEEDBACK" 1.329 MB 7995 rows
. . exported "MEDA_USER1"."ELECTRONIC_INVOICE_MOBILE" 12.34 KB 146 rows
. . exported "MEDA_USER1"."GG_HEARTBEAT" 5.835 KB 1 rows
. . exported "MEDA_USER1"."UC_MIDDLE_USER" 6.679 KB 0 rows
. . exported "MEDA_USER1"."ZT_USR_AWARD_ROLE" 8.335 KB 1 rows
. . exported "MEDA_USER1"."ZT_USR_ADDR_WHITE" 0 KB 0 rows
. . exported "MEDA_USER1"."ZT_USR_UPDATE_TMP" 0 KB 0 rows
Master table "MEDA_USER1"."SYS_EXPORT_SCHEMA_01" successfully loaded/unloaded
******************************************************************************
Dump file set for MEDA_USER1.SYS_EXPORT_SCHEMA_01 is:
/u01/app/oracle/expbk/user6.dmp
Job "MEDA_USER1"."SYS_EXPORT_SCHEMA_01" successfully completed at Mon Mar 20 10:31:57 2017 elapsed 0 00:00:23
總結(jié)
以上是生活随笔為你收集整理的oracle数据泵导入提示00972,oracle数据库使用expdp指定FLASHBACK_TIME遇到ORA-39150错误 | 信春哥,系统稳,闭眼上线不回滚!...的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: php detailview,GridV
- 下一篇: c语言订餐管理系统报告,用c语言编程小型