Category Archives: linux

Part 8 – Building Oracle 12c development suite – Library setup for Oracle Enterprise Linux 6.5 for Oracle RDBMS 12c

Library setup for Oracle Enterprise Linux 6.5 for Oracle RDBMS 12c

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 for configuration libraries for an Oracle Enterprise Linux 6.5 installation in preparation for installation of Oracle 12c RDBMS.
NOTE: This process can be used for most Linux installations, regardless of original company or organization providing the base Linux OS.

1. Logon to your Windows desktop/laptop as an administrator and open Oracle VirtualBox.
2. Logon to your Linux VM as the root user.
3. Change directory to your yum repository with command: “cd /etc/yum.repos.d”

[root@oel65 ~]# cd /etc/yum.repos.d
[root@oel65 yum.repos.d]#

4. Extract the repository from the oracle public yum website with the command: “wget http://public-yum.oracle.com/public-yum-ol6.repo”

[root@OEL65 yum.repos.d]# wget http://public-yum.oracle.com/public-yum-ol6.repo
–2015-04-12 18:49:53– http://public-yum.oracle.com/public-yum-ol6.repo
Resolving public-yum.oracle.com… 70.186.29.33, 70.186.29.58
Connecting to public-yum.oracle.com|70.186.29.33|:80… connected.
HTTP request sent, awaiting response… 200 OK
Length: 5046 (4.9K) [text/plain]
Saving to: “public-yum-ol6.repo.1”

100%[======================================>] 5,046 –.-K/s in 0s

2015-04-12 18:49:53 (225 MB/s) – “public-yum-ol6.repo.1” saved [5046/5046]

[root@OEL65 yum.repos.d]#

5. Edit the yum repo file with appropriate values with the following perl command: “perl -pi.bak -e ‘s/enabled=0/enabled=1/g’ /etc/yum.repos.d/public-yum-ol6.repo”

[root@OEL65 yum.repos.d]# perl -pi.bak -e ‘s/enabled=0/enabled=1/g’ /etc/yum.repos.d/public-yum-ol6.repo
[root@OEL65 yum.repos.d]#

6. Download necessary RPM file from oracle with command: “wget –no-check-certificate https://public-yum.oracle.com/RPM-GPG-KEY-oracle-ol6 -O /etc/pki/rpm-gpg/RPM-GPG-KEY-oracle”

[root@OEL65 yum.repos.d]# wget –no-check-certificate https://public-yum.oracle.com/RPM-GPG-KEY-oracle-ol6 -O /etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
–2015-04-12 18:50:29– https://public-yum.oracle.com/RPM-GPG-KEY-oracle-ol6
Resolving public-yum.oracle.com… 70.186.29.58, 70.186.29.33
Connecting to public-yum.oracle.com|70.186.29.58|:443… connected.
WARNING: no certificate subject alternative name matches
requested host name “public-yum.oracle.com”.
HTTP request sent, awaiting response… 200 OK
Length: 1011 [text/plain]
Saving to: “/etc/pki/rpm-gpg/RPM-GPG-KEY-oracle”

100%[======================================>] 1,011 –.-K/s in 0s

2015-04-12 18:50:30 (16.8 MB/s) – “/etc/pki/rpm-gpg/RPM-GPG-KEY-oracle” saved [1011/1011]

[root@OEL65 yum.repos.d]#

7. Use the following yum command to install the packages from oracle for 12c RDBMS install: “yum install oracle-rdbms-server-12cR1-preinstall”

[root@OEL65 yum.repos.d]# yum install oracle-rdbms-server-12cR1-preinstall
Loaded plugins: rhnplugin, security
This system is receiving updates from ULN.
Setting up Install Process



public_ol6_MySQL | 1.2 kB 00:00
libdmx.x86_64 0:1.1.3-3.el6 libstdc++-devel.x86_64 0:4.4.7-11.el6
xorg-x11-utils.x86_64 0:7.5-6.el6 xorg-x11-xauth.x86_64 1:1.0.2-7.1.el6

Complete!

8. This completes the setup of the VM libraries for Oracle 12c RDBMS.

Larry Catt, OCP

Part 6 – Building Oracle 12c development suite – Security setup for Oracle Enterprise Linux 6.5 on Oracle VirtualBox

Security setup for Oracle Enterprise Linux 6.5 on 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 for a true production system. This article outlines the process for configuration security for an Oracle Enterprise Linux 6.5 installation in preparation for installation of Oracle 12c RDBMS.
NOTE: This process can be used for most Linux installations, regardless of original company or organization providing the base Linux OS.

The two key security requirements to temporarily remove during installation of most software suites is the firewall and linux se feature.

To disable the Linux firewall perform the following:
1. Logon to the linux VM as the root user and execute the command: “chkconfig iptables off”

login as: root
root@10.30.15.127’s password:

