jueves, 26 de junio de 2008

Oracle Database 10g Conceptos Procesos en Memoria

Oracle Database 10g Conceptos Procesos en Memoria

DBwriter: Es el encargado de escribir los datos modificados dentro del data buffer cache en los datafiles luego que se active el proceso de

Procesos checkpoint y Dirty Buffer

LogWriter: Es el encargado de escribir los redo modificados en el redolog buffer en los online redolog

Procesos Commit Redo log Buffer Third Full
Mas de 1 Mega Byte
Antes que el dbwriter escriba en el datafile
Después de 3 Segundos

Smon: Es el proceso responsable de la recuperacion de la instancia cuando esta falla, los datos no pueden escribirse en disco, el smon automáticamente recupera cuando la base de datos es re abierta

Pmon: Es el proceso encargado de limpiar la memoria y otros recursos cuando los procesos fallan, rollback de transacciones bloqueo de tablas y registros y recursos del usuario

Checkpoint: Es el responsable de informar al Dbwriter cuando ocurre un checkpoint y cuando hay un log switch o la instancia en Shutdown. El checkpoint actualiza el header de todos los datafiles con el numero del checkpoint.

Mmon: Es un nuevo proceso de Oracle 10g que recolecta estadisticas para Automatic Workload Repository (AWR) Es responsable de los snapshots y estadisticas de Memoria

Arcn: Es un proceso importante de background luego de un switch log file este proceso es activado cuando la instancia esta en mode archive, este proceso asegura que todos los cambios en la base de datos queden registrados y salvados.

viernes, 13 de junio de 2008

Oracle Database 10g Procesos en Memoria

Procesos en Memoria Oracle

Dbwn, lgwr, pmon, smon, ckpt, mmon

$ ps -fea grep dbw
oracle 20718 20506 0 10:21:10 pts/5 0:00 grep dbw
oracle 20336 1 0 Dec 29 ? 84:47 ora_dbw0_BDDWSGRD

$ ps -fea grep lgw
oracle 20738 20506 0 10:21:23 pts/5 0:00 grep lgw
oracle 20338 1 0 Dec 29 ? 84:16 ora_lgwr_BDDWSGRD

$ ps -fea grep pmon
oracle 20330 1 0 Dec 29 ? 58:50 ora_pmon_BDDWSGRD
oracle 20748 20506 0 10:21:36 pts/5 0:00 grep pmon

$ ps -fea grep smon
oracle 20342 1 0 Dec 29 ? 12:56 ora_smon_BDDWSGRD
oracle 20750 20506 0 10:21:45 pts/5 0:00 grep smon

$ ps -fea grep ckpt
oracle 20340 1 0 Dec 29 ? 63:52 ora_ckpt_BDDWSGRD
oracle 20754 20506 0 10:21:59 pts/5 0:00 grep ckpt

$ ps -fea grep mmon
oracle 20348 1 0 Dec 29 ? 18:24 ora_mmon_BDDWSGRD
oracle 20756 20506 0 10:22:09 pts/5 0:00 grep mmon

Procesos Opcionales

$ ps -fea grep arc
oracle 20764 20506 0 10:23:11 pts/5 0:00 grep arc

$ ps -fea grep rec
oracle 20344 1 0 Dec 29 ? 0:10 ora_reco_BDDWSGRD
oracle 20768 20506 0 10:23:29 pts/5 0:00 grep rec

$ ps -fea grep qmn
oracle 20582 1 0 Dec 29 ? 0:58 ora_qmnc_BDDWSGRD
oracle 20770 20506 0 10:23:42 pts/5 0:00 grep qmn

$ ps -fea grep cjq
oracle 20774 20506 0 10:24:00 pts/5 0:00 grep cjq
oracle 20346 1 0 Dec 29 ? 58:05 ora_cjq0_BDDWSGRD

$ ps -fea grep pnn
oracle 20778 20506 0 10:24:14 pts/5 0:00 grep pnn

$ ps -fea grep dnn
oracle 20782 20506 0 10:24:30 pts/5 0:00 grep dnn

$ ps -fea grep snn
oracle 20784 20506 0 10:24:39 pts/5 0:00 grep snn

Oracle Database 10g Instalation for Solaris SPARC 64-Bit)

Implementing Optimal Flexible Architecture

You can install different products with the same release number in the same
Oracle base directory, for example:

