Category Archives: unix

OpenJDK JVM not supported while installing Oracle Fusion Middleware on Linux 7

Various software releases will sometimes have incompatibility because the two products were released or tested at about the same time. This is the cause of Oracle Fusion Middleware 12.2.1.0.0 (FMW 12c) and
Oracle Enterprise Linux 7.2 (OEL 7). FMW 12c was thoroughly tested against OEL 6, but due to its release date collision with OEL 7, there are some validation which fail checks during the install. Resulting in the
error below:

[oracle@linux1 STAGE]$ java -Djava.io.tmpdir=/u04/tmp -jar fmw_12.2.1.1.0_infrastructure.jar -silent -ignoreSysPrereqs -responseFile /u01/STAGE/fmw.rsp
Launcher log file is /u04/tmp/OraInstall2017-07-13_08-41-06AM/launcher2017-07-13_08-41-06AM.log.
Extracting the installer . . . . . . . . . . . . Done
The OpenJDK JVM is not supported on this platform.
The log is located here: /u04/tmp/OraInstall2017-07-13_08-41-06AM/launcher2017-07-13_08-41-06AM.log.
[oracle@linux1 STAGE]$

This error is a result of FMW 12c being testing against OEL 6 with JDK 1.7, but the default JDK for OEL 7 is JDK 1.8. This article outlines a procedure to resolve this error and proceed with installation
of Oracle Fusion Middleware 12.2.1.0.0 on OEL 7 or any Linux 7 distribution.

1. Logon to OEL 7 server as the root user.

[larry@linux1 ~]$ su –
Password:
Last login: Tue Jul 13 09:44:38 EDT 2017 on pts/1
[root@linux1 ~]#

2. Determine current JAVA installed with command: java -version

[root@linux2 ~]# java -version
openjdk version “1.8.0_65”
OpenJDK Runtime Environment (build 1.8.0_65-b17)
OpenJDK 64-Bit Server VM (build 25.65-b01, mixed mode)
[root@linux2 ~]#

We will install an alternative JDK for use of FMW with one we know works, in this case that JDK is 1.7.0_79.

3. Move to a directory to install the alternative JDK. In this case we will use /opt with command: cd /opt

[root@linux2 ~]# cd /opt
[root@linux2 opt]#

4. Download the JDK 1.7.0_79 with wget command: wget –no-check-certificate –no-cookies –header “Cookie: oraclelicense=accept-securebackup-cookie” “http://download.oracle.com/otn-pub/java/jdk/7u79-b15/jdk-7u79-linux-x64.tar.gz” “http://download.oracle.com/otn-pub/java/jdk/7u79-b15/jdk-7u79-linux-i586.tar.gz”

[root@linux2 opt]# wget –no-check-certificate –no-cookies –header “Cookie: oraclelicense=accept-securebackup-cookie” “http://download.oracle.com/otn-pub/java/jdk/7u79-b15/jdk-7u79-linux-x64.tar.gz”
–2017-07-14 14:14:46– http://download.oracle.com/otn-pub/java/jdk/7u79-b15/jdk-7u79-linux-x64.tar.gz
Resolving download.oracle.com (download.oracle.com)… 70.186.31.18, 70.186.31.9
Connecting to download.oracle.com (download.oracle.com)|70.186.31.18|:80… connected.
HTTP request sent, awaiting response… 302 Moved Temporarily
Location: https://edelivery.oracle.com/otn-pub/java/jdk/7u79-b15/jdk-7u79-linux-x64.tar.gz [following]
–2017-07-14 14:14:47– https://edelivery.oracle.com/otn-pub/java/jdk/7u79-b15/jdk-7u79-linux-x64.tar.gz
Resolving edelivery.oracle.com (edelivery.oracle.com)… 104.72.8.208
Connecting to edelivery.oracle.com (edelivery.oracle.com)|104.72.8.208|:443… connected.
HTTP request sent, awaiting response… 302 Moved Temporarily
Location: https://edelivery.oracle.com/osdc-otn/otn-pub/java/jdk/7u79-b15/jdk-7u79-linux-x64.tar.gz [following]
–2017-07-14 14:14:48– https://edelivery.oracle.com/osdc-otn/otn-pub/java/jdk/7u79-b15/jdk-7u79-linux-x64.tar.gz
Reusing existing connection to edelivery.oracle.com:443.
HTTP request sent, awaiting response… 302 Moved Temporarily
Location: http://download.oracle.com/otn-pub/java/jdk/7u79-b15/jdk-7u79-linux-x64.tar.gz?AuthParam=1473877008_9518549fbff39b6f0a026bcbd58215c9 [following]
–2017-07-14 14:14:48– http://download.oracle.com/otn-pub/java/jdk/7u79-b15/jdk-7u79-linux-x64.tar.gz?AuthParam=1473877008_9518549fbff39b6f0a026bcbd58215c9
Connecting to download.oracle.com (download.oracle.com)|70.186.31.18|:80… connected.
HTTP request sent, awaiting response… 200 OK
Length: 153512879 (146M) [application/x-gzip]
Saving to: ‘jdk-7u79-linux-x64.tar.gz’

