2014年5月18日 星期日

EBS系統更新PATCH時發生錯誤解決方法

EBS系統更新PATCH時,跑了異常的久,於是我決定先停掉在重開看看狀況,
結果就關閉後重新進行adpatch就遇到以下問題:
The worker should not have status 'Running' or 'Restarted' at this point.

這個問題要進入adctrl來將目前的worker更改狀態。
這次手邊沒有記錄資料,大略說明一下。

oramgr>adctrl

進去後會問你一堆問題,全部回答完後會進入選單:
                    AD Controller Menu
     ---------------------------------------------------

     1.    Show worker status

     2.    Tell worker to restart a failed job

     3.    Tell worker to quit

     4.    Tell manager that a worker failed its job

     5.    Tell manager that a worker acknowledges quit

     6.    Restart a worker on the current machine

     7.    Exit







Enter your choice [1] : 

首先輸入1,確認worker status。

確認若有狀態是RUNNING,
則輸入4,將worker status都改回Failed。

最後輸入2,
將worker的狀態設為Restart。

如此就可以在回到adpatch繼續將PATCH完成了。

adadmin關閉Maintenance Mode

[crp40mgr@ebstest 17023223_ZHT]$ adadmin

                     Copyright (c) 2002 Oracle Corporation
                        Redwood Shores, California, USA

                     Oracle Applications AD Administration

                                 Version 12.0.0

NOTE: You may not use this utility for custom development
      unless you have written permission from Oracle Corporation.

Your default directory is '/u01/crp40/apps/apps_st/appl'.
Is this the correct APPL_TOP [Yes] ? 

AD Administration records your AD Administration session in a text file
you specify.  Enter your AD Administration log file name or press [Return]
to accept the default file name shown in brackets.

Filename [adadmin.log] : 

************* Start of AD Administration session *************
AD Administration version: 12.0.0
AD Administration started at: Wed May 14 2014 15:08:31

APPL_TOP is set to /u01/crp40/apps/apps_st/appl

You can be notified by email if a failure occurs.
Do you wish to activate this feature [No] ? 

Please enter the batchsize [1000] : 


Please enter the name of the Oracle Applications System that this
APPL_TOP belongs to.

The Applications System name must be unique across all Oracle
Applications Systems at your site, must be from 1 to 30 characters
long, may only contain alphanumeric and underscore characters,
and must start with a letter.

Sample Applications System names are: "prod", "test", "demo" and 
"Development_2".

Applications System Name [crp40] : crp40 *


NOTE: If you do not currently have certain types of files installed
in this APPL_TOP, you may not be able to perform certain tasks.

Example 1: If you don't have files used for installing or upgrading
the database installed in this area, you cannot install or upgrade
the database from this APPL_TOP.

Example 2: If you don't have forms files installed in this area, you cannot
generate them or run them from this APPL_TOP.

Example 3: If you don't have concurrent program files installed in this area,
you cannot relink concurrent programs or generate reports from this APPL_TOP.


Do you currently have files used for installing or upgrading the database
installed in this APPL_TOP [YES] ? YES *


Do you currently have Java and HTML files for HTML-based functionality
installed in this APPL_TOP [YES] ? YES *


Do you currently have Oracle Applications forms files installed
in this APPL_TOP [YES] ? YES *


Do you currently have concurrent program files installed
in this APPL_TOP [YES] ? YES *


Please enter the name Oracle Applications will use to identify this APPL_TOP.

The APPL_TOP name you select must be unique within an Oracle Applications
System, must be from 1 to 30 characters long, may only contain
alphanumeric and underscore characters, and must start with a letter.

Sample APPL_TOP Names are: "prod_all", "demo3_forms2", and "forms1".

APPL_TOP Name [ebstest] : ebstest *



You are about to use or modify Oracle Applications product tables
in your ORACLE database 'crp40'
using ORACLE executables in '/u01/crp40/apps/tech_st/10.1.2'.

Is this the correct database [Yes] ? 

AD Administration needs the password for your 'SYSTEM' ORACLE schema
in order to determine your installation configuration.

Enter the password for your 'SYSTEM' ORACLE schema:  