/u01/app/oracle/product/10.2.0/db_1/u01/app/oracle/product/10.2.0/client_1

You can install the same product more than once in the same Oracle base directory, for example:
/u01/app/oracle/product/10.2.0/db_1/u01/app/oracle/product/10.2.0/db_2

Instalacion

Extracting the Installation Files

To uncompress each file, enter a command similar to the following:

$ gunzip filename.cpio.gz

To extract the installation files, enter a command similar to the following:

$ cpio -idcmv <

Mounting Discs

Switch user to root:

$ su - root

If necessary, enter the following command to eject the currently mounted disc, then remove it from the drive:

# eject


Insert the appropriate disc into the disc drive.

To verify that the disc mounted automatically, enter the following command:

# ls /dvd/dvd0

If this command fails to display the contents of the disc, enter a command similar to the following to mount it:

# /usr/sbin/mount -r -F hsfs /dev/dsk/cxtydzs2 /dvd

If Oracle Universal Installer is displaying the Disk Location dialog box, enter the disc mount point directory path, for example:


Disc mounted automatically:

/dvd/dvd0


Disc mounted manually:

/dvd


Running Oracle Universal Installer

$ cd /tmp
$ /directory_path/runInstaller

$ ./runInstaller

Oracle Enterprise Manager Database Control

Use a Web browser to access the Database Control

http://host:port/em


$ORACLE_HOME/install/portlist.ini file:

Enterprise Manager Console HTTP Port (db_name) = 1158

The installation reserves the first available port from the range 5500 to 5519. For example, if you installed Oracle Database on host mgmt42, and the Database Control uses port 1158, use the following

http://mgmt42:1158/em

Oracle Enterprise Manager displays the Database Control login page.
Log in to the database using the user name SYS and connect as SYSDBA.
Use the password that you specified for the SYS account during the installation.

# cat /etc/project

# su - oracle

$ id -p

jueves, 12 de junio de 2008

Oracle Database 10g Identifying Required Software Directories for Solaris SPARC 64-Bit)


Identifying Required Software Directories

You must identify or create the following directories for the Oracle software:

Oracle Base Directory
Oracle Inventory Directory
Oracle Home Directory

To create the Oracle base directory and specify the correct owner, group, and permissions for it:
Enter commands similar to the following to create the recommended subdirectories in the mount point directory that you identified and set the appropriate owner, group, and permissions on them:

# mkdir -p /mount_point/app/oracle_sw_owner
# chown -R oracle:oinstall /mount_point/app/oracle_sw_owner
# chmod -R 775 /mount_point/app/oracle_sw_owner

For example, if the mount point you identify is /u01 and oracle is the user name of the Oracle software owner, then the recommended Oracle base directory path is as follows:/u01/app/oracle


Database file directory:

# mkdir /mount_point/oradata
# chown oracle:oinstall /mount_point/oradata
# chmod 775 /mount_point/oradata


Recovery file directory (flash recovery area):# mkdir /mount_point/flash_recovery_area

# chown oracle:oinstall /mount_point/flash_recovery_area
# chmod 775 /mount_point/flash_recovery_area

Identifying existing Oracle home directories
Enter the following command to view the contents of the oratab file:#

# more /var/opt/oracle/oratab

Oracle Database 10g Configuring Kernel Parameters for Solaris SPARC 64-Bit)

Configuring Kernel Parameters

Verify that the kernel parameters shown in the following table are set to values greater than or equal to the recommended value shown on Solaris 8 and Solaris 9 operating systems. The procedure following the table describes how to verify and set the values.

Parameter
Recommended Value


set noexec_user_stack=1
set semsys:seminfo_semmni=100
set semsys:seminfo_semmns=1024
set semsys:seminfo_semmsl=256
set semsys:seminfo_semvmx=32767
set shmsys:shminfo_shmmax=4294967295
set shmsys:shminfo_shmmin=1
set shmsys:shminfo_shmmni=100
set shmsys:shminfo_shmseg=10


Note:The following parameters are obsolete in Solaris 9:
shmsys:shminfo_shmmin
shmsys:shminfo_shmseg

On Solaris 10, verify that the kernel parameters shown in the following table are set to values greater than or equal to the recommended value shown. The table aslo contains the resource controls that replace the /etc/system file for a specific kernel parameter.

Note:In Solaris 10, you are not required to make changes to the

/etc/system

