TA的每日心情 | 开心 2023-8-9 11:05 |
---|
|
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- [oracle@zy1 34411846]$ srvctl stop home -oraclehome $ORACLE_HOME -statefile /tmp/stat1 -node zy1
- [oracle@zy1 34411846]$ pwd
- /tmp/34411846
- [oracle@zy1 34411846]$ opatch apply
- Oracle Interim Patch Installer version 12.2.0.1.33
- Copyright (c) 2023, Oracle Corporation. All rights reserved.
- Oracle Home : /u01/app/oracle/product/19.0.0/db_1
- Central Inventory : /u01/app/oraInventory
- from : /u01/app/oracle/product/19.0.0/db_1/oraInst.loc
- OPatch version : 12.2.0.1.33
- OUI version : 12.2.0.7.0
- Log file location : /u01/app/oracle/product/19.0.0/db_1/cfgtoollogs/opatch/opatch2023-01-06_19-18-37PM_1.log
- Verifying environment and performing prerequisite checks...
- OPatch continues with these patches: 34411846
- Do you want to proceed? [y|n]
- y
- User Responded with: Y
- All checks passed.
- Please shutdown Oracle instances running out of this ORACLE_HOME on the local system.
- (Oracle Home = '/u01/app/oracle/product/19.0.0/db_1')
- Is the local system ready for patching? [y|n]
- y
- User Responded with: Y
- Backing up files...
- Applying interim patch '34411846' to OH '/u01/app/oracle/product/19.0.0/db_1'
- Patching component oracle.javavm.server, 19.0.0.0.0...
- Patching component oracle.javavm.server.core, 19.0.0.0.0...
- Patching component oracle.rdbms.dbscripts, 19.0.0.0.0...
- Patching component oracle.rdbms, 19.0.0.0.0...
- Patching component oracle.javavm.client, 19.0.0.0.0...
- Patch 34411846 successfully applied.
- Log file location: /u01/app/oracle/product/19.0.0/db_1/cfgtoollogs/opatch/opatch2023-01-06_19-18-37PM_1.log
- OPatch succeeded.
复制代码
|
|