Saturday, 9 July 2016

                   ORACLE DATABASE ARCHITECTURE 


            what is architectur 

  •  board outlines,mechanisms and design 
  •  architecture is the combination of hardware and software which is completly relive one is depend on the other one 


main components of architecture with respect to oracle server 

                                 1) ORACLE DATABASE 

it is a completly base on the storage level component. which means combination of difrent types of file together comes on oracle database.its completly depending on storage its require a more and more spacess. 

                                 2)ORACLE INSTANCE 

 oracle instance is northing but a memory structure and baground process(in os level).its majorly relate on memory structure along with some baground process at operating system level.

              oracle database dividing in two types 

   1)physical structure


 An Oracle database is a set of files that store Oracle data in persistent disk storage its called physical structure 

  a)contol file 


controfiles are the file holding the control information about the database physical structure of the database store in the control files. its also maintain the consistency of the database.it is also called "heart of the databae".its also holds the information about database files. extension name is '.ctl' 

 

controlfile cantains 

 


* database name 

 * name,path,size of redq logfile

 * scn number 

 * archive log information

 * rman backup information

 * log sequential number

  b)redo logfile 


 redo log files are the file record changes make to database and its hold the current image,previous image in terms of redo groups.its an used recovery purpose. extension name is '.log' 

                             status of redolog

  cuurent: cuurent transaction taking place in that group
          active : this indicate content  can writen
        inactive : this indicate content  can no writen
        unused :  the group data is use not even ones


 c)data file


 its store a actual data and metadata.extension name is '.dbf' three types of datafile 

  !)system datafile:system related information
 !!)sysoux datafile:meta data information of table
 !!!)non system datafile:   
              
               * user datafile               * temporary datafile                * undo datafile 

 d)parameter file


parameter file hold the charactersticks of database and instance its used to startup of database and creation of database 

 two types of parameter file


!)parameter file:

its a text file we can change using ' vi ' command extension name is init sid.ora 

!!)server parameter file:

its also called a spfile. its a 'binary file'.we can change using alter command extension name is spfile sid.ora 


 e)password file its holds the sysdba,sysoper and difrent user passwords 


 f)archive logfile its an offline copy of online redo logfile 

 2)logical structure

    its physio logical structure in which data is store logicaly in physical structure 

a)tablespace 


            two types of tablespace 

        !) small file tablespace 
       !!)big file tablespace 
  
      based on space management 

 !)localy managed tablespace: space alocation delocation represent or managed in bitmap header 'non system tablespace managed localy'


 !!)Dictionary managed tablespace: space alocation delocation refered in data dictionary.'system and sysaux managed dictionary managed'


b)segment  segment is an part of tablespace it includes one or more extents


 c)extents  extens is part of segment it haves number of block space alocation and delocation will  always happen in terms of extents 


 d)blocks  it s smallest storege unit of oracle database,data will exactly stored here 

                             

                  SYTEM GLOBAL AREA 


 1)shared pool 

 !)library cache :most recently executed pl&sql and sql statement                              !!)dictionary cache :it holds the information related to the recently executed sql statement 
 !!!)large pool :it holds the information about backup and recovery 

 2)db cache :it holds the actual data inside of buffer 

 !)clean buffer: which has not using ones its called clean buffer 
 !!)pin buffer: which holds the black images which yet to modify its called pin buffer               !!!)dirty buffer:it is the modify buffer 
 !v)free buffer :buffer that can be over writen 

 3)redolog buffer cache: it holds the records changes made to the data in bufffer cache 


 PROGRAM GLOBAL AREA 

!)session information:login or logout privilazes,user records maintaining 
!!)stakes space: if u are diclaring a variable then the values been stack space 
!!!)sort areaentire operation done by within the sort area 

   baground process

              

                               System Monitor (SMON)


                  general server housekeeping functions.

Rollback: uncommited data stored in datafile will be roll back to redolog 

Roll forward: commited data which not stored in datafile will be recover from redolog file Process Monitor 

                               

                       (PMON)


monitors and manages individual user sessions .performs database locking/unlocking functions on UPDATE and DELETE query 

                           

                     DBWR (db writer)


DBwr write the dirty buffer images to respective datafiles and its used keep the dirty buffer cache free 

                      

when it accur 


!)check point accur 

 !!)even manual log switch occur

 !!!)commit 

 !v)every 1/3 full v) every 3 seconds 

 

  LGWR (logwriter)


