《Oracle Applications DBA 基础》5- AD 工具 and patching

来源:互联网 发布:网络统考成绩怎么查 编辑:程序博客网 时间:2024/05/28 01:34
Oracle Applications DBA 基础》5- AD 工具 and patching
============

参考资料:

1. Oracle Applications Maintenance Procedures
http://download.oracle.com/docs/ ... robat/r12adproc.pdf

2. Oracle Applications Maintenance Utilities
http://download.oracle.com/docs/ ... robat/r12adutil.pdf

3. Oracle Applications Patching Procedures
http://download.oracle.com/docs/ ... oa_patching_r12.pdf

4.《Oracle EBS R12: Install, Patch and Maintain Applications 》之
"Use Oracle Applications AD Utilities"
"Generate Applications Files Tasks"
"Maintain Applications Files Tasks"
"Maintain Database Entities Tasks"
"Compile/Reload Database Entities Tasks"
"Non-interactive and Maintenance mode"
"Special Utilities"
"AutoConfig"
"License Manager"
"Reporting Utilities"
"Configuration Utilities"
"Patching and the AutoPatch Process"
"Patch Wizard"
"Running AutoPatch"
"OAM Timing Reports"
"Other Patching Topics"
"Applied Patches Information"

AD Utilities:
与其他大型的应用软件一样, R12也需要不停的patch,upgrade,整个应用系统也会
有各种各样的问题需要做各种维护。

所以Oracle 为此提供了 一套AD Utilities。

所有的AD 工具都相当类此,有着相同的操作界面,过程,参数输入方式,report格式。

AD utilities的Configuration file 在 $APPL_TOP/admin
ls adconfig.txt applprod.txt

还有就是前面提到的 Environment Files 在 $APPL_TOP, APPSVIS_mis.env.

AD Utilities 主要包括这些:
AD Administration (adadmin) :执行各种维护动作。
AutoPatch (adpatch) : patching
AD Controller (adctrl) :处理patching/adadmin 过程中的worker,manager 问题。
AD Relink (adrelink) :relink R12的文件。
AD Merge Patch (admrgpch) : 将几个 patch merge 到一起 供adpatch 一起patch
AD Splicer (adsplice) :register new product
File Character Set Converter (adncnv) : 转换character set。
AD Configuration (adutconf.sql) : report R12 的 configuration。
AD File Identification (adident) : report file version。
        例如:adident Header $FND_TOP/bin/FNDFS
AD Job Timing Report (adtimrpt.sql)

除了以上这些基于command line的工具外, 还有一些 Web-based 的 Utilities, 是在
Oracle Applications Manager (OAM) 上使用的。

AutoConfig: 根据context file 来配置R12。通过OAM 修改context file,
然后用 adautocfg.sh 来take effect。
License Manager:
Patch Wizard:用OAM 检查还需apply 什么patch。
Applied Patches:用OAM 检查已经applied 了什么patch。


AD Utilities 命令执行可能需要各种参数,格式如下:
        adpatch options=nocopyportion,nogenerateportion
另外,也有flags,例如:
adpatch flags=hidepw

adpatch 和 adadmin 都可以使用 Parallel Processing 来加快。 这时候
adpatch 和 adadmin 就成为 Managers, 然后生成若干个  Workers 进程
(adworker) 。相应的信息在FND_INSTALL_PROCESSES 中。

因为目的是Parallel processing, adworker 的数目显然要吻合系统的CPU ,
Memory 能力, Oracle的推荐最大值是 CPU 数目 +2 。 
具体可参考 
How to Troubleshoot "adpatch" Performance Issues: Slow, Hanging or Crashes (Doc ID 756063.1)

如果APPL_TOP 是shared filesystem,那么还可以考虑 Distributed AD。就是在不同的
node 上同时运行 adpatch 或 adadmin 的 job。

Log Files 主要在  $APPL_TOP/admin/<SID>/log。

Worker Log Files 在 $APPL_TOP/admin/<SID>/log/adwork<number>.log

AD 工具一般都可以restart, 例如adpatch、adadmin, 它们的Restart Files 就在
$APPL_TOP/admin/<SID>/restart。

做adpatch 时 R12系统 需要 通过 adadmin 进入 Maintenance Mode。

Maintenance Mode 关闭掉 the Workflow Business Events System 。
每当 R12 中的 seed data 改变的时候,Workflow Business Events System
会生成Java cache invalidation message, 影响FNDLOAD的性能,
所以关掉Cache Invalidation Workflow 就会提高patching 时候的性能。

当系统在Maintenance Mode时而你又想运行 OAM 的timing report 来查看progress,
那么可以使用 Restricted Mode access logon。

下面主要都是讲用 adadmin 有关的一些维护R12应用文件系统的内容。主要就是下面
4 方面的内容:

- File generation tasks       

- File system maintenance tasks

- Database maintenance tasks

- Database entities compilation and reloading tasks

下面列出相关的menu:
==========================
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

Generate Applications Files Tasks
      Generate Applications Files
   ----------------------------------------
   1.    Generate message files
   2.    Generate form files
   3.    Generate report files
   4.    Generate product JAR files
   5.    Return to Main Menu


Maintain Applications Files Tasks
      Maintain Applications Files
   ----------------------------------------
   1.    Relink Applications programs
   2.    Copy files to destinations
   3.    Convert character set
   4.    Maintain snapshot information
   5.    Check for missing files
   6.    Return to Main Menu


Maintain Database Entities Tasks
        Maintain Applications Database Entities
  ---------------------------------------------------
   1.    Validate APPS schema
   2.    Re-create grants and synonyms for APPS schema
   3.    Maintain multi-lingual tables
   4.    Check DUAL table
   5.    Return to Main Menu


Compile/Reload Database Entities Tasks
        Compile/Reload Applications Database Entities
   ---------------------------------------------------
   1.    Compile APPS schema
   2.    Compile menu information
   3.    Compile flexfields
   4.    Reload JAR files to database
   5.    Return to Main Menu

adadmin 还可以在 Non-Interactive mode 下运行。另外,也用它来
启动 Maintenance Mode。

除了 adadmin 外, AD 还有一些 Special Utilities。包括 adctrl 及
adrelink 等。

AD Controller (adctrl) 查看FND_INSTALL_PROCESSES,它的功能如下:

                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

还有一个(hidden) option 8 可以 skip the worker job(s)。

AD 工具中有一个相当重要的,就是 AutoConfig。

R12 将所有的配置参数集中在 context file 中, app tier 一个context file,
db tier 一个 context file。例如,如果用户要修改Apache中的Maxclients 参数,不是直接修改
httpd.conf,而是用 OAM 修改 app tier 的 context file
($INST_TOP/appl/admin/<Context_Name>.xml ) ( 当然, 你也可以直接vi, 不过,
Oracle 建议用OAM ),
然后再通过 AutoConfig 工具按照template file 修改生成一个新版本的httpd.conf。

每一个参数文件都有template file,比如, httpd.conf 的template file 就在
$FND_TOP/admin/template/httpd_conf_1013.tmp

除了生成参数文件外,autoconfig 还会负责生成
profile option values 的SQL script 及 services startup and shutdown script。

App tier 的 AutoConfig的命令在 $ADMIN_SCRIPTS_HOME/adautocfg.sh
DB tier 的 AutoConfig的命令在 $
ORACLE_HOME/appsutil/scripts/VIS_mis/adautocfg.sh

运行的过程基本就是 shutdown 应用,运行adautocfg.sh,startup 应用。

AutoConfig Log Files 分别在 $INST_TOP/admin/log ( app tier) , $ORACLE_HOME/appsutil/<CONTEXT_NAME>
(db tier ).

AutoConfig 会自动生成Rolling Back script。
AutoConfig也可以 run in Test Mode。相关命令是 (app tier ):
        <AD_TOP>/bin/adchkcfg.sh


AD 工具中的 License Manager 主要包括如下功能:

登记 the E-Business Suite
登记 component applications
登记 individual products
登记 country-specific functionalities
登记 languages
       

AD 工具中的 Reporting Utilities:  这个工具就是一个SQL file,在
$AD_TOP/sql/adutconf.sql , 生成一个 adutconf.lst 文件。输出内容包括:

- SQL*Plus PAUSE and NEWPAGE settings
- Rollback segment information
- Information about the product group
- Whether Multi-Org is configured
- List of operating units
- List of registered products
- Information on all registered schemas
- Information about all registered products, including shared and dependent products
- Status of localization modules
- The base language and other installed languages
- NLS init.ora settings


上面讲了 adadmin,adautoconfig等工具, 下面就是AD 工具中差不多最重要的内容:patching
及其工具 adpatch。

Patch 有以下几种 Patch Types:
-----------
Bug fix:        就是 fix 现有问题。
New feature:        增加新功能。
Interoperability:        主要是不同版本间兼容,例如数据库是10g, 要升到11g, 就要一个
                Interoperability patch。
Diagnostic        收集信息以确定问题所在。
Translation        多语言用的
Performance:        解决性能问题的
Documentation:        有关 Oracle Applications Online Help.

Patch 有如下的 Terminology:
-----------------
Patch:        <patch number>
Product Family Release Update Pack: R12.<prod>.A,R12.<prod>.B
                Patches for EBS 12.0 will show an 'A' (e.g. "8414069.R12.AR.A")
                Patches for EBS 12.1 will show a 'B' (e.g. "8414069.R12.AR.B")
                How to Determine if a Patch is for R12.0 or 12.1 (Note 837731.1)
Release Update Pack:        12.0.1, 12.0.2

每个Patch 有着如下的Components:
----------------
        Readme files
        Patch driver files
        Replacement files
        Patch Metadata files : list of files in patch etc。
Patch Driver Files 负责如下的功能:
        Copies replacement files
        Performs database updates
        Generates files

