2015年4月30日 星期四

【Oracle ERP Note 】Kill Oracle EBS Session


Oracle EBS User 有時其連結之 Session 卡住,而以 OEM 工具路徑下的 Blocking Session / Hang Analysis 檢查又沒此紀錄,甚至以 Super User 登入,在路徑下 System Administration > Oracle Applications Managers > Concurrent Requests 等查看時,也是正常。此時可考慮 Kill Session,其步驟如下:

1. 以下列 SQL script 找出此 User 的 SID:

SELECT fsav.user_name
      ,d.description
      ,fsav.responsibility_name
      ,fsav.user_form_name
      ,TIME
      ,s.SID
      ,s.SERIAL#
      ,s.LOGON_TIME
      ,s.PROGRAM
      ,s.MODULE
      ,s.BLOCKING_SESSION_STATUS
FROM   fnd_signon_audit_view fsav
      ,fnd_user   d
      ,v$process  p
      ,v$session  s
WHERE  d.user_name = fsav.user_name
       AND d.user_name LIKE '01%'
       --AND fsav.responsibility_name LIKE 'ELVISMENG' || '&RESPONSIBILITY' || '%'
       AND fsav.PROCESS_SPID = p.SPID
       AND fsav.PID = p.PID
       AND p.ADDR = s.PADDR
ORDER BY fsav.user_name
例如: 這 User 的 SID 為 740 2. 使用 OEM (Oracle Enterprise Manager) 工具,在路徑 Performance > Search Sessions 的視窗下,找出其 SID, 直接 Kill 其 Session。

【Oracle ERP Note 】Which init.ora?


DBA 有機會需更改 DB 的 init.ora 的參數,那就需先知道其所在位置 location,才能修改。 首先以 find 指令尋找,發現搜尋結果有數筆資料,而那一個 init.ora 才是我們將要修改的呢?


# find / -name initDEV3.ora -print
/u01/proddb/proddb/11.2.2/dbs/initDEV3.ora
/ora01/proddb/proddb/11.2.2/dbs/initDEV3.ora
/ora01/app/DEV3/db/tech_st/11.1.0/dbs/initDEV3.ora
我們在搜尋時以 initDEV3.ora 這 keyword 來搜尋, 只因 Oracle DB 的 init.ora 通用命名原則為 init<ORACLE_SID>.ora ,一般此檔案在 $Oracle_HOME/dbs 目錄下,但也有可能在其他 link 的目錄下。 在此我們以 SQL> show parameter 這指令來驗證:

SQL> show parameter
NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
gcs_server_processes                 integer     0
global_context_pool_size             string
global_names                         boolean     FALSE
global_txn_processes                 integer     1
hash_area_size                       integer     131072
hi_shared_memory_address             integer     0
hs_autoregister                      boolean     TRUE
ifile                                file        /u01/proddb/proddb/11.2.2/dbs/
                                                 DEV3_test_ifile.ora 
instance_groups                      string
instance_name                        string      DEV3
參數 ifile 的值為 /u01/proddb/proddb/11.2.2/dbs/DEV3_test_ifile.ora ,由此也可得知 Oracle DB 的 init.ora 位於 $ORACLE_HOME/dbs 目錄之下。 Reference 1. Specifying Initialization Parameters, http://docs.oracle.com/cd/B28359_01/server.111/b28310/create005.htm#ADMIN11099 2. Oracle Concepts - initialization parameters init.ora, http://www.dba-oracle.com/concepts/initialization_parameters_init_ora.htm

2015年4月29日 星期三

【Oracle ERP Note 】Cold Backup 冷備份 Oracle EBS


Oracle 提供許多 database 備份工具,而 Cold Backup 在某些場合算是簡單的備份方法。

首先,Oracle EBS 的 Cold Backup 要備份那些資料呢? 基本上備份 data file, control file, log file 與 archive log,而它們所在的目錄位置可以下列 SQL script 查詢:

SQL> select name from v$datafile; 
SQL> select name from v$controlfile; 
SQL> select member from v$logfile; 
SQL> select name from v$archived_log; 


$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.2.0 Production on Thu Apr 30 09:24:57 2015

Copyright (c) 1982, 2010, Oracle.  All rights reserved.


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> select name from v$datafile;

NAME
--------------------------------------------------------------------------------
/u01/proddb/proddata/system01.dbf
/u01/proddb/proddata/system02.dbf
...
/u01/proddb/proddata/sysaux06.dbf
/u01/proddb/proddata/sysaux07.dbf

509 rows selected.

SQL> select name from v$controlfile;

NAME
--------------------------------------------------------------------------------
/u01/proddb/proddata/cntrl01.dbf
/u01/proddb/proddata/cntrl02.dbf

SQL> select member from v$logfile;

MEMBER
--------------------------------------------------------------------------------
/u01/proddb/proddata/redo/log13b.dbf
/u01/proddb/proddata/redo/log12b.dbf
/u01/proddb/proddata/redo/log11b.dbf
/u01/proddb/proddata/redo/log10b.dbf
/u01/proddb/proddata/redo/log09b.dbf
/u01/proddb/proddata/redo/log08b.dbf

6 rows selected.

SQL> select name from v$archived_log;

no rows selected

SQL>
由此知該備份的資料皆位於 /u01/proddb/proddata 之下。 接下來我們可使用 tar 這 Backup / Recovery 工具。使用方式如下: 壓縮檔案 : tar -zcvf archive_name.tar.gz directory_name 解壓縮檔案: tar -zxvf archive_name.tar.gz 例如:

# tar -zcvf proddata.20150430.tar.gz /u01/proddb/proddata
tar: Removing leading `/' from member names
/u01/proddb/proddata/
/u01/proddb/proddata/jed01.dbf
/u01/proddb/proddata/oksx01.dbf
/u01/proddb/proddata/system05.dbf
...
/u01/proddb/proddata/posx01.dbf
/u01/proddb/proddata/ARCH05/

# ls -l
total 46609264
-rw-r--r-- 1 root   root   14840460437 Oct 28  2014 dev-proddata.zip
drwx------ 2 root   root         16384 May  3  2010 lost+found
-rw-r--r-- 1 root   root   14493168709 Oct 27  2014 proddata.20141027
-rw-r--r-- 1 root   root   18347582047 Apr 30 15:39 proddata.20150430.tar.gz
drwxr-xr-x 3 devdba devdba        4096 Oct 28  2014 proddb-erp
drwxr-xr-x 3 devdba devdba        4096 Oct 28  2014 proddb-xx

當然,在壓縮檔案存放之前,先檢查 disk size,檢查方式可用 df -h 此指令。 Reference 1. oracle冷備份/熱備份/熱備份還原, http://to52016.pixnet.net/blog/post/231667915-oracle%E5%86%B7%E5%82%99%E4%BB%BD-%E7%86%B1%E5%82%99%E4%BB%BD-%E7%86%B1%E5%82%99%E4%BB%BD%E9%82%84%E5%8E%9F 2. http://tnrc.ncku.edu.tw/course/93/fedora_core2/page7/p7.htm 3. http://www.cyberciti.biz/faq/how-do-i-compress-a-whole-linux-or-unix-directory/

2015年4月28日 星期二

【Oracle ERP Note 】Oralce Adadmin / Snapshot 跑不動?


Problem

Oracle ERP 在做 Snapshot 時,發現系統好像 Hang 住,經查 AD_SNAPSHOT_FILES 與 AD_SNAPSHOT_BUGFIXES 的欄位,其中 AD_SNAPSHOT_FILES 表中欄位 SNAPSHOT_ID 有負值。將其以下列指令刪除:

SQL> delete from applsys.ad_snapshot_files where snapshot_id=-1069;

然而,重新測試時,系統仍似乎 Hang 住不動如下:


        Maintain Current View Snapshot Information
    -------------------------------------------

   1.    Update Complete APPL_TOP

   2.    Update JAVA_TOP only

   3.    Update a PRODUCT_TOP

   4.    Return to previous Menu


Enter your choice [4] : 1

Trying to obtain a lock...


   Deleting Temp Global Snapshot files ...Start time:Tue Apr 28 2015 11:59:57

   Deleting Temp Global Snapshot Bugfixes ...Start time:Tue Apr 28 2015 13:19:11


   Updating Global Snapshot files ...Start time:Tue Apr 28 2015 13:19:11
   Total No. of records to be processed = 788340
Study 此 Snapshot 執行時過慢,或似乎有 Hang 住現象,在 Oracle Note. 1447463.1 R12: Adadmin Maintain Snapshot Takes a Long Time To Complete 有紀載,需上 Path 13424445 - ADADMIN - Mainatin Snapshot Information Hangs with Latch Contention Solution 1. 先檢查 AD_SNAPSHOT_FILES 的表中欄位 SNAPSHOT_ID 皆為正值 SQL> select distinct(snapshot_id) from applsys.ad_snapshot_files; 2. 以 testmgr 登入,shutdown APP Tier 3. apply patch 13424445 4. 重新做 snapshot 測試


Maintain Current View Snapshot Information 
------------------------------------------- 

1. Update Complete APPL_TOP 

2. Update JAVA_TOP only 

3. Update a PRODUCT_TOP 

4. Return to previous Menu 







Enter your choice [4] : 1 

Trying to obtain a lock... 


Deleting Temp Global Snapshot files ...Start time:Tue Apr 28 2015 15:47:52 
Deleting Temp Global Snapshot Bugfixes ...Start time:Tue Apr 28 2015 15:47:52 


Updating Global Snapshot files ...Start time:Tue Apr 28 2015 15:47:53 
Total No. of records to be processed = 788340 

0% Complete. Done updating 2001 rows[Tue Apr 28 2015 15:47:56]. 
0% Complete. Done updating 4001 rows[Tue Apr 28 2015 15:47:58]. 
0% Complete. Done updating 6001 rows[Tue Apr 28 2015 15:47:59]. 
1% Complete. Done updating 8001 rows[Tue Apr 28 2015 15:48:00]. 
1% Complete. Done updating 10001 rows[Tue Apr 28 2015 15:48:01]. 
... 
99% Complete. Done updating 786001 rows[Tue Apr 28 2015 15:51:08]. 
99% Complete. Done updating 788001 rows[Tue Apr 28 2015 15:51:08]. 
100% Complete. Done updating 788340 rows[Tue Apr 28 2015 15:51:08]. 


Done Updating Snapshot files into global snapshot 



Updating Global Snapshot bugs ...Start time:Tue Apr 28 2015 15:51:11 
Total No. of records to be processed = 413202 

0% Complete. Done updating 2001 rows[Tue Apr 28 2015 15:51:12]. 
0% Complete. Done updating 4001 rows[Tue Apr 28 2015 15:51:12]. 
1% Complete. Done updating 6001 rows[Tue Apr 28 2015 15:51:12]. 
... 
99% Complete. Done updating 410001 rows[Tue Apr 28 2015 15:51:40]. 
99% Complete. Done updating 412001 rows[Tue Apr 28 2015 15:51:40]. 
100% Complete. Done updating 413202 rows[Tue Apr 28 2015 15:51:40]. 


Done Updating Snapshot Temp Table 



Deleting Current Global Snapshot files ...Start time:Tue Apr 28 2015 15:51:40 
Deleting Current Global Snapshot Bugfixes ...Start time:Tue Apr 28 2015 15:52:09 
Updating Temp Global Snapshot Files ...Start time:Tue Apr 28 2015 15:52:23 
Done Updating Temp Global Snapshot Files ...End time:Tue Apr 28 2015 15:52:48 
Updating Temp Global Snapshot BugFixes ...Start time:Tue Apr 28 2015 15:52:48 
Done Updating Temp Global Snapshot Bugfixes ...End time:Tue Apr 28 2015 15:53:07 

Gathering statistics for table 'AD_SNAPSHOTS'... 
Done. 

Gathering statistics for table 'AD_SNAPSHOT_BUGFIXES'... 
Done. 

Gathering statistics for table 'AD_SNAPSHOT_FILES'... 
Done. 





Cleaning up temporary files... 

***** File-system snapshot utility completed successfully ****** 


Review the messages above, then press [Return] to continue. 


Backing up restart files, if any......Done. 

2015年4月27日 星期一

【Oracle ERP Note 】Request Job,但 ERP 回報 No Manager (Concurrent)

Problem

啟動一個 Report Job,系統回報 No Manager

Solution 以 AP 的 testmgr 登入,source 其操作環境後,以 adcmctl.sh 此 script 來啟動 concurrent manager 如下

$ cd $INST_TOP/admin/scripts
$ adcmctl.sh start

You are running adcmctl.sh version 120.17.12010000.5


Enter the APPS username : apps

Enter the APPS password :
Starting concurrent manager for TEST ...
Starting TEST_0428@TEST Internal Concurrent Manager
Default printer is noprint

adcmctl.sh: exiting with status 0


adcmctl.sh: check the logfile /u01/apps/TEST/inst/apps/TEST_twhc-ora/logs/appl/admin/log/adcmctl.txt for more information ...
Reference 1. EBS 的 concurrent manager 进程, http://blog.csdn.net/zhangyu19881125/article/details/43191013

【Oracle ERP Note 】備份特定的 Table


有時在測試時,我們須先備份某些特定的 Table,這時可使用下列指令來達成:

CREATE TABLE backup_table_name AS SELECT * FROM source_table_name 

例如:當 AD_SNAPSHOT_FILES 與 AD_SNAPSHOT_BUGFIXES 表有差異時,我們需事先備份此兩個 Table。


> select distinct(snapshot_id) from ad_snapshot_files; 

SNAPSHOT_ID 
1 44 
2 47 
3 46 
4 1069 
5 2068 
6 68 
7 1068 
8 45 
9 -1069 
10 67 

> select distinct(snapshot_id) from ad_snapshot_bugfixes; 
SNAPSHOT_ID 
1 43 
2 44 
3 47 
4 46 
5 68 
6 1069 
7 2068 
8 1068 
9 45 
10 67 
備份 AD_SNAPSHOT_FILES 與 AD_SNAPSHOT_BUGFIXES 表如下:

SQL> select count(*) from applsys.ad_snapshot_files;

  COUNT(*)
----------
   2658158

SQL> create table ad_snapshot_files_elvismeng as select * from applsys.ad_snapshot_files;

Table created.

SQL> select count(*) from ad_snapshot_files_elvismeng;

  COUNT(*)
----------
   2658158


SQL> select count(*) from applsys.ad_snapshot_bugfixes;

  COUNT(*)
----------
   1375068

SQL> create table ad_snapshot_bugfixes_elvismeng as select * from applsys.ad_snapshot_bugfixes;

Table created.

SQL> select count(*) from ad_snapshot_bugfixes_elvismeng;

  COUNT(*)
----------
   1375068

SQL>

2015年4月24日 星期五

【MIS】 網路 IP 與 DNS 設定正確,但無法上網


現況

XP 的 IE 無法上網連線

判讀

在DOS命令視窗下,以指令 ipconfig /all 來檢視 TCP/IP的設定,發現 IP / GateWay / DNS 的設定還在,但是 ping 外部的 WWW 網站,無法連線 

解決方法

1. 重新啟動,以 administrator 帳號登入
2. 在 DOS 命令視窗,以下面指令更新 win socket 的 catalog 

C:\netsh winsock reset catalog

3. 重新開機,再以 User 帳號登入即可  


參考

此解決方法完全參考下列網站:

1. http://blog.xuite.net/webqos/blog/138018671-win+7+IE+%E7%84%A1%E6%B3%95%E9%A1%AF%E7%A4%BA%E7%B6%B2%E9%A0%81+IP+%E8%88%87DNS+%E8%A8%AD%E5%AE%9A%E9%83%BD%E6%AD%A3%E5%B8%B8+%5B%E6%8E%A8%E8%96%A6%E5%B7%B2%E9%A9%97%E8%AD%89%E8%A7%A3%E6%B1%BA%5D

狀況:

1. 網路可以正確要到IP,右下角網路顯示正常連線
2. IE Chrome 等都無法顯示網頁
3. Ping 的到 router (IP分享器)
4. Nslookup 都沒有回應,但是Ping DNS Server 卻是正常
5. 移除與重新安裝網路卡驅動程式無法解決問題

解決方式:

在命令列模式下

netsh winsock reset catalog

 

重新開機,即可 

2015年4月16日 星期四

【Oracle ERP Note 】sqlplus: Permission denied


Problem

平常週期性跑報表的 script,執行時突然冒出錯誤訊息:


WIP Defect Analysis Daily Report Generate: 01-DEC-2014
./gen_wip_prod_def.sh: line 23: /u01/proddb/proddb/11.2.2/bin/sqlplus: Permission denied
Study 依據 Reference 1,檢查 $ORACLE_HOME/bin, lib, oracore, sqlplus 權限,發現 sqlplus其他帳號無 read / execute 權限,但 PATH 中有指向其路徑。

[proddba]$ ls -l sql*
-rwxr-x--x 1 proddba proddba 1489856 Apr  4  2013 sqlldr
-rwxr-x--- 1 proddba proddba       0 Sep  5  2010 sqlldrO
-rwxr-x--- 1 proddba proddba    9181 Apr  4  2013 sqlplus
Solution 更改 sqlplus 的權限後,以 which sqlplus來檢驗 OK,而此時可跑週期性的報表

[proddba]$ chmod 755 sqlplus
[proddba]$ ls -l sql*
-rwxr-x--x 1 proddba proddba 1489856 Apr  4  2013 sqlldr
-rwxr-x--- 1 proddba proddba       0 Sep  5  2010 sqlldrO
-rwxr-xr-x 1 proddba proddba    9181 Apr  4  2013 sqlplus
Reference 1. Permitting a user on UNIX / Linux to use sqlplus, http://databaseoracle.blogspot.tw/2006/11/permitting-user-on-unix-linux-to-use.html, Oracle Database Technology Thanks Anshu Singare for his great work. I refer to his article shown as below:

For any normal user (not a part of "oinstall" / "dba" groups ) to be able to run sqlplus and access an ORACLE database , read/execute permissions are required for these 4 directories :
$ORACLE_HOME/bin
$ORACLE_HOME/lib
$ORACLE_HOME/oracore
$ORACLE_HOME/sqlplus

In addition, these 4 parameters should also be set in the user's environment (.profile) :
ORACLE_HOME,
LD_LIBRARY_PATH,
ORACLE_SID,
PATH

【Oracle ERP Note 】Looking for the directory : 9idata Directory does not exist


Problem

當執行 adconfig.sh 時,系統出現 AutoConfig completed with errors 此錯誤。


[proddba]$ $ORACLE_HOME/appsutil/bin/adconfig.sh contextfile=/u01/proddb/proddb/11.2.2/appsutil/PROD_erp.xml
Enter the APPS user password:
The log file for this session is located at: /u01/proddb/proddb/11.2.2/appsutil/log/PROD_erp/04161914/adconfig.log

AutoConfig is configuring the Database environment...

AutoConfig will consider the custom templates if present.
        Using ORACLE_HOME location : /u01/proddb/proddb/11.2.2
        Classpath                   : :/u01/proddb/proddb/11.2.2/jdbc/lib/ojdbc5.jar:/u01/proddb/proddb/11.2.2/appsutil/java/xmlparserv2.jar:/u01/proddb/proddb/11.2.2/appsutil/java:/u01/proddb/proddb/11.2.2/jlib/netcfg.jar:/u01/proddb/proddb/11.2.2/jlib/ldapjclnt11.jar

        Using Context file          : /u01/proddb/proddb/11.2.2/appsutil/PROD_erp.xml

Context Value Management will now update the Context file

        Updating Context file...COMPLETED

        Attempting upload of Context file and templates to database...COMPLETED

Updating rdbms version in Context file to db112
Updating rdbms type in Context file to 64 bits
Configuring templates from ORACLE_HOME ...

AutoConfig completed with errors.

查看 /u01/proddb/proddb/11.2.2/appsutil/log/PROD_erp/04161914/adconfig.log 此 log時,發現有紀錄以下錯誤:

##########################################################################
             Validating information needed for NLS........
##########################################################################
DATABASE version : db112

Looking for the directory : /u01/proddb/proddb/11.2.2/nls/data/9idata
Directory does not exist

Looking for file : /u01/proddb/proddb/11.2.2/nls/data/old/cr9idata.pl
File exists

In a 11g instance, this amounts to either of the following
        - an uncertified version of 11g for Apps
        - an unsuccessful installation
Please refer to Metalink note: 883874.1 for details on further steps
ERRORCODE = 1 ERRORCODE_END
.end std out.

.end err out.
****************************************************
Soution 參考 Oracle 文件 AutoConfig is Failing with status 4 for a New Database with NLS Environment Error ORA-12705 (DOC ID 1612017.1) , 其建議下列步驟:

1. Run the $ORACLE_HOME/nls/data/old/cr9idata.pl scipt to create the $ORACLE_HOME/nls/data/9idata directory

2. After creating the directory, make sure the ORA_NLS10 environment variable is set to the full path of the 9idata directory whenever you enable the 11g Oracle home.

3. Verify there are files in 9idata directory

4. Re-run autoconfig
依舊,解決方式為先 shutdown AP,再以 proddba 用戶執行 cr9idata.pl此 script。執行完,系統會新增一個目錄為 9idata。以下為整個解決步驟的Action Plan

0. Login as prodmgr
# su - prodmgr
$ cd $APPL_TOP
$ . ./APPSPROD_erp.env

1. disable Maintenance Mode
$ adadmin

2. shutdown AP Tier
$ $INST_TOP/admin/scripts/adstpall.sh

3. generate 9idata directory
$ perl /u01/proddb/proddb/11.2.2/nls/data/old/cr9idata.pl

4. set ORA_NLS10 environment
$ ORA_NLS10=/u01/proddb/proddb/11.2.2/nsl/data/9idata

5. execute the command, adautocfg.sh on db tier
$ sh $ORACLE_HOME/appsutil/scripts/PROD_erp/adautocfg.sh
跑完 adautocfg.sh 之後,會更新 PROD_erp.env 檔案,而以 $ echo $ORA_NLS10 時,這環境變數指向 /u01/proddb/proddb/11.2.2/nls/data/9idata

【Oracle ERP Note 】ERROR: Unable to set CLASSPATH is missing

Problem

當在 DB Tier 以 adautocfg.sh 上 Patch 時,系統出現下列錯誤訊息:

[proddba]$ sh $ORACLE_HOME/appsutil/scripts/PROD_erp/adautocfg.sh
Enter the APPS user password:
The log file for this session is located at: /u01/proddb/proddb/11.2.2/appsutil/log/PROD_erp/04131943/adconfig.log

AutoConfig is configuring the Database environment...

AutoConfig will consider the custom templates if present.
        Using ORACLE_HOME location : /u01/proddb/proddb/11.2.2
ERROR: Unable to set CLASSPATH
         is missing
ERROR: Unable to set CLASSPATH
         is missing
        Classpath                   :

Version Conflicts among development maintained and customized templates encountered; aborting AutoConfig run.

The logfile for this session is located at: /u01/proddb/proddb/11.2.2/appsutil/log/PROD_erp/04131943/adconfig.log
Solution Oracle 建議以下列步驟解決:

1. Take a backup of the current database context file. 

2. Generate the new Database Context File  using the following command: 
perl /appsutil/bin/adbldxml.pl 

3. Run adconfig on DB tier against the new DB tier context file for R12 as follows:     
/appsutil/bin/adconfig.sh contextfile= 

replace  with the real context file path and name 

4. Retest. 
步驟 1 雖是預防,但是冗餘。因在執行perl /appsutil/bin/adbldxml.pl 指令時,系統會判別此 DB 的 context file 是否存在,若已經有此檔案,系統會先以.bak檔名備份,然後產生新的 context file。 注意:若要在步驟 1 備份 DB context file 時,要驗證 current directory 是否在 $ORACLE_HOME/proddb/proddb/11.2.2/appsutil 之下。 由於是上 Patch 執行 adautocfg.sh 時出現錯誤,所以依據上面說明執行後,只要重新執行 adautocfg.sh 即可,然後接著繼續執行其他未完成的步驟。因此以下列出修補此錯誤的 Action Plan: 0. Enable Maintenance Mode 1. Shut down AP tier 2. Back up DB Context File 3. Generate a new DB Context File 4. Update 系統的 DB Context File

0. Enable Maintenance Mode
# su - prodmgr
$ adadmin

1. Shut down AP tier
# su - prodmgr
$ cd $APPL_TOP
$ . ./APPSPROD_erp.env
$ $INST_TOP/admin/scripts/adstpall.sh

2. Back up DB Context File
# su  - proddba
$ cd $ORACLE_HOME
$ . ./PROD_erp.env
$ cp $ORACLE_HOME/appsutil/PROD_erp.xml PROD_erp.xml.bak

3. Generate a new DB Context File
$ perl $ORACLE_HOME/appsutil/adbldxml.pl

4. Update 系統的 DB Context File
% perl $ORACLE_HOME/appsutil/bin/adconfig.sh contextfile=/u01/proddb/proddb/11.2.2/appsutil/PROD_erp.xml

Verify 我們重新執行 adautocfg,此時 ClassPath此環境變數可找到執行命令時所需參考到的檔案。

[proddba]$ sh $ORACLE_HOME/appsutil/scripts/PROD_erp/adautocfg.sh
Enter the APPS user password:
The log file for this session is located at: /u01/proddb/proddb/11.2.2/appsutil/log/PROD_erp/04162009/adconfig.log

AutoConfig is configuring the Database environment...

AutoConfig will consider the custom templates if present.
        Using ORACLE_HOME location : /u01/proddb/proddb/11.2.2
        Classpath                   : :/u01/proddb/proddb/11.2.2/jdbc/lib/ojdbc5.jar:/u01/proddb/proddb/11.2.2/appsutil/java/xmlparserv2.jar:/u01/proddb/proddb/11.2.2/appsutil/java:/u01/proddb/proddb/11.2.2/jlib/netcfg.jar:/u01/proddb/proddb/11.2.2/jlib/ldapjclnt11.jar

        Using Context file          : /u01/proddb/proddb/11.2.2/appsutil/PROD_erp.xml

Context Value Management will now update the Context file

        Updating Context file...COMPLETED

        Attempting upload of Context file and templates to database...COMPLETED

Updating rdbms version in Context file to db112
Updating rdbms type in Context file to 64 bits
Configuring templates from ORACLE_HOME ...

AutoConfig completed successfully.

prettyPrint();