2012年8月12日 星期日

Oracle ERP R12. - Resubmitting WIP_MOVE_TXN_INTERFACE

Resubmitting Failed Move Transactions

若WIP_MOVE_TXN_INTERFACE執行失敗後,經修正完錯誤原因後,要重新執行的Update 語法如下 :


UPDATE WIP_MOVE_TXN_INTERFACE A
   SET A.GROUP_ID = NULL,
       A.TRANSACTION_ID = NULL,
       A.PROCESS_STATUS = 1
 WHERE A.TRANSACTION_ID = <要重新執行的那些資料>


參考文件 : Oracle - Resolving Period Close Pending Transaction

Oracle ERP R12. - Resubmitting Pending Material Transactions

若有些交易卡在MTL_TRANSACTION_INTERFACE,並在修正完錯誤資料欄位,想透過Update interface的方式來重新執行,其Update 語法如下 :


UPDATE MTL_TRANSACTIONS_INTERFACE A
   SET A.PROCESS_FLAG = 1,
       A.LOCK_FLAG = 2,
       A.TRANSACTION_MODE = 3,
       A.ERROR_CODE = NULL
 WHERE A.PROCESS_FLAG = 3 --ERROR


Ps. 但一般仍建議由Oracle Standard 的Transaction Interface功能(INVTVPTX)來Resubmit

參考文件 : Oracle - Resolving Period Close Pending Transaction

Oracle ERP R12. - Resubmitting WIP_COST_TXN_INTERFACE

Resubmitting Failed or Pending Resource Transactions

若工單過站charge resource交易的成本收集失敗,其交易會卡在WIP_COST_TXN_INTERFACE,並會造成無法關結期間.
重新執行的Update語法如下:


UPDATE WIP_COST_TXN_INTERFACE A
   SET A.GROUP_ID = NULL,
       A.TRANSACTION_ID = NULL,
       A.REQUEST_ID = NULL,
       A.PROCESS_STATUS = 1
 WHERE A.PROCESS_STATUS = 3 --Error


參考文件 : Oracle - Resolving Period Close Pending Transaction

Oracle ERP R12. - Resubmitting MTL_MATERIAL_TRANSACTIONS's Uncosted transactions

Resubmitting Uncosted Transactions

若MTL_MATERIAL_TRANSACTIONS有些交易執行Cost Manager失敗,導致該交易的成本未收集到,並影响關帳,其重新執行的Update 語法如下:


UPDATE MTL_MATERIAL_TRANSACTIONS A
   SET A.COSTED_FLAG = 'N',
       A.TRANSACTION_GROUP_ID = NULL
 WHERE A.COSTED_FLAG IS NOT NULL


參考文件 : Oracle - Resolving Period Close Pending Transaction

Oracle ERP R12 - Resubmitting MTL_MATERIAL_TRANSACTIONS_TEMP

Resubmitting Unporcessed Material Transactions :

Unporcessed Material Transactions指MTL_MATERIAL_TRANSACTIONS_TEMP內有未處理完成或失敗的交易.其重新執行的Update 語法如下 :


UPDATE MTL_MATERIAL_TRANSACTIONS_TEMP A
   SET A.PROCESS_FLAG = 'Y',
       A.LOCK_FLAG = 'N',
       A.TRANSACTION_MODE = 3,
       A.ERROR_CODE = NULL
 WHERE A.TRANSACTION_HEADER_ID = <要重新執行的TRANSACTION_HEADER_ID>



參考文件 : Oracle - Resolving Period Close Pending Transaction

2012年8月2日 星期四

Oracle DBA - Use DBMS_PROFILER performance tuning

DBMS_PROFILER該工具包主要用來追蹤PL/SQL執行過程中所使用的時間及SQL語句,以供DBA人員分析該PL/SQL裡TOP 10的SQL為何,DBA就可進一步針對該SQL進行SQL Tuning。

<前置作業>
Step 1. 請先檢查該Package是否已存在:

SELECT *
  FROM DBA_OBJECTS A
 WHERE A.OBJECT_NAME = 'DBMS_PROFILER';
若沒有資料,則表示該Package未建立,故請透過以下步驟來建立所需的Package及Table。
(該Package好像是Oracle 8i開始提供的)
Step 1.1. 請使用DBA權限登入 (例 : sqlplus / as sysdba)
Step 1.2. SQL>@?/rdbms/admin/profload.sql  (profload.sql將會建立該Package並Grant權限)
Step 1.3. SQL>@?/rdbms/admin/proftab.sql
      (proftab.sql將會建立PLSQL_PROFILER_DATA / PLSQL_PROFILER_UNITS / PLSQL_PROFILER_RUNS)

Step 2. 由Metalink下戴243755.1下戴Script ==> profiler.sql
Script to produce HTML report with top consumers out of PL/SQL Profiler DBMS_PROFILER data [ID 243755.1]

<PL/SQL 執行數據的收集>
Step 1. 執行DBMS_PROFILER.START_PROFILER來啟動收集程序 。
Step 2. 執行所需監控的PL/SQL。
Step 3. 執行DBMS_PROFILER.STOP_PROFILER來停止收集程序。
Step 4. 執行profiler.sql 進行HTML文件的產生

例 :

begin
  DBMS_PROFILER.START_PROFILER('你自己的說明'); --啟動收集程序
  --
  MY_PKG.P_TEST();  --所需監控的PL/SQL
  --
  DBMS_PROFILER.STOP_PROFILER(); --停止收集程序
end;


SQL>@profiler.sql

其產出的HTML文件就會列出其TOP 10的SQL




Oracle DBA - Performance tuning 參考文件

Master Note: Database Performance Overview [ID 402983.1]


這份文件內容如下 : 詳細資料請自行登入metalink後搜尋402983.1該文獻即可
Purpose
Questions and Answers
* Troubleshooting Guides
* Common Problem Topics
Slow Database Performance
Concurrency Issues
Database Hangs/Spins
Session Hangs/Spins
Locking Issues
Deadlock
Upgrade Planning
Debugging Waits for Various Events
Library Cache/Mutex Contention/Cursor Type Events:
Other Types:
Common Causes of Performance issues
Cursor Sharing/High Version Counts for Cursors
High CPU usage
Issues With waits for 'log file sync'
WAITED TOO LONG FOR A ROW CACHE ENQUEUE LOCK!
Buffer Busy/Cache Buffers Chains Latch waits
SYSAUX Issues
Performance Diagnostics References
General Diagnostics Overview
AWR/Statspack
10046 Trace
Systemstates/Hanganalyze
Errorstacks for Performance Issues
PStack
PL/SQL Profiler
OS Watcher
LTOM
Trace/Result Interpretation
Performance (and other) Webcasts
Performance and Scalability White Papers and Documentation
Interacting With Performance Support
Community: Database Tuning
References