AutoPatch 的具体 Operations 如下:
- Prompts for required information。
- Unloads patch metadata and verifies prerequisite patches 。
- Uploads patch history information to the database (if needed)
- Reads and validates the patch driver file
- Reads product file driver files
- Extracts object modules from the product libraries to compare version numbers
- Compares the version numbers of the existing files against the files in the patch (version checking)
- Backs up any existing files that will be changed
- Copies files
- Archives files into libraries
- Relinks executables
- Generates Java archive (JAR) files as required
- Compiles JSP files
- Updates database objects
- Compiles invalid database objects
- Generates forms, reports, and message files
- Runs AutoConfig if any template files are introduced or updated by the patch
- Saves patch history information to the database


当 Applying a Patch 的时候:
- Reads the patch driver files under PATCH_TOP.
- Verifies that the on-site file with the same name and location is an older version than the patch file.
- Before replacing a file, makes a back up in a subdirectory of the patch directory.
- Copies the new file from PATCH_TOP to the product directory.
- If the patch is a C object module, relinks dependent Oracle Applications executables with the Oracle server.
- Performs database updates specified in the database driver. The checkfile feature ensures database tasks are not repeated.
- If you are applying a generate driver, it generates forms, reports, and/or message files.
Records actions in the Applied Patches database.

有关的Patch log file 在:
$APPL_TOP/admin/<SID>/log/adpatch.log, adpatch.lgi:

adpatch 的执行并没有什么特别的地方,照提示做就是了。基本步骤就是:
- shutdown system
- enable maintenance mode
- prerequisite tasks as said in readme
- run adpatch
- post tasks as requested in the readme file。
- disable maintenance mode
- start system

有关的log file
在 $APPL_TOP/admin/<SID>/log/adpatch.log

OAM 有详细的 patch 的 Timing Reports。也可以跟踪 patch的进度。
--------

其他 Patching Topics 有兴趣的有:
adpatch 可以在运行时加option, 例如 adpatch options=nocompiledb
另外,patch 也可以 Merge 再 apply,例如:
admrgpch -s <source directory> \ -d <destination directory> \ -merge_name <name> -manifest <filename>
         
OAM 上 有 详细的 Applied Patches Information。

下面是查找patch的信息 一些方法:

sqlplus apps/apps @$AD_TOP/sql/adutconf.sql

col APPLICATION_NAME for a35
col APPLICATION_SHORT_NAME for a10
col PATCH_LEVEL for a15                

SELECT app.application_short_name, app.application_name, pi.patch_level
FROM fnd_product_installations pi, fnd_application_vl app
WHERE app.application_id = pi.application_id

select distinct patch_name from applsys.ad_applied_patches;


### R12.0.4 (6435000 or 6272680) ,ref: <416708.1>
select creation_date,bug_number from ad_bugs
where bug_number in ('6435000','6272680')

### R12.0.6 ( patch 6728000 or patch 7237006) ref : <787209.1>

select bug_number from apps.ad_bugs where bug_number in
('6145693');

select patch_level from fnd_product_installations;

select t.application_name
from applsys.fnd_application a , applsys.fnd_application_tl t
where a.application_id = t.application_id and t.language='US'
and a.application_short_name = 'FND';

select a.application_short_name, t.application_name
from applsys.fnd_application a , applsys.fnd_application_tl t
where a.application_id = t.application_id and t.language='US'
and upper(t.application_name) like '%HUMAN%'

Using OAM:
site map => monitoring => system configuraion => overview => "product installed"

using patchesets.sh for family pack 11i.HR_PF.I info:
metalink note <139684.1>


11i 有关 Patch 的 Naming Conventions

"Product Families"   Groups of applications modules that are functionally related.  
For example, Accounts Payable, Accounts Receivable, and Chart of Accounts
are members of the Financials product family.

"Emergency Patch"  A patch containing a fix for a specific bug for
a specific product.  For example, Order Management might release
patch 3968068 to fix a very tightly-defined bug.  
Some emergency patches are released to fix a cluster of interrelated bugs.

"Product Mini-Pack"  A collection of bug fixes for a specific applications module.  
For example, fixes for XML Publisher would be released in an XML Publisher
mini-pack called 11i.XDO.H.

"Product Family Patchset"   A collection of product mini-packs for a specific,
individual product family.  
For example, fixes for Payroll, Benefits, and Training Administration
would be released together in a Human Resources Suite Product Family Patchset
called 11i.HR_PF.K.  
New features are not supposed to be included in product family patchsets,
but it happens.

"Recommended Patch List"  A list of individual patches for a specific product
family that you should have applied.  These lists might include recommended
emergency patches as well as product mini-packs.  
If a product family recommends a patch via these lists, it's usually a very
good idea to heed that.

"Maintenance Packs"   A comprehensive collection of all of the latest product
family patchsets and new features.  For example, the 11.5.10.2 Maintenance Pack
includes product family patchsets for Financials, Procurement, HR, Supply Chain,
and everything else in the E-Business Suite.

"Consolidated Updates"   A large collection of all of the latest recommended
patch lists, including new features.  
Released after a maintenance pack, such as the Consolidated Update for 11.5.10.

"Technology Stack Updates"  Any combination of patchsets or mini-packs
that change the underlying services that product families depend upon.  
For example,  the latest Applications Technology Family Pack is released in
11i.ATG_PF.H.
原创粉丝点击