[root@oel65 ~]# chkconfig iptables off
[root@oel65 ~]#
To remove the Linux SE feature, perform the following:

2. Logon to your linux VM as the root user and execute the command: “perl -pi.bak -e ‘s/SELINUX=enforcing/SELINUX=disabled/g’ /etc/selinux/config”.

login as: root
root@10.30.15.127’s password:
[root@oel65 ~]# perl -pi.bak -e ‘s/SELINUX=enforcing/SELINUX=disabled/g’ /etc/selinux/config
[root@oel65 ~]#

3. Issue the command “reboot” for the the changes to take affect
[root@oel65 ~]# reboot
Broadcast message from root@oel65
(/dev/pts/0) at 22:02 …
The system is going down for reboot NOW!
[root@oel65 ~]#

4. This completes the setup of the linux security for Oracle installation.

Larry Catt, OCP

Disable Linux Firewall

When preparing your RHEL server for an Oracle RDBMS or other application software installations, it is normally a good idea to temporarily disable the OS layer firewall to prevent possible communication errors. This can be performed with the command CHKCONFIG. Use the following procedures to check and disable or enable the RHEL firewall.

1. Logon as the root user.
Using username “root”.
Last login: Mon Jun 2 08:57:14 2014 from 192.168.10.1
[root@linuxpc ~]#
2. Check the current status of RHEL firewall with command ‘SERVICE’ command.
[root@linuxpc ~]# service iptables status
Table: filter
Chain INPUT (policy ACCEPT)
num target prot opt source destination
1 ACCEPT all — 0.0.0.0/0 0.0.0.0/0 state RELATED,ESTABLISHED
2 ACCEPT icmp — 0.0.0.0/0 0.0.0.0/0
3 ACCEPT all — 0.0.0.0/0 0.0.0.0/0
4 ACCEPT tcp — 0.0.0.0/0 0.0.0.0/0 state NEW tcp dpt:22
5 REJECT all — 0.0.0.0/0 0.0.0.0/0 reject-with icmp-host-prohibited

Chain FORWARD (policy ACCEPT)
num target prot opt source destination
1 REJECT all — 0.0.0.0/0 0.0.0.0/0 reject-with icmp-host-prohibited

Chain OUTPUT (policy ACCEPT)
num target prot opt source destination

[root@linuxpc ~]#

3. As shown above the firewall is currently active, You can disable now with the ‘SERVICE’ command.
[root@linuxpc ~]# service iptables stop
iptables: Flushing firewall rules: [ OK ]
iptables: Setting chains to policy ACCEPT: filter [ OK ]
iptables: Unloading modules: [ OK ]
[root@linuxpc ~]#

4. Or you can use the ‘CHKCONFIG’ command to disable the RHEL firewall, which shuts the firewall down on reboot. This is done by adding references to the appropriate /etc/rc.d directory to either kill the service or start the service at given run level.
[root@linuxpc ~]# chkconfig iptables off
[root@linuxpc ~]#

Larry Catt, OCP

Part 3 – Building Oracle 12c development suite – Configuration for Oracle Enterprise Linux install on VirtualBox.

Configuration for Oracle Enterprise Linux install on 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 setting up a VirtualBox for a guest Linux OS.

NOTE: This instructions can be used for installing any type of guest OS, just acquire the appropriate ISO or CD for the guest OS you wish to install.
Required files:
ISO V41362-01 – Oracle Enterprise Linux 6.5
1. Logon to your Windows desktop/laptop as an administrator and open Oracle Virtual Box.
2. Select the New button on the tool bar or select Machine ? New from drop down menu.

s
3. Enter the Name, Type and Version of your guest OS and select Next.

4. Select the amount of memory you would like to provide to your Guest OS, I would recommend a minimum of 2048M or ¼ of your system memory. Then select the Next button.

5. Under Create Virtual Machine page, add hard drive via the Create a virtual hard drive now selection and select the Create button.

6. At the page Hard drive file type, select VDI (VirtualBox Disk Image) and press the Next button.

7. At the Storage on Physical hard drive button, select Dynamically allocated button and press the Next button.

8. At the File location and size page, I would recommend a minimum of 50GB and press the Create button.

9. The base configuration of your Guest OS is now create, but we still have to load your guest OS ISO or CD for installation of the guest OS. To do this ensure that your new guest OS is highlighted in the left panel of your VirtualBox Control Panel and select the Settings button from the tool bar.

10. At the Settings page, select the storage option from the left panel and select the plus symbol over the desks next to Controller: IDE.

11. At the VirtualBox – Question select the Choose disk button.

12. Navigate to the directory where you are storing your guest OS ISO or DVD and select the file or device, then press Open.

13. The ISO or DVD will now show up in the Controller: IDE panel of Storage Tree, select the OK button to save your changes.

14. This completes the process of setting up your VirtualBox Console for a new Guest OS installation.

Larry Catt

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