Tuesday, March 29, 2011

after mysql-server install

service mysqld start

gives the following messages


[root@ranee wb003c]# service mysqld start
Initializing MySQL database:  Installing MySQL system tables...
OK
Filling help tables...
OK

To start mysqld at boot time you have to copy
support-files/mysql.server to the right place for your system

PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:
/usr/bin/mysqladmin -u root password 'new-password'
/usr/bin/mysqladmin -u root -h ranee password 'new-password'

Alternatively you can run:
/usr/bin/mysql_secure_installation

which will also give you the option of removing the test
databases and anonymous user created by default.  This is
strongly recommended for production servers.

See the manual for more instructions.

You can start the MySQL daemon with:
cd /usr ; /usr/bin/mysqld_safe &

You can test the MySQL daemon with mysql-test-run.pl
cd mysql-test ; perl mysql-test-run.pl

Please report any problems with the /usr/bin/mysqlbug script!

The latest information about MySQL is available on the web at
http://www.mysql.com
Support MySQL by buying support/licenses at http://shop.mysql.com
                                                           [  OK  ]
Starting MySQL:                                            [  OK  ]

Saturday, March 26, 2011

my basic IPTABLES firewall

#!/bin/bash
#
# iptables example configuration script
#
# Flush all current rules from iptables
#
/sbin/iptables -F
#
# Allow SSH connections on tcp port 22
# This is essential when working on remote servers via SSH to prevent locking yourself out of the system
#
/sbin/iptables -A INPUT -p tcp --dport 22 -j ACCEPT
# Port 1521 for oracle
/sbin/iptables -A INPUT -p tcp --dport 1521 -j ACCEPT
#
# Set default policies for INPUT, FORWARD and OUTPUT chains
#
/sbin/iptables -P INPUT DROP
/sbin/iptables -P FORWARD DROP
/sbin/iptables -P OUTPUT ACCEPT
#
# Set access for localhost
#
/sbin/iptables -A INPUT -i lo -j ACCEPT
#
# Accept packets belonging to established and related connections
#
/sbin/iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
#
#---------------------------------------------------------------
# Allow port 80 (www) and 22 (SSH) connections to the firewall
#---------------------------------------------------------------

/sbin/iptables -A INPUT -p tcp -i eth0 --dport 80 --sport 1024:65535 \
  -m state --state NEW -j ACCEPT

# Save settings
#
/sbin/service iptables save
#
# List rules
#
/sbin/iptables -L -v

perl script to Block IP addresses - IPTABLES - Centos 5

#!/usr/bin/perl

# To run through cron - run every 10-15 minutes or so
# Scan /var/log/secure and then add those ip's to IPTABLES.

use strict;

my $user;
my $block_ip;
my $valid_user = "user1|oracle";
my @valid_ip   = ("146.21.0.0",);
my %distinct_ip = ();

open(IP,"tail -50 /var/log/secure | grep 'Failed password'|") || die "cannot open file for reading $!\n";


while(my $line = <IP>) {
 if ($line =~ /for (invalid user )*?(\w{1,}) from (\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})/) {
  $user = $2;
  $block_ip = $3;
  if ($user !~ /($valid_user)/) {
   #print "$line\n";
   $distinct_ip{$block_ip} = $user;
  }
 }
}


foreach my $ip (keys %distinct_ip) {
  my $already_blocked = `/sbin/iptables -L -n | grep DROP | grep $ip`;
  if (! $already_blocked) {
   if (&block_ip_yn($ip) ) {
      #print "Will block $ip for user $distinct_ip{$ip}\n";
      system("/sbin/iptables -I INPUT 1 -s $ip -j DROP");
   }
   else {
     #print "Will ALLOW $ip\n";
   }
  }
  else {
    #print "Will IGNORE - Already Blocked\n";
  }
}


sub block_ip_yn {
 my $ip_to_block = shift;
 my ($vip_1,$vip_2,$vip_3,$vip_4);
 my ($bip_1,$bip_2,$bip_3,$bip_4) = split("\\.",$ip_to_block);
 my $to_block = 1;

 foreach my $vip (@valid_ip) {
   ($vip_1,$vip_2,$vip_3,$vip_4) = split("\\.",$vip);
    if ( &sub_part($vip_1,$bip_1) + &sub_part($vip_2,$bip_2) + &sub_part($vip_3,$bip_3) + &sub_part($vip_4,$bip_4)  == 0) {
    $to_block = 0;
    last;
   }
 }
 return $to_block;
}