to move the contents from redolog buffer cache to redolog files


  when it accur 


!)in every redolog buffer 1m full 

 !!)when redolog 1/3 full

 !!!)every 3 seconds 

 !v)commit accur V)check point accur

* log writer is the fastest baground process 

  

  archive process(ARCn) 


its optional baground process. its offline copy of online redolog file

Monday, 20 June 2016



ORACLE DATABASE INSTALATION ON OEL  

            WITH SCREEN SHOT



Step 1  =   cat /etc/hosts
=================================================================
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1               localhost.localdomain localhost

[root@localhost ~]#    vi  /etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1               localhost.localdomain localhost
192.168.56.181    saivm1.srkinfo.com          saivm1




After Changing the hostname the content of the file as bellow 
----------------------------------------------------------------------------
[root@localhost ~]# cat /etc/sysconfig/network
NETWORKING=yes
NETWORKING_IPV6=no
HOSTNAME=saivm1.srkinfo.com





=======================================================================
 Step 2  Required Directory Creation
=======================================================================
mkdir -p /u01/app/oracle
mkdir -p /u01/app/oracle
chown   oracle:oinstall /u01/app/oracle
chmod -R 777 /u01/app




Step 3   Just copy and past as Root user (KERNEL PARAMETERS)
grep -q ip_local_port_range /etc/sysctl.conf
if [ $? -ne 0 ]; then
  echo "" >> /etc/sysctl.conf
  echo "# Oracle parameters" >> /etc/sysctl.conf
  echo "kernel.shmall = 2097152" >> /etc/sysctl.conf
  echo "kernel.shmmax = 4294967295" >> /etc/sysctl.conf
  echo "kernel.shmmni = 4096" >> /etc/sysctl.conf
  echo "kernel.sem = 250 32000 100 128" >> /etc/sysctl.conf
  echo "fs.file-max = 65536" >> /etc/sysctl.conf
  echo "net.ipv4.ip_local_port_range = 9000 65000" >> /etc/sysctl.conf
  echo "net.core.rmem_default = 262144" >> /etc/sysctl.conf
  echo "net.core.rmem_max = 4194304" >> /etc/sysctl.conf
  echo "net.core.wmem_default = 262144" >> /etc/sysctl.conf
  echo "net.core.wmem_max = 262144" >> /etc/sysctl.conf
  echo "fs.aio-max-nr=1048576" >> /etc/sysctl.conf
  sysctl -p >> /dev/null
fi


Step 4
grep -q ip_local_port_range /etc/sysctl.conf
if [ $? -ne 0 ]; then
  echo "" >> /etc/sysctl.conf
  echo "# Oracle parameters" >> /etc/sysctl.conf
  echo "kernel.shmall = 2097152" >> /etc/sysctl.conf
  echo "kernel.shmmax = 4294967295" >> /etc/sysctl.conf
  echo "kernel.shmmni = 4096" >> /etc/sysctl.conf
  echo "kernel.sem = 250 32000 100 128" >> /etc/sysctl.conf
  echo "fs.file-max = 65536" >> /etc/sysctl.conf
  echo "net.ipv4.ip_local_port_range = 9000 65000" >> /etc/sysctl.conf
  echo "net.core.rmem_default = 262144" >> /etc/sysctl.conf
  echo "net.core.rmem_max = 4194304" >> /etc/sysctl.conf
  echo "net.core.wmem_default = 262144" >> /etc/sysctl.conf
  echo "net.core.wmem_max = 262144" >> /etc/sysctl.conf
  echo "fs.aio-max-nr=1048576" >> /etc/sysctl.conf
  sysctl -p >> /dev/null
Fi




Step 5   Just copy and past as Root user
===================================================================
grep -q oracle /etc/profile
if [ $? -ne 0 ]; then
  echo "" >> /etc/profile
  echo "if [ \$USER = "oracle" ] || [ \$USER = "grid" ]; then " >> /etc/profile
  echo "  if [ \$SHELL = \"/bin/ksh\" ]; then" >> /etc/profile
  echo "    ulimit -p 16384" >> /etc/profile
  echo "    ulimit -n 65536" >> /etc/profile
  echo "  else" >> /etc/profile
  echo "    ulimit -u 16384 -n 65536" >> /etc/profile
  echo "  fi" >> /etc/profile
  echo "fi" >> /etc/profile
Fi



