2010年12月12日星期日

Linux Tips

A.
When try to su to another user, the command always prompt incorrent password. The sudo works.

using the following commands:
 ls -l /bin/su

rpm -qf /bin/su
coreutils

rpm -qV coreutils
....
S file Size differs
M Mode differs (includes permissions and file type)
       5 MD5 sum differs
       D Device major/minor number mis-match
       L readLink(2) path mis-match
       U User ownership differs
       G Group ownership differs
       T mTime differs 

if the rpm -qV coreutils output something, means the coreutils has been updated.

have to install it.

don't know why it is updated/modified.

B.
close the putty session in the Windows client, and it's really sad that the server processing that is supposed to long running is killed too.
How to keep it running at the back end while I close the putty client session in the Windows desktop and leave the office.

Just run the back end server process using the following command:
nohup ****.sh &

Everything will be OK.


Install Oracle database in Linux (Oracle EL and CentOS 5, Red Hat 5)

This blog will record the steps to install Oracle database 11g in Linux. The Linux distribution I am using is Oracle EL 5.x and CentOS 5.x.

Once I tried to install Oracle 10g XE in Fedora 13, it's pretty simple and similar to the 11g enterprise/standard editions in the Oracle EL and CentOS, both are supposed to be incompatible with Redhat distribution.

So I think if you just want to install Oracle database on Linux, please try the enterprise distribution which are supposed to compatible with Redhat, Suse. And from the installation guide, it's really surprises me when I got the information that AsiaLinux was also supported by Oracle database.

I have to say that the installation guide in oracle.com is quite useful and by following this guide I can complete the installation process.

The hardware requirement is not a problem for me since I install the database in a server which has a memory of 8G, which also mean that I have to install the 64bit Linux.

The operation system neither is not a problem for me, oracle 11g support Linux 5 (Oracle EL 5, redhat 5 ...). In all the installations I have done, I got the conclusion that if you decide to use oracle's software and Linux as an operation system, maybe Oracle EL is your best choice, even better than RedHat or SUSE.  I believe that Oracle has done lots of test on their own Linux distribution. Although Oracle EL is just a little variant from RedHat right now, I believe that one day Oracle EL will develop independently with Redhat.

The lib requirements are the real requirement that I need to handle. They are still very simple, just with a simple command 'yum info' and 'yum install' I got all the required libraries installed. There is one thing needs to be mentioned, some libraries should be installed with both 32bit and 64bit version. 

Different Linux distributions differs in their pre-installed libraries. CentOS is with the minimum number of required libraries, especially when compared with Oracle Linux and Fedora.  The library's version is still very important. Since Oracle 11g is supposed to installed in an server, which definitely is equipped with older version libraries.  If you try to install Oracle 11g in Fedora 13, which has lots of latest libraries and some older libraries maybe have been deprecated, you may encounter this kind of problem.

Once I tried to install Oracle Forms builder in a Linux with Fedora 13 installed, after install various old version libraries, the Forms builder was still not be able to start up.  There is really  a contradiction in this scenario, which by the way is off topic. The contradiction is  that you have to install the latest distribution of Linux in desktop because of latest hardware support, otherwise your wireless card or anything else may not work properly; on the other hand, if you want to develop on this laptop, some enterprise software development tools may only support old version libraries. Sometimes, even a developer has to use Windows to replace Linux. That kind of scenarios suck.

Create the user and the groups needed. Someone may install everything as a root, which in my opinion is not a good practice. Others may intend to install the software in the /home directory. Maybe some very important/system level software should/can be installed in the /home directory, but I think install software in the /opt directory is very good.

Configure the kernel parameters for the Linux. 
This process is very important and maybe one of the most distinguished different between install software in Linux and Windows. In Windows, when you install a software, the OS is unchangeable, you just have to click 'Next' and 'Finish', but in Linux, there are lots of things to configure. This kernel parameters have lots of things to do with performance, without properly set of these parameters, the Oracle 11g can not be installed. During the run-time of the database, these parameters can be changed to tuning the performance of the database.

Configure Shell limits for the oracle user.  oracle is the installing user of the software, maybe it can be used as the user of all the oracle software.

Create required directory and environment variables like ORACLE_BASE, ORACLE_HOME.

# Oracle Settings
TMP=/tmp; export TMP
TMPDIR=$TMP; export TMPDIR

ORACLE_HOSTNAME=THE-HOST-NAME-OF-THE-SERVER; export ORACLE_HOSTNAME
ORACLE_UNQNAME=DB11G; export ORACLE_UNQNAME
ORACLE_BASE=/opt/app/oracle; export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1; export ORACLE_HOME
ORACLE_SID=DB11G; export ORACLE_SID
ORACLE_TERM=xterm; export ORACLE_TERM
PATH=/usr/sbin:$PATH; export PATH
PATH=$ORACLE_HOME/bin:$PATH; export PATH

LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib; export LD_LIBRARY_PATH
CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib; export CLASSPATH

if [ $USER = "oracle" ]; then
if [ $SHELL = "/bin/ksh" ]; then
ulimit -p 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
fi

Run the Installer. I run the Installer in the VNC Viewer. When I run the installer in the putty, the installer is not able to display even after I set the display property.

After the installation of the Database software and the setting of the environment variables, issue the following command:
  dbca
to create a database.

 

When install oracle 10g in the Redhat 5, the OS is not certified. After install all the required packages with the exact or higher version, changing the kernel parameters.

issue the following command to start the install process:

 

./runInstall –ignoreSysPrereqs

 

Often, the swap space size limitation is also annoying, for the redhat didn’t set the swap size properly when install the system. It’s very hard to extend the swap size, so you can just ignore the sys requirement check by using the –ignoreSysPrereqs parameter.