100%[===============================================================================================>] 153,512,879 4.64MB/s in 32s

2017-07-14 14:15:20 (4.58 MB/s) – ‘jdk-7u79-linux-x64.tar.gz’ saved [153512879/153512879]

[root@linux2 opt]#

5. View the downloaded JDK with ls -l command:

[root@linux2 opt]# ls -l
total 149916
drwxr-xr-x. 4 oracle dba 43 Aug 25 14:22 app
-rw-r–r–. 1 root root 153512879 Apr 13 2015 jdk-7u79-linux-x64.tar.gz
drwxr-xr-x. 2 root root 6 Mar 26 2015 rh
[root@linux2 opt]#

6. Unpack the JDK with tar command: tar xzf ./jdk-7u79-linux-x64.tar.gz

[root@linux2 opt]# tar xzf ./jdk-7u79-linux-x64.tar.gz
[root@linux2 opt]# ls
app jdk1.7.0_79 jdk-7u79-linux-x64.tar.gz rh
[root@linux2 opt]#

7. change directory to the newly created JDK directory under /opt with cd command: cd /opt/jdk1.7.0_79/

[root@linux2 opt]# cd /opt/jdk1.7.0_79/
[root@linux2 jdk1.7.0_79]#

8. Use the alternatives command to install new JDK with command:

alternatives –install /usr/bin/java java /opt/jdk1.7.0_79/bin/java 2

9. Set the newly installed JDK as local default with command: alternatives –config java

[root@linux2 jdk1.7.0_79]# alternatives –config java

There are 2 programs which provide ‘java’.

Selection Command
———————————————–
*+ 1 /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.65-3.b17.el7.x86_64/jre/bin/java
2 /opt/jdk1.7.0_79/bin/java

Enter to keep the current selection[+], or type selection number: 2
[root@linux2 jdk1.7.0_79]#

10. Install JAR from new JDK with command: alternatives –install /usr/bin/jar jar /opt/jdk1.7.0_79/bin/jar 2

[root@linux2 jdk1.7.0_79]# alternatives –install /usr/bin/jar jar /opt/jdk1.7.0_79/bin/jar 2
[root@linux2 jdk1.7.0_79]#

11. Install javac executable from new JDK with command: alternatives –install /usr/bin/javac javac /opt/jdk1.7.0_79/bin/javac 2

[root@linux2 jdk1.7.0_79]# alternatives –install /usr/bin/javac javac /opt/jdk1.7.0_79/bin/javac 2
[root@linux2 jdk1.7.0_79]#

11. Set the new JAR as the default with command: alternatives –set jar /opt/jdk1.7.0_79/bin/jar

[root@linux2 jdk1.7.0_79]# alternatives –set jar /opt/jdk1.7.0_79/bin/jar
[root@linux2 jdk1.7.0_79]#

12. Set the new JAVAC executable as the default with command: alternatives –set javac /opt/jdk1.7.0_79/bin/javac

[root@linux2 jdk1.7.0_79]# alternatives –set javac /opt/jdk1.7.0_79/bin/javac
[root@linux2 jdk1.7.0_79]#

13. Check the default java version with command: java -version

[root@linux2 jdk1.7.0_79]# java -version
java version “1.7.0_79”
Java(TM) SE Runtime Environment (build 1.7.0_79-b15)
Java HotSpot(TM) 64-Bit Server VM (build 24.79-b02, mixed mode)
[root@linux2 jdk1.7.0_79]#

14. NOTE: The Java version is now 1.7 79. Logon as the oracle software owner.

[root@linux2 STAGE]# su – oracle
Last login: Wed Jul 14 10:56:10 EDT 2017 on pts/1
[oracle@linux2 ~]$

15. Move to your FMW 12c installation directory and attempt running the installer again. The java error should be removed.

