Professional Documents
Culture Documents
Download Files
Overview
This guide is a short description how to install Oracle 10.2.0.x on Linux (32 or 64 Bit). The full Oracle in
can be found here: Oracle® Database Installation Guide 10g Release 2 (10.2) for Linux x86.
ORACLE_BASE=/export/home/oracle
export ORACLE_HOME=$ORACLE_BASE/product/10.2.0
export ORACLE_SID=GENTIC
Download
Download the following software from the Oracle Download or Metalink Site
cksum 10201_database_linux32.zip
md5sum p6810189_10204_Linux-x86.zip
Requirements
Checking Memory and Swap Space
Oracle says that the system must have at least 1GB of physical RAM and 1GB of swap space or twice th
And for systems with more than 2 GB of RAM, the swap space can be between one and two times the si
might also want to check out sizing swap space.
You also can add temporary swap space to your system by creating a temporary swap file instead of
device. Here is the procedure:
su - root
cd /root
dd if=/dev/zero of=/root/tmpswp bs=1k count=500000
500000+0 records in
500000+0 records out
chmod 600 tmpswp
mkswap tmpswp
Setting up swapspace version 1, size = 511995 kB
swapon tmpswp
grep SwapTotal /proc/meminfo
SwapTotal: 1504044 kB
The Oracle Universal Installer requires up to 400 MB of free space in the /tmp directory. If you do not h
space in the /tmp filesystem, you can temporarily create a tmp directory in another filesystem. Here is h
this (/u01 is another filesystem)
su - root
mkdir /u01/tmp
chown root:root /u01/tmp
chmod 1777 /u01/tmp
export TEMP=/u01
export TMPDIR=/u01
When you are done with the Oracle installation, shutdown Oracle and remove the temporary /tmp direc
su - root
rmdir /u01/tmp
unset TEMP
unset TMPDIR
su - root
sysctl -a
Verify that the kernel parameters shown in the following table are set to values greater than or equal to the re
value shown. Do not change the value of any kernel parameter on a system where it is already higher than lis
requirement.
Parameter Value File
semmsl 250 /proc/sys/kernel/sem
semmns 32000
semopm 100
semmni 128
shmall 2097152 /proc/sys/kernel/shmall
shmmax Half the size of physical /proc/sys/kernel/shmmax
memory (in bytes)
shmmni 4096 /proc/sys/kernel/shmmni
file-max 65536 /proc/sys/fs/file-max
ip_local_port_range Minimum:1024 /proc/sys/net/ipv4/ip_local_port_ra
Maximum: 65000
rmem_default 1048576 /proc/sys/net/core/rmem_default
rmem_max 1048576 /proc/sys/net/core/rmem_max
wmem_default 262144 /proc/sys/net/core/wmem_default
wmem_max 262144 /proc/sys/net/core/wmem_max
We added the following lines to the /etc/sysctl.conf file which is used during the boot process:
Adding these lines to the /etc/sysctl.conf file will cause the system to change these kernel paramete
boot using the /etc/init.d/bootmisc script which is invoked by /etc/inittab. But in order that these
lines or settings in /etc/sysctl.conf become effective immediately, execute the following command:
su - root
sysctl -p
su - root
groupadd -g 400 dba
useradd -u 400 -g 400 -d /export/home/oracle -s /bin/bash -c "Oracle Owner" oracle
Members of the dba group can administer Oracle databases, for example starting up and shutting down
databases. In this guide, we are creating the oracle user account to have this responsibility.
The oinstall group is often needed for those organizations who have separate groups that maintain th
the database. In this scenario, the group membership prevents unauthorized access to the database by
maintain the software, and it prevents the database administrators from making changes to the softwar
installations inventory directory.
When using oinstall during the install of the software, one must set their default group to the one tha
maintaining the database before creating the database or permission problems will arise.
Oinstall is not needed when the same people will be maintaining the software and the database. In this
create more work and add an extra layer of complexity to the maintenance of the installation.
Recommendation: if you don't need the oinstall group for added security, just install using the dba g
ulimit -a
After you changed and increased /proc/sys/fs/file-max, there is still a per user limit of open file de
is set to 1024 by default:
su - oracle
ulimit -n
1024
To change this, you have to edit the file /etc/security/limits.conf as root and make the following c
the following lines, respectively:
The «soft limit» in the first line defines the number of file handles or open files that the Oracle user will
If the Oracle user gets error messages about running out of file handles, then the Oracle user can increa
of file handles like in this example up to 63536 («hard limit») by running the following command:
ulimit -n 63536
Note that we do not recommend to set the «hard limit» for nofile for the oracle user equal to /proc/sys
If you do that and the user uses up all the file handles, then the system would run out of file handles. T
that you won't be able to initiate new remote logins any more since the system won't be able to open an
which are required for performing a login. That's why we set the hard limit to 63536 and not to 65536.
You also need to make sure that pam_limits is configured in the file /etc/pam.d/system-auth. This is t
that will read the /etc/security/limits.conf file. The entry should read like:
Now login to the oracle account again since the changes will become effective for new login sessions on
su - oracle
ulimit -n
4096
For the Bourne, Bash, or Korn shell, add the following lines to the $HOME/.bash_profile
Setup Environment
Before installing the Oracle software, set the environment in $HOME/admin/.GENTIC, this file will be sou
after login. In the example below, gentic is the SID of the database which we will create.
cd $HOME
. ./.gentic
ls -l
drwxr-xr-x 4 oracle dba 4.0K Sep 26 14:51 admin
lrwxrwxrwx 1 oracle dba 15 Oct 2 10:18 .gentic -> admin/.gentic
cat .gentic
#!/bin/bash
unset TWO_TASK
export ORACLE_SID=GENTIC
export LISTENER_NAME=$ORACLE_SID
export ORACLE_BASE=/export/home/oracle
export ORACLE_HOME=$ORACLE_BASE/product/10.2.0
export ORACLE_DOC=$ORACLE_HOME/doc
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:$LD_LIBRARY_PATH
export TNS_ADMIN=/export/home/oracle/admin/sqlnet
export PATH=$ORACLE_HOME/bin:$PATH
export NLS_LANG=american_america.al32utf8
export ORA_NLS10=$ORACLE_HOME/nls/data
export TEMP=/tmp
export TMPDIR=/tmp
export EDITOR=vi
Do not create a Database using Oracle installer, this is an extra step, install software only
Create the Oracle Inventory in $ORACLE_BASE/product.
Choose «Oracle Database 10g Products 10.2.0.1.0» option when installing companion
Oracle Installer does not create Oracle Base / Oracle Home directories.
mkdir -p /export/home/oracle/product/10.2.0
Start Installer
As Oracle10g is certified only on some Linux editions you may get the following error when you run Ora
runInstaller, and installation will stop:
cd <unpacked directory>
DISPLAY=<my X-Window Host>:0.0
export DISPLAY
./runInstaller
The location of the Oracle Inventory can always be checked in the file /etc/oraInst.loc
cat /etc/oraInst.loc
inventory_loc=/export/home/oracle/product
inst_group=dba
Choose «Oracle Database 10g Products 10.2.0.1.0» option, to avoid NCOMP error.
Cleanup $ORACLE_HOME/bin
After the installation some non used files in $ORACLE_HOME/bin can be removed.
cd $ORACLE_HOME/bin
rm *O
rm *0
Example of LISTNER.ORA
# --------------------------------------------------------------------------
# File: listener.ora
#
# Purpose: Configuration file for Net Listener
#
# Location: $TNS_ADMIN
#
# Certified: Oracle 10.2.0.3 on Oracle Enterprise Linux 5
# --------------------------------------------------------------------------
GENTIC =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = DBHOST.EXAMPLE.COM)(PORT = 25000))
(ADDRESS = (PROTOCOL = IPC)(KEY = GENTIC.EXAMPLE.COM))
)
)
SID_LIST_GENTIC =
(SID_LIST =
(SID_DESC =
(SID_NAME = GENTIC)
(GLOBAL_DBNAME = GENTIC.EXAMPLE.COM)
(ORACLE_HOME = /export/home/oracle/product/10.2.0)
)
)
LOG_DIRECTORY_GENTIC = /export/home/oracle/admin/sqlnet
TRACE_FILE_GENTIC = gentic.trc
Example of TNSNAMES.ORA
# --------------------------------------------------------------------------
# File: tnsnames.ora
#
# Purpose: Configuration File for all Net Clients
#
# Location: $TNS_ADMIN
#
# Certified: Oracle 10.2.0.3 on Oracle Enterprise Linux 5
# --------------------------------------------------------------------------
GENTIC =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = DBHOST.EXAMPLE.COM)(PORT = 25000))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = GENTIC.EXAMPLE.COM)
)
)
Example of SQLNET.ORA
# --------------------------------------------------------------------------
# File: sqlnet.ora
#
# Purpose: Configuration File for all Net Clients
#
# Location: $TNS_ADMIN
#
# Certified: Oracle 10.1.0.3 on RedHat Enterprise 5
# --------------------------------------------------------------------------
NAMES.DIRECTORY_PATH= (TNSNAMES)
cd $ORACLE_HOME/network/admin
Create Database
We recommend to generate the create scripts using Oracle DBCA. These scripts should be verified beca
man important issues - important to know for every DBA. Based on these scripts, we created our own i
initSID.ora to create the database. In the subdirectory addons all optional parts of the database can b
installed using install-addons.bash
Adjust and check the parameters for your environment, for example all PATH must be changed, the valu
SGA_TARGET and SGA_MAX_SIZE must be set according your physical memory, etc.
$ORACLE_BASE/admin/GENTIC/scripts/initGENTIC.sql
$ORACLE_BASE/admin/GENTIC/pfile/initGENTIC.ora
If you want to manage all of your Oracle databases from one place and not have to log on to each host,
via a network connection. For example to remotely administer RMAN through a network connection, you
environment. To enable remote administration you have to two things:
cd $ORACLE_BASE/admin/GENTIC/pfile
orapwd file=orapwGENTIC password=xxxx entries=5 force=y
After you create a password file, you need to enable remote logins. To do this, set the instance's
REMOTE_LOGIN_PASSWORDFILE initialization parameter in INIT.ORA to exclusive, as shown:
remote_login_passwordfile = exclusive
Setting this parameter to exclusive signifies that only one database can use the password file and that u
SYS can reside in it. You can now use a network connection to connect to your target database as SYSD
$ cd $ORACLE_HOME/dbs
lrwxrwxrwx orapwGENTIC -> /export/home/oracle/admin/GENTIC/pfile/orapwGENTIC
lrwxrwxrwx initGENTIC.ora -> /export/home/oracle/admin/GENTIC/pfile/initGENTIC.ora
First start the Instance, just to test your INIT file for correct syntax and system resources.
cd $ORACLE_BASE/admin/GENTIC/scripts
sqlplus /nolog
SQL> connect / as sysdba
SQL> startup nomount
SQL> shutdown immediate
SQL> @initGENTIC.sql
SQL> @shutdown immediate
SQL> startup
If you do not want all additional products to be installed, uncomment them in install-addons.bash.
cd $ORACLE_BASE/admin/GENTIC/scripts/addons
./install-addons.bash
Create Server Parameter File
Server parameter files let you make persistent changes to individual parameters. When you use a serve
you can specify in an ALTER SYSTEM SET parameter statement that the new parameter value should be
means that the new value applies not only in the current instance, but also to any instances that are sta
subsequently. Traditional client-side parameter files do not let you make persistent changes to paramet
cd $ORACLE_HOME/dbs
rm initGENTIC.ora
sqlplus / as sysdba
SQL> create spfile = '/export/home/oracle/admin/GENTIC/pfile/spfileGENTIC.ora'
from pfile = '/export/home/oracle/admin/GENTIC/pfile/initGENTIC.ora';
File created.
SQL> exit;
ln -s /export/home/oracle/admin/GENTIC/pfile/spfileGENTIC.ora spfileGENTIC.ora
sqlplus / as sysdba
SQL> shutdown immediate;
SQL> startup;
SQL> exit;
If you want to start the database automatically on boot-time perform the following steps:
cd $ORACLE_HOME/bin
cp dbstart dbshut $ORACLE_BASE/admin
#!/bin/bash
#
# chkconfig: 12345 99 10
# description: Oracle auto start-stop script
# --------------------------------------------------------------------------
# File: oracle
#
# Purpose: Oracle auto start-stop script
#
# Location: /etc/init.d
#
# Certified: Oracle 10.2.0.3 on Enterprise Linux 5
# --------------------------------------------------------------------------
# Variables
ORACLE_OWNER=oracle; export ORACLE_OWNER
ORACLE_BASE=/export/home/oracle; export ORACLE_BASE
ORACLE_SCRIPTS_DIR=$ORACLE_BASE/admin; export ORACLE_SCRIPTS_DIR
ORACLE_HOME=$ORACLE_BASE/product/10.2.0; export ORACLE_HOME
# Source function library.
. /etc/rc.d/init.d/functions
# Source networking configuration.
[ -f /etc/sysconfig/network ] && . /etc/sysconfig/network
RETVAL=0
prog="oracle"
start() {
echo -n $"Starting $prog: "
if [ ! -f $ORACLE_SCRIPTS_DIR/dbstart ]
then
echo "Oracle not started (no dbstart script)"
else
# Start RDBMS
su - $ORACLE_OWNER -c $ORACLE_SCRIPTS_DIR/dbstart
# Start Enterprise Manager Console
# su - $ORACLE_OWNER $ORACLE_HOME/bin/emctl start dbconsole
# Start iSQL*Plus
# su - $ORACLE_OWNER $ORACLE_HOME/bin/isqlplusctl start
fi
RETVAL=$?
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/oracle
return $RETVAL
}
stop() {
echo -n $"Shutting down $prog: "
if [ ! -f $ORACLE_SCRIPTS_DIR/dbshut ]
then
echo "Oracle not stopped (no dbshut script)"
else
# Stop iSQL*Plus
# su - $ORACLE_OWNER $ORACLE_HOME/bin/isqlplusctl stop
# Stop Enterprise Manager Console
# su - $ORACLE_OWNER $ORACLE_HOME/bin/emctl stop dbconsole
# Stop RDBMS
su - $ORACLE_OWNER -c $ORACLE_SCRIPTS_DIR/dbshut
fi
RETVAL=$?
[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/oracle
return $RETVAL
}
# See how we were called.
case "$1" in
start)
start
;;
stop)
stop
;;
*)
echo $"Usage: $0 {start|stop}"
exit 1
esac
exit $RETVAL
su - root
chkconfig --add oracle
chkconfig --list oracle
su - root
cat /etc/oratab
GENTIC:/export/home/oracle/product/10.2.0:Y
http://<db-host>:1158/em