sub sub_part {
 my ($a,$b) = @_;

 if ( ($a == $b) || ($a == 0) ) {
  return 0;
 }
  return 1;
# return 0 if subpart matches else return 1;
}

Thursday, March 24, 2011

IP addresses to block from /var/log/secure on Centos 5


grep "Failed password" secure | grep      invalid | awk '{print $11,$13}'
grep "Failed password" secure | grep  -v invalid | awk '{print $9,$11}'


Monday, March 7, 2011

Oracle 11g Release 2 on Centos 5

source : http://ivan.kartik.sk/oracle/install_ora11gR2_elinux.html


Installation of Oracle 11g Release 2 (11.2.0.1.0) on RedHat EL 5, (Oracle) Enteprise Linux 5 and Centos 5


This paper (HOWTO) describes step-by-step installation of Oracle 11g R2 database software on RedHat Enterprise Linux 5 or Enteprise Linux 5 shipped by Oracle Corp. This article is useful for Centos Linux release 5. Note that Centos distribution is not certified by Oracle Corporation.
This article does not cover database creation process, and ASM Instance creation process.

This paper covers following steps:

Pre-Instalation Tasks

1. Create oracle User Account

Login as root and create te user oracle which belongs to oinstall,dba,asmdba and asmadmin groups.
su -
# groupadd dba
# groupadd oinstall
# groupadd asmdba
# groupadd asmadmin
# useradd -g oinstall -G dba,asmdba,asmadmin oracle
Note: "#" sign means that you need execute this command as root user.
You can separate ASM and DBA roles between more users. You can create for example "asm" user as ASM administrator.


2. Setting System parameters
Edit the /etc/sysctl.conf and add following lines:
kernel.shmall = 2097152
kernel.shmmax = 536870912
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
fs.file-max = 6815744
fs.aio-max-nr = 1048576
net.ipv4.ip_local_port_range = 9000 65500
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048576
Note: You need reboot system or execute "sysctl -p" command to apply above settings.

Edit the /etc/pam.d/login file and add following line:
session required pam_limits.so

Edit the /etc/security/limits.conf file and add following lines:
oracle    soft  nproc  2047
oracle    hard  nproc  16384
oracle    soft  nofile  1024
oracle    hard  nofile  65536

3. Creating oracle directories
# mkdir /opt/oracle
# chown -R oracle:dba /opt/oracle

4. Setting Oracle Enviroment
Edit the /home/oracle/.bash_profile file and add following lines:
ORACLE_BASE=/opt/oracle
ORACLE_HOME=$ORACLE_BASE/112
ORACLE_SID=ORCL
LD_LIBRARY_PATH=$ORACLE_HOME/lib
PATH=$PATH:$ORACLE_HOME/bin

export ORACLE_BASE ORACLE_HOME ORACLE_SID LD_LIBRARY_PATH PATH

Save the .bash_profile and execute following commands for load new enviroment:
cd /home/oracle
. .bash_profile

Check current status of SELinux:
/usr/sbin/getenforce

If output is "Enforcing" then change mode to "Permissive" using following command:
/usr/sbin/setenforce 0

To prevent Enforcing mode restore after next reboots or to disable SELinux modify the /etc/sysconfig/selinux change value of SELINUX variable to permissive or disabled:
SELINUX=permissive

Important steps/workarounds for Centos 5 only!
# cp /etc/redhat-release /etc/redhat-release.old
# echo "Red Hat Enterprise Linux Server release 5 (Tikanga)" > /etc/redhat-release
# cp /etc/issue /etc/issue.old
# echo "Red Hat Enterprise Linux Server release 5 (Tikanga)" > /etc/issue
# echo "Kernel \r on an \m" >> /etc/issue
# echo "" >> /etc/issue
# echo "redhat-release-5Server-5" > /tmp/.linux_release

Download & Install

1. Download and install required .rpm packages

Some additional packages are required for succesful instalation of Oracle software. To check wheter required packages are installed on your operating system use following command:
rpm -q binutils compat-db compat-libstdc++-33 glibc glibc-devel glibc-headers gcc gcc-c++ libstdc++ gdbm make ksh elfutils-libelf sysstat libaio libaio-devel setarch unixODBC libXp libXtst xorg-x11-utils --qf '%{name}.%{arch}\n'|sort

