oracle11g之expdp產生library cache lock及tablespace autoextend off_alert log
--------過行如下匯出指令碼hang住了
expdp tbl_bck/system schemas=tbl_bck dumpfile=dir_tbl_bck:expdp_tbl_bck.dmp
---等待事件的會話請求的object handle address
select p1raw from v$session where sid=48;--48為請求鎖會話
--定位持鎖會話的會話地址
select * from v$libcache_locks where object_handle='000007FF57DB6E40' and mode_held=3;
-- statement suspended, wait error to be cleared --此事件即會話語句出錯,導致會話語句暫時掛起,等待處理完畢後即可恢復正常
select sid,serial#,(select sql_text from v$sql where sql_id=v$session.sql_id),event from v$session where saddr='000007FF627AFDB8';---saddr即上述的持鎖會話查詢出的持鎖會話
--殺掉持鎖會話
alter system kill session '52,479'---等待事件的會話請求的object handle address
select p1raw from v$session where sid=48;
--定位持鎖會話的會話地址
select * from v$libcache_locks where object_handle='000007FF57DB6E40' and mode_held=3;
-- statement suspended, wait error to be cleared
select sid,serial#,(select sql_text from v$sql where sql_id=v$session.sql_id),event from v$session where saddr='000007FF627AFDB8';---saddr即上述的持鎖會話查詢出的持鎖會話
--殺掉持鎖會話
alter system kill session '52,479'
C:\Users\123>expdp tbl_bck/system schemas=tbl_bck dumpfile=dir_tbl_bck:expdp_tbl
_bck.dmp
Export: Release 11.2.0.1.0 - Production on Fri May 17 15:54:34 2013
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit
Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
ORA-39006: internal error
ORA-39068: invalid master table data in row with PROCESS_ORDER=-3
ORA-01658: unable to create INITIAL extent for segment in tablespace TBS_NEWLY --好像和表空間有關
ORA-39097: Data Pump job encountered unexpected error -1658
--檢視並配置表空間為自動擴充套件
SQL> select * from dba_data_files;
FILE_NAME FILE_ID TABLESPACE_NAME BYTES BLOCKS STATUS RELATIVE_FNO AUTOEXTENSIBLE MAXBYTES MAXBLOCKS INCREMENT_BY USER_BYTES USER_BLOCKS ONLINE_STATUS
-------------------------------------------------------------------------------- ---------- ------------------------------ ---------- ---------- --------- ------------ -------------- ---------- ---------- ------------ ---------- ----------- -------------
D:\ORACLE11G_64BIT\ORADATA\SECOND\SYSTEM01.DBF 1 SYSTEM 1268776960 154880 AVAILABLE 1 YES 3435972198 4194302 1280 1267728384 154752 SYSTEM
D:\ORACLE11G_64BIT\ORADATA\SECOND\SYSAUX01.DBF 2 SYSAUX 629145600 76800 AVAILABLE 2 YES 3435972198 4194302 1280 628097024 76672 ONLINE
D:\ORACLE11G_64BIT\ORADATA\SECOND\UNDOTBS01.DBF 3 UNDOTBS1 408944640 49920 AVAILABLE 3 YES 3435972198 4194302 640 407896064 49792 ONLINE
D:\ORACLE11G_64BIT\ORADATA\SECOND\USERS01.DBF 4 USERS 49807360 6080 AVAILABLE 4 YES 3435972198 4194302 160 48758784 5952 ONLINE
D:\ORACLE11G_64BIT\ORADATA\SECOND\TBS _NEWLY.DBF 5 TBS_NEWLY 10485760 1280 AVAILABLE 5 NO 0 0 0 9437184 1152 ONLINE
SQL> alter database datafile 'D:\ORACLE11G_64BIT\ORADATA\SECOND\TBS _NEWLY.DBF' autoextend on;
Database altered
SQL> select * from dba_data_files;
FILE_NAME FILE_ID TABLESPACE_NAME BYTES BLOCKS STATUS RELATIVE_FNO AUTOEXTENSIBLE MAXBYTES MAXBLOCKS INCREMENT_BY USER_BYTES USER_BLOCKS ONLINE_STATUS
-------------------------------------------------------------------------------- ---------- ------------------------------ ---------- ---------- --------- ------------ -------------- ---------- ---------- ------------ ---------- ----------- -------------
D:\ORACLE11G_64BIT\ORADATA\SECOND\SYSTEM01.DBF 1 SYSTEM 1268776960 154880 AVAILABLE 1 YES 3435972198 4194302 1280 1267728384 154752 SYSTEM
D:\ORACLE11G_64BIT\ORADATA\SECOND\SYSAUX01.DBF 2 SYSAUX 629145600 76800 AVAILABLE 2 YES 3435972198 4194302 1280 628097024 76672 ONLINE
D:\ORACLE11G_64BIT\ORADATA\SECOND\UNDOTBS01.DBF 3 UNDOTBS1 408944640 49920 AVAILABLE 3 YES 3435972198 4194302 640 407896064 49792 ONLINE
D:\ORACLE11G_64BIT\ORADATA\SECOND\USERS01.DBF 4 USERS 49807360 6080 AVAILABLE 4 YES 3435972198 4194302 160 48758784 5952 ONLINE
D:\ORACLE11G_64BIT\ORADATA\SECOND\TBS _NEWLY.DBF 5 TBS_NEWLY 10485760 1280 AVAILABLE 5 YES 3435972198 4194302 1 9437184 1152 ONLINE
SQL>
---重置為禁用自動擴充套件
SQL> alter database datafile 'D:\ORACLE11G_64BIT\ORADATA\SECOND\TBS _NEWLY.DBF' autoextend off;
Database altered
--也可以直接檢視alert日誌分析定位問題:
DM00 started with pid=37, OS id=9568, job TBL_BCK.SYS_SQL_FILE_SCHEMA_01
Fri May 17 17:50:07 2013
DW00 started with pid=38, OS id=18732, wid=1, job TBL_BCK.SYS_SQL_FILE_SCHEMA_01
statement in resumable session 'TBL_BCK.SYS_SQL_FILE_SCHEMA_01' was suspended due to
ORA-01658: unable to create INITIAL extent for segment in tablespace TBS_NEWLY --很明顯與表空間有關
Fri May 17 17:57:17 2013
alter database datafile 'D:\ORACLE11G_64BIT\ORADATA\SECOND\TBS _NEWLY.DBF' autoextend on
Completed:
alter database datafile 'D:\ORACLE11G_64BIT\ORADATA\SECOND\TBS _NEWLY.DBF' autoextend on
Fri May 17 17:57:19 2013
statement in resumable session 'TBL_BCK.SYS_SQL_FILE_SCHEMA_01' was resumed
---使用sqlfile選項匯出create 相關的ddl語句到指定的檔案,sqlfile指定分為2部分:1為directory,2為指定的檔案
C:\Users\123>impdp tbl_bck/system schemas=tbl_bck dumpfile=dir_tbl_bck:expdp_tbl
_bck.dmp sqlfile=dir_tbl_bck:impdp_ddl.log
小結:
1,expdp與impdp選項很多
2,如出錯先查alert更快,而後為v$session相關檢視,最後才是trace檔案分析
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/9240380/viewspace-761389/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- oracle11g之v$libcache_locks處理library cache lock及library cache pinOracle
- Library Cache Pin 及 Library Cache Lock分析
- oracle library cache之library cache lock_library cache pin wait event釋義OracleAI
- library cache lock和library cache pin理解
- LIBRARY CACHE LOCK 等待事件事件
- 【TUNE_ORACLE】等待事件之“library cache lock”Oracle事件
- oracle 10049 event之library cache lockOracle
- 11G資料庫之library cache lock及library cache pin模擬結合hanganalyze定位資料庫
- library cache pin和library cache lock的診斷分析
- library cache lock和library cache pin區別總結
- latch:library cache lock等待事件事件
- oracle異常:library cache lockOracle
- 深入理解shared pool共享池之library cache的library cache lock系列四
- Shared pool的library cache lock/pin及硬解析
- sql version count引發cursor:pin s wait x及library cache latch library cache lockSQLAI
- 定位Library Cache pin,Library Cache lock等待的解決方法
- Oracle 11g業務使用者更改密碼後產生大量library cache lock等待Oracle密碼
- zt_如何平面解決library cache lock和library cache pin
- enq:Library cache lock/pin等待事件ENQ事件
- library cache lock 阻塞程式查詢
- Library cache lock/pin詳解(轉)
- 常用定位library cache lock的方法
- LIBRARY CACHE LOCK WAITS AND NO BLOCKER FOUNDAIBloC
- oracle 11g下如何捕捉library cache物件執行時產生的lock、pin等資訊Oracle物件
- High 'library cache lock' Wait Time Due to Invalid Login AttemptsAI
- RAC生產庫出現嚴重row cache lock和log file switch(archiving need)
- 短連線 引起的 library cache lock
- 查詢library cache lock的源頭
- zt_如何使用event 10049分析定位library cache lock and library cache pin
- Oracle11g 密碼延遲認證導致library cache lock的情況分析Oracle密碼
- 一次library cache lock 問題分析
- library cache pin/lock的解決辦法
- zt_library cache pin和lock等待分析
- 尋找 library cache lock 等待事件的session事件Session
- 'library cache lock'等待事件的處理方法事件
- 俺也談談 library cache lock 等待事件事件
- [20240824]跟蹤library cache lock library cache pin使用gdb.txt
- [20240920]跟蹤library cache lock library cache pin使用gdb.txt