On Solaris 8 and Solaris 9 operating systems, use the following procedure to view the current value specified for these kernel parameters, and to change them if necessary:
To view the current values of these parameters, enter the following commands:

# grep noexec_user_stack /etc/system
# /usr/sbin/sysdef grep SEM
# /usr/sbin/sysdef grep SHM

If you must change any of the current values, then:
Create a backup copy of the /etc/system file, for example:

# cp /etc/system /etc/system.orig

Open the /etc/system file in any text editor and, if necessary, add lines similar to the following
(edit the lines if the file already contains them):set noexec_user_stack=1

set semsys:seminfo_semmni=100
set semsys:seminfo_semmns=1024
set semsys:seminfo_semmsl=256
set semsys:seminfo_semvmx=32767
set shmsys:shminfo_shmmax=4294967295
set shmsys:shminfo_shmmin=1
set shmsys:shminfo_shmmni=100
set shmsys:shminfo_shmseg=10

Enter the following command to restart the system:

# /usr/sbin/reboot

Oracle Database 10g Creating Required Operating System Groups and Users for Solaris SPARC 64-Bit)

Creating Required Operating System Groups and Users

Creating the Oracle Inventory Group
When you install Oracle software on the system for the first time, Oracle Universal Installer creates the oraInst.loc file. This file identifies the name of the Oracle Inventory group and the path of the Oracle Inventory directory.

To determine whether the Oracle Inventory group exists, enter the following command:

# more /var/opt/oracle/oraInst.loc

If the oraInst.loc file exists, then the output from this command is similar to the

following:inventory_loc=/u01/app/oracle/oraInventoryinst_group=oinstall

The inst_group parameter shows the name of the Oracle Inventory group, oinstall.
Creating the Oracle Inventory Group

If the oraInst.loc file does not exist, then create the Oracle Inventory group by entering the following command:

# /usr/sbin/groupadd oinstall
# /usr/sbin/groupadd dba
# /usr/sbin/groupadd oper

# id -a oracle

If the oracle user exists, then the output from this command is similar to the following:uid=440(oracle) gid=200(oinstall) groups=201(dba),202(oper)

Creating an Oracle Software Owner User

1. To create the oracle user, enter a command similar to the following:

# /usr/sbin/useradd -g oinstall -G dba[,oper] oracle

# mkdir /export/home

# /usr/sbin/usermod -d /export/home/oracle -m oracle



In this command:
o The -g option specifies the primary group, which must be the Oracle Inventory group, for example oinstall
o The -G option specifies the secondary groups, which must include the OSDBA group and if required, the OSOPER group. For example, dba or dba,oper

2. Set the password of the oracle user:

# passwd -r

Modifying an Oracle Software Owner User

# /usr/sbin/usermod -g oinstall -G dba[,oper] oracle

1. To determine whether the user exists, enter the following command:

Oracle Database Installation 10g Checking the Network Setup for Solaris (SPARC 64-Bit)


Checking the Network Setup


Configuring Name Resolution
When you run Oracle Universal Installer, an error may occur if name resolution is not set up. To avoid this error, before you begin installation, you must ensure that host names are resolved only through the

/etc/hosts

To ensure that host names are resolved only through the /etc/hosts file:

Verify that the /etc/hosts file is used for name resolution. You can do this by checking the hosts file entry in the nsswitch.conf file as follows:

# cat /etc/nsswitch.conf grep hosts

The output of this command should contain an entry for files.

Verify that the host name has been set by using the hostname command as follows:

# hostname

The output of this command should be similar to the following:myhost.mycomputer.com
Verify that the domain name has not been set dynamically by using the domainname command as follows:

# domainname

This command should not return any results.
Verify that the hosts file contains the fully qualified host name by using the following command:

# cat /etc/hosts grep `eval hostname`

The output of this command should contain an entry for the fully qualified host name and for localhost.

For example:192.168.100.16 myhost.us.mycompany.com myhost
127.0.0.1 localhost localhost.localdomain

Oracle® Database Installation 10g Checking the Software for Solaris(SPARC 64-Bit)

Checking the Software Requirements

$ cat /etc/release

# uname -r

Requirement Operating system One of the following 64-bit operating system versions:

Solaris 8 Update 7 or later
Solaris 9 Update 6 or later
Solaris 10

