Tuesday, October 18, 2011

flash_recovery_area full error- cant start database

Trace file /opt/app/oracle/diag/rdbms/cert/cert/trace/cert_ora_8290.trc
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
ORACLE_HOME = /opt/app/oracle/product/11.2.0/dbhome_1
System name: Linux
Node name: xpsi7
Release: 2.6.32-131.12.1.el6.x86_64
Version: #1 SMP Tue Aug 23 11:13:45 CDT 2011
Machine: x86_64
Instance name: cert
Redo thread mounted by this instance: 1
Oracle process number: 19
Unix process pid: 8290, image: oracle@xpsi7 (TNS V1-V3)

*** 2011-10-18 22:11:30.934
*** SESSION ID:(96.3) 2011-10-18 22:11:30.934
*** CLIENT ID:() 2011-10-18 22:11:30.934
*** SERVICE NAME:() 2011-10-18 22:11:30.934
*** MODULE NAME:(sqlplus@xpsi7 (TNS V1-V3)) 2011-10-18 22:11:30.934
*** ACTION NAME:() 2011-10-18 22:11:30.934

ORA-19815: WARNING: db_recovery_file_dest_size of 4070572032 bytes is 100.00% used, and has 0 remaining bytes available.
************************************************************************
You have following choices to free up space from recovery area:
1. Consider changing RMAN RETENTION POLICY. If you are using Data Guard,
then consider changing RMAN ARCHIVELOG DELETION POLICY.
2. Back up files to tertiary device such as tape using RMAN
BACKUP RECOVERY AREA command.
3. Add disk space and increase db_recovery_file_dest_size parameter to
reflect the new space.
4. Delete unnecessary files using RMAN DELETE command. If an operating
system command was used to delete files, then use RMAN CROSSCHECK and
DELETE EXPIRED commands.
************************************************************************
ORA-19809: limit exceeded for recovery files
ORA-19804: cannot reclaim 43637760 bytes disk space from 4070572032 limit
*** 2011-10-18 22:11:30.936 4132 krsh.c
ARCH: Error 19809 Creating archive log file to '/opt/app/oracle/flash_recovery_area/CERT/archivelog/2011_10_18/o1_mf_1_114_%u_.arc'
*** 2011-10-18 22:11:30.936 2747 krsi.c
krsi_dst_fail: dest:1 err:19809 force:0 blast:1
DDE: Problem Key 'ORA 312' was flood controlled (0x1) (no incident)
ORA-00312: online log 3 thread 1: '/opt/app/oracle/oradata/cert/redo03.log'
ORA-16038: log 3 sequence# 114 cannot be archived
ORA-19809: limit exceeded for recovery files
ORA-00312: online log 3 thread 1: '/opt/app/oracle/oradata/cert/redo03.log'

*** 2011-10-18 22:11:31.000
USER (ospid: 8290): terminating the instance due to error 16038


Fixed by
sqlplus / as sysdba
startup nomount

SQL> ALTER SYSTEM SET DB_RECOVERY_FILE_DEST_SIZE = 10G SCOPE=BOTH SID='*';

select * from v$recovery_file_dest;




select * from v$flash_recovery_area_usage;

select name
, floor(space_limit / 1024 / 1024) "Size MB"
, ceil(space_used / 1024 / 1024) "Used MB"
from v$recovery_file_dest
order by name;

Sunday, September 18, 2011

Java Notes

Java Notes: - one public class per file and the filename should be named after the public class name - The top level class cannot be private or protected - Multiple classes can be declared in a file but only one can be Public. If you ever are in a situation where you need to use two classes with the same name but in different packages, then using imports does not work. You will need to refer to each class by their fully qualified name in your source file. The following code compiles successfully: public class FullyQualifiedDemo { public javax.management.AttributeList a1; public javax.swing.text.html.parser.AttributeList a2; } Example: Take note of the command line arguments (dir structure) where it can compile and where it can run from Code: Message.java: package org.rakesh; public class Message { public void PrintMessage(String msg) { System.out.println(msg); } } TestMessage.java: package org.rakesh.test; import org.rakesh.Message; public class TestMessage { public static void main(String[] args) { Message m; m = new Message(); m.PrintMessage("Rakesh Prajapati"); } } NOTE: (no other dir path other than below could compile or run) To Compile: bash-4.1$ pwd /home/oracle/workspace/learning/src bash-4.1$ javac -d ../bin Message.java bash-4.1$ pwd /home/oracle/workspace/learning/src bash-4.1$ javac -cp ../bin -d ../bin TestMessage.java To Run: bash-4.1$ pwd /home/oracle/workspace/learning/bin bash-4.1$ java org/rakesh/test/TestMessage Rakesh Prajapati

Monday, July 11, 2011

Emacs ispell-buffer error


Error: No word lists can be found for the language “en_US”.

When u get try  M-x ispell-buffer in Emacs, then you need to install the aspell-en package:

yum install aspell-en

Thursday, June 30, 2011

Emacs cheat sheet


C-o
Insert a blank line after the cursor (open-line).
C-x C-o
Delete all but one of many consecutive blank lines (delete-blank-lines).
M + l to change to lowercase all the letters from the cursor to the end of the word
M + u convert to upper case
M + c capitalizes first letter.

Deletion means erasing text and not saving it in the kill ring. For the most part, the Emacs commands that delete text are those that erase just one character or only whitespace.

C-d

Delete next character (delete-char).