Output for 32 bit (i386) Linux version:
binutils.i386
compat-db.i386
compat-libstdc++-33.i386
elfutils-libelf.i386
gcc-c++.i386
gcc.i386
gdbm.i386
glibc-devel.i386
glibc-headers.i386
glibc.i386
glibc.i686
ksh.i386
libaio-devel.i386
libaio.i386
libstdc++.i386
libXp.i386
libXtst.i386
make.i386
setarch.i386
sysstat.i386
unixODBC.i386
xorg-x11-utils.i386

Output for 64 bit (x86_64) Linux version:
binutils.x86_64
compat-db.x86_64
compat-libstdc++-33.i386
compat-libstdc++-33.x86_64
elfutils-libelf.i386
elfutils-libelf.x86_64
gcc-c++.x86_64
gcc.x86_64
gdbm.x86_64
glibc-devel.i386
glibc-devel.x86_64
glibc-headers.x86_64
glibc.i686
glibc.x86_64
ksh.x86_64
libaio-devel.i386
libaio-devel.x86_64
libaio.i386
libaio.x86_64
libstdc++.i386
libstdc++.x86_64
libXp.i386
libXtst.i386
libXtst.x86_64
make.x86_64
setarch.x86_64
sysstat.x86_64
unixODBC.i386
unixODBC.x86_64
xorg-x11-utils.x86_64

If some package is not installed then install it from installation media or download it from following locations:
RedHat Enterprise Linux 5 - source packages only
CentOS Linux 5 i386
CentOS Linux 5 x86_64


This is example how to build RPM package from source package (libaio-0.3.105-2.src.rpm). Note gcc, make and rpm-build (and dependent) packages must be already installed on your system.
# rpm -ivh libaio-0.3.105-2.src.rpm
# cd /usr/src/redhat/SPECS/
# rpmbuild -bb --target i386 libaio.spec
# cd ../RPMS/i386/
# rpm -ivh libaio-0.3.105-2.i386.rpm libaio-devel-0.3.105-2.i386.rpm


Install the required packages using the rpm command:
rpm -ivh <package_name>.rpm


2. Download the Oracle 11g release 2 (11.2.0.1.0) software from Oracle website.


Extract the files using following command:

For Grid (CRS) software installation:
unzip linux.x64_11gR2_grid.zip

For Database software installation:
unzip linux.x64_11gR2_database_1of2.zip
unzip linux.x64_11gR2_database_2of2.zip

3. Start the Oracle software installation process.

Now the system is prepared for Oracle software installation. To start the installation process execute the following commands: Now the system is prepared for Oracle software installation. To start the installation process execute the following commands:

For Grid (CRS) software installation:
cd grid
./runInstaller

For Database software installation:
cd database
./runInstaller

Post-Instalation Tasks

1. (Optional) Auto Startup and Shutdown of Database and Listener
Login as root and modify /etc/oratab file and change last character to Y for apropriate database.
ORCL:/opt/oracle/112:Y

As root user create new file "oracle" (init script for startup and shutdown the database) in /etc/init.d/ directory with following content:
#!/bin/bash
#
# oracle Init file for starting and stopping
# Oracle Database. Script is valid for 10g and 11g versions.
#
# chkconfig: 35 80 30
# description: Oracle Database startup script

# Source function library.

. /etc/rc.d/init.d/functions

ORACLE_OWNER="oracle"
ORACLE_HOME="/opt/oracle/112"

case "$1" in
start)
echo -n $"Starting Oracle DB:"
su - $ORACLE_OWNER -c "$ORACLE_HOME/bin/dbstart $ORACLE_HOME"
echo "OK"
;;
stop)
echo -n $"Stopping Oracle DB:"
su - $ORACLE_OWNER -c "$ORACLE_HOME/bin/dbshut $ORACLE_HOME"
echo "OK"
;;
*)
echo $"Usage: $0 {start|stop}"
esac

Execute (as root) following commands (First script change the permissions, second script is configuring execution for specific runlevels):
chmod 750 /etc/init.d/oracle
chkconfig --add oracle --level 0356

2. (Optional) Auto Startup and Shutdown of Enterprise Manager Database Control
As root user create new file "oraemctl" (init script for startup and shutdown EM DB Console) in /etc/init.d/ directory with following content:
#!/bin/bash
#
# oraemctl Starting and stopping Oracle Enterprise Manager Database Control.
# Script is valid for 10g and 11g versions.
#
# chkconfig: 35 80 30
# description: Enterprise Manager DB Control startup script

