Instalación de Base de Datos y pool de conecciones

Page last edited hace 2117 días 3 horas
De Solaris-ES
Saltar a: navegación, buscar

Instalacion de Oracle 11gR2 for Solaris 10 X86[editar]

Descargar y descomprimir el paquete de instalacion Download[editar]

solaris.x64_11gR2_database_1of2.zip
solaris.x64_11gR2_database_2of2.zip

Verificamos Usuario y Grupo Oracle DBA[editar]

Si no existe los creamos
$ su -
# groupadd -g 100 dba
# groupadd oinstall
# groupadd asmdba
# groupadd asmadmin
# useradd -g oinstall -G dba,asmdba,asmadmin -m -d /oracle -s /bin/bash oracle

# grep -i oracle /etc/passwd
oracle:x:60004:100::/oracle:/bin/bash

# grep -i dba /etc/group 
dba::100:root

Paquetisamos la instalacion de Oracle[editar]

# mkdir -p /oracle/pkg78
# mkdir -p /oracle/pkg78/soft
# mkdir -p /oracle/pkg78/soft/oraInventory
# mkdir -p /oracle/pkg78/soft/bd 
# mkdir -p /oracle/pkg78/soft/bd/bd112
# mkdir -p /oracle/pkg78/medusa
# mkdir -p /oracle/pkg78/medusa/admin/diag
# mkdir -p /oracle/pkg78/medusa/redo1
# mkdir -p /oracle/pkg78/medusa/redo2
# mkdir -p /oracle/pkg78/medusa/oradata1/data
# mkdir -p /oracle/pkg78/medusa/oradata1/data/controlfiles
# mkdir -p /oracle/pkg78/medusa/redo1/controlfiles
# mkdir -p /oracle/pkg78/medusa/redo2/controlfiles

# chown -R oracle:dba /oracle/pkg78

Creamos el proyecto pkg78 para los parametros de sistema de Oracle[editar]

# projadd -p 300 -c "Proyecto para la BBDD MEDUSA pkg78" -U oracle -G dba \
 -K 'process.max-file-descriptor=(basic,65536,deny),(priv,65536,deny)' \
 -K 'process.max-msg-messages=(priv,8192,deny)' \
 -K 'process.max-msg-qbytes=(priv,65536,deny)' \
 -K 'process.max-sem-nsems=(priv,2048,deny)' \
 -K 'process.max-sem-ops=(priv,512,deny)' \
 -K 'project.max-msg-ids=(priv,128,deny)' \
 -K 'project.max-sem-ids=(priv,1024,deny)' \
 -K 'project.max-shm-ids=(priv,256,deny)' \
 -K 'project.max-shm-memory=(priv,18446744073709551615,deny)' pkg78

Creamos proyecto para la instalacion de Oracle[editar]

Setting System parameters /etc/system
set noexec_user_stack=1
# projadd -U oracle -K "project.max-shm-memory=(priv,4g,deny)" user.oracle
# projmod -sK "project.max-sem-nsems=(priv,512,deny)" user.oracle
# projmod -sK "project.max-sem-ids=(priv,128,deny)" user.oracle
# projmod -sK "project.max-shm-ids=(priv,128,deny)" user.oracle

Parametros de SO[editar]

# vi /etc/init.d/ndd
#!/bin/sh 
# Defaults values: 
# tcp_smallest_anon_port=32768 
# tcp_largest_anon_port=65535 
# udp_smallest_anon_port=32768 
# udp_largest_anon_port=65535 
# 
# tcp_smallest_anon_port=32768 
# tcp_largest_anon_port=65535 
# udp_smallest_anon_port=32768 
# udp_largest_anon_port=65535 
# 
# for oracle installation 
ndd -set /dev/tcp tcp_smallest_anon_port=9000 
ndd -set /dev/tcp tcp_largest_anon_port=65500 
ndd -set /dev/udp udp_smallest_anon_port=9000 
ndd -set /dev/udp udp_largest_anon_port=65500 
# chmod 744 /etc/init.d/ndd 
# chown root:sys /etc/init.d/ndd 
# ln /etc/init.d/ndd /etc/rc2.d/S70ndd  

Instalacion de la Base de datos Oracle 11g R2[editar]

oracle@xxxx $ cd database/
oracle@xxxx $ ./runInstaller
  Starting Oracle Universal Installer...
  Checking Temp space: must be greater than 180 MB.   Actual 8976 MB    Passed
  Checking swap space: must be greater than 150 MB.   Actual 10610 MB    Passed
  Checking monitor: must be configured to display at least 256 colors.    Actual 16777216    Passed
  Preparing to launch Oracle Universal Installer from /tmp/OraInstall2012-07-27_11-18-44AM. Please wait ...oracle@taurus $ Warning: Cannot convert string "-monotype-arial-regular-r-normal--*-140-*-*-p-*-iso8859-1" to type FontStruct
  You can find the log of this install session at:
   /oracle/pkg78/soft/oraInventory/logs/installActions2012-07-27_11-18-44AM.log
