一般透過INTERFACE 執行WO Import時,若有資料欄錯誤,則其系統都會在interface或其它的error table內紀錄錯誤欄位及原因。但WIP_JOB_SCHEDULE_INTERFACE可能有種狀況就是沒有很明確的顯示原因,這時請檢查一下,若你要import的WO狀態是Released,則其Inventory period必需是Open的。但若是Unreleased狀態則不會卡。
<以上純屬個人經驗,若有錯誤還請不吝指教~>
1. 這是個初學農友的農友日誌~ 2. Oracle ERP 分享 3. Oracle DBA 心得 4. Android 開發心得 5. MoJo寵物手作粉絲成員 6. 程式客製及外包專案接案
2011年12月30日 星期五
2011年12月28日 星期三
Oracle ERP R12 - 帳號密碼檢查FUNCTION
FND_WEB_SEC.VALIDATE_LOGIN(:USER_ACCOUNT,:PASSWORD)
其回傳值為:
Y ==> 帳號密碼正確
N ==> 帳號或密碼不正確
其回傳值為:
Y ==> 帳號密碼正確
N ==> 帳號或密碼不正確
2011年12月20日 星期二
Oracle ERP R12. 刪除已存在資料Document Sequence
因為Oracle ERP 的Document Sequence一經設定就不予許刪除重指定,故若傳票編碼設定後就不能修改.但現實狀況裡,可能遇到期初的思慮不週導致後來需要變更Document sequence assign之狀況.
以下文章為顧問公司所提供之Document Sequence刪除的建議步驟:
※以下針對已Assignment Document
Sequence做刪除,若僅define Document Sequence並未Assign給任何Category並需要刪除者,處理3. DROP DATABASE SEQUNCE 及4. DELETE SEQUENCE DEFINE TABLE(第3步的DATABASE SEQUENCE應該還未建立)
Step 1. 資料備份
CREATE TABLE
AP_DOC_SEQUENCE_AUDIT_BK AS
SELECT *
FROM AP_DOC_SEQUENCE_AUDIT;
CREATE TABLE
AR_DOC_SEQUENCE_AUDIT_BK AS
SELECT *
FROM AR_DOC_SEQUENCE_AUDIT;
CREATE TABLE
FND_DOC_SEQUENCE_AUDIT_BK AS
SELECT *
FROM FND_DOC_SEQUENCE_AUDIT;
CREATE TABLE
GL_DOC_SEQUENCE_AUDIT_BK AS
SELECT *
FROM GL_DOC_SEQUENCE_AUDIT;
CREATE TABLE
FND_DOC_SEQUENCE_ASSIGNS_BK AS
SELECT *
FROM
FND_DOC_SEQUENCE_ASSIGNMENTS;
CREATE TABLE
FND_DOCUMENT_SEQUENCES_BK AS
SELECT *
FROM FND_DOCUMENT_SEQUENCES;
Step 2. 刪除Audit table
/* 若已經部份用舊編號,以新的sequence
update回各table(ex: RA_CUSTOMER_TRX_ALL,
AP_INVOICES_ALL...) doc_sequence_id,
doc_sequence_value 之後,
要將audit table刪除,再補(insert into )新的 document_sequence_value,
doc_sequence_id, doc_sequence_assignment_id 資料, 以避免相關的 "Audit Report xxxx" 標準報表錯誤.
*/
<AP Document Number 記錄檔 :
包括 AP 立帳, AP 付款>
DELETE
FROM AP_DOC_SEQUENCE_AUDIT adsa
WHERE 1=1
AND EXISTS
(
SELECT 'X'
FROM FND_DOC_SEQUENCE_ASSIGNMENTS fdca
WHERE 1=1
AND fdca.set_of_books_id = :p_set_of_books_id -- ledger_id
AND fdca.application_id = nvl(:p_application_id , fdca.application_id) -- 101: gl ; 200: ap ; 222: ar ; 660 : om
AND trunc(fdca.start_date) >= trunc(:p_start_date)
AND trunc(fdca.end_date) <= trunc(:p_end_date)
AND fdca.doc_sequence_id = adsa.doc_sequence_id
AND fdca.doc_sequence_assignment_id = adsa.doc_sequence_assignment_id
);
<AR Document Number 記錄檔 : 包括AR 立帳, AR收款, AR ADJUSTMENT>
DELETE
FROM AR_DOC_SEQUENCE_AUDIT adsa
WHERE 1=1
AND EXISTS
(
SELECT 'X'
FROM FND_DOC_SEQUENCE_ASSIGNMENTS fdca
WHERE 1=1
AND fdca.set_of_books_id = :p_set_of_books_id -- ledger_id
AND fdca.application_id = nvl(:p_application_id , fdca.application_id) -- 101: gl ; 200: ap ; 222: ar ; 660 : om
AND trunc(fdca.start_date) >= trunc(:p_start_date)
AND trunc(fdca.end_date) <= trunc(:p_end_date)
AND fdca.doc_sequence_id = adsa.doc_sequence_id
AND fdca.doc_sequence_assignment_id = adsa.doc_sequence_assignment_id
);
<FND Document Number 記錄檔 :
包括 OM SALES ORDER NUMBERING , WSH 出貨DELIVERY NUMBERING>
**(若只要刪除 AR/AP 代傳票 以及 GL 傳票 序號, 此一 SCRIPT 不要執行!)**
DELETE
FROM FND_DOC_SEQUENCE_AUDIT fdsa
WHERE 1=1
AND EXISTS
(
SELECT 'X'
FROM FND_DOC_SEQUENCE_ASSIGNMENTS fdca
WHERE 1=1
AND fdca.set_of_books_id = :p_set_of_books_id -- ledger_id
AND fdca.application_id = nvl(:p_application_id , fdca.application_id) -- 101: gl ; 200: ap ; 222: ar ; 660 : om
AND trunc(fdca.start_date) >= trunc(:p_start_date)
AND trunc(fdca.end_date) <= trunc(:p_end_date)
AND fdca.doc_sequence_id = fdsa.doc_sequence_id
AND fdca.doc_sequence_assignment_id = fdsa.doc_sequence_assignment_id
);
<GL Document Number 記錄檔 :
傳票序號>
DELETE
FROM GL_DOC_SEQUENCE_AUDIT gdsa
WHERE 1=1
AND EXISTS
(
SELECT 'X'
FROM FND_DOC_SEQUENCE_ASSIGNMENTS fdca
WHERE 1=1
AND fdca.set_of_books_id = :p_set_of_books_id -- ledger_id
AND fdca.application_id = nvl(:p_application_id , fdca.application_id) -- 101: gl ; 200: ap ; 222: ar ; 660 : om
AND trunc(fdca.start_date) >= trunc(:p_start_date)
AND trunc(fdca.end_date) <= trunc(:p_end_date)
AND fdca.doc_sequence_id = gdsa.doc_sequence_id
AND fdca.doc_sequence_assignment_id = gdsa.doc_sequence_assignment_id
);
<DROP DATABASE SEQUNCE :
產生的SCRIPT , 再丟到 SQL*PLUS 執行 >
SELECT 'DROP SEQUENCE APPLSYS.' || fds.DB_SEQUENCE_NAME || ';' DROP_SCRIPT, fds.*
FROM FND_DOCUMENT_SEQUENCES fds
WHERE 1=1
AND fds.application_id = nvl(:p_application_id , fds.application_id) -- 101: gl ; 200: ap ; 222: ar ; 660 : om
AND (
upper(:p_only_arapgl) = 'N' OR
( upper(:p_only_arapgl) = 'Y' OR
fds.application_id IN ( 101, 200, 222 ) -- 101: gl ; 200: ap ; 222: ar
)
)
AND trunc(fds.start_date) >= trunc(:p_start_date)
AND trunc(fds.end_date) <= trunc(:p_end_date)
AND fds.DB_SEQUENCE_NAME is NOT NULL
AND EXISTS ----指定帳本, 以避免將所有的 DB SEQUENCE都DROP 掉
(
SELECT 'X'
FROM FND_DOC_SEQUENCE_ASSIGNMENTS fdca
WHERE 1=1
AND fdca.set_of_books_id = :p_set_of_books_id -- ledger_id
AND fdca.doc_sequence_id = fds.doc_sequence_id
);
<DELETE SEQUENCE DEFINE TABLE :
先刪此一TABLE, 因為FND_DOC_SEQUENCE_ASSIGNMENTS TABLE 才能判別 帳本 (SET_OF_BOOKS_ID)>
DELETE
FROM FND_DOCUMENT_SEQUENCES fds
WHERE 1=1
AND fds.application_id = nvl(:p_application_id , fds.application_id) -- 101: gl ; 200: ap ; 222: ar ; 660 : om
AND (
upper(:p_only_arapgl) = 'N' OR
( upper(:p_only_arapgl) = 'Y' OR
fds.application_id IN ( 101, 200, 222 ) -- 101: gl ; 200: ap ; 222: ar
)
)
AND trunc(fds.start_date) >= trunc(:p_start_date)
AND trunc(fds.end_date) <= trunc(:p_end_date)
AND fds.NAME = nvl(:p_sequence_name, fds.NAME)
AND EXISTS --指定帳本, 以避免將所有的 DB SEQUENCE都DROP 掉
(
SELECT 'X'
FROM FND_DOC_SEQUENCE_ASSIGNMENTS fdca
WHERE 1=1
AND fdca.set_of_books_id = :p_set_of_books_id -- ledger_id
AND fdca.doc_sequence_id = fds.doc_sequence_id
);
<DELETE SEQUENCE ASSIGNMENTS TABLE>
DELETE
FROM FND_DOC_SEQUENCE_ASSIGNMENTS fdca
WHERE 1=1
AND fdca.set_of_books_id = :p_set_of_books_id -- ledger_id
AND fdca.application_id = nvl(:p_application_id , fdca.application_id) -- 101: gl ; 200: ap ; 222: ar ; 660 : om
AND trunc(fdca.start_date) >= trunc(:p_start_date)
AND trunc(fdca.end_date) <= trunc(:p_end_date)
AND (
upper(:p_only_arapgl) = 'N' OR
( upper(:p_only_arapgl) = 'Y' OR
fdca.application_id IN ( 101, 200, 222 ) -- 101: gl ; 200: ap ; 222: ar
)
)
2011年12月14日 星期三
Oracle Discoverer - 開啟Discoverer Desktop出現Failed to update the system registry
因為Microsoft 在windows 2000以後的版本,有對regedit (註冊表),進行權限的控管,故可能造成Desktop在執行時無法順利的變更其regedit值,故常會在開啟Desktop時出現錯誤訊息"Failed to update the system registry",不過就我的經驗似乎也沒有多大的影响,報表一樣可以正常開發。但總是覺得不完美,故上Meta link找了一下,總於找到相關的解決文件:
Doc ID : ID 197716.1
Doc ID : ID 197716.1
其主要的解法如下:
Step 1. 執行regedit
Step 2. 將以下機碼的權限予以適當的授權 (本人是給Users這群組)
Grant full control privilege on the following registry to Users group:
HKEY_LOCAL_MACHINE\Software\Oracle
HKEY_LOCAL_MACHINE\Software\Classes\.DIS
HKEY_LOCAL_MACHINE\Software\Classes\Dis.Document
HKEY_LOCAL_MACHINE\Software\Classes\Discoverer.Application
HKEY_LOCAL_MACHINE\Software\Classes\DIS
HKEY_LOCAL_MACHINE\Software\Classes\CLSID
2011年12月12日 星期一
Oracle Discoverer - 如何查詢Discoverer報表之授權
SQL 如下:
SELECT 'USER' ASSIGN_TYPE,
CASE
WHEN TRUNC(SYSDATE) BETWEEN FU.START_DATE AND
NVL(FU.END_DATE, TRUNC(SYSDATE)) THEN
FU.USER_NAME
ELSE
EEU.EU_USERNAME
END ASSIGN_TO,
FU.DESCRIPTION ASSIGN_TO_DESCRIPTION,
ED.DOC_NAME REPORT_NAME,
ED.DOC_DESCRIPTION REPORT_DESCRIPTION
FROM EUL10_US.EUL5_EUL_USERS EEU,
EUL10_US.EUL5_ACCESS_PRIVS EAP,
EUL10_US.EUL5_DOCUMENTS ED,
FND_USER FU
WHERE EAP.GD_DOC_ID = ED.DOC_ID
AND EAP.AP_EU_ID = EEU.EU_ID
AND EEU.EU_ROLE_FLAG = 0 --By User
AND TO_CHAR(FU.USER_ID) = SUBSTR(EEU.EU_USERNAME, 2)
UNION ALL
SELECT 'RESPONSIBILITY' ASSIGN_TYPE,
CASE
WHEN TRUNC(SYSDATE) BETWEEN R.START_DATE AND
NVL(R.END_DATE, TRUNC(SYSDATE)) THEN
R.RESPONSIBILITY_NAME
ELSE
EEU.EU_USERNAME
END USER_NAME,
R.DESCRIPTION,
ED.DOC_NAME,
ED.DOC_DESCRIPTION
FROM EUL10_US.EUL5_EUL_USERS EEU,
EUL10_US.EUL5_ACCESS_PRIVS EAP,
EUL10_US.EUL5_DOCUMENTS ED,
FND_RESPONSIBILITY_VL R
WHERE EAP.GD_DOC_ID = ED.DOC_ID
AND EAP.AP_EU_ID = EEU.EU_ID
AND EEU.EU_ROLE_FLAG = 1 --By Responisbility
AND TO_CHAR(R.RESPONSIBILITY_ID) =
SUBSTR(EEU.EU_USERNAME, 2, INSTR(EEU.EU_USERNAME, '#', 1, 2) - 2)
AND TO_CHAR(R.APPLICATION_ID) =
SUBSTR(EEU.EU_USERNAME, INSTR(EEU.EU_USERNAME, '#', 1, 2) + 1);
SELECT 'USER' ASSIGN_TYPE,
CASE
WHEN TRUNC(SYSDATE) BETWEEN FU.START_DATE AND
NVL(FU.END_DATE, TRUNC(SYSDATE)) THEN
FU.USER_NAME
ELSE
EEU.EU_USERNAME
END ASSIGN_TO,
FU.DESCRIPTION ASSIGN_TO_DESCRIPTION,
ED.DOC_NAME REPORT_NAME,
ED.DOC_DESCRIPTION REPORT_DESCRIPTION
FROM EUL10_US.EUL5_EUL_USERS EEU,
EUL10_US.EUL5_ACCESS_PRIVS EAP,
EUL10_US.EUL5_DOCUMENTS ED,
FND_USER FU
WHERE EAP.GD_DOC_ID = ED.DOC_ID
AND EAP.AP_EU_ID = EEU.EU_ID
AND EEU.EU_ROLE_FLAG = 0 --By User
AND TO_CHAR(FU.USER_ID) = SUBSTR(EEU.EU_USERNAME, 2)
UNION ALL
SELECT 'RESPONSIBILITY' ASSIGN_TYPE,
CASE
WHEN TRUNC(SYSDATE) BETWEEN R.START_DATE AND
NVL(R.END_DATE, TRUNC(SYSDATE)) THEN
R.RESPONSIBILITY_NAME
ELSE
EEU.EU_USERNAME
END USER_NAME,
R.DESCRIPTION,
ED.DOC_NAME,
ED.DOC_DESCRIPTION
FROM EUL10_US.EUL5_EUL_USERS EEU,
EUL10_US.EUL5_ACCESS_PRIVS EAP,
EUL10_US.EUL5_DOCUMENTS ED,
FND_RESPONSIBILITY_VL R
WHERE EAP.GD_DOC_ID = ED.DOC_ID
AND EAP.AP_EU_ID = EEU.EU_ID
AND EEU.EU_ROLE_FLAG = 1 --By Responisbility
AND TO_CHAR(R.RESPONSIBILITY_ID) =
SUBSTR(EEU.EU_USERNAME, 2, INSTR(EEU.EU_USERNAME, '#', 1, 2) - 2)
AND TO_CHAR(R.APPLICATION_ID) =
SUBSTR(EEU.EU_USERNAME, INSTR(EEU.EU_USERNAME, '#', 1, 2) + 1);
2011年12月4日 星期日
Oracle DBA(11g) - 如何關閉SQL Tuning Advisor功能
因Oracle 11g所提供之SQL Tuning Advisor功能,仍存在以下Bug,故其會一直產生下文的Alert log,故有些DBA顧問公司會建議在Patch提供之前先行停用功能。以下為停用的指令供各位參考。
狀況:
----- PL/SQL Call Stack -----
object line object
handle number name
700000027223ab8 11774 package body SYS.DBMS_SQLTUNE_INTERNAL
70000003f8f5ed0 7 SYS.WRI$_ADV_SQLTUNE
70000001c3c1510 545 package body SYS.PRVT_ADVISOR
70000001c3c1510 2613 package body SYS.PRVT_ADVISOR
7000000119b7d38 241 package body SYS.DBMS_ADVISOR
700000037884030 772 package body SYS.DBMS_SQLTUNE
7000000273b1bd0 4 anonymous block
請參考metalink文件 11732364 , 9954040
指令步驟:
Step 1. 以SYSDBA角色登入Database
Step 2. 檢查系統參數
SQL> show parameter pack
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
control_management_pack_access string DIAGNOSTIC+TUNING --> 目前的值
Step 3. 關閉Tuning功能
SQL> alter system set control_management_pack_access="DIAGNOSTIC"; --> 把 TUNING 關掉
狀況:
----- PL/SQL Call Stack -----
object line object
handle number name
700000027223ab8 11774 package body SYS.DBMS_SQLTUNE_INTERNAL
70000003f8f5ed0 7 SYS.WRI$_ADV_SQLTUNE
70000001c3c1510 545 package body SYS.PRVT_ADVISOR
70000001c3c1510 2613 package body SYS.PRVT_ADVISOR
7000000119b7d38 241 package body SYS.DBMS_ADVISOR
700000037884030 772 package body SYS.DBMS_SQLTUNE
7000000273b1bd0 4 anonymous block
請參考metalink文件 11732364 , 9954040
指令步驟:
Step 1. 以SYSDBA角色登入Database
Step 2. 檢查系統參數
SQL> show parameter pack
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
control_management_pack_access string DIAGNOSTIC+TUNING --> 目前的值
Step 3. 關閉Tuning功能
SQL> alter system set control_management_pack_access="DIAGNOSTIC"; --> 把 TUNING 關掉
2011年12月1日 星期四
Oracle ERP R12. EBS+Discoverer Multi-Org應用(1)
有鑑於本身在開發Discoverer常遇到要By ORGANIZATION_ID控制存取權限之問題。故分享本人的做法。
條件說明:
1. Discoverer Viewer/Plus登入權限是結合Oracle ERP EBS認證(即不是用DB Account來認證)
2. 開發之報表只能是assign給Inventory level的RESPONSIBILITY(即有做assign org的)
3. 資料來源(Folder)必需是Customer SQL.(不能是From database...)
做法及原理:
1. 因為登入時是同EBS結合,故其會要求是用那一RESPONSIBILITY的角色登入。此時Oracle便會在DB 的Global變數內戴入Profile的設定及紀錄現行的RESPONSIBILITY。
2. 因為該RESPONSIBILITY有做assign org,故只要在資料來源的SQL加入限制即可。
範例如下:
條件說明:
1. Discoverer Viewer/Plus登入權限是結合Oracle ERP EBS認證(即不是用DB Account來認證)
2. 開發之報表只能是assign給Inventory level的RESPONSIBILITY(即有做assign org的)
3. 資料來源(Folder)必需是Customer SQL.(不能是From database...)
做法及原理:
1. 因為登入時是同EBS結合,故其會要求是用那一RESPONSIBILITY的角色登入。此時Oracle便會在DB 的Global變數內戴入Profile的設定及紀錄現行的RESPONSIBILITY。
2. 因為該RESPONSIBILITY有做assign org,故只要在資料來源的SQL加入限制即可。
範例如下:
訂閱:
文章 (Atom)