# Source function library.

. /etc/rc.d/init.d/functions

ORACLE_OWNER="oracle"
ORACLE_HOME="/opt/oracle/112"

case "$1" in
start)
echo -n $"Starting Oracle EM DB Console:"
su - $ORACLE_OWNER -c "$ORACLE_HOME/bin/emctl start dbconsole"
echo "OK"
;;
stop)
echo -n $"Stopping Oracle EM DB Console:"
su - $ORACLE_OWNER -c "$ORACLE_HOME/bin/emctl stop dbconsole"
echo "OK"
;;
*)
echo $"Usage: $0 {start|stop}"
esac

Execute (as root) following commands (First script change the permissions, second script is configuring execution for specific runlevels):
chmod 750 /etc/init.d/oraemctl
chkconfig --add oraemctl --level 0356

3. (Optional) You may consider to use rlwrap for comfortable work with sqlplus, rman and adrci utility. RPM package for RedHat compatible distribution you can download it here:
For Redhat 32 bit (i386)
For Redhat 32 bit (x86_64)

Install downloaded packages:
su -
# rpm -ivh rlwrap-0.24-rh.i386.rpm
# exit
echo "alias sqlplus='rlwrap sqlplus'" >> /home/oracle/.bash_profile
echo "alias adrci='rlwrap rman'" >> /home/oracle/.bash_profile
echo "alias adrci='rlwrap adrci'" >> /home/oracle/.bash_profile
. /home/oracle/.bash_profile


Common Installation Errors

DISPLAY not set. Please set the DISPLAY and try again. 
Solution: Execute "export DISPLAY=:0.0" when you perform installation on local machine or "export DISPLAY=:0.0 when you perform installation on remote machine connected over SSH". Don't forget to execute "xhost +" command on client machine.

error while loading shared libraries: libaio.so.1: cannot open shared object file: No such file or directory 
Solution: Install libaio and libaio-devel packages. If packages already installed and error still occurs try execute "ldconfig" as root.

Check complete. The overall result of this check is: Failed <<<< 
Solution: Install missing package or set check system parameters (See reason of failure).

error while loading shared libraries: ... libclntsh.so.11.1: cannot restore segment prot after reloc: Permission denied 
Solution: SELinux is running in "Enforcing" mode. Change SELinux mode to "Permissive" using /usr/sbin/setenforce 0 and change the settings in /etc/sysconfig/selinux (See Pre-Instalation Tasks section).

ADVM/ACFS is not supported on centos-release-5.el5.centos or ADVM/ACFS is not supported on centos-release-5-1.el5.centos or ADVM/ACFS is not supported on centos-release-5-2.el5.centos or ADVM/ACFS is not supported on centos-release-5-3.el5.centos or ADVM/ACFS is not supported on centos-release-5-4.el5.centos or 
Execute "as root": echo "redhat-release-5Server-5" > /tmp/.linux_release



Last update: 29-12-2009 (DD-MM-YYYY). Comments, suggestions, questions, errors (also grammatical :) )? Feel free to contact me. Also You can leave the comment to relevant post on my blog

command line for selinux - Centos 5

/usr/bin/system-config-securitylevel

Customizations on my Optiplex for Oracle 10g on Centos 5.5


# Values found on my system.
sudo /sbin/sysctl -a | egrep "kernel.sem|kernel.shm|
file-max|ip_local_port_range|rmem_default|
rmem_max|wmem_default|wmem_max"

net.ipv4.ip_local_port_range = 32768    61000
net.core.rmem_default = 129024
net.core.wmem_default = 129024
net.core.rmem_max = 131071
net.core.wmem_max = 131071
kernel.sem = 250        32000   32      128
kernel.shmmni = 4096
kernel.shmall = 4294967296
kernel.shmmax = 68719476736
fs.file-max = 300478



/etc/sysctl.conf
# Add the following only.
kernel.sem = 250 32000 100 128
net.ipv4.ip_local_port_range = 1024 65000
net.core.rmem_default = 262144
net.core.rmem_max = 262144
net.core.wmem_default = 262144
net.core.wmem_max = 262144

After installation Got a screen with the following details.


The following J2EE Applications have been deployed and are accessible at the URLs listed below.

iSQL*Plus URL:
http://localHost:5560/isqlplus

