运维联盟俱乐部

 找回密码
 立即注册
查看: 1107|回复: 0

[安装部署] ojvm patch

[复制链接]
  • TA的每日心情
    开心
    2023-8-9 11:05
  • 发表于 2023-1-6 23:39:34 | 显示全部楼层 |阅读模式

    19.17 ojvm支持rolling patch,停掉一个节点的home打ojvm ru,拉起home,然后在另一个节点重复,最后在一个节点上datapatch -verbose

    Is OJVM installed?
    OJVM is generally installed by default in a database. Use the following SQL query to confirm. The SQL statement returns a "VALID" status otherwise OJVM is not installed. See Figure 3.
    SELECT version, status FROM dba_registry WHERE comp_id='JAVAVM';

    For example:
    SQL> SELECT version, status FROM dba_registry WHERE comp_id='JAVAVM';

    VERSION                        STATUS
    ------------------------------ -----------
    12.1.0.2.0                     VALID

    If OJVM is NOT installed then there is no need to apply the OJVM PSU, ignore the remainder of this document.
    Is OJVM used?If the component 'JAVAVM' is installed, then the OJVM PSU must be applied. The application options you can choose from depend on your tolerance for maintenance windows.  Use the following SQL to collect OJVM usage for your applications. This SQL includes Oracle utilities and internal usage and will show usage from when the instance started. The SQL should be executed on each instance. The SQL are verified against Oracle Database :  select count(*) from x$kglob where KGLOBTYP = 29 OR KGLOBTYP = 56;
    In order to determine the user of OJVM we can examine V$SESSION via the following SQL to show SERVICE, PROGRAM or USER that invoked Java in the database. This SQL will show active users only (so may have to be run periodically to fully collect data). Note that ORAchk utility can be used to automatically run the SQL listed below and generate an HTML report for all databases in a cluster. The ORAchk command is listed below the SQL statements. col service_name format a20
    col username format a20
    col program format a20
    set num 8

    select sess.service_name, sess.username,sess.program, count(*)
    from
    v$session sess,
    dba_users usr,
    x$kgllk lk,
    x$kglob
    where kgllkuse=saddr
    and kgllkhdl=kglhdadr
    and kglobtyp in (29,56)
    and sess.user# = usr.user_id
    and usr.oracle_maintained = 'N'      
    #### omit this line on 11.2.0.4
    group by sess.service_name, sess.username, sess.program
    order by sess.service_name, sess.username, sess.program;
    If you wish to report Oracle utilities that you are using in addition to your own applications (so the Oracle utilities can also be paused) use the following SQL SELECT statement. The Just-In-Time compiler, JIT, is stopped as a part of the rolling process. col service_name format a20
    col username format a20
    col program format a20
    set num 8

    select sess.service_name, sess.username,sess.program, count(*)
    from
    v$session sess,
    x$kgllk lk,
    x$kglob
    where kgllkuse=saddr
    and kgllkhdl=kglhdadr
    and kglobtyp in (29,56)
    group by sess.service_name, sess.username, sess.program
    order by sess.service_name, sess.username, sess.program;
    For example, on 12.1.0.2 without Oracle components: SQL> select sess.service_name, sess.username,sess.program, count(*) from v$session sess, dba_users usr,x$kgllk lk,x$kglob where kgllkuse=saddr and kgllkhdl=kglhdadr and kglobtyp in (29,56) and sess.user# = usr.user_id and usr.oracle_maintained = 'N' group by sess.service_name, sess.username, sess.program order by sess.service_name, sess.username, sess.program;

    svc                  USERNAME             Program                        COUNT(*)
    -------------------- -------------------- ------------------------------ --------
    SYS$USERS            MYOJVM               sqlplus@rwxxx10 (TNS V1-V3)    4
    SYS$USERS            MYTEST               sqlplus@rwxxx10 (TNS V1-V3)    4
    Or with Oracle components: SQL> select sess.service_name, sess.username,sess.program, count(*) from v$session sess, x$kgllk lk, x$kglob where kgllkuse=saddr and kgllkhdl=kglhdadr and kglobtyp in (29,56) group by sess.service_name, sess.username, sess.program order by sess.service_name, sess.username, sess.program;

    svc                  USERNAME             Program                        COUNT(*)
    -------------------- -------------------- ------------------------------ --------
    SYS$BACKGROUND                            oracle@rwxxx10 (M000)          2
    SYS$USERS            MYOJVM               sqlplus@rwxxx10 (TNS V1-V3)    4
    SYS$USERS            MYTEST               sqlplus@rwxxx10 (TNS V1-V3)    4
    Note that the ORAchk utility will automatically run the SQL statements above and generate an HTML report for all databases in a cluster. Run the following utility as the root user to generate the HTML report ( with the latest release of orachk 19 , the below command will fail ) :
    $ $GRID_HOME/suptools/orachk/orachk –profile ojvm_psu
    1. [oracle@zy1 34411846]$ srvctl stop home -oraclehome $ORACLE_HOME -statefile /tmp/stat1 -node zy1
    2. [oracle@zy1 34411846]$ pwd
    3. /tmp/34411846
    4. [oracle@zy1 34411846]$ opatch apply
    5. Oracle Interim Patch Installer version 12.2.0.1.33
    6. Copyright (c) 2023, Oracle Corporation.  All rights reserved.


    7. Oracle Home       : /u01/app/oracle/product/19.0.0/db_1
    8. Central Inventory : /u01/app/oraInventory
    9.    from           : /u01/app/oracle/product/19.0.0/db_1/oraInst.loc
    10. OPatch version    : 12.2.0.1.33
    11. OUI version       : 12.2.0.7.0
    12. Log file location : /u01/app/oracle/product/19.0.0/db_1/cfgtoollogs/opatch/opatch2023-01-06_19-18-37PM_1.log

    13. Verifying environment and performing prerequisite checks...
    14. OPatch continues with these patches:   34411846  

    15. Do you want to proceed? [y|n]
    16. y
    17. User Responded with: Y
    18. All checks passed.

    19. Please shutdown Oracle instances running out of this ORACLE_HOME on the local system.
    20. (Oracle Home = '/u01/app/oracle/product/19.0.0/db_1')


    21. Is the local system ready for patching? [y|n]
    22. y
    23. User Responded with: Y
    24. Backing up files...
    25. Applying interim patch '34411846' to OH '/u01/app/oracle/product/19.0.0/db_1'

    26. Patching component oracle.javavm.server, 19.0.0.0.0...

    27. Patching component oracle.javavm.server.core, 19.0.0.0.0...

    28. Patching component oracle.rdbms.dbscripts, 19.0.0.0.0...

    29. Patching component oracle.rdbms, 19.0.0.0.0...

    30. Patching component oracle.javavm.client, 19.0.0.0.0...
    31. Patch 34411846 successfully applied.
    32. Log file location: /u01/app/oracle/product/19.0.0/db_1/cfgtoollogs/opatch/opatch2023-01-06_19-18-37PM_1.log

    33. OPatch succeeded.
    复制代码



    回复

    使用道具 举报

    您需要登录后才可以回帖 登录 | 立即注册

    本版积分规则

    运维联盟俱乐部 ( 冀ICP备19036648号 )

    GMT+8, 2024-5-17 15:51 , Processed in 0.051129 second(s), 21 queries , Gzip On.

    Powered by Discuz! X3.4

    © 2001-2023 Discuz! Team.

    快速回复 返回顶部 返回列表