===================================================================
Step 6     Just copy and past as Root user
===================================================================
grep -q pam_limits /etc/pam.d/login
if [ $? -ne 0 ]; then
  echo "session    required     /lib/security/pam_limits.so" >> /etc/pam.d/login
fi




login as oracle user create directory and verify 
[root@saivm1 ~]#   su  - oracle
[oracle@saivm1 ~]$  mkdir  software





Again login as root user you can find where software is there and copy the database  where you want


[root@saivm1 ~]# cp -r /media/sf_datastore/11gR20/database/ /home/oracle/software


To change group and owner ship execute following command as "root"
--------------------------------------------------------------------------------
[root@saivm1 ~]#  chown -R oracle:oinstall  /home/oracle/software/
[root@saivm1 ~]# chmod -R 775 /home/oracle/software/database/





After copy you can verify the database folder has copied into software folder of oracle
 but the owner & group are 'root' only, Actually it supposed to be owner as "oracle" and group as "oinstall" to changed the above picture
 ------------------------------------------------------------------------------------------------------------

REMEMBER  you should be in oracle terminal / user 

[oracle@saivm1 ~]$ ll software/
total 4
drwxr-x--- 8 root root 4096 Jan 31 20:52 database
*************************************************************************************  Start Installing Software  as "oracle" user 
*************************************************************************************
copy & paste the following command 

   /home/oracle/software/database/runInstaller  




ORACLE DATABASE INSTALATION STARTED OBSERVE THE GUI


f you need oracle support create an oracle account and give. and  no need oracle support unmark the  securites support






If you want to next updates give the username and password  and 
No needed  skip software updates




Choose the Create and configure a database option. Or, you also have the option of choosing to only install the database software, but then you must create a database in an additional step after the software is installed. If you are currently using a previous version of Oracle Database, choose Upgrade an existing database. After you have chosen an option, click Next


· Desktop Class—This installation class is most appropriate for laptop or desktop computers. It includes a starter database and requires minimal configuration.
· Server Class—This installation class is for servers, such as you would find in a data center, or used to support enterprise-level applications. Choose this installation class if you need access to advanced configuration options.


· ORACLE_BASE  where you want give the location
· Software location is northing but  database home location where uyou want to install software                give the location
· Database edition       Enterprise Edition:—This installation type is the full-featured Oracle     Database product that provides   data management for enterprise-level applications. It is intended for mission-critical, high-security online transaction processing (OLTP) and data warehousing environments.
  1. Standard Edition:—This installation type is suitable for workgroup or department-level applications, and for small to medium-sized enterprises. It provides core relational database management services and options and includes an integrated set of management tools, replication, Web features, and facilities for building business-critical applications.
  2. Standard One Edition:—This installation type is suitable for workgroup, department, or web applications. It provides core relational database management services for single-server environments or highly distributed branch environments. Oracle Standard Edition One includes all the facilities necessary to build business-critical applications.
  3. Personal Edition: (Microsoft Windows operating systems only)—This installation type installs the same software as the Enterprise Edition, but supports only a single-user, development and deployment environment.

· Character set  which is based on the operating system language settings, or Unicode


·osdbaGroup :Specify the operating system DBA group. Host computer users in this group have administrative privileges on the database. This group is typically named 
·  Global database is northing but database name what you want give 





Inventory directory
  If this is the first time you are installing any Oracle software on this computer, then the Create    Inventory Directory window appears. You must specify a local directory for the inventory, which OUI uses to keep track of all Oracle software installed on the computer. This information is used while applying patches or upgrading an existing installation, and while deinstalling Oracle software. Note that this directory is different from the Oracle home directory. The recommended value for the inventory directory is Oracle_base/../oraInventory, or one level above the Oracle base directory, in the oraInventory subdirectory. If your Oracle base directory is /u01/app/oracle, then the Oracle inventory directory defaults to /u01/app/oraInventory.




It is the last step what ever your giving its showing one screen please check this atleast ones





START  THE INSTALING A SOFTWARE




Database installing is started






(Optional) Click Password Management to unlock user accounts to make the accounts accessible to users.
The SYS and SYSTEM accounts are unlocked by default.



In the Execute Configuration Scripts window, you are prompted to open a new terminal window, and to run scripts as the root user.




After you run the scripts, return to this window and click OK






You use Oracle Enterprise Manager Database Control to perform common database administration tasks. The URL and port information for Database Control can be found after installation in theOracle_home/install/portlist.ini file.