iSQL*Plus DBA URL:
http://localHost:5560/isqlplus/dba

----------------
----------------
Post Installation
----------------
----------------
- Make sure /etc/hosts has hostname set
   192.168.1.26     ranee
Do this step before DBCA is run or DBCA gives error immediately while running.
- opened ports 1158, 1521
- setup listener using netca


Oracle 10g on Centos 5

source : http://ivan.kartik.sk/oracle/install_ora10gR2_redhat.html



Installation of Oracle 10g Release 2 (10.2.0.1.0) on RedHat EL 3, 4, 5 and (Oracle) Enteprise Linux 4, 5.


This paper (HOWTO) describes step-by-step installation of Oracle 10g R2 database software on RedHat Enterprise Server 3, 4, 5 and (Oracle) Enteprise Linux 4, 5. This article is useful for Centos Linux release 3, 4 and 5 and for White Box Enterprise Linux release 3 and 4. Note that Centos and White Box distributions are not certified by Oracle Corporation.
This article does not cover database creation process, and ASM Instance creation process.

This paper covers following steps:

Pre-Instalation Tasks

1. Create oracle User Account

Login as root and create te user oracle which belongs to dba group.
su -
# groupadd dba
# useradd -g dba oracle

2. Setting System parameters
Edit the /etc/sysctl.conf and add following lines:
kernel.shmall = 2097152
kernel.shmmax = 2147483648
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
fs.file-max = 65536
net.ipv4.ip_local_port_range = 1024 65000
net.core.rmem_default = 262144
net.core.rmem_max = 262144
net.core.wmem_default = 262144
net.core.wmem_max = 262144
Note: You need reboot system or execute "sysctl -p" command to apply above settings.

For RedHat (OEL, Centos, WBL) 3 and 4 versions: Edit the /etc/pam.d/login file and add following line:
session required /lib/security/pam_limits.so

For RedHat (OEL, Centos) 5 version: Edit the /etc/pam.d/login file and add following line:
session required pam_limits.so

Edit the /etc/security/limits.conf file and add following lines:
oracle    soft  nproc  2047
oracle    hard  nproc  16384
oracle    soft  nofile  1024
oracle    hard  nofile  65536

3. Creating oracle directories
# mkdir /opt/oracle
# mkdir /opt/oracle/102
# chown -R oracle:dba /opt/oracle

4. Setting Oracle Enviroment
Edit the /home/oracle/.bash_profile file and add following lines:
Use this settings for 32bit (x86) architecture.
ORACLE_BASE=/opt/oracle
ORACLE_HOME=$ORACLE_BASE/102
ORACLE_SID=ORCL
LD_LIBRARY_PATH=$ORACLE_HOME/lib
PATH=$PATH:$ORACLE_HOME/bin

export ORACLE_BASE ORACLE_HOME ORACLE_SID LD_LIBRARY_PATH PATH

Use this settings for 64bit (x86_64) architecture.
ORACLE_BASE=/opt/oracle
ORACLE_HOME=$ORACLE_BASE/102
ORACLE_SID=ORCL
LD_LIBRARY_PATH=$ORACLE_HOME/lib:$ORACLE_HOME/lib32
PATH=$PATH:$ORACLE_HOME/bin

export ORACLE_BASE ORACLE_HOME ORACLE_SID LD_LIBRARY_PATH PATH

Save the .bash_profile and execute following commands for load new enviroment:
cd /home/oracle
. .bash_profile

Download & Install

1. Download and install required .rpm packages

Some additional packages are required for succesful instalation of Oracle software. To check wheter required packages are installed on your operating system use following command: Note: Since RHEL 5 (OEL 5, Centos 5) pdksh package was renamed to ksh

For 32 bit (x86) Linux version:
rpm -q binutils gcc glibc glibc-headers glibc-kernheaders glibc-devel compat-libstdc++ cpp compat-gcc make compat-db compat-gcc-c++ compat-libstdc++ compat-libstdc++-devel setarch sysstat pdksh libaio libaio-devel --qf '%{name}.%{arch}\n'|sort

For 64 bit (x86_64) Linux version:
rpm -q binutils compat-db compat-libstdc++-33 glibc glibc-devel glibc-headers gcc gcc-c++ libstdc++ cpp make libaio ksh elfutils-libelf sysstat libaio libaio-devel setarch --qf '%{name}.%{arch}\n'|sort