Packages
SUNWarc
SUNWbtool
SUNWhea
SUNWlibm
SUNWlibms
SUNWsprot
SUNWtoo
SUNWi1of
SUNWi1cs
SUNWi15cs
SUNWxwfnt
SUNWsprox


To determine which version of Solaris is installed, enter the following command:

# uname -r
5.9

In this example, the version shown is Solaris 9 (5.9). If necessary, refer to your operating system documentation for information about upgrading the operating system.

To determine whether the required packages are installed, enter a command similar to the following:

# pkginfo -i SUNWarc SUNWbtool SUNWhea SUNWlibm SUNWlibms SUNWsprot \
SUNWsprox SUNWtoo SUNWi1of SUNWi1cs SUNWi15cs SUNWxwfnt

To determine whether an operating system patch is installed, enter a command similar to the following:

# /usr/sbin/patchadd -p grep patch_number(without version number)


For example, to determine if any version of the 111713 patch is istalled, use the follwing command:

# /usr/sbin/patchadd -p grep 111713

If an operating system patch is not installed, then download it from the following Web site and install it:http://sunsolve.sun.com/









Oracle® Database Installation 10g Checking the Hardware for Solaris (SPARC 64-Bit)

Checking the Hardware Requirements

The system must meet the following minimum hardware requirements:
At least 1024 MB of physical RAM
The following table describes the relationship between installed RAM and the configured swap space requirement.
RAM
Swap Space
Between 1024 MB and 2048 MB
1.5 times the size of RAM
Between 2049 MB and 8192 MB
Equal to the size of RAM
More than 8192 MB
0.75 times the size of RAM
400 MB of disk space in the /tmp directory
Between 1.5 GB and 3.5 GB of disk space for the Oracle software, depending on the installation type
1.2 GB of disk space for a preconfigured database that uses file system storage (optional)


To determine the physical RAM size, enter the following command:

# /usr/sbin/prtconf grep "Memory size"

If the size of the physical RAM is less than the required size, then you must install more memory before continuing.
To determine the size of the configured swap space, enter the following command:

# /usr/sbin/swap -s


If necessary, refer to the operating system documentation for information about how to configure additional swap space.

To determine the amount of disk space available in the /tmp directory, enter the following command:

# df -k /tmp
# df -h /tmp (on Solaris 10)

If there is less than 400 MB of free disk space available in the /tmp directory, then complete one of the following steps:

Delete unnecessary files from the /tmp directory to meet the disk space requirement.

Set the TMP and TMPDIR environment variables when setting the oracle user's environment (described later).

Extend the file system that contains the /tmp directory. If necessary, contact your system administrator for information about extending file systems.
To determine the amount of free disk space on the system, enter the following command:

# df -k
# df -h (on Solaris 10)

To determine whether the system architecture can run the software, enter the following command:

# /bin/isainfo -kv

Variables de Ambiente


OFA OPTIMAL FLEXIBLE ARQUITECTURE

What is OFA The OFA standard is a series of recommendations for naming files and folders when installing and implementing an Oracle database. The official OFA advice can be found in the manuals at docs.oracle.com (for 9i - Administering Oracle, for 10g - Installing Oracle)

Ejemplo 1

vi .profile

# Oracle Settings
umask 022
TMP=/tmp;
export TMPTMPDIR=$TMP;
export TMPDIR
ORACLE_BASE=/u01/app/oracle;
export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/product/10.2.0;
export ORACLE_HOME
#ORACLE_SID=
export ORACLE_SID
ORACLE_TERM=xterm;
export ORACLE_TERM
PATH=/usr/sbin:$PATH:/export/home/oracle;
export PATH=$ORACLE_HOME/bin:$PATH;
export PATH
LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib;
export LD_LIBRARY_PATHCLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib;export CLASSPATH


vi .profile


Ejemplo 2

HOME=/export/home/oracle
LD_LIBRARY_PATH=/u01/app/oracle/product/10.2.0/lib:/lib:/usr/lib
LOGNAME=oracleMAIL=/var/mail/oracle
ORACLE_BASE=/u01/app/oracle
ORACLE_HOME=/u01/app/oracle/product/10.2.0
ORACLE_SID=BDDWSGRD
ORACLE_TERM=xtermPATH=/u01/app/oracle/product/10.2.0/bin:/usr/sbin:/usr/bin::/export/home/oracle
SHELL=/bin/sh
TERM=vt100
TMP=/tmp
TMPDIR=/tmp
TZ=America/Bogota