Showing posts with label redhat. Show all posts
Showing posts with label redhat. Show all posts

Monday, March 23, 2009

Install Oracle DB 10g on RH5

N.B.: Blogger has hosed up some of the text blocks below. If you receive strange warnings about invalid options or field formats, you may need to retype some of the values here or otherwise convert them to plaintext.

Oracle Database 10g refuses to install on Redhat AS 5 because the OS is newer than the app. It's not hard to fix, especially if you have some chewing gum and baling wire on hand, but the fix is a right PITA to find.

I have some inanely long-winded docs from Metalink which (overlapping slightly with the 10g Quick Install) boil down to this:
  1. Make sure that the server's primary IP address is associated with the primary, or lowest-numbered, NIC. For example, the installer will fail obscurely if your main, named, network IP is on eth2 and your management network interface is on eth0.

    Don't be dense: ask yourself whether this requires recabling.

  2. Create oracle:oinstall and set its home directory to ORACLE_BASE (read on to see what ORACLE_BASE means.)
    • Add ORACLE_BASE and ORACLE_SID to the oracle user's shell profile; for example:
      # vi /home/oracle/.bash_profile
      export ORACLE_BASE=/u01/app/oracle
      export ORACLE_SID=orcl
      unset ORACLE_HOME
  3. Edit database/install/oraparam.ini thusly:
    [Certified Versions]
    Linux=redhat­3,SuSE­9,redhat­4,UnitedLinux­1.0,asianux­1,asianux­2,redhat­5 

  4. Edit database/stage/prereq/db/refhost.xml, inserting the following before the Operating System stanza for Redhat 9:
    <OPERATING_SYSTEM> 
    <VERSION VALUE="5"/> 
    <ARCHITECTURE VALUE="x86"/> 
    <NAME VALUE="Linux"/> 
    <VENDOR VALUE="redhat"/> 
    <GLIBC ATLEAST="2.5­12"> 
    </GLIBC> 
    <PACKAGES> 
    <PACKAGE NAME="make" VERSION="3.81" /> 
    <PACKAGE NAME="binutils" VERSION="2.17" />
    <PACKAGE NAME="gcc" VERSION="4.1" > 
    <PACKAGE NAME="libaio" VERSION="0.3.106" > 
    <KERNEL> 
    <PROPERTY NAME="semmsl" NAME2="semmsl2" VALUE="250" /> 
    <PROPERTY NAME="semmns" VALUE="32000" /> 
    <PROPERTY NAME="semopm" VALUE="100" /> 
    <PROPERTY NAME="semmni" VALUE="128" /> 
    <PROPERTY NAME="shmmax" VALUE="536870912" /> 
    <PROPERTY NAME="shmmni" VALUE="4096" /> 
    <PROPERTY NAME="shmall" VALUE="2097152" /> 
    <PROPERTY NAME="file­max" VALUE="65536" /> 
    <PROPERTY NAME="VERSION" VALUE="2.6.9" /> 
    <PROPERTY NAME="ip_local_port_range" ATLEAST="1024" ATMOST="65000" /> 
    <PROPERTY NAME="rmem_default" VALUE="262144" /> 
    <PROPERTY NAME="rmem_max" VALUE="262144" /> 
    <PROPERTY NAME="wmem_default" VALUE="262144" /> 
    <PROPERTY NAME="wmem_max" VALUE="262144" /> 
    </KERNEL> 
    </OPERATING_SYSTEM> 
    • Or use the following in the same spot for a client-only install:
      <OPERATING_SYSTEM> 
      <VERSION VALUE="5"> 
      <ARCHITECTURE VALUE="x86"> 
      <NAME VALUE="Linux"> 
      <VENDOR VALUE="redhat"> 
      <PACKAGES> 
      <PACKAGE NAME="make" VERSION="3.81" > 
      <PACKAGE NAME="binutils" VERSION="2.17" > 
      <PACKAGE NAME="gcc" VERSION="4.1" > 
      </PACKAGES> 
      </OPERATING_SYSTEM> 

  5. Use the info you added to refhost.xml to solve dependencies before running the installer. Hints from Oracle:
       
    • gcc­-4.1.1 ­52.el5.i386.rpm 
    • libstdc++­-devel­-4.1.1­52.el5.i386.rpm 
    • glibc-­devel-­2.5­12.i386.rpm 
    • glibc­-headers-­2.5­12.i386.rpm 
    • libgomp­-4.1.1­52.el5.i386.rpm 
    • gcc­-c++-­4.1.1­52.el5.i386.rpm
    • libXp-­1.0.0 ­8.i386.rpm 
    • compat-libstdc++­-33­-3.2.3­61.i386.rpm 
    • compat ­libstdc++­296­2.96­138.i386.rpm 
    • sysstat­-7.0.0­3.el5.i386.rpm

    All of these should be available on RHN.

  6. Make sure the following lines/values are in /etc/sysctl.conf, then activate them with sysctl -p:
    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 = 1048576 
    net.core.rmem_max = 1048576 
    net.core.wmem_default = 262144 
    net.core.wmem_max = 262144 
    net.ipv4.tcp_wmem = 262144 262144 262144 
    net.ipv4.tcp_rmem = 4194304 4194304 4194304 
  7. More /etc edits ...
    • Add this to /etc/security/limits.conf:
      oracle soft nproc 2047 
      oracle hard nproc 16384 
      oracle soft nofile 1024 
      oracle hard nofile 65536 
    • Add to /etc/pam.d/login: session required pam_limits.so

    • Add to /etc/profile:
      if [ $USER = "oracle" ]; then 
      ulimit -­u 16384 
      ulimit -n 65536 
      fi 

  8. Now, now, only NOW may you run the installer. At. Your. Peril.
    (Don't forget to use an X-enabled session. Doh.)

Wednesday, June 11, 2008

Extend a Redhat LVM filesystem

Slightly simpler case than the earlier one ... this is just something I'd like to have spelled out for convenience, since I do it so rarely.

We want to fix this:
/dev/mapper/prod_dg-volOracle
4128448 3918544 192 100% /u01

And we have this:
[root@woogie /]# lvscan
...
ACTIVE '/dev/prod_dg/volOracle' [4.00 GB] inherit
[root@woogie /]# pvscan
...
PV /dev/sdb1 VG prod_dg lvm2 [273.22 GB / 139.44 GB free]


So we do this:
[root@woogie /]# lvextend --size 6G /dev/prod_dg/volOracle /dev/sdb1
Extending logical volume volOracle to 6.00 GB
Logical volume volOracle successfully resized


(lvextend usage: lvextend --size nG logical-path physical-path ... Use the paths from pvscan and lvscan, and absolute or relative sizes denoted by K,M,G, etc.)


[root@woogie /]# umount /u01
[root@woogie /]# resize2fs /dev/prod_dg/volOracle 6G
resize2fs 1.35 (28-Feb-2004)
Please run 'e2fsck -f /dev/prod_dg/volOracle' first.

[root@woogie /]# e2fsck -f /dev/prod_dg/volOracle
e2fsck 1.35 (28-Feb-2004)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
/dev/prod_dg/volOracle: 27925/524288 files (3.4% non-contiguous), 996131/1048576 blocks
[root@woogie /]# resize2fs /dev/prod_dg/volOracle 6G
resize2fs 1.35 (28-Feb-2004)
Resizing the filesystem on /dev/prod_dg/volOracle to 1572864 (4k) blocks.
The filesystem on /dev/prod_dg/volOracle is now 1572864 blocks long.

[root@woogie /]# mount /u01