Search This Blog

Saturday, 17 January 2015

Oracle_10G_Architecture

Oracle_10G_Architecture






You can see the Oracle background processes with this query

Select * 
from v$session
 where type='background';

Mandatory Oracle background processes:
ARCH - (Optional) Archive process writes filled redo logs to the archive log location(s). In RAC, the various ARCH processes can be utilized to ensure that copies of the archived redo logs for each instance are available to the other instances in the RAC setup should they be needed for recovery.

CKPT - Checkpoint process writes checkpoint information to control files and data file headers.

DBWR - Database Writer or Dirty Buffer Writer process is responsible for writing dirty buffers from the database block cache to the database data files. Generally, DBWR only writes blocks back to the data files on commit, or when the cache is full and space has to be made for more blocks. The possible multiple DBWR processes in RAC must be coordinated through the locking and global cache processes to ensure efficient processing is accomplished.


LGWR - Log Writer process is responsible for writing the log buffers out to the redo logs. In RAC, each RAC instance has its own LGWR process that maintains that instance’s thread of redo logs.



PMON - Process Monitor process recovers failed process resources. If MTS (also called Shared Server Architecture) is being utilized, PMON monitors and restarts any failed dispatcher or server processes. In RAC, PMON’s role as service registration agent is particularly important.



SMON - System Monitor process recovers after instance failure and monitors temporary segments and extents. SMON in a non-failed instance can also perform failed instance recovery for other failed RAC instance.

Thursday, 15 January 2015

RPM Intallation

How to install RPM

1.Connect to  Root and Mount cd/dvd  and connect it.
2.Go to the desktop and then media.
3. Look at the list (using ls -l)and go to the Server (folder).cd /media/cdrom/server
Cd /media àRHCL_5.7*
4.Copy and paste below parameters.
# From Oracle Linux 5 DVD
cd /media/cdrom/Server
rpm -Uvh binutils-2.*
rpm -Uvh compat-libstdc++-33*
rpm -Uvh compat-libstdc++-33*.i386.rpm
rpm -Uvh elfutils-libelf*
rpm -Uvh gcc-4.*
rpm -Uvh gcc-c++-4.*
rpm -Uvh glibc-2.*
rpm -Uvh glibc-common-2.*                                                                            
rpm -Uvh glibc-devel-2.*
rpm -Uvh glibc-headers-2.*
rpm -Uvh ksh*
rpm -Uvh libaio-0.*
rpm -Uvh libaio-devel-0.*
rpm -Uvh libgomp-4.*
rpm -Uvh libgcc-4.*
rpm -Uvh libstdc++-4.*
rpm -Uvh libstdc++-devel-4.*
rpm -Uvh make-3.*
rpm -Uvh sysstat-7.*
rpm -Uvh unixODBC-2.*
rpm -Uvh unixODBC-devel-2.*
rpm -Uvh numactl-devel-*
cd /
eject



Oracle Installtion on linux

Oracle 11g Installation on Linux

This post assumes that you have already installed Red Hat Enterprise Linux 5. (Cent OS 5can also be used for this purpose.)

1) First we will add groups by running the following commands.
groupadd oper
groupadd dba
groupadd oinstall
groupadd asmadmin

Note. We are not going to use the "asmadmin" group, since this installation will not use ASM.


2) Then we will add user oracle, with primary group Oninstall & secondary group G dba,oper  oracle

useradd -g oinstall -G dba,oper  oracle

3) Then we will assign password to this user. The password assigned to this user is oracle however you can choose your own password.

passwd oracle

4) Then we will run xhost command which enables access to the X server which runs on linux. The main purpose of this server is to enable and run GUI applications in a networking mode.(This command should be run as the root user when the oracle software is to be installed or when the dbca utility is to be used.)

xhost + (it will give you a message like access control disabled ------- and so on. Don't worry its a message not a error.)

5) Now we will make a directory for all the oracle components.

