Skip to main content

How to Upgrade JDK 1.6 to 1.7 in GRID and RDBMS HOME


How to Upgrade JDK 1.6 to 1.7 in GRID and RDBMS HOME

Pre-Patching steps:

Step 1: Change the permissions for all files located under RDBMS and Grid Home JDK directory.
GRID and RDBMS Homes:
chmod -R 755 $ORACLE_HOME/jdk



Step 2: Check the conflicts for both GRID and RDBMS homes

opatch prereq CheckConflictAgainstOHWithDetail -ph ./




Step 3:
Verify the current version of JDK under Grid and RDBMS homes:
/u01/app/oracle/product/12.1.0.2/db_1/jdk/bin
 ./java -version
java version "1.6.0_211"
Java(TM) SE Runtime Environment (build 1.6.0_211-b11)
Java HotSpot(TM) 64-Bit Server VM (build 20.211-b11, mixed mode)
/u01/app/oracle/product/12.1.0.2/db_1/jdk/bin
> cd /u01/app/12.1.0.2/grid/jdk/
/u01/app/12.1.0.2/grid/jdk
cd bin
/u01/app/12.1.0.2/grid/jdk/bin
<dbname> > ./java -version
java version "1.6.0_211"
Java(TM) SE Runtime Environment (build 1.6.0_211-b11)
Java HotSpot(TM) 64-Bit Server VM (build 20.211-b11, mixed mode)


Patching Steps:
Login with root and apply the patch using opatchauto.
/u01/app/12.1.0.2/grid/OPatch/opatchauto apply /lfs/dba/JULJDK_2019/29924111

Example:
[root@server ~]# /u01/app/12.1.0.2/grid/OPatch/opatchauto apply /lfs/dba/JULJDK_2019/29924111

OPatchauto session is initiated at Mon Aug 19 05:33:53 2019

System initialization log file is /u01/app/12.1.0.2/grid/cfgtoollogs/opatchautodb/systemconfig2019-08-19_05-33-55AM.log.

Session log file is /u01/app/12.1.0.2/grid/cfgtoollogs/opatchauto/opatchauto2019-08-19_05-33-59AM.log
The id for this session is 7U6N

Executing OPatch prereq operations to verify patch applicability on home /u01/app/oracle/product/12.1.0.2/db_1
Patch applicability verified successfully on home /u01/app/oracle/product/12.1.0.2/db_1


Verifying SQL patch applicability on home /u01/app/oracle/product/12.1.0.2/db_1
No step execution required.........


Executing OPatch prereq operations to verify patch applicability on home /u01/app/12.1.0.2/grid
Patch applicability verified successfully on home /u01/app/12.1.0.2/grid


Preparing to bring down database service on home /u01/app/oracle/product/12.1.0.2/db_1
Successfully prepared home /u01/app/oracle/product/12.1.0.2/db_1 to bring down database service


Bringing down database service on home /u01/app/oracle/product/12.1.0.2/db_1
Following database has been stopped and will be restarted later during the session: DBname
Database service successfully brought down on home /u01/app/oracle/product/12.1.0.2/db_1


Bringing down CRS service on home /u01/app/12.1.0.2/grid
Prepatch operation log file location: /u01/app/12.1.0.2/grid/cfgtoollogs/crsconfig/hapatch_2019-08-19_05-34-38AM.log
CRS service brought down successfully on home /u01/app/12.1.0.2/grid


Start applying binary patch on home /u01/app/oracle/product/12.1.0.2/db_1
Binary patch applied successfully on home /u01/app/oracle/product/12.1.0.2/db_1


Start applying binary patch on home /u01/app/12.1.0.2/grid
Binary patch applied successfully on home /u01/app/12.1.0.2/grid


Starting CRS service on home /u01/app/12.1.0.2/grid
Postpatch operation log file location: /u01/app/12.1.0.2/grid/cfgtoollogs/crsconfig/hapatch_2019-08-19_05-36-08AM.log
CRS service started successfully on home /u01/app/12.1.0.2/grid


Starting database service on home /u01/app/oracle/product/12.1.0.2/db_1
Database service successfully started on home /u01/app/oracle/product/12.1.0.2/db_1


Preparing home /u01/app/oracle/product/12.1.0.2/db_1 after database service restarted
No step execution required.........


Trying to apply SQL patch on home /u01/app/oracle/product/12.1.0.2/db_1
No step execution required.........

OPatchAuto successful.

--------------------------------Summary--------------------------------

Patching is completed successfully. Please find the summary as follows:

Host:<server>
SIDB Home:/u01/app/oracle/product/12.1.0.2/db_1
Version:12.1.0.2.0
Summary:

==Following patches were SUCCESSFULLY applied:

Patch: /lfs/dba/JULJDK_2019/29924111
Log: /u01/app/oracle/product/12.1.0.2/db_1/cfgtoollogs/opatchauto/core/opatch/opatch2019-08-19_05-35-00AM_1.log


Host:<server>
SIHA Home:/u01/app/12.1.0.2/grid
Version:12.1.0.2.0
Summary:

