Monday, August 17, 2020

Oracle RAC Services

 Oracle RAC Services


Introduction:


In RAC (Real Application Cluster)environment  a single  service can represent an application,multiple applications or a subset of a single application,a single service can be associated with one or more instances of a oracle RAC database.



listener (server side)

    establish a connection.

        remote server - tnsnames.ora(client side configuration)


    tnsping net_service_name

    tnsping prod


we can have multiple listener with different ports

configured ?

    yes

    list1 - 1521 - 10conn

    list2 - 9101 - 20

------------------------------------------

Services .


    Purpose - for load balance and failover.

 

hrms  - db1  - app1  -connec1

   finance - db2  - app2 -connec2

  sales - db3  - app3 -connec3-tns


RAC    4 node RAC


    every node has instance and listener(local) with scan listner(remote-dns)


    node1 - scanliste - prod1

    node2 - scanliste - prod2

    node3 - scanliste - prod3

    node4 - scanliste - prod4


   hrms - node1,3-10k

    prod -      finance -n2  -10k

    sales - n3,2  -40k


Automatic Workload Management :


RAC Services:


Using RAC Services , How do we manage applications ?


Define Services to a particular application or to a subset

of application’s operations.


Services enable you to manage your application workloads as

separate entities.


Ensures that business priorities are met by controlling

how processing resources are applied to your application

workloads.


If a primary instance fails, then Oracle moves the service

from the failed instance to a surviving alternate instance.


Using SRVCTL (Server Control) Utility,

DBCA  – we can create, modify,

 start, stop operations


     

How the connections are distributed/balanced across these

 nodes?


by defining a service , the workload is distributed across

nodes as a separate entity.



Preferred Instance :


    The instance that support service.


Available Instance :


 The instance that support a service if the service’s

 preferred instance fails.


Limit of 115 services per database.

Sys$background,sys$users are default Services


using srvctl:


$srvctl add service -d prod -s hrms -r prod1,prod3 -a prod2

$srvctl add service -d prod -s finance -r prod1,prod2 -a prod3

$srvctl add service -d prod -s sales -r prod2 -a prod1

srvctl add service -d prod -s hr -r prod2,prod3 -a prod1

srvctl add service -d prod -s acct -r prod3 -a prod1

$srvctl add service -d prod -s idbi -r prod2 -a prod1


    -r preffered instance

    -a available instance

    -s service name

    -d database name


$srvctl status service -d prod -s hrms

$srvctl start service -d prod -s hr


list of services - using config

$ srvctl config database -d prod


If load on the instance, can move/relocate the service

connections to another instance.


select inst_id,service_name,count(*) from gv$session group by inst_id,service_name;


1  hrms   4500

2 finance   200

2  sales   3000

3 manfacturing    1000

$srvctl relocate service -d prod -s hr -i prod2 -t prod1


        -t newinstance

        -i old instance


by finding number of sessions on service name.


sql>select inst_id,service_name,machine,count(*) from gv$session

group by inst_id,service_name,machine;


1 hrms - 12000

2 sales - 15000

3 fin - 30000

sql>connect sys/sys123@prod1


    For prod1 ,

        has to configure tnsnames.ora

        with service name prod

                 instance_name prod1


     


shared storage - datafiles

                prod -  prod1-list1-scanip

                     prod2-list1-scanip

                    prod3-list1-scanip

application - 3 but db is one(prod)

sales schema

    <-scan

       <-sales - to make it seperate entity with in the same

           db.

        define services to support workload balancing

        and failover.

hrms schema

    <-scan

       <-hrms

finance schema

    <-scan

       <-finance


hrms-prod1,prod3 (A-prd2) - connections - 1000 - gv$session

finance-prod2,prod3 - conn - 200

sales -prod3 - conn - 40



Enabling load balance,Failover


Automatic workload Manangement


    with services - can define.


 

Client side Load Balancing


    tnsnames.ora - copy from server to get connect from

    user.

        using a connect string.

        net service name

     

        nsn - prod

        service_name = prod

        host=scan-cluster - DNS - route least loaded

        node in a round robin method.

 

        LOAD_BALANCE=ON.


    prod1,prod2 - scan will route the connection for these

    preferred nodes configure with service.


    When new node prod3 added to the cluster  then

    Client side additional configuration is not needed.

        when configured with scan and load balance-on

    From server side, modify the service with additional

    instance as a preferred node to support and restart

    the service


FailOver- Client Side :


    using parameter in tnsnames.ora with failover=on will

support Client side failover when node fails.

    helps to failover if the first listener

    connection fails.


    failover=on


Server Side - Load Balancing:


    In server side load balancing , configure the scan

listener as remote listenr in every instance to route the

connection.

    The PMON maintains the performance information and will

    provide from every instance.

    The local listener will redirect to the least loaded

    node as per load provided by pmon from the instance.


    sql>show parameter remote_listener

    sql>show parameter local_listener



What is service?

What is the purpose of service?

How do define services in rac?

What is preferred instance?

What is available instance?

Type of failover and load balancing?

How do we enable client side failover/load balancing?

What are the parameter configured for local and remote listener?

What are the views to find the performance or load on the server in cluster?

    using gv$session


To configure cluster - parameter ?

cluster_database=true


utility to configure services? srvctl


finding services configured for preferred and available

srvctl config service -d prod -s sales



Note:Info on Oracle RAC service it may be differ from your environment prod,test,dev and directories etc



THANKS FOR VIEWING MY BLOG FOR MORE UPDATES FOLLOW ME OR SUBSCRIBE ME


Oracle Database 19c Installation on OEL 8.1

Oracle Database 19c Installation on OEL7.5/8.1 

vmware 15 installed on host machine

Login as root user 

root123


Wired Connect - Internet


Prerequisites - Installation using yum install.


# cd /etc/yum.repos.d/

wget http://yum.oracle.com/public-yum-ol7.repo

yum install oracle-database-preinstall-19c


Install Winscp - download


Finding ipaddress using ifconfig


eg: 192.168.21.100


From source to target , copy the db file LINUX.X64_193000_db_home.zip (drag and drop)


Where default we have root user,Need to provide ownership to user oracle on

Oracle binaries


 To manage Oracle Installed binaries, will create OS groups and user.


 Oracle recommends three groups.


    dba - Full Administrative privileges

    oinstall - Will have privileges on inventory files.

    oper  - optional - operational - limited privileges

After Installing Pre-requisites, These user and groups are created by it self.


Verify using ID

#id oracle

If not exists, Need to create Manually.


Create Directories:


mkdir -p /u01/app/oraInventory

mkdir -p /u01/app/oracle/product/19.3.0/dbhome_1


Permissions on File systems 



#chown -R oracle:oinstall /u01

#chown -R oracle:oinstall /softwares

#chown -R oracle:oinstall /oradata

#chown -R oracle:oinstall /orabackup

#chown -R oracle:oinstall /archives


Note: -R ? includes all subfiles and folders

Will Provide read,write,execute permissions on file systems


chmod -R 775 /u01

chmod -R 775 /softwares

chmod -R 775 /oradata

chmod -R 775 /orabackup

chmod -R 775 /archives


----------------------------


Configure hostname


vi /etc/hosts

#add entry

127.0.0.1  localhost.localdomain  localhost

192.168.21.100  host1.chaitanyaoracledba.com  host1

:wq!


vi /etc/hostname

#delete existing entry

host1.chaitanyaoracledba.com


:wq!

--------------------------------

set the oracle password

#passwd oracle


Enter the passwd : oracle123

confirm : oracle123


Login to Oracle user

#su - oracle

------------------------------------------------------------

Configuing .bash_profile - Environment Variables

-------------------------------------------------------------

is a hidden file for every user default profile

Will declare variables to locate the oracle binaries

So 




$vi .bash_profile


#Append few parameters following


TMP=/tmp; export TMP

TMPDIR=$TMP; export TMPDIR


ORACLE_BASE=/u01/app/oracle; export ORACLE_BASE

ORACLE_HOME=$ORACLE_BASE/product/19.3.0/dbhome_1; export ORACLE_HOME

ORACLE_SID=prod; export ORACLE_SID

PATH=/usr/sbin:$PATH; export PATH

PATH=$ORACLE_HOME/bin:$PATH; export PATH

ORACLE_HOSTNAME=host1.chaitanyaoracledba.com; export ORACLE_HOSTNAME

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


Now ... save the file

esc   :wq!


then execute

$. .bash_profile






# Silent mode.

$cd /u01/app/oracle/product/19.3.0/dbhome_1

$ cp LINUX.X64_193000_db_home.zip /u01/app/oracle/product/19.3.0/dbhome_1/

$cd /u01/app/oracle/product/19.3.0/dbhome_1/

$unzip LINUX.X64_193000_db_home.zip

$ls

Will see runInstaller file to install the db software


$export ORACLE_HOSTNAME=host1.chaitanyaoracledba.com

$./runInstaller -ignorePrereq -waitforcompletion -silent -printtime -printmemory  

    -responseFile ${ORACLE_HOME}/install/response/db_install.rsp          

    oracle.install.option=INSTALL_DB_SWONLY                                   

    ORACLE_HOSTNAME=host1.chaitanyaoracledba.com                                    

    UNIX_GROUP_NAME=oinstall                                                  

    INVENTORY_LOCATION=/u01/app/oraInventory                                   

    SELECTED_LANGUAGES=en,en_GB                                               

    ORACLE_HOME=${ORACLE_HOME}                                               

    ORACLE_BASE=${ORACLE_BASE}                                                

    oracle.install.db.InstallEdition=EE                                       

    oracle.install.db.OSDBA_GROUP=dba                                         

    oracle.install.db.OSBACKUPDBA_GROUP=dba                                  

    oracle.install.db.OSDGDBA_GROUP=dba                                       

    oracle.install.db.OSKMDBA_GROUP=dba                                       

    oracle.install.db.OSRACDBA_GROUP=dba                                     

    SECURITY_UPDATES_VIA_MYORACLESUPPORT=false                                

    DECLINE_SECURITY_UPDATES=true


Run the root scripts when prompted.


As a root user, execute the following script(s):

        1. /u01/app/oraInventory/orainstRoot.sh

        2. /u01/app/oracle/product/19.3.0/dbhome_1/root.sh






# Silent mode - Create Database using database configuration assistant - silent mode

dbca -silent -createDatabase                                                  

     -templateName General_Purpose.dbc                                       

     -gdbname prod -sid  prod -responseFile NO_VALUE        

     -characterSet AL32UTF8                                                    

     -sysPassword sys123                                                 

     -systemPassword sys123                                            

     -createAsContainerDatabase false                                         

     -numberOfPDBs 0                                                         

     -pdbName pdbhr                                                     

     -pdbAdminPassword PdbPassword1                                            

     -databaseType MULTIPURPOSE                                                

     -automaticMemoryManagement false                                        

     -totalMemory 870                                                        

     -storageType FS                                                         

     -datafileDestination "/oradata"                                         

     -redoLogFileSize 50                                                     

     -emConfiguration NONE                                                    

     -ignorePreReqs



Note : Info on oracle db19c installation it may be differ from your environment production,testing,development,and naming conventions,directories etc


THANKS FOR VIEWING MY BLOG FOR MORE UPDATES FOLLOW ME OR SUBSCRIBE ME 

ITIL Process

ITIL Process Introduction In this Blog i am going to explain  ITIL Process, ITIL stands for Information Technology Infrastructure Library ...