mkdir -p /u01/app/oracle/product/11.2.0/db_1

6) Give permissions to the above created folder.

chmod -R 777 /u01

7) Choose the owner and group for that folder.

chown -R oracle:oinstall /u01



8)
Open the following file and add the kernel parameters to the last line.

vi /etc/sysctl.conf ## open file syntax

fs.suid_dumpable = 1
fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmall = 2097152
kernel.shmmax = 536870912
kernel.shmmni = 4096
# semaphores: semmsl, semmns, semopm, semmni
kernel.sem = 250 32000 100 128
net.ipv4.ip_local_port_range = 9000 65500
net.core.rmem_default=4194304
net.core.rmem_max=4194304
net.core.wmem_default=262144
net.core.wmem_max=1048586




after making the required changes quit the vi editor and run the following command as the root user.
The current values can be tested using the following command.
/sbin/sysctl -a | grep <param-name>


/sbin/sysctl -p ## gives you a printout of all the parameters in the sysctl file.

10) Open this file and add the parameters at the end.

vi /etc/security/limits.conf

oracle              soft    nproc   2047
oracle              hard    nproc   16384
oracle              soft    nofile  4096
oracle              hard    nofile  65536
oracle              soft    stack   10240


11) Setting up the bash profile.

su - oracle ##switch to oracle user from the root user

vi .bash_profile ## open the oracle users bash profile.

d ## press the "d" key to delete all the contents of the file.

i ## go into insert mode

copy all the information below and paste it into the bash profile.
# .bash_profile

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
        . ~/.bashrc
fi

# User specific environment and startup programs
PATH=$PATH:$HOME/bin

export PATH
ORACLE_HOSTNAME=admin.localdomain; export ORACLE_HOSTNAME

ORACLE_UNQNAME=DBID; export ORACLE_UNQNAME

ORACLE_BASE=/u01/app/oracle; export ORACLE_BASE

ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1; export ORACLE_HOME

ORACLE_SID=SID; export ORACLE_SID

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/jlib:$ORACLE_HOME/rdbms/jlib; export CLASSPATH
------------------------------------------------------------------------------------------------------------------------------------------------

save the information # some changes in bash_profiles are you can set ORACLE_HOSTNAME ="as per your machine" host name find in you machine through hostname comand on linux by degault u get localhost.localdoamin so u set localhost.localdomain

Set ORACLE_UNQNAME=DBID that we want. like ORACLE_UNQNAME=orcl11g;
Set ORACLE_SID=SID that we want like ORACLE_SID=orcl,

exit ## exit from the oracle user prompt.



su - oracle ## Then again switch to the oracle user. If at this stage after switching if there is any error check the bash profile for typographical error.



12) Now we are ready to install the oracle software.


make a folder in the /u01 folder as "soft" and  copy/unzip the oracle database files in that folder.

How to unzip the folder

Go to file location n just type unzip (file_ location)


open a new command prompt

chmod -R 777 /u01 ## again give permissions.

xhost + ## required to run the oracle installation.

su - oracle

cd /u01/soft/database ## go to the oracle directory.

ls -l ## check the directory contents.

./runInstaller ## Initiate the installation process.


13) oracle setup values.

1st screen

choose the enterprise edition change the group to "dba" and remove the tick from
the create starter database.

2nd screen

change the group for orainventory to "dba".


14) final step

when the oracle installation is finished it will ask you to run
two scripts as the root user.

open a new terminal and run the scripts exactly as they are written one by one.


after running the scripts click ok and exit the enterprise manager.
now your oracle software installation is finished.



15) Time to create a database.


as the root user do the following:-

xhost + ## required to run the dbca utility

su - oracle

dbca

in the dbca utility in the template section choose the "general purpose" template. Also in the schemas section you can choose the install sample schemas.
Then give the sid name to the database (i usually give orcl, but you can choose any name you want.)
other than the above changes don't change any other variables, keep on clicking next and finally hit the finish button.
So now we have created our first database.