Category Archives: linux

Part 2 – Building Oracle 12c development suite – Installation of Oracle VirtualBox

Installation of Oracle VirtualBox
Oracle Corporation provides the ability for developers to create a complete development suite on their personal windows desktop or laptop without requiring the expensive equipment required for a true production system. This article outlines the process of installing Oracle VirtualBox for installation of guest Operating Systems on your windows desktop or laptop.

NOTE: This suite can be installed on any type of OS, just download the appropriate VirtualBox software package for your base system.
Required files:
VirtualBox-4.3.20-96997-Win.exe
or
The latest version available at www.oracle.com
1. Logon to your windows desktop or laptop as an administrator.
2. Double click on the VirtualBox executable.
3. Click on Next button at the Welcome page.

4. Click on the Next button at the Custom Setup page.

5. Click on the Next button at the Custom Setup Options page.

6. Click on the Next button at the Warning Network Interfaces page.

7. Click on the Install button at the Ready to Install page.

8. After Installation completes, click the Finish button.

9. The administration console will open after installation is completed.

Larry Catt

Creating multiple Oracle Environments in Single Linux Server

When preparing your RHEL server for an Oracle RDBMS or other application software installations, it is common to have multiple oracle RDBMS instances or other related applications which share the same environmental variables, but with different values.    This procedure shows how to setup your RHEL environment to support multiple Oracle software installs.

 

  1. Logon as the oracle software user.
  2. Go to the user’s home directory and edit the .bash_profile file with the following lines and placing the environmental variables for each database instance in the separate block.

# .bash_profile

# Get the aliases and functions

if [ -f ~/.bashrc ]; then

. ~/.bashrc

fi

# User specific environment and startup programs

PATH=$PATH:$HOME/bin

export PATH

# User specific environment and startup programs

echo “Choose the number associated with the SID you wish to administrate:”

echo ” 1 – ORCL”

echo ” 2 – MYDB”

read SID_NUMBER

if [ $SID_NUMBER = 1 ]; then

echo “SID Number is $SID_NUMBER”

<ENTER ENVIRONMENTAL Variables for instance 1 here>

elif [ $SID_NUMBER = 2 ]; then

echo “SID Number is $SID_NUMBER”

<ENTER ENVIRONMENTAL Varaibles for instance 2 here>

else

<Default environmental variables>

echo “Invalid SID Number, defaulting to $ORACLE_SID”

fi

 

  1. In our example the .bash_profile file looks like:

if [ -f ~/.bashrc ]; then

. ~/.bashrc

fi

# User specific environment and startup programs

PATH=$PATH:$HOME/bin

export PATH

# .bash_profile

# Get the aliases and functions

if [ -f ~/.bashrc ]; then

. ~/.bashrc

fi

# User specific environment and startup programs

echo “Choose the number associated with the SID you wish to administrate:”

echo ” 1 – ORCL”

echo ” 2 – MYDB”

read SID_NUMBER

if [ $SID_NUMBER = 1 ]; then

echo “SID Number is $SID_NUMBER”

export JAVAPATH=/usr/bin/java

export ORACLE_BASE=/opt/app/oracle

export ORACLE_HOME=/opt/app/oracle/ORCL_db

export ORACLE_SID=ORCL

export PATH=$PATH:$HOME/bin:$ORACLE_HOME/bin:$ORACLE_HOME/OPatch:$JAVAPATH:$ORACLE_HOME/lib

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOME/lib

umask 022

elif [ $SID_NUMBER = 2 ]; then

echo “SID Number is $SID_NUMBER”

export JAVAPATH=/usr/bin/java

export ORACLE_BASE=/opt/app/oracle

export ORACLE_HOME=/opt/app/oracle/MYDB_db

export ORACLE_SID=MYDB

export PATH=$PATH:$HOME/bin:$ORACLE_HOME/bin:$ORACLE_HOME/OPatch:$JAVAPATH:$ORACLE_HOME/lib

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOME/lib

umask 022

else

export JAVAPATH=/usr/bin/java

export ORACLE_BASE=/opt/app/oracle

export ORACLE_HOME=/opt/app/oracle/MYDB_db