cd /u01/STAGE
java -Djava.io.tmpdir=/u04/tmp -jar fmw_12.2.1.1.0_infrastructure.jar -silent -ignoreSysPrereqs -responseFile /u01/STAGE/fmw.rsp

[root@linux2 jdk1.7.0_79]# cd /u01/STAGE
[root@linux2 STAGE]# su – oracle
Last login: Wed Jul 14 10:56:10 EDT 2017 on pts/1
[oracle@linux2 ~]$ cd /u01/STAGE
[oracle@linux2 STAGE]$ java -Djava.io.tmpdir=/u04/tmp -jar fmw_12.2.1.1.0_infrastructure.jar -silent -ignoreSysPrereqs -responseFile /u01/STAGE/fmw.rsp
Launcher log file is /u04/tmp/OraInstall2017-07-14_02-26-54PM/launcher2017-07-14_02-26-54PM.log.
Extracting the installer . . . . . . . . . . . . . . . . . . . . . . . . .java -Djava.io.tmpdir=/u04/tmp -jar fmw_12.2.1.1.0_infrastructure.jar -silent -ignoreSysPrereqs -responseFile /u01/STAGE/fmw.rsp . . . . . . . . . . . . . . . . . . Done
Checking if CPU speed is above 300 MHz. Actual 3478.990 MHz Passed
Checking swap space: must be greater than 512 MB. Actual 2047 MB Passed
Checking if this platform requires a 64-bit JVM. Actual 64 Passed (64-bit not required)
Checking temp space: must be greater than 300 MB. Actual 32284 MB Passed

Preparing to launch the Oracle Universal Installer from /u04/tmp/OraInstall2017-07-14_02-26-54PM
oraInstFile: /etc/oraInst.loc

16. NOTE: JDK error is now removed.

Larry Catt, OCP

Changing command prompt in LINUX

1. Logon as the user which you which to change the prompt. NOTE: You have to add this to your .profile file to have it survive reboot. This file is normally located /home/ directory and it is a hidden file so will be preceded by a period.
2. Export a new PS1 value with the text you want: In this example I am using ‘username@machine_name promt’

$export PS1='[\u@mylinux \W ]\$’
[oracle@mylinux ~ ]$

3. This completes changing command prompt on LINUX.
Larry Catt, OCP

Set Linux Network Adapters to startup automatically

1. Logon as the root user to your Linux Server.

[larry@linux1 ~]$ sudo su
[root@linux1 larry]#

2. Execute the command: ip -o link show | awk -F’: ‘ ‘{print “ip link set dev “$2″ up”}’ >ip_up.sh

[root@linux1 larry]# ip -o link show | awk -F’: ‘ ‘{print “ip link set dev “$2″ up”}’ >ip_up.sh
[root@linux1 larry]#

3. Change Permission to 775 on file ip_up.sh

[root@linux1 larry]# chmod 770 ip_up.sh
[root@linux1 larry]#

4. Execute file ip_up.sh

[root@linux1 larry]# ./ip_up.sh
[root@linux1 larry]#

5. Execute the command:

find /etc/sysconfig/network-scripts -name “ifcfg-*” -not -name “*bak”| awk -F’: ‘ ‘{print “perl -pi.bak -e ‘”‘”‘s/ONBOOT=no/ONBOOT=yes/g'”‘”‘ “$1}’ > net_ifcfg_update.sh

6. Change the permissions to 775 on file net_ifcfg_update.sh.

[root@linux1 ~]# chmod 775 net_ifcfg_update.sh
[root@linux1 ~]#

7. Execute file net_ifcfg_update.sh.

[root@linux1 ~]# ./net_ifcfg_update.sh
[root@linux1 ~]#

8. Now restart your linux server with the command: reboot.

[root@linux1 larry]# reboot

9. This completes changing your Network adapters to automatically start at system start.

Larry Catt, OCP

Rename LINUX Server

1. Logon as the root user to your Linux Server.

[larry@localmachine ~]$ su –
Password:
Last login: Thu Jun 11 12:29:24 EDT 2017 on pts/1
[root@localmachine ~]#

2. You must edit the file /etc/hostname to change the local machine name. You can generate a statement to update /etc/hostname with the following bash command:

cat /etc/hostname | awk -F. ‘{print “\n\n perl -pi.bak -e ‘”‘”‘s/”$1″//g'”‘”‘ /etc/hostname”}’

[root@localmachine ~]# cat /etc/hostname | awk -F. ‘{print “\n\n perl -pi.bak -e ‘”‘”‘s/”$1″//g'”‘”‘ /etc/hostname”}’

perl -pi.bak -e ‘s/localmachine//g’ /etc/hostname
[root@localmachine ~]#

3. Take the resulting string and replace the text with the name of the machine you wish for your server.

Original Perl Command output:
perl -pi.bak -e ‘s/localmachine//g’ /etc/hostname

Edited Perl Command output: (New Server Name)

perl -pi.bak -e ‘s/localmachine/linux1/g’ /etc/hostname

[root@localmachine ~]# perl -pi.bak -e ‘s/localmachine/linux1/g’ /etc/hostname
[root@localmachine ~]#

4. Reboot your Linux Server.

[root@localmachine ~]# reboot

5. Logon to your Linux Server after reboot completes and see new name of Server with command: hostname.

[larry@linux1 ~]$ su –
Password:
Last login: Thu Jun 11 14:31:50 EDT 2017 from 10.30.15.69 on pts/1
[root@linux1 ~]# hostname
linux1.localdomain
[root@linux1 ~]#

6. This completes changing LINUX Server name.

Larry Catt, OCP

Executing SQL script from command line or executable shell script

You can call into SQLPLUS to execute SQL script from any shell script. This procedure shows how to structure your statements to LINUX environment for call into SQLPLUS from shell script.

1. Logon to your LINUX server as a user with access to SQLPLUS.
2. Use VI to create a executable file. Replace the connection string with appropriate username/password@SID values. Additionally, change the script you which to execute in this example we are executing “utlrp.sql”.

sqlplus sys/password@orcl as sysdba < < EOF @?/rdbms/admin/utlrp.sql exit; EOF

Larry Catt
OCP

Executing Oracle Script as a LINUX or UNIX background process

There are multiple situations where you have to execute processes in your Oracle environment as a daemon or background process of your OS. This procedure describes the use of “NOHUP” to begin the execution of a background process. In this example we are executing the Oracle 12c upgrade script ‘preupgrd.sql’ on an OEL (Oracle Enterprise Linux) platform.

1. Logon to your OEL server as the oracle software owner.

root@mylinux#su – oracle
oracle@mylinux#

2. Change directory to the location of your script file.

oracle@mylinux#cd /opt/app/oracle/product/12.1.0.2/rdbms/admin/
oracle@mylinux#

3. At the OS prompt execute the NOHUP command passing in a sqlplus connection string and the script name to be executed following by a terminating ampersand sign ‘&’.

nohup sqlplus sys/password as sysdba @./preupgrd.sql &

oracle@mylinux#nohup sqlplus sys/password as sysdba @./preupgrd.sql &
[1] 7260
oracle@mylinux#nohup: ignoring input and appending output to `nohup.out’

oracle@mylinux#

4. The (nohup) command will produce a log file in the local directory named nohup.out which records all terminal output from the daemon.

oracle@mylinux#cat nohup.out
SQL*Plus: Release 11.2.0.4.0 Production on Sat Mar 26 17:28:19 2017
Copyright (c) 1982, 2013, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 – 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

Loading Pre-Upgrade Package…

SQL>

5. You can also see the processing with the system process command (ps) as shown below.

oracle@mylinux#ps -ef|grep nohup
oracle 9707 9268 0 18:11 pts/0 00:00:00 grep nohup
[1]+ Exit 1 nohup sqlplus sys/password as sysdba @./preupgrd.sql
oracle@mylinux#

6. This completes executing an Oracle script as a LINUX or UNIX background process.

Larry J. Catt, OCP

Allowing SCP on Linux 7

Attempting to transfer files from one server Linux1 to Linux2 results in error: Linux2 sshd not started.

[oracle@linux1 STAGE]$ scp * oracle@10.2.0.155:/u01/STAGE/*
ssh: connect to host 10.2.0.155 port 22: Connection refused
lost connection
[oracle@linux1 STAGE]$
1. Logon as the root user to linux2 server.

[larry@linux2 ~]$ su –
Password:
Last login: Wed Sep 14 10:26:34 EDT 2016 on pts/1
[root@linux2 ~]#

2. Attempt to start the SSH service with command: service sshd start

[root@linux2 ~]# service sshd start
Redirecting to /bin/systemctl start sshd.service
[root@linux2 ~]#

3. Check the status of sshd service with command: service sshd status

[root@linux2 ~]# service sshd status
Redirecting to /bin/systemctl status sshd.service
? sshd.service – OpenSSH server daemon
Loaded: loaded (/usr/lib/systemd/system/sshd.service; enabled; vendor preset: enabled)
Active: active (running) since Wed 2016-09-14 10:23:36 EDT; 16min ago
Docs: man:sshd(8)
man:sshd_config(5)
Main PID: 1283 (sshd)
CGroup: /system.slice/sshd.service
??1283 /usr/sbin/sshd -D

Sep 14 10:23:36 linux2.localdomain systemd[1]: Started OpenSSH server daemon.
Sep 14 10:23:36 linux2.localdomain systemd[1]: Starting OpenSSH server daemon…
Sep 14 10:23:36 linux2.localdomain sshd[1283]: Server listening on 0.0.0.0 p….
Sep 14 10:23:36 linux2.localdomain sshd[1283]: Server listening on :: port 22.
Sep 14 10:25:45 linux2.localdomain sshd[3639]: pam_unix(sshd:auth): authenti…y
Sep 14 10:25:47 linux2.localdomain sshd[3639]: Failed password for larry fro…2
Sep 14 10:25:50 linux2.localdomain sshd[3639]: Accepted password for larry f…2
Sep 14 10:39:50 linux2.localdomain systemd[1]: Started OpenSSH server daemon.
Hint: Some lines were ellipsized, use -l to show in full.
[root@linux2 ~]#

4. Re-attempt the transfer from linux1 server.

[oracle@linux1 STAGE]$ scp * oracle@10.2.0.155:/u01/STAGE/.
oracle@10.2.0.155’s password:
fmw_12.2.1.1.0_infrastructure_Disk1_1of1.zip 100% 1490MB 99.3MB/s 00:15
fmw_12.2.1.1.0_infrastructure.jar 100% 1490MB 99.4MB/s 00:15
fmw_12211_readme.htm 100% 19KB 19.1KB/s 00:00
fmw.rsp 100% 1996 2.0KB/s 00:00
jdk1.7.0_79: not a regular file
jdk-7u79-linux-x64.tar.gz 100% 146MB 146.4MB/s 00:01
[oracle@linux1 STAGE]$
This completes failure of SCP transfer from stopped SSHD processes.
Larry Catt
OCP

Change time zone of Linux Server

This procedure demonstrates the method to change the Time Zone of a typical Linux server.   NOTE:  Due to the number and variations LINUX distributions, this procedure may not work on all LINUX installs.   This procedure was performed on Oracle Enterprise Linux 7.2  (OEL 7.2).

 

  1. Logon to your Linux server as root.

 

[larry@linux2 ~]$ sudo su –

[sudo] password for larry:

Last login: Thu Nov  3 11:02:19 EDT 2016 on pts/1

[root@linux2 ~]#

 

 

  1. Change to directory /etc

 

[root@linux2 ~]# cd /etc

[root@linux2 etc]#

 

  1. Display the currently set system time with command date.

 

[root@linux2 etc]# date

Wed Nov 30 12:39:08 UTC 2016

[root@linux2 etc]#

 

  1. List the current setting to link /etc/localtime and remove link /etc/localtime, using the “rm –f” command.

 

[root@linux2 etc]# ls -l localtime

lrwxrwxrwx. 1 root root 23 Nov 30 14:22 localtime -> /usr/share/zoneinfo/UTC

[root@linux2 etc]# rm -rf localtime

[root@linux2 etc]#

 

  1. Create new link to directory /usr/share/zoneinfo/<your time zone> with you correct timezone.  In this example we are changing to EST.

 

ln -s /usr/share/zoneinfo/EST localtime

 

 

[root@linux2 etc]# ls -l localtime

lrwxrwxrwx. 1 root root 23 Nov 30 09:23 localtime -> /usr/share/zoneinfo/EST

[root@linux2 etc]#

 

  1. Execute linux date command to see new timezone.

 

[root@linux2 etc]# date

Wed Nov 30 09:25:40 EST 2016

[root@linux2 etc]#

 

  1. This completes changing the time zone on Linux server.

 

Larry Catt

OCP

 

Undo root.sh script in 11g GRID or RDBMS install

If you have executed root.sh on the installation of an Oracle 11g clusterware or RDBMS install and it failed. Remove the changes made by root.sh before re-execution with the following procedure.

1. Logon as the root user.

2. Navigate to the Oracle GRID_HOME

3. Execute the following command.

/opt/app/11.2.0/grid/crs/install/rootcrs.pl -deconfig –force -verbose

This completes the undoing the execution of root.sh from an Oracle Grid Installation.

Larry J. Catt, OCP 9i, 10g
oracle@allcompute.com
www.allcompute.com