Delete previous character (delete-backward-char).
M-\
Delete spaces and tabs around point (delete-horizontal-space).
M-
Delete spaces and tabs around point, leaving one space (just-one-space).
C-x C-o
Delete blank lines around the current line (delete-blank-lines).
M-^
Join two lines by deleting the intervening newline, along with any indentation following it (delete-indentation).

Sunday, June 5, 2011

flash plugin for scientific linux

[root@xpsi7 rick]# yum install flash-plugin
Loaded plugins: refresh-packagekit
adobe-linux-i386                                         |  951 B     00:00    
adobe-linux-i386/primary                                 |  12 kB     00:00    
adobe-linux-i386                                                          18/18
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package flash-plugin.x86_64 0:10.3.162.29-0.1.el6.rf set to be updated
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
 Package           Arch        Version                      Repository     Size
================================================================================
Installing:
 flash-plugin      x86_64      10.3.162.29-0.1.el6.rf       rpmforge      3.5 M

Transaction Summary
================================================================================
Install       1 Package(s)
Upgrade       0 Package(s)

Total download size: 3.5 M
Installed size: 10 M
Is this ok [y/N]: y
Downloading Packages:
flash-plugin-10.3.162.29-0.1.el6.rf.x86_64.rpm           | 3.5 MB     00:11    
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing     : flash-plugin-10.3.162.29-0.1.el6.rf.x86_64               1/1

Installed:
  flash-plugin.x86_64 0:10.3.162.29-0.1.el6.rf                                 

Complete!
[root@xpsi7 rick]#

Sunday, May 29, 2011

iptables , remove all DROP rules

iptables -L -n | grep DROP  | awk '{print "iptables -D INPUT -s ",$4,"-j DROP"}' | sh

# There may be a way to flush all rules without specifying all ip addresses
# ie delete all DROP rules from the input chain.

Saturday, April 30, 2011

Oracle - Flash recovery area full

Errors in file /opt/oracle/diag/rdbms/cert/CERT/trace/CERT_m000_11268.trc:
ORA-19815: WARNING: db_recovery_file_dest_size of 53687091200 bytes is 98.96% used, and has 556750848 remaining bytes available.
************************************************************************
You have following choices to free up space from recovery area:
1. Consider changing RMAN RETENTION POLICY. If you are using Data Guard,
   then consider changing RMAN ARCHIVELOG DELETION POLICY.
2. Back up files to tertiary device such as tape using RMAN
   BACKUP RECOVERY AREA command.
3. Add disk space and increase db_recovery_file_dest_size parameter to
   reflect the new space.
4. Delete unnecessary files using RMAN DELETE command. If an operating
   system command was used to delete files, then use RMAN CROSSCHECK and
   DELETE EXPIRED commands.
************************************************************************
Fri Apr 29 22:33:36 2011
Thread 1 cannot allocate new log, sequence 1253

-- The size was increased to 50 Gb.

[oracle@www oracle]$ du -m flash_recovery_area/
1       flash_recovery_area/CERT/archivelog/2011_04_30
168     flash_recovery_area/CERT/archivelog/2011_04_26
62      flash_recovery_area/CERT/archivelog/2011_04_24
50279   flash_recovery_area/CERT/archivelog/2011_04_29
126     flash_recovery_area/CERT/archivelog/2011_04_28
610     flash_recovery_area/CERT/archivelog/2011_04_27
20      flash_recovery_area/CERT/archivelog/2011_04_25
51263   flash_recovery_area/CERT/archivelog
1       flash_recovery_area/CERT/onlinelog
51274   flash_recovery_area/CERT
51274   flash_recovery_area/



Oracle - archiver error

sqlplus username/password

SQL*Plus: Release 11.2.0.1.0 Production on Sat Apr 30 10:00:40 2011

Copyright (c) 1982, 2009, Oracle.  All rights reserved.

ERROR:
ORA-00257: archiver error. Connect internal only, until freed.


Installing MediaWiki on Centos 5.6

  1. Download mediawiki from   http://www.mediawiki.org/wiki/Download
  2. mkdir /wiki
  3. cp mediawiki-1.16.4.tar.gz /wiki
  4. cd /wiki
  5. gtar -zxvf mediawiki-1.16.4.tar.gz
  6. cd mediawiki-1.16.4/
  7. mv * ..
  8. cd ..
  9. rmdir mediawiki-1.16.4/
  10. chmod 777 config
  11. cd /etc/httpd/conf
  12. vi httpd.conf (add the following)
    1. Alias /wiki "/wiki"
      <Directory "/wiki">
          AllowOverride None
          Options None
          Order allow,deny
          Allow from all
      </Directory>
  13. /sbin/service httpd  restart
Install mysql
# yum install mysql-server
# service mysqld start
---cut here---
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 www.centosraka.org 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  ]

--cut here---

# mysql_secure_installation

Install PHP

yum install php php-mysql



Login to mysql

# mysql --user=root -p
mysql> show databases;
mysql> create databases wikidb;
mysql> show databases;
mysql> create user 'wikiuser'@'localhost' identified by 'password';
mysql> grant all on *.* to 'wikiuser'@'localhost';

 
Setting up the Wiki Page


http://192.168.1.22/wiki/


Follow the messages and enter passwords


mv LocalSettings.php ..
cd ..
chmod 700 LocalSettings.php


Create an account on the wiki if required and you are all set.






      Tuesday, April 26, 2011

      sync with ntp time server - centos

      # yum install ntp
      # chkconfig ntpd on
      # ntpdate pool.ntp.org
      # /etc/init.d/ntpd start
         

      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