Also install packages
yum install  gcc make binutils libaio1 gawk ksh libc6-dev rpm libmotif3 alien lsb-rpm libtool
-- The above made the error go away while linking during software install.
-- Not all will be available for Centos. Got this list from Ubuntu Oracle installation in my blog.


-- Looking at the errors below 
yum install libXp

Required packages for 32bit (x86) architecture:
binutils.i386
compat-gcc-7.3-2.96.128.i386
compat-gcc-c++-7.3-2.96.128.i386
compat-libstdc++-7.3-2.96.128.i386
compat-libstdc++-devel-7.3-2.96.128.i386
cpp.i386
gcc.i386
gcc-c++.i386
glibc.i386
glibc-common.i386
glibc-devel.i386
glibc-headers.i386
glibc-kernheaders.i386
libstdc++.i386
libstdc++-devel.i386
libaio
libai-devel.i386
pdksh.i386
setarch.i386
sysstat.i386


Required packages for 64bit (x86_64) architecture:
binutils.x86_64
compat-db.x86_64
compat-libstdc++-33.i386
compat-libstdc++-33.x86_64
cpp.x86_64
elfutils-libelf.i386
elfutils-libelf.x86_64
gcc-c++.x86_64
gcc.x86_64
glibc-devel.i386
glibc-devel.x86_64
glibc-headers.x86_64
glibc.i686
glibc.x86_64
ksh.x86_64
libaio-devel.i386
libaio-devel.x86_64
libaio.i386
libaio.i386
libaio.x86_64
libaio.x86_64
libstdc++.i386
libstdc++.x86_64
make.x86_64
setarch.x86_64
sysstat.x86_64


If some package is not installed then install it from installation media or download it from following locations:
RedHat Enterprise Linux 3 - source packages only
RedHat Enterprise Linux 4 - source packages only
White Box Linux 3
White Box Linux 4
Centos Linux 3
Centos Linux 4
Centos Linux 5


This is example how to build RPM package from source package (libaio-0.3.96-3.src.rpm). Note gcc, make and rpm-build (and dependent) packages must be already installed on your system.
# rpm -ivh libaio-0.3.96-3.src.rpm
# cd /usr/src/redhat/SPECS/
# rpmbuild -bb --target i386 libaio.spec
# cd ../RPMS/i386/


Install the required packages using the rpm command:
# rpm -ivh <package_name>.rpm


2. Download the Oracle 10g release 2 (10.2.0.1.0) software from Oracle website.
Extract the files using following command: For 32bit installation archive
unzip 10201_database_linux32.zip

For 64bit installation archive
gunzip 10201_database_linux_x86_64.cpio.gz
cpio -idmv <10201_database_linux_x86_64.cpio

For RHEL 5, Centos 5: Modify database/install/oraparam.ini file and add "redhat-5" to "Certified Versions" section.
Example:
[Certified Versions]
Linux=redhat-3,SuSE-9,redhat-4,UnitedLinux-1.0,asianux-1,asianux-2,redhat-5


3. Start the Oracle software installation process.

Now the system is prepared for Oracle software installation. To start the installation process execute the following commands:
cd db/Disk1/
./runInstaller

Note: You may get "Warning" status during some pre-requisites checks. This will happen on RH EL 3 where Update 3 or 4 were not installed. You can continue in installation when you simply change the status as "User verified".

Post-Instalation Tasks

1. (Optional) Auto Startup and Shutdown of Database and Listener
Login as root and modify /etc/oratab file and change last character to Y for apropriate database.
ORCL:/opt/oracle/102:Y

As root user create new file "oracle" (init script for startup and shutdown the database) in /etc/init.d/ directory with following content:
#!/bin/bash
#
# oracle Init file for starting and stopping
# Oracle Database. Script is valid for 10g and 11g versions.
#
# chkconfig: 35 80 30
# description: Oracle Database startup script

# Source function library.

. /etc/rc.d/init.d/functions

ORACLE_OWNER="oracle"
ORACLE_HOME="/opt/oracle/102"

case "$1" in
start)
echo -n $"Starting Oracle DB:"
su - $ORACLE_OWNER -c "$ORACLE_HOME/bin/dbstart $ORACLE_HOME"
echo "OK"
;;
stop)
echo -n $"Stopping Oracle DB:"
su - $ORACLE_OWNER -c "$ORACLE_HOME/bin/dbshut $ORACLE_HOME"
echo "OK"
;;
*)
echo $"Usage: $0 {start|stop}"
esac