-- VER MANUAL DE INSTALACION PERSONALIZADO --

Pasamos los scripts de Gestion y Administracion de Oracle[editar]

oracle@taurus $ mkdir -p /oracle/pkg78/soft/admdba
oracle@taurus $ cd /oracle/pkg78/soft/admdba
oracle@taurus $ scp -r newdes:/doracle/pkg09/soft/admdba/* .
The authenticity of host 'newdes (192.168.152.45)' can't be established.
RSA key fingerprint is 36:c5:27:fe:a3:ce:b3:ac:a8:b9:ab:02:90:07:3c:0c.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'newdes,192.168.152.45' (RSA) to the list of known hosts.
Password: 
arranca_agent.sh     100% |*********************************************************************************|   820       00:00    
arranca_agent_pkg.sh 100% |*********************************************************************************|   728       00:00    
arranca_bd.sh        100% |*********************************************************************************|  1543       00:00    
arranca_listener.sh  100% |*********************************************************************************|   861       00:00    
arranca_todo.sh      100% |*********************************************************************************|   794       00:00    
copia.htm            100% |*********************************************************************************|    83       00:00    
lcopiaon.sql         100% |*********************************************************************************|   223       00:00    
copiaon.sql          100% |*********************************************************************************| 12533       00:00    
lcopiaon.sh          100% |*********************************************************************************|  2059       00:00    
nohup.out            100% |*********************************************************************************| 14443       00:00    
copiaon.log          100% |*********************************************************************************|   567       00:00    
backup.log           100% |*********************************************************************************| 22772       00:00    
controlf.bck         100% |*********************************************************************************| 17496 KB    00:01    
controlf.sql         100% |*********************************************************************************| 11921       00:00    
copiaon.htm          100% |*********************************************************************************|   123       00:00    
entorno_bd_apps.sh   100% |*********************************************************************************|  3296       00:00    
entorno_bd_apps.sh.9 100% |*********************************************************************************|  3295       00:00    
entorno_bd_pkg.sh    100% |*********************************************************************************|  3445       00:00    
entorno_bd_pkg.sh-ol 100% |*********************************************************************************|  3444       00:00    
entorno_bd_pkg.sh-pr 100% |*********************************************************************************|  3444       00:00    
entorno_bd_pkg.sh.9i 100% |*********************************************************************************|  3444       00:00    
entorno_gc_pkg.sh    100% |*********************************************************************************|  2766       00:00    
oraInst.loc.pkg09    100% |*********************************************************************************|    62       00:00    
ora_log.tmp          100% |*********************************************************************************|   519       00:00    
oratab.pkg09         100% |*********************************************************************************|   742       00:00    
parada_agent.sh      100% |*********************************************************************************|   808       00:00    
parada_agent_pkg.sh  100% |*********************************************************************************|   701       00:00    
parada_bd.sh         100% |*********************************************************************************|  1077       00:00    
parada_listener.sh   100% |*********************************************************************************|   852       00:00    
parada_todo.sh       100% |*********************************************************************************|   783       00:00    
sys_path             100% |*********************************************************************************|    79       00:00     

Actualizar scripts de entorno[editar]

oracle@taurus $ vi entorno_bd_pkg.sh
V_PKG=pkg78
V_SID=MEDUSA
V_DB_HOST=taurus21
V_ADMIN_HOME=/oracle/$V_PKG/soft/admdba
export ORACLE_BASE=/doracle/$V_PKG/soft

###
### Configura el proyecto si existe
###

/usr/bin/projects -l $V_PKG > /dev/null 2>&1
if [ $? = 0 ]
then
  newtask -p $V_PKG -c $$
  echo "******************************************************************"
  echo "* Proyecto $V_PKG existe y ha sido cargado"
  echo "******************************************************************"
fi

oracle@taurus $ vi entorno_bd_apps.sh
V_PKG=pkg78
V_SID=MEDUSA
V_DB_HOST=taurus
V_ADMIN_HOME=/oracle/$V_PKG/soft/admdba
export ORACLE_BASE=/doracle/$V_PKG/soft

###
### Configura el proyecto si existe
###

/usr/bin/projects -l $V_PKG > /dev/null 2>&1
if [ $? = 0 ]
then
  newtask -p $V_PKG -c $$
  echo "******************************************************************"
  echo "* Proyecto $V_PKG existe y ha sido cargado"
  echo "******************************************************************"
fi
oracle@xxxx $ vi .profile
echo "---------------------------------------------------------------------------"
echo "-- ENTORNOS DINAMICOS (MGB: EN PRUEBAS) "
echo "---------------------------------------------------------------------------"
for ENTORNO in /oracle/pkg??/soft/admdba/entorno_bd_pkg.sh
do
  __SID__=`grep "^V_SID" $ENTORNO | cut -d= -f2`
  echo ". $ENTORNO => $__SID__"
done 

PS1='$ORACLE_SID:$PWD> '
export PS1
# export DISPLAY=$(who am i|awk '{print $6}'|cut -c2-|awk -F\) '{print $1}'):0.0
umask 022
# mv oraInst.loc.pkgXX oraInst.loc.pkg78
# mv oratab.pkgXX oratab.pkg78

Nota: Dentro mas de lo mismo!!!

Terminamos la instalación[editar]

root@xxxx # /opt/oracle/oraInventory/orainstRoot.sh
root@xxxx # /oracle/pkg78/soft/bd/bd112/root.sh
root@xxxx # chown oracle:dba /var/opt/oracle/

MEDUSA:/oracle> unset ORACLE_SID
:/oracle> dbca & 
-- VER MANUAL DE INSTALACION PERSONALIZADO --

MEDUSA:/oracle> sqlplus /nolog

SQL*Plus: Release 11.2.0.3.0 Production on Fri Jul 27 14:35:51 2012

Copyright (c) 1982, 2011, Oracle.  All rights reserved.

SQL> conn / as sysdba
Connected.

SQL> create pfile from spfile;

File created.

SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.

SQL> exit
Disconnected from Oracle Database 11g Release 11.2.0.3.0 - 64bit Production

MEDUSA:/oracle/pkg78/soft/bd/bd112/dbs> cd $ORACLE_HOME
MEDUSA:/oracle/pkg78/soft/bd/bd112/dbs> cd dbs/
MEDUSA:/oracle/pkg78/soft/bd/bd112/dbs> vi initMEDUSA.ora
*.compatible='11.2.0.3.0'
*.diagnostic_dest='/oracle/pkg78/medusa/admin'

MEDUSA:/oracle/pkg78/soft/bd/bd112/dbs> sqlplus /nolog

SQL*Plus: Release 11.2.0.3.0 Production on Fri Jul 27 14:42:51 2012

Copyright (c) 1982, 2011, Oracle.  All rights reserved.

SQL> conn / as sysdba
Connected to an idle instance.

SQL> startup nomount pfile=initMEDUSA.ora
ORACLE instance started.

Total System Global Area  801701888 bytes
Fixed Size                  2230272 bytes
Variable Size             469764096 bytes
Database Buffers          322961408 bytes
Redo Buffers                6746112 bytes

SQL> show parameter compatible

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
compatible                           string      11.2.0.3.0
SQL> 
SQL> create spfile from pfile;

File created.

SQL> shutdown immediate;
ORA-01507: database not mounted

ORACLE instance shut down.

Arrancar el la Base de Datos[editar]

SQL> startup
ORACLE instance started.

Total System Global Area  801701888 bytes
Fixed Size                  2230272 bytes
Variable Size             469764096 bytes
Database Buffers          322961408 bytes
Redo Buffers                6746112 bytes
Database mounted.
Database opened.

Arrancar el Listener[editar]

MEDUSA:/oracle/pkg78/soft/bd/bd112/network/admin> lsnrctl start LISTENER_MEDUSA

LSNRCTL for Solaris: Version 11.2.0.3.0 - Production on 27-JUL-2012 14:49:33
Copyright (c) 1991, 2011, Oracle.  All rights reserved.
Starting /oracle/pkg78/soft/bd/bd112/bin/tnslsnr: please wait...
TNSLSNR for Solaris: Version 11.2.0.3.0 - Production
System parameter file is /oracle/pkg78/soft/bd/bd112/network/admin/listener.ora
Log messages written to /oracle/pkg78/soft/diag/tnslsnr/taurus/listener_medusa/alert/log.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=taurus)(PORT=1709)))

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=taurus)(PORT=1709)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER_MEDUSA
Version                   TNSLSNR for Solaris: Version 11.2.0.3.0 - Production
Start Date                27-JUL-2012 14:49:33
Uptime                    0 days 0 hr. 0 min. 0 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /oracle/pkg78/soft/bd/bd112/network/admin/listener.ora
Listener Log File         /oracle/pkg78/soft/diag/tnslsnr/taurus/listener_medusa/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=taurus)(PORT=1709)))
Services Summary...
Service "MEDUSA" has 1 instance(s).
  Instance "MEDUSA", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully

Creamos usuario tiadm en oracle[editar]

MEDUSA:/oracle> sqlplus /nolog
SQL> conn / as sysdba
SQL> create tablespace users datafile '/oracle/pkg78/medusa/oradata1/data/users01.dbf' size 50m autoextend off;
SQL> create user "tiadm" identified by "xXxXx" default tablespace users temporary tablespace temp;
User created.
SQL> grant connect, resource to "tiadm";
Grant succeeded.
SQL> grant create session to "tiadm";
Grant succeeded.
SQL> select * from all_users;


Crear el RDCP en Oracle[editar]

begin
DBMS_CONNECTION_POOL.CONFIGURE_POOL(null,minsize=>15,maxsize=>40,incrsize=>5);
DBMS_CONNECTION_POOL.STart_POOL;
end;