Friday, September 18, 2009

How to enable kernel dumps on RH4

This was rather annoying to find, so for now, a pointer --
http://www.nocrack.fr/?p=24

Monday, June 22, 2009

Fixing X11 on Red Hat

Every time I upgrade the kernel on my Red Hat machine and reboot, startx errors out. The xorg.0.log says, "(EE) NVIDIA(0): Failed to load the NVIDIA kernel module!"

NVidia has tips here, but they are predicated on running modprobe nvidia. When I did that, modprobe and rmmod reported that the nvidia driver was not present in /proc/modules.

The fix for my machine:
  1. Run nvidia-installer --update
    • OR, Run nvidia-installer-latest to get the FTP URL for the latest nvidia driver.
    • Download same using wget. (Cut & paste may work.)

Tuesday, March 24, 2009

Extending a swap LVM in Redhat 4 or 5

This refers to a pre-production box. Note, before you start, that swapoff is involved, and consider whether you want to do that to a busy box. :)
  • lvscan
  • lvextend --size +4G /dev/someVG/someVol
  • lvscan
  • free -m
  • swapoff
  • mkswap /dev/someVG/someVol
  • swapon -va
  • free -m

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.)