Pesquisar neste blog

quarta-feira, 15 de outubro de 2008

Instalando Oracle 10g no CentOS 5

Este artigo descreve a instalação do oracle 10g no centOS 5. Segundo a documentação do software o requisito mínimo de sistema é 1024Mb de memória RAM e 2048Mb de SWAP, SELINUX desativado e os seguintes grupos de pacotes instalados:


* GNOME Desktop Environment
* Editors
* Graphical Internet
* Text-based Internet
* Development Libraries
* Development Tools
* Legacy Software Development
* Server Configuration Tools
* Administration Tools
* Base
* Legacy Software Support
* System Tools
* X Window System

Download do Oracle

Oracle Database 10g Release 2 (10.2.0.1) Software
http://www.oracle.com/technology/software/products/database/oracle10g/index.html

Configurando o sistema para instalação

alterar o arquivo ''/etc/sysctl.conf'' com as configurações abaixo:

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

Execute o seguinte comando para alterar os parametros do kernel:

# /sbin/sysctl -p

Adicione as seguintes linhas no arquivo /etc/security/limits.conf :

* soft nproc 2047
* hard nproc 16384
* soft nofile 1024
* hard nofile 65536

Desabilite o secure linux alterando o arquivo /etc/selinux/config:

SELINUX=disabled

Instalação de requisitos básicos para instalação do oracle

Obs: nesse exemplo o yum esta configurado com repositorios DAG e DRIES.

yum install compat-db compat-libgcc compat-libstdc++ gcc gcc-c++ glib-devel gnome-libs libaio libaio-devel openmotif21 make orbit-devel gtk+-devel imlib-devel gnome-libs-devel xorg-x11-deprecated-libs xorg-x11-deprecated-libs-devel libgcc libstdc++ binutils

Criar grupos e usuarios necessario

groupadd oinstall
groupadd dba
groupadd oper
useradd -g oinstall -G dba oracle
passwd oracle

Criar os diretorios do software

mkdir -p /home/oracle/app/oracle/product/10.2.0/db_1
chown -R oracle.oinstall /home/oracle/

Editar o arquivo /etc/redhat-release substitua o conteúdo por:

redhat-4

Edite o arquivo /home/oracle/.bash_profile como usuario oracle

# su - oracle
#vi /home/oracle/.bash_profile

inserir esse conteudo no fim do arquivo .bash_profile

# Oracle Settings
TMP=/tmp; export TMP
TMPDIR=$TMP; export TMPDIR
ORACLE_BASE=/home/oracle/app/oracle; export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1; export ORACLE_HOME
ORACLE_SID=orcl; 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

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


Instalação do Oracle 10g

Logar no Linux em algum terminal grafico como root (Ex. VNC, NX, ou localmente KDE ou GNOME), abra um terminal de console

cd /home/oracle
tar -xvzf 10201_database_linux32.zip
chown oracle -R /oracle
Executar como root: xhost + localhost
su - oracle
cd /home/oracle/database
./runInstaller

Após a execução do comando acima, aai abrir uma tela grafica com o processo de instalação, vá procedendo a instalção conforme a sua necessidade.

Finalizando instalação

Editar o arquivo /etc/oratab para iniciar o banco no startup do oracle
trocar onde esta 'N' para 'Y' no banco que deseja iniciar no dbstart ex:
dbteste:/home/oracle/app/oracle/product/10.2.0/db_1:Y
Criar o Arquivo /etc/init.d/oracle para iniciar o oracle no boot
vi /etc/init.d/oracle

colocar o seguinte conteudo no arquivo:


#!/bin/sh
# chkconfig: 345 99 10
# description: Oracle auto start-stop script.
#

# Set ORA_HOME to be equivalent to the $ORACLE_HOME
# from which you wish to execute dbstart and dbshut;
#
# Set ORA_OWNER to the user id of the owner of the
# Oracle database in ORA_HOME.

ORA_HOME=/home/oracle/app/oracle/product/10.2.0/db_1
ORA_OWNER=oracle
if [ ! -f $ORA_HOME/bin/dbstart ]
then
echo "Oracle startup: cannot start"
exit
fi
case "$1" in
'start')
# Start the Oracle databases:
# The following command assumes that the oracle login
# will not prompt the user for any values
su - $ORA_OWNER -c "$ORA_HOME/bin/lsnrctl start"
su - $ORA_OWNER -c $ORA_HOME/bin/dbstart

;;
'stop')
# Stop the Oracle databases:
# The following command assumes that the oracle login
# will not prompt the user for any values
su - $ORA_OWNER -c $ORA_HOME/bin/dbshut
su - $ORA_OWNER -c "$ORA_HOME/bin/lsnrctl stop"
;;
esac

Nenhum comentário: