最近在匯出schema層級的資料時被hang住,不得不停止當前的匯出作業,如果你有類似的問題,請繼續往下看。
1、問題描述
匯出整個schema時資料庫被hang住,如下所示
符號">"是由SecureCRT設定的每300秒發送一次
Oracle@Dev-DB-04:~> expdp goex_admin/xxx directory=db_dump_dir dumpfile=gobo2.dmp logfile=gobo2.log schemas=goex_admin
Export: Release 10.2.0.4.0 - 64bit Production on Thursday, 23 May, 2013 9:30:52
Copyright (c) 2003, 2007, Oracle. All rights reserved.
Connected to: Oracle Database 10g Release 10.2.0.4.0 - 64bit Production
Starting "GOEX_ADMIN"."SYS_EXPORT_SCHEMA_01": goex_admin/******** directory=db_dump_dir dumpfile=gobo2.dmp
logfile=gobo2.log schemas=goex_admin
>>>>
-->查詢超長時間的操作,沒有任何結果,也就是說datapump壓根啥也沒有做
goex_admin@GOBO2> @long_ops
no rows selected
-->查詢job產生的對象的表,表存在
goex_admin@GOBO2> @datapump_master_tb
STATUS OBJECT_ID OBJECT_TYPE OWNER_OBJECT
------- ---------- ------------------- --------------------------------------------------
VALID 315838 TABLE GOEX_ADMIN.SYS_EXPORT_SCHEMA_01
2、問題解決
參數fixed_date引起資料庫匯入匯出被hang住 [ID 563171.1]
goex_admin@GOBO2> show parameter fixed
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
fixed_date string 20130506 16:00:00
-- Author : Robinson
goex_admin@GOBO2> alter system set fixed_date=none;
System altered.
-->參數fixed_date被移除後,匯出正常
oracle@Dev-DB-04:~> expdp goex_admin/xxx directory=db_dump_dir dumpfile=gobo2.dmp logfile=gobo2.log schemas=goex_admin
Export: Release 10.2.0.4.0 - 64bit Production on Thursday, 23 May, 2013 9:30:52
Copyright (c) 2003, 2007, Oracle. All rights reserved.
Connected to: Oracle Database 10g Release 10.2.0.4.0 - 64bit Production
Starting "GOEX_ADMIN"."SYS_EXPORT_SCHEMA_01": goex_admin/******** directory=db_dump_dir dumpfile=gobo2.dmp
logfile=gobo2.log schemas=goex_admin
>>>>
Estimate in progress using BLOCKS method...
Processing object type SCHEMA_EXPORT/TABLE/TABLE_DATA
Total estimation using BLOCKS method: 89.31 MB
Processing object type SCHEMA_EXPORT/USER
Processing object type SCHEMA_EXPORT/SYSTEM_GRANT
.......................
Processing object type SCHEMA_EXPORT/POST_SCHEMA/PROCACT_SCHEMA
. . exported "GOEX_ADMIN"."GO_GA_CUST_TBL" 148.4 KB 551 rows
. . exported "GOEX_ADMIN"."GO_GA_ACC_TBL" 167.9 KB 533 rows
3、參數FIXED_DATE
FIXED_DATE enables you to set a constant date that SYSDATE will always return instead of the current date.
To undo a fixed date setting, specify FIXED_DATE=NONE. This parameter is useful primarily for testing.
The value can be in the format shown above or in the default Oracle date format, without a time.
FIXED_DATE參數可以定義當前的日期為一個常量而不隨系統日期的變化而變化,通常用於測試目的使用
對於使用datapump進行匯入匯出的情形,應考慮將該參數設定為none來避免匯入匯出hang住的問題
該參數影響的版本Version 10.1.0.2 to 11.2.0.3