==Following patches were SUCCESSFULLY applied:

Patch: /lfs/dba/JULJDK_2019/29924111
Log: /u01/app/12.1.0.2/grid/cfgtoollogs/opatchauto/core/opatch/opatch2019-08-19_05-35-34AM_1.log



OPatchauto session completed at Mon Aug 19 05:37:38 2019
Time taken to complete the session 3 minutes, 45 seconds


Post Patching Steps:

Step 1: Verify the JDK version of GRID and RDBMS Homes:
/u01/app/oracle/product/12.1.0.2/db_1/jdk/bin
<dbname> > ./java -version
java version "1.7.0_221"
Java(TM) SE Runtime Environment (build 1.7.0_221-b08)
Java HotSpot(TM) 64-Bit Server VM (build 24.221-b08, mixed mode)
/u01/app/oracle/product/12.1.0.2/db_1/jdk/bin
 cd /u01/app/12.1.0.2/grid/jdk/bin
/u01/app/12.1.0.2/grid/jdk/bin
<db_name>> ./java -version
java version "1.7.0_221"
Java(TM) SE Runtime Environment (build 1.7.0_221-b08)

Step 2:
Follow the standard procedure for upgrading JDK 1.7 u221 to latest version JDK 1.7u231 version of both GRID and RDBMS Homes. Oracle Doc Id: 2286866.1

Step 3:
Verify the DB JVM version from Database level.
select dbms_java.get_jdk_version() from dual;

We will be getting following error after upgrading to JDK 1.7



Steps to upgrade DB JVM.
1.     Shutdown all the services
+ASM> crsctl stop has/crs
Note: if it is RAC, shutdown the services in all the nodes
2.     Set the environment to DB HOME and Run the following command to upgrade JDK version at DB LEVEL in all the nodes
perl $ORACLE_HOME/javavm/install/update_javavm_binaries.pl 7
3.     Relink the libraries in all the nodes
cd $ORACLE_HOME/rdbms/lib
make -f ins_rdbms.mk ioracle
4.     Start the DB Services in all nodes
+ASM > crsctl start has/crs
5.     Update the JVM to latest version at DB Level
SQL> @$ORACLE_HOME/javavm/install/update_javavm_db.sql
Note: Run this SQL in any one node for all databases.
6.     Verify the DB JVM
SQL> select dbms_java.get_jdk_version() from dual;


Comments

Popular posts from this blog

How to unmount and mount ACFS FILESYSTEM

How to unmount and mount ACFS FileSystem in Linux Unmounting ACFS File Systems ACFS file systems can be used by Oracle RAC for hosting software files for the database. It can also be used as a general purpose file system for non-database files. The ACFS file system is managed and administered by the Oracle Grid Infrastructure, So ACFS file systems will be impacted when shutting down the GI stack for patching GI homes. Shut down the processes (including non-Oracle processes) that use the files on ACFS, then unmount the ACFS file system. If the ACFS file system is used by Oracle database software, then perform Steps 1 and 2. 1.      Execute the following command to find the names of the CRS managed ACFS file system resource.  # crsctl stat res -w "TYPE = ora.acfs.type" -p | grep VOLUME 2.      Execute the following command to stop the CRS managed ACFS file system resource with the resource name found from Step 1. ...

How to perform GRID/RDBMS patching of DB systems deployed in OCI using dbcli command line utility

This procedure covers OS, Grid and RDBMS home patching for Oracle Cloud Infrastructure (OCI) DB systems using the dbcli utility. Run every step as root . Advantages of dbcli patching Simple command line, with no manual patch download or copy to the nodes. Patches are downloaded automatically if the service gateway can reach Oracle Object Storage and the YUM repos. Applied in a rolling fashion, so no downtime is needed. Disadvantages You can't choose the patch version; the latest available in OCI is applied. Rollback isn't possible from the console, and dbcli support is limited (see the note at the end). Steps 1. Backup Make sure a recent full backup exists before patching. 2. Blackout Create a blackout for both nodes (console or emctl ) to avoid unnecessary alerts. 3. Check patch availability # dbcli describe-component 4. Pre-checks Grid home: # dbcli update-server -p # dbcli describe-job -i <jobId> RDBMS home: # dbcli list-dbhomes...

To fix huge lag between primary and DR using 12c feature: 12c Recover from service

Scope If transport or apply lag is huge difference, then we can fix using 12c new feature “Recover from Service”. Prerequisites : Oracle Net connectivity is established between the physical standby database and the primary database. You can do this by adding an entry corresponding to the primary database in the tnsnames.ora file of the physical standby database. The password files on the primary database and the physical standby database are the same. The COMPATIBLE parameter in the initialization parameter file of the primary database and physical standby database is set to 12.0 or higher. Start RMAN and connect as target to the physical standby database. Detailed Steps: Step 1: Stop the MRP process in standby database. If dg broker: Edit database <dbname> set state=’APPLY-OFF’; Step 2:   Shut down the standby database and mount the same. Shut immediate;   (srvctl stop database –d <dbname>)  ...