The ORACLE username specified below for Application Object Library
uniquely identifies your existing product group: APPLSYS

Enter the ORACLE password of Application Object Library [APPS] :  

AD Administration is verifying your username/password.
The status of various features in this run of AD Administration is:

                                           <-Feature version in->
Feature                          Active?   APPLTOP    Data model    Flags
------------------------------   -------   --------   -----------   -----------
CHECKFILE                        Yes       1          1             Y N N Y N Y
PREREQ                           Yes       6          6             Y N N Y N Y
CONCURRENT_SESSIONS              No        2          2             Y Y N Y Y N
PATCH_TIMING                     Yes       2          2             Y N N Y N Y
PATCH_HIST_IN_DB                 Yes       6          6             Y N N Y N Y
SCHEMA_SWAP                      Yes       1          1             Y N N Y Y Y
JAVA_WORKER                      Yes       1          1             Y N N Y N Y
CODELEVEL                        Yes       1          1             Y N N Y N Y



Identifier for the current session is 39835

Reading product information from file...

Reading language and territory information from file...

Reading language information from applUS.txt ...

AD Administration warning:
 Product Data File
 /u01/crp40/apps/apps_st/appl/admin/zfaprod.txt
 does not exist for product "zfa".
This product is registered in the database but the
above file does not exist in APPL_TOP.  The product
will be ignored without error.


AD Administration warning:
 Product Data File
 /u01/crp40/apps/apps_st/appl/admin/zsaprod.txt
 does not exist for product "zsa".
This product is registered in the database but the
above file does not exist in APPL_TOP.  The product
will be ignored without error.


AD Administration warning:
 Product Data File
 /u01/crp40/apps/apps_st/appl/admin/jtsprod.txt
 does not exist for product "jts".
This product is registered in the database but the
above file does not exist in APPL_TOP.  The product
will be ignored without error.


Reading database to see what industry is currently installed.

Reading FND_LANGUAGES to see what is currently installed.
Currently, the following languages are installed:

Code   Language                                Status
----   --------------------------------------- ---------
US     American English                        Base         
ZHT    Traditional Chinese                     Install      

Reading language information from applZHT.txt ...

Your base language will be AMERICAN.

Your other languages to install are: TRADITIONAL CHINESE

Setting up module information.
Reading database for information about the modules.
Saving module information.
Reading database for information about the products.
Reading database for information about how products depend on each other.
Reading topfile.txt ...

Saving product information.

AD code level : [B.3]

            AD Administration Main Menu
   --------------------------------------------------

   1.    Generate Applications Files menu

   2.    Maintain Applications Files menu

   3.    Compile/Reload Applications Database Entities menu

   4.    Maintain Applications Database Entities menu

   5.    Change Maintenance Mode

   6.    Exit AD Administration









Enter your choice [6] : 5

             Change Maintenance Mode
   ----------------------------------------

Maintenance Mode is currently: [Enabled].


Maintenance mode should normally be enabled when patching
Oracle Applications and disabled when users are logged on
to the system.  See the Oracle Applications Maintenance
Utilities manual for more information about maintenance mode.


Please select an option:

   1.    Enable Maintenance Mode

   2.    Disable Maintenance Mode

   3.    Return to Main Menu



Enter your choice [3] : 2

sqlplus -s &un_apps/***** @/u01/crp40/apps/apps_st/appl/ad/12.0.0/patch/115/sql/adsetmmd.sql DISABLE

Successfully disabled Maintenance Mode.

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


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

             Change Maintenance Mode
   ----------------------------------------

Maintenance Mode is currently: [Disabled].


Maintenance mode should normally be enabled when patching
Oracle Applications and disabled when users are logged on
to the system.  See the Oracle Applications Maintenance
Utilities manual for more information about maintenance mode.


Please select an option:

   1.    Enable Maintenance Mode

   2.    Disable Maintenance Mode

   3.    Return to Main Menu



Enter your choice [3] : 3

            AD Administration Main Menu
   --------------------------------------------------

   1.    Generate Applications Files menu

   2.    Maintain Applications Files menu

   3.    Compile/Reload Applications Database Entities menu

   4.    Maintain Applications Database Entities menu

   5.    Change Maintenance Mode

   6.    Exit AD Administration









Enter your choice [6] : 6



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


There is no timing information available for the current session.


AD Administration is complete.

Errors and warnings are listed in the log file
/u01/crp40/apps/apps_st/appl/admin/crp40/log/adadmin.log

and in other log files in the same directory.

[crp40mgr@ebstest 17023223_ZHT]$ 

adpatch更新patch

[crp40mgr@ebstest 17023223_ZHT]$ adpatch

                     Copyright (c) 2002 Oracle Corporation
                        Redwood Shores, California, USA

                         Oracle Applications AutoPatch

                                 Version 12.0.0

NOTE: You may not use this utility for custom development
      unless you have written permission from Oracle Corporation.


Attention: AutoPatch no longer checks for unapplied pre-requisite patches.
You must use OAM Patch Wizard for this feature. Alternatively, you can
review the README for pre-requisite information.


Your default directory is '/u01/crp40/apps/apps_st/appl'.
Is this the correct APPL_TOP [Yes] ? 

AutoPatch records your AutoPatch session in a text file
you specify.  Enter your AutoPatch log file name or press [Return]
to accept the default file name shown in brackets.

Filename [adpatch.log] : patchTest.log

You can be notified by email if a failure occurs.
Do you wish to activate this feature [No] ? 

Please enter the batchsize [1000] : 


Please enter the name of the Oracle Applications System that this
APPL_TOP belongs to.

The Applications System name must be unique across all Oracle
Applications Systems at your site, must be from 1 to 30 characters
long, may only contain alphanumeric and underscore characters,
and must start with a letter.

Sample Applications System names are: "prod", "test", "demo" and 
"Development_2".

Applications System Name [crp40] : crp40 *


NOTE: If you do not currently have certain types of files installed
in this APPL_TOP, you may not be able to perform certain tasks.

Example 1: If you don't have files used for installing or upgrading
the database installed in this area, you cannot install or upgrade
the database from this APPL_TOP.

Example 2: If you don't have forms files installed in this area, you cannot
generate them or run them from this APPL_TOP.

Example 3: If you don't have concurrent program files installed in this area,
you cannot relink concurrent programs or generate reports from this APPL_TOP.


Do you currently have files used for installing or upgrading the database
installed in this APPL_TOP [YES] ? YES *


Do you currently have Java and HTML files for HTML-based functionality
installed in this APPL_TOP [YES] ? YES *


Do you currently have Oracle Applications forms files installed
in this APPL_TOP [YES] ? YES *


Do you currently have concurrent program files installed
in this APPL_TOP [YES] ? YES *


Please enter the name Oracle Applications will use to identify this APPL_TOP.

The APPL_TOP name you select must be unique within an Oracle Applications
System, must be from 1 to 30 characters long, may only contain
alphanumeric and underscore characters, and must start with a letter.

Sample APPL_TOP Names are: "prod_all", "demo3_forms2", and "forms1".

APPL_TOP Name [ebstest] : ebstest *



You are about to apply a patch to the installation of Oracle Applications
in your ORACLE database 'crp40'
using ORACLE executables in '/u01/crp40/apps/tech_st/10.1.2'.

Is this the correct database [Yes] ? 

AutoPatch needs the password for your 'SYSTEM' ORACLE schema
in order to determine your installation configuration.

Enter the password for your 'SYSTEM' ORACLE schema:  


The ORACLE username specified below for Application Object Library
uniquely identifies your existing product group: APPLSYS

Enter the ORACLE password of Application Object Library [APPS] :  

AutoPatch is verifying your username/password.
The status of various features in this run of AutoPatch is:

                                           <-Feature version in->
Feature                          Active?   APPLTOP    Data model    Flags
------------------------------   -------   --------   -----------   -----------
CHECKFILE                        Yes       1          1             Y N N Y N Y
PREREQ                           Yes       6          6             Y N N Y N Y
CONCURRENT_SESSIONS              No        2          2             Y Y N Y Y N
PATCH_TIMING                     Yes       2          2             Y N N Y N Y
PATCH_HIST_IN_DB                 Yes       6          6             Y N N Y N Y
SCHEMA_SWAP                      Yes       1          1             Y N N Y Y Y
JAVA_WORKER                      Yes       1          1             Y N N Y N Y
CODELEVEL                        Yes       1          1             Y N N Y N Y



Identifier for the current session is 39834

Reading product information from file...

Reading language and territory information from file...

Reading language information from applUS.txt ...

AutoPatch warning:
 Product Data File
 /u01/crp40/apps/apps_st/appl/admin/zfaprod.txt
 does not exist for product "zfa".
This product is registered in the database but the
above file does not exist in APPL_TOP.  The product
will be ignored without error.


AutoPatch warning:
 Product Data File
 /u01/crp40/apps/apps_st/appl/admin/zsaprod.txt
 does not exist for product "zsa".
This product is registered in the database but the
above file does not exist in APPL_TOP.  The product
will be ignored without error.


AutoPatch warning:
 Product Data File
 /u01/crp40/apps/apps_st/appl/admin/jtsprod.txt
 does not exist for product "jts".
This product is registered in the database but the
above file does not exist in APPL_TOP.  The product
will be ignored without error.


Reading database to see what industry is currently installed.

Reading FND_LANGUAGES to see what is currently installed.
Currently, the following languages are installed:

Code   Language                                Status
----   --------------------------------------- ---------
US     American English                        Base         
ZHT    Traditional Chinese                     Install      

Reading language information from applZHT.txt ...

Your base language will be AMERICAN.

Your other languages to install are: TRADITIONAL CHINESE

Setting up module information.
Reading database for information about the modules.
Saving module information.
Reading database for information about the products.
Reading database for information about how products depend on each other.
Reading topfile.txt ...

Saving product information.

AD code level : [B.3]



Trying to obtain a lock...


  Attempting to instantiate the current-view snapshot...

  Was already instantiated. So no instantiation done this time.


     **************** S T A R T   O F   U P L O A D ****************

Start date: Wed May 14 2014 15:05:43



0 "left over" javaupdates.txt files uploaded to DB: Wed May 14 2014 15:05:43

0 patches uploaded from the ADPSV format patch history files: Wed May 14 2014 15:05:43


Uploading information about files copied during the previous runs ...

0 "left over" filescopied_<session_id>.txt files uploaded to DB: Wed May 14 2014 15:05:43

     ****************** E N D   O F   U P L O A D ******************




End date: Wed May 14 2014 15:05:43




Enter the directory where your Oracle Applications patch has been unloaded

The default directory is [/u01/crp40/patches/17023223_ZHT] : 

Please enter the name of your AutoPatch driver file : u17023223.drv

adadmin開啟Maintenance Mode

[crp40mgr@ebstest patches]$ adadmin

                     Copyright (c) 2002 Oracle Corporation
                        Redwood Shores, California, USA

                     Oracle Applications AD Administration

                                 Version 12.0.0

NOTE: You may not use this utility for custom development
      unless you have written permission from Oracle Corporation.

Your default directory is '/u01/crp40/apps/apps_st/appl'.
Is this the correct APPL_TOP [Yes] ? 

AD Administration records your AD Administration session in a text file
you specify.  Enter your AD Administration log file name or press [Return]
to accept the default file name shown in brackets.

Filename [adadmin.log] : 

************* Start of AD Administration session *************
AD Administration version: 12.0.0
AD Administration started at: Wed May 14 2014 14:21:42

APPL_TOP is set to /u01/crp40/apps/apps_st/appl

You can be notified by email if a failure occurs.
Do you wish to activate this feature [No] ? 

Please enter the batchsize [1000] : 


Please enter the name of the Oracle Applications System that this
APPL_TOP belongs to.

The Applications System name must be unique across all Oracle
Applications Systems at your site, must be from 1 to 30 characters
long, may only contain alphanumeric and underscore characters,
and must start with a letter.

Sample Applications System names are: "prod", "test", "demo" and 
"Development_2".

Applications System Name [crp40] : crp40 *


NOTE: If you do not currently have certain types of files installed
in this APPL_TOP, you may not be able to perform certain tasks.

Example 1: If you don't have files used for installing or upgrading
the database installed in this area, you cannot install or upgrade
the database from this APPL_TOP.

Example 2: If you don't have forms files installed in this area, you cannot
generate them or run them from this APPL_TOP.

Example 3: If you don't have concurrent program files installed in this area,
you cannot relink concurrent programs or generate reports from this APPL_TOP.


Do you currently have files used for installing or upgrading the database
installed in this APPL_TOP [YES] ? YES *


Do you currently have Java and HTML files for HTML-based functionality
installed in this APPL_TOP [YES] ? YES *


Do you currently have Oracle Applications forms files installed
in this APPL_TOP [YES] ? YES *


Do you currently have concurrent program files installed
in this APPL_TOP [YES] ? YES *


Please enter the name Oracle Applications will use to identify this APPL_TOP.

The APPL_TOP name you select must be unique within an Oracle Applications
System, must be from 1 to 30 characters long, may only contain
alphanumeric and underscore characters, and must start with a letter.

Sample APPL_TOP Names are: "prod_all", "demo3_forms2", and "forms1".

APPL_TOP Name [ebstest] : ebstest *



You are about to use or modify Oracle Applications product tables
in your ORACLE database 'crp40'
using ORACLE executables in '/u01/crp40/apps/tech_st/10.1.2'.

Is this the correct database [Yes] ? 

AD Administration needs the password for your 'SYSTEM' ORACLE schema
in order to determine your installation configuration.

Enter the password for your 'SYSTEM' ORACLE schema:  


The ORACLE username specified below for Application Object Library
uniquely identifies your existing product group: APPLSYS

Enter the ORACLE password of Application Object Library [APPS] :  

AD Administration is verifying your username/password.
The status of various features in this run of AD Administration is:

                                           <-Feature version in->
Feature                          Active?   APPLTOP    Data model    Flags
------------------------------   -------   --------   -----------   -----------
CHECKFILE                        Yes       1          1             Y N N Y N Y
PREREQ                           Yes       6          6             Y N N Y N Y
CONCURRENT_SESSIONS              No        2          2             Y Y N Y Y N
PATCH_TIMING                     Yes       2          2             Y N N Y N Y
PATCH_HIST_IN_DB                 Yes       6          6             Y N N Y N Y
SCHEMA_SWAP                      Yes       1          1             Y N N Y Y Y
JAVA_WORKER                      Yes       1          1             Y N N Y N Y
CODELEVEL                        Yes       1          1             Y N N Y N Y



Identifier for the current session is 39831

Reading product information from file...

Reading language and territory information from file...

Reading language information from applUS.txt ...

AD Administration warning:
 Product Data File
 /u01/crp40/apps/apps_st/appl/admin/zfaprod.txt
 does not exist for product "zfa".
This product is registered in the database but the
above file does not exist in APPL_TOP.  The product
will be ignored without error.


AD Administration warning:
 Product Data File
 /u01/crp40/apps/apps_st/appl/admin/zsaprod.txt
 does not exist for product "zsa".
This product is registered in the database but the
above file does not exist in APPL_TOP.  The product
will be ignored without error.


AD Administration warning:
 Product Data File
 /u01/crp40/apps/apps_st/appl/admin/jtsprod.txt
 does not exist for product "jts".
This product is registered in the database but the
above file does not exist in APPL_TOP.  The product
will be ignored without error.


Reading database to see what industry is currently installed.

Reading FND_LANGUAGES to see what is currently installed.
Currently, the following languages are installed:

Code   Language                                Status
----   --------------------------------------- ---------
US     American English                        Base         
ZHT    Traditional Chinese                     Install      

Reading language information from applZHT.txt ...

Your base language will be AMERICAN.

Your other languages to install are: TRADITIONAL CHINESE

Setting up module information.
Reading database for information about the modules.
Saving module information.
Reading database for information about the products.
Reading database for information about how products depend on each other.
Reading topfile.txt ...

Saving product information.

AD code level : [B.3]

            AD Administration Main Menu
   --------------------------------------------------

   1.    Generate Applications Files menu

   2.    Maintain Applications Files menu

   3.    Compile/Reload Applications Database Entities menu

   4.    Maintain Applications Database Entities menu

   5.    Change Maintenance Mode

   6.    Exit AD Administration









Enter your choice [6] : 5

             Change Maintenance Mode
   ----------------------------------------

Maintenance Mode is currently: [Disabled].


Maintenance mode should normally be enabled when patching
Oracle Applications and disabled when users are logged on
to the system.  See the Oracle Applications Maintenance
Utilities manual for more information about maintenance mode.


Please select an option:

   1.    Enable Maintenance Mode

   2.    Disable Maintenance Mode

   3.    Return to Main Menu



Enter your choice [3] : 1

sqlplus -s &un_apps/***** @/u01/crp40/apps/apps_st/appl/ad/12.0.0/patch/115/sql/adsetmmd.sql ENABLE

Successfully enabled Maintenance Mode.

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


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

             Change Maintenance Mode
   ----------------------------------------

Maintenance Mode is currently: [Enabled].


Maintenance mode should normally be enabled when patching
Oracle Applications and disabled when users are logged on
to the system.  See the Oracle Applications Maintenance
Utilities manual for more information about maintenance mode.


Please select an option:

   1.    Enable Maintenance Mode

   2.    Disable Maintenance Mode

   3.    Return to Main Menu



Enter your choice [3] : 

            AD Administration Main Menu
   --------------------------------------------------

   1.    Generate Applications Files menu

   2.    Maintain Applications Files menu

   3.    Compile/Reload Applications Database Entities menu

   4.    Maintain Applications Database Entities menu

   5.    Change Maintenance Mode

   6.    Exit AD Administration









Enter your choice [6] : 



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


There is no timing information available for the current session.


AD Administration is complete.

Errors and warnings are listed in the log file
/u01/crp40/apps/apps_st/appl/admin/crp40/log/adadmin.log

and in other log files in the same directory.

[crp40mgr@ebstest patches]$ 

EBS系統更新PATCH方法

※警告:此處是留下我的筆記,若真的是要進行EBS的更新時,請與SUPPORT作好連絡,作好系統備份並且仔細觀看PATCH的說明文件。

進行EBS的更新,必定是遇到BUG時,請求ORACLE SUPPORT的協助,
ORACLE SUPPORT的顧問方建議更新PATCH時,才進行更新。

更新PATCH一般遵循以下規則:
1.詳讀NOTE文件
2.詳讀PATCH文件
3.關閉AP NODE
4.進行Preparation Tasks
5.進行Pre-Install Tasks
6.Patch更新-adadmin
7.Patch更新-adpatch
8.進行Post-install Tasks
9.進行Finishing Tasks

關閉AP NODE
就是下達adstpall.sh 帳號/密碼
將AP NODE整個關閉,在進行上PATCH的動作。

特別說明adadmin和adpatch使用方式,
adadmin顧名思義,便是AD的ADMIN。
在上PATCH前,必須將AD的狀態更改為Maintenance Mode。
http://qknight313.blogspot.tw/2014/05/adadminmaintenance-mode.html

進行完後,進入adpatch開始上PATCH,
需要注意的是,如果你的PATCH有語言包的話,
那務必先上Generic再上語言包(例如ZHT等等)。
http://qknight313.blogspot.tw/2014/05/adpatchpatch.html

結束之後,再次回到adadmin,將Maintenance Mode關閉。
http://qknight313.blogspot.tw/2014/05/adadminmaintenance-mode_18.html

最後使用adstrtal.sh 帳號/密碼,
將系統開啟檢查錯誤是否已解決。

2014年5月7日 星期三

解除ORACLE帳號鎖定

同事在連結ORACLE資料庫時,輸入太多次錯誤的密碼,
導致ORACLE的帳號被鎖定住了。

所以緊急上網尋找解除ORACLE帳號鎖定的方式。
原來還蠻簡單的!記錄如下:

$sqlplus / as sysdba

SQL> alter user apps account unlock;


User altered.