export ORACLE_SID=MYDB

export PATH=$PATH:$HOME/bin:$ORACLE_HOME/bin:$ORACLE_HOME/OPatch:$JAVAPATH:$ORACLE_HOME/lib

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOME/lib

umask 022

echo “Invalid SID Number, Defaulting to $ORACLE_SID”

fi

  1. No logon as the oracle user and select the appropriate choose for your environment.

[root@MYLINUX ~]# su – oracle

Choose the number associated with the SID you wish to administrate:

1 – ORCL

2 – MYDB

1

SID Number is 1

[oracle@MYLINUX ~]$ exit

logout

[root@MYLINUX ~]# su – oracle

Choose the number associated with the SID you wish to administrate:

1 – ORCL

2 – MYDB

2

SID Number is 2

[oracle@MYLINUX ~]$ exit

logout

[root@MYLINUX ~]# su – oracle

Choose the number associated with the SID you wish to administrate:

1 – ORCL

2 – MYDB

5

Invalid SID Number, Defaulting to MYDB

[oracle@MYLINUX ~]$

  1. This completes creating multiple oracle environmental variables for a single Linux Server

 

Larry Catt, OCP

Translate UNIX / Linux EPOCH time to Oracle date

Translate UNIX / Linux EPOCH time to Oracle date

Epoch time in computers is general defined as the number of milliseconds since 1 January 1970 and provides for a very useful way of determining times between system and other time specific functions.   However, it is very difficult for humans to read.   The following code will convert an Epoch time to Oracle date time format.

Given epoch time is 579052800000. we can retrieve oracle time as below.

SQL> define test_time=579052800000

SQL> select  (TO_DATE(’01-01-1970′,’MM-DD-YYYY’) + (&test_time / 86400000)-1) from dual;

old   1: select  (TO_DATE(’01-01-1970′,’MM-DD-YYYY’) + (&test_time / 86400000)-1) from dual

new   1: select  (TO_DATE’01-01-1970′,’MM-DD-YYYY’) + (579052800000 / 86400000)-1) from dual

(TO_DATE(

———

07-MAY-88

SQL>

and convert standard oracle date to epoch

 

select to_char(sysdate – to_date(’01-01-1970′,’MM-DD-YYYY’))*86400000 from dual;

 

SQL> select to_char(sysdate – to_date(’01-01-1970′,’MM-DD-YYYY’))*86400000 from dual;

TO_CHAR(SYSDATE-TO_DATE(’01-01-1970′,’MM-DD-YYYY’))*86400000 ————————————————————

1.3807E+12

SQL>

Larry Catt

Changing network configuration on Linux

This procedure can be used to change anything related to your network card configuration and have that change be persistent on system reboot.

  1. Logon as the root user
  2. Change directory to /etc/sysconfig/network-scripts

 [root@oel1 ~]# cd /etc/sysconfig/network-scripts

[root@oel1 network-scripts]#

3. VI the file ifcfg-eth0 and make the changes you wish.   In the example below, we edited the IPADDR variable to value of 192.1638.1.220

DEVICE=eth0

HWADDR=08:00:27:8F:E8:7D

TYPE=Ethernet

UUID=3138ac97-98ca-40fe-b24a-adea56ab46a9

ONBOOT=yes

NM_CONTROLLED=yes

BOOTPROTO=static

BROADCAST=192.168.1.255

IPADDR=192.168.1.220

NETMASK=255.255.255.0

  1. Stop the network service

 service network stop

5. Start the network service

service network start

6.   See the new configuration detail of eth0 with ifconfig command.

[root@oel1 ~]# ifconfig eth0

eth0      Link encap:Ethernet  HWaddr 08:00:27:8F:E8:7D

          inet addr:19.168.1.220 Bcast:19.168.1.255  Mask:255.255.255.0

          inet6 addr: fe80::a00:27ff:fe8f:e87d/64 Scope:Link

          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

          RX packets:16595 errors:0 dropped:0 overruns:0 frame:0

          TX packets:659 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:1000

          RX bytes:3986311 (3.8 MiB) TX bytes:98819 (96.5 KiB)

 

[root@oel1 ~]#

 

Larry Catt

Fixing access denied error from Linux Server

You attempt to access a remote Linux machine and receive the following error after logon attempt with correct username/password combination.  This indicates that the machine is not accepting password authentication as an access method.   To resolve this issue, perform the following change to sshd_config file as follows:

 

Error:

 

login as: root

root@192.168.1.220’s password:

Access denied

root@192.168.1.220’s password:

 

 

Steps to resolve this issue:

  1. Logon directly to Linux console as the root user.
  2. Change directory to /etc/ssh

[root@oel1 ~]# cd /etc/ssh

  1. Open the file sshd_config

[root@oel1 ssh]# vi sshd_config

  1. Change the line <PasswordAuthentication no> to read <PasswordAuthentication yes>
  2. Stop the sshd service

[root@oel1 ssh]# service sshd stop

Stopping sshd:                                            [  OK  ]

[root@oel1 ssh]#

  1. Start the sshd service

[root@oel1 ssh]# service sshd start

Starting sshd:                                            [  OK  ]

[root@oel1 ssh]#

  1. Attempt to connect with username / password combination.

[root@oel1 ssh]# ssh 192.168.1.220

The authenticity of host ‘192.168.1.220 (192.168.1.220)’ can’t be established.

RSA key fingerprint is 74:e4:db:67:e9:7e:81:6f:dc:16:1d:06:25:7e:20:ae.

Are you sure you want to continue connecting (yes/no)? yes

Warning: Permanently added ‘192.168.1.220’ (RSA) to the list of known hosts.

Password:

Last login: Thu Oct  3 11:09:46 2013 from 192.168.1.78

[root@oel1 ~]#

 

You have successfully logon with username and password.

 

Larry Catt

Problem with RHEL 5.4 and Oracle RAC

 

I Ran into an issue while working with Oracle Corporation on 11gR2 RAC and RHEL 5.4 using OS layer files and OCFS2 for storage.  Now Oracle is currently saying that no known problem exists, but I thought I would drop a note here, just in case anyone comes across the same situation.   It appears that when you upgrade your RHEL kernel from version 2.6.18-194.26.1.el5 to 2.6.18-238.1.1.el5 and of course upgrade your OCFS2 drivers to the same version.   Access to the shared files of RAC becomes an issue for Oracle upon installation and execution of root.sh.  

We struggled with this for two weeks, and from the start said the only thing we did was upgrade the kernel.  However, Oracle repeatedly said all Kernels above 2.16.18 have no issues.    Finally, we downgraded the system back to the original kernel 2.6.18-194.26.1.el5 and re-applied the OCFS2 RPMs for that kernel and everything began to work. 

So if you are have problems with Oracle 11g RAC install on RHEL 5.4 with kernel 2.6.18-238.1.1.el5 and can find no reasonable solution.  You may want to downgrade your kernel and try again.   It actually only took 45 minutes to downgrade, update the Oracle RPMs and provided a solution to a two week old problem. 

 

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

SSH, PING, and RSH – Permissions causing failure on Oracle RAC Installation

Oracle RAC requires permissions to networking components which are typically restricted on most systems. Most notable are permissions to utilities SSH, PING, and RSH. If you are attempting to install Oracle RAC software and you are receiving failures in communications; check the permissions of these utilities for a possible cause.

1. Logon to your Linux server as root.

2. Change the permissions on the following files to u+s.

chmod u+s /bin/ping
chmod u+s /usr/bin/ssh
chmod u+s /usr/bin/rsh

This completes allowing Oracle permissions to SSH, PING, and RSH for RAC configurations.
Larry J. Catt, OCP 9i, 10g
oracle@allcompute.com
www.allcompute.com

Required packages for Oracle 11g RDBMS install on LINUX

The installation of Oracle RDBMS software requires supporting OS level functionality to successfully complete and operate. This article outlines the RPM checks which should be completed before the installation of Oracle 11g RDBMS is begun.

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

2. Below is a listing of the RPM Oracle gives as required for a successful 11g RDBMS install. However, RPMs are continuously updated so the version on your system may be newer than what was given by the manufacturer

binutils-2.17.50.0.6
compat-libstdc++-33-3.2.3
elfutils-libelf-0.125
elfutils-libelf-devel-0.125
elfutils-libelf-devel-static-0.125
gcc-4.1.2
gcc-c++-4.1.2
glibc-2.5-24
glibc-common-2.5
glibc-devel-2.5
glibc-headers-2.5
kernel-headers-2.6.18
ksh-20060214
libaio-0.3.106
libaio-devel-0.3.106
libgcc-4.1.2
libgomp-4.1.2
libstdc++-4.1.2
libstdc++-devel-4.1.2
make-3.81
numactl-devel-0.9.8.i386
sysstat-7.0.2
unixODBC-2.2.11
unixODBC-devel-2.2.11

3. Thus, when investigating if the RPM exists on your system, you should not include the version number. In this example we will check for the existence of RPM binutils-2.17.50.0.6. Use the rpm –qa command to gather all installed packages, then lookup for the specific one with grep.


[root@mylinux1 ~]# rpm -qa|grep binutils
binutils-2.17.50.0.6-14.el5
[root@mylinux1 ~]#

4. As seen above the actual version of the rpm binutils-2.17.50.0.6 is an exact match, but it does not have to be. As long as the installed package has a version greater than the required version of 2.17.50.0.6, it meets our needs for 11g RDBMS install.

5. Repeat these steps for each required package.
This completes checking for required Oracle 11g RDBMS packages.

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

Required packages for Oracle 10g RDBMS install on LINUX

The installation of Oracle RDBMS software requires supporting OS level functionality to successfully complete and operate. This article outlines the check which should be done before the installation of Oracle 10g RDBMS is begun.

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

2. Below is a listing of the RPMs Oracle gives as required for a successful 10g RDBMS install. However, RPMs are continuously updated so the version on your system may be newer than shown below.

libgomp-4.1.2-42.el5.x86_64.rpm
kernel-headers-2.6.18-92.el5.x86_64.rpm
glibc-headers-2.5-24.x86_64.rpm
libstdc++-devel-4.1.2-42.el5.x86_64.rpm
sysstat-7.0.2-1.el5.x86_64.rpm
glibc-devel-2.5-24.x86_64.rpm
libaio-devel-0.3.106-3.2.x86_64.rpm
gcc-4.1.2-42.el5.x86_64.rpm
gcc-c++-4.1.2-42.el5.x86_64.rpm
elfutils-libelf-devel-static-0.125-3.el5.x86_64.rpm
elfutils-libelf-devel-0.125-3.el5.x86_64.rpm
compat-db-4.2.52-5.1.x86_64.rpm
compat-gcc-34-3.4.6-4.x86_64.rpm
compat-gcc-34-c++-3.4.6-4.x86_64.rpm
gdb-6.5-37.el5.x86_64.rpm
libtermcap-devel-2.0.8-46.1.x86_64.rpm
readline-devel-5.1-1.1.x86_64.rpm
unixODBC-2.2.11-7.1.x86_64.rpm
unixODBC-devel-2.2.11-7.1.x86_64.rpm
glibc-devel-2.5-24.i386.rpm
libXp-1.0.0-8.1.el5.i386.rpm
libstdc++-devel-4.1.2-42.el5.i386.rpm
unixODBC-2.2.11-7.1.i386.rpm
unixODBC-devel-2.2.11-7.1.i386.rpm
libaio-devel-0.3.106-3.2.i386.rpm

3. When investigating if the RPM exists on your system, you should not include the version number. In this example we will check for the existence of RPM libgomp-4.1.2-42.el5.x86_64.rpm. Use the rpm –qa command to gather all installed packages, then lookup the specific one with grep.

[root@mylinux1 ~]# rpm -qa|grep libgomp
libgomp-4.4.4-13.el5
[root@mylinux1 ~]#

4. As seen above the actual version of the rpm libgomp is 4.4.4 which is greater than the required version of 4.1.2 and meets our needs for 10g RDBMS install.

5. Repeat these steps for each required package.

This completes checking for required Oracle 10g RDBMS packages.

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