Execute (as root) following commands (First script change the permissions, second script is configuring execution for specific runlevels):
chmod 750 /etc/init.d/oracle
chkconfig --add oracle --level 0356

2. (Optional) Auto Startup and Shutdown of Enterprise Manager Database Control
As root user create new file "oraemctl" (init script for startup and shutdown EM DB Console) in /etc/init.d/ directory with following content:
#!/bin/bash
#
# oraemctl Starting and stopping Oracle Enterprise Manager Database Control.
# Script is valid for 10g and 11g versions.
#
# chkconfig: 35 80 30
# description: Enterprise Manager DB Control startup script

# Source function library.

. /etc/rc.d/init.d/functions

ORACLE_OWNER="oracle"
ORACLE_HOME="/opt/oracle/102"

case "$1" in
start)
echo -n $"Starting Oracle EM DB Console:"
su - $ORACLE_OWNER -c "$ORACLE_HOME/bin/emctl start dbconsole"
echo "OK"
;;
stop)
echo -n $"Stopping Oracle EM DB Console:"
su - $ORACLE_OWNER -c "$ORACLE_HOME/bin/emctl stop dbconsole"
echo "OK"
;;
*)
echo $"Usage: $0 {start|stop}"
esac

Execute (as root) following commands (First script change the permissions, second script is configuring execution for specific runlevels):
chmod 750 /etc/init.d/oraemctl
chkconfig --add oraemctl --level 0356

3. (Optional) You may consider to use rlwrap for comfortable work with sqlplus and rman utility.
RPM package for RedHat compatible (x86) distribution you can download here.
RPM package for RedHat compatible (x86_64) distribution you can download here.
su -
# rpm -ivh rlwrap*.rpm
# exit
echo "alias sqlplus='rlwrap sqlplus'" >> /home/oracle/.bash_profile
echo "alias adrci='rlwrap rman'" >> /home/oracle/.bash_profile
. /home/oracle/.bash_profile


Common Installation Errors

DISPLAY not set. Please set the DISPLAY and try again. 
Solution: Execute "export DISPLAY=:0.0" when you perform installtion on local machine or "export DISPLAY=:0.0 when you perform installation on remote machine connected over SSH". Don't forget to execute "xhost +" command on client machine.

Exception java.lang.UnsatisfiedLinkError: /tmp/OraInstall2005-07-07_09-40-45AM/jre/1.4.2/lib/i386/libawt.so: libXp.so.6: cannot open shared object file: No such file or directory occurred.. java.lang.UnsatisfiedLinkError: /tmp/OraInstall2005-07-07_09-40-45AM/jre/1.4.2/lib/i386/libawt.so: libXp.so.6: cannot open shared object file: No such file or directory 
Solution: RH 3, WB 3, Centos 3 - Install the XFree86-libs-4.3.0-81.EL.i386.rpm and dependent packages.
RH 4, WB 4, Centos 4 - Install the xorg-x11-deprecated-libs-6.8.2-1.EL.13.6.i386.rpm package.
RH 5, OEL 5, Centos 5 - Install the libXp-1.0.0-8.1.el5.i386.rpm package.

error while loading shared libraries: libaio.so.1: cannot open shared object file: No such file or directory 
Solution: Install libaio and libaio-devel packages. If packages already installed and error still occurs try execute "ldconfig" as root.

Check complete. The overall result of this check is: Failed <<<< 
Solution: Install missing package or set check system parameters (See reason of failure).



Comments, suggestions, questions, errors (also grammatical :) )? Feel free to contact me.

Centos - edit network interfaces

/etc/sysconfig/network-scripts/

-rw-r--r-- 3 root root   257 Mar  5 07:15 ifcfg-wlan0
-rw-r--r-- 3 root root   231 Mar  5 07:15 ifcfg-eth0
-rw-r--r-- 1 root root   231 Mar  7 00:01 ifcfg-eth1
 


 cat ifcfg-eth0
# Intel Corporation 82567LM-3 Gigabit Network Connection
DEVICE=eth0
BOOTPROTO=none
HWADDR=<MACADDRESS HERE>
ONBOOT=yes
NETMASK=255.255.255.0
IPADDR=192.168.1.24
GATEWAY=192.168.1.1
TYPE=Ethernet
USERCTL=no
IPV6INIT=no
PEERDNS=yes
 

Followers

About Me

Torrance, CA, United States