Tuesday, August 18, 2020

Oracle RAC File System

 Oracle RAC File System:


DB Instance status

. db_env

SQL> select inst_id,instance_number,status,instance_name from gv$instance;


gv$database - Db up and running.

SQL> select inst_id,name,open_mode from gv$database;


Using srvctl - tool - manage database resources


$srvctl status database -d prod


Finding instance status in RAC

$ srvctl status instance  -d prod -i prod1


How to start/stop/status - instance in RAC


$ srvctl stop instance -d prod -i prod2

$ srvctl status instance  -d prod -i prod1,prod2

$ srvctl start instance -d prod -i prod2


To shutdown database and all instances

$srvctl stop database -d prod -o immediate

$srvctl start database -d prod -o open

$ srvctl config database -d prod


RAC files:


In rac, using OMF concept (oracle managed files) . Oracle will assign


the file name and location to store in asm.


using parameter db_create_file_dest


sql>show parameter db_create_file_dest


db_create_file_dest                  string      +DATA


+DATA is the diskgroup associated with disks physically in ASM.

    setting this parameter, oracle will store files in diskgroup


default.


Creating tablespace :


sql>select file_name from dba_data_files;

sql>select tablespace_name from dba_tablespaces;

sql>create tablespace utbs datafile '/oradata/prod/ctbs01.dbf' size

100m autoextend on maxsize unlimited;


using diskgroups

sql>create tablespace ractbs;

sql>create tablespace ctbs datafile '+DATA' size 100m autoextend on maxsize unlimited;

sql>alter tablespace ctbs add datafile '+DATA' size 100m;

sql>alter tablespace ctbs add datafile '+DATA';


SQL> drop tablespace CTBS including contents and datafiles;

sql>show parameter db_create_file_dest

        +DATA


SQL> create tablespace ractbs;


sql>select


file_name,autoextensible,bytes/1024/1024,maxbytes/1024/1024 from


dba_data_files where tablespace_name like 'CTBS';


    default 100m , auto,max32gb


or else , we can explicity use the location with .dbf


sql>create tablespace mtbs datafile '+DATA/prod/datafile/catbs01.dbf'


size 100m;


Adding datafiles:


sql>alter tablespace ractbs add datafile '+DATA' size 100m autoextend


on maxsize unlimited;


with out

sql>alter tablespace ractbs add datafile


'+DATA/prod/datafile/ractbs03.dbf' size 100m;



For Undo Management :


purpose : to hold old images for read consistency


    Every instance has own undo tablespace

 

    rac1 - prod1 - undoractbs1

    rac2 - prod2 - undoractbs2

        define retention of every instance independently


        or using sid='*' applicable for all instances.


sql>select tablespace_name from dba_tablespaces where tablespacE_name like 'UNDO%';


Adding datafile for undo


sql>alter tablespace undotbs1 add datafile '+DATA' size 100m;

SQL> select tablespace_name from dba_tablespaces where tablespace_name like 'UNDO%';

or

sql>alter tablespace undoractbs1 add datafile;

or

sql>create undo tablespace undoractbs3;


Login to instance prod1, same in other instances.

sql>show parameter undo_tablespace

sql>show parameter undo_retention


Redo Management



using parameter db_create_online_log_dest_1=+DATA

        db_create_online_log_dest_2=+FRA


    set the destination of redo using OMF



 redo is associated with every instance with thread#

    thread# from gv$instance

Redo groups are created independently for every instance.

each Instance has default two redo groups


SQL> select thread#,instance_number,instance_name from gv$instance;


sql>select thread#,group#,bytes/1024/1024,members from gv$log


Maintain same number of group# and size of every instance logs.


SQL> column REDOLOG_FILE_NAME format a50;


SQL> set lines 1000

SQL> SELECT a.GROUP#, a.THREAD#, a.SEQUENCE#,

 a.ARCHIVED, a.STATUS, b.MEMBER AS REDOLOG_FILE_NAME,

 (a.BYTES/1024/1024) AS SIZE_MB FROM v$log a

JOIN v$logfile b ON a.Group#=b.Group#

ORDER BY a.GROUP#;


SQL> ALTER DATABASE ADD LOGFILE THREAD 1

GROUP 5 '+DATA' SIZE 100m,

GROUP 6 '+FRA' SIZE 100m;



SQL>

SQL> ALTER DATABASE ADD LOGFILE THREAD 2

GROUP 7 '+DATA' SIZE 100m,

GROUP 8 '+FRA' SIZE 100m;



5-8groups approc each instance. with 2gb each member


Enable Archivelogs - FRA diskgroup


Configure +FRA- by adding diskgroups using asmca or sql>


alter system set db_recovery_file_dest_size=5G scope=both sid='*';


alter system set db_recovery_file_dest='+DATA' scope=both sid='*';



bring down db and do the change in any one of the instance of a db.

$srvctl stop database -d prod

on rac1

sql>startup mount

or

$srvctl start instance -d prod -i prod1 -o mount

sql>alter database archivelog;

sql>alter database open;

$srvctl start instance -d prod -i prod2,prod3



RAC - DB files


using db_create_file_dest parameter will set the diskgroup

so can create tablespace / add datafile with out specifying the filename/location.


will auto allocate the file name with file number in diskgroup configured globally.

using OMF concept.(oracle managed files).


eg: +DATA

db_create_file_dest=+DATA

. db_env

sql>create tablespace rtbs;


asmcmd>ls


  a file number is associated with every asm file when added as per OMF.


Redo/Undo


Abt redo and undo are independent associated with that instance.


If rac1 - then using thread# - redo and undo are associated.

1       1,2     undoractbs1

   rac2 - then using thread#

2 3,4 undoractbs2

   rac3 - 3 5,6 undoractbs3


so add new 9 redo groups each instance with min 3 with size 1/2G


Unix level , can start/stop/status of instance/db using srvctl.



Note :Info on Oracle RAC Files it may be differ from your environment production,testing,development and naming conventions etc,Unix level , can start/stop/status of instance/db using srvctl.


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


ORA-01536: Space Quotas Exceeded for Table Space for a Particular User

 ORA-01536: Space Quotas Exceeded for Table Space for a Particular User


Problem


while creating the table or insert the data values into the table user is getting an error  ORA-01536 :space quota exceeded for tablesapce


sql> create table accountmaster tablespace smalltbs as select * from dba_objects;


create table accountmaster tablespace smalltbs as select * from dba_objects;

*

ERROR at line 1;

ORA-01536 : space quota exceeded for tablespace 'SMALLTBS'


Solution


Table space quota is the allocated in a particular user in tablespace, Once the particular user reaches the max allocated space it shows error like this


SQL>select tablespace_name,username,bytes/1024/1024,max_bytes/1024/1024 from dba_ts_quotas where username like 'CHAITANYA';


TABLESPACE_NAME       USER_NAME  BYTES/1024/1024   MAX_BYTES /1024/1024

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


SMALLTBS                         CHAITANYA               18                          25



Here CHAITANYA user can have maximum upto 25 MB space  of SMALLTBS tablespace but currently  it reaches used upto 18 MB



SQL> create table accountmaster tablespace smalltbs as select * from dba_objects;


create table accountmaster tablespace smalltbs as select * from dba_objects;

*

ERROR at line 1;

ORA-01536 : space quota exceeded for tablespace 'SMALLTBS'



Let us start the  process to start the fix it and increase the quota for that user 'CHAITANYA'


SQL> alter user CHAITANYA quota 100M on SMALLTBS;


user altered


SQL>select tablespace_name,username,bytes/1024/1024,max_bytes/1024/1024 from dba_ts_quotas where username like 'CHAITANYA';


TABLESPACE_NAME       USER_NAME  BYTES/1024/1024   MAX_BYTES /1024/1024

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


SMALLTBS                         CHAITANYA               18                         100


Now create the table and insert the table values into that particular user


SQL> create table accountmaster tablespace smalltbs as select * from dba_objects;


create table accountmaster tablespace smalltbs as select * from dba_objects;


table created sucessfully



SQL>select tablespace_name,username,bytes/1024/1024,max_bytes/1024/1024 from dba_ts_quotas where username like 'CHAITANYA';


TABLESPACE_NAME       USER_NAME  BYTES/1024/1024   MAX_BYTES /1024/1024

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


SMALLTBS                         CHAITANYA               30                        100




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




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 

Sunday, August 16, 2020

olsnodes command in oracle rac

 olsnodes command in oracle rac


Olsnodes,oifcfg,cluvfy,


Introduction


olsnodes command provides the list of nodes and other information of all the nodes particapating in the cluster.


crsctl tool

will verify health check of cluster services


from one node, can verify of all nodes.



#cd /u01/app/11.2.0/grid/bin

#./crsctl check cluster -all


crs

css

evm - upper stack

ohasd - lower stack -

Only specific node - service status of that particular node.


./crsctl check cluster


Note: On server boot, the cluster services get started on its own.

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

To stop the clusterware services


#./crsctl stop cluster -all ( includes all the nodes)

But make sure to stop lower stack manually of every node.

./crsctl stop crs (execute on every node)

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


To start .. the service if manually then


just start crs

both lower and upper get started.

./crsctl start crs

Monitor ./crsctl check cluster -all

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


 Verify Unix logs and clusterware logs.


For every service, we have a log in grid home.

Where does the clusterware logs locate?

cd $GRID_HOME/log  path


eg: /u01/app/11.2.0/grid/log/rac1

For node2

/u01/app/11.2.0/grid/log/rac2


Will find

folders

crsd

cssd

evmd


How to read the log file ?

# tail -100f crsd.log


also

# tail -1000f crsd.log | more




Using diagcollection script

diagcollection.pl


Steps: #

# ./diagcollection.pl --collect


once the zip files generated , will use winscp/ftp to pull in to desktop and then upload to metalink/support.


If oracle support needs , to collect diagnostic information from cluster logs to identify the issue. Will need to provide logs using diagcollection script





Diagnostic files - Retention policy - housekeeping

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

$GRID_HOME/log/rac1

crsd.log

cssd.log

ohasd.log

read by tail command


Retention Policy for these logs.


# Rotation / retention Policy

  10x10 rules as part of automatic rotation/retention policy

and governed automatically.


10 copies of cssd.log files with 50M retained and rotated

subsequently

ohasd,evmd,crsd etc logs also retain 10 copies with 10m size.


The policy doesnt applies to the alerthostname.log file.


If the file got removed , need to stop,start service.



Changing parameter file :

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

 Use sid to apply on nodes in a cluster.


sql>alter system set undo_retention=2600 scope=both sid='*';


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

About -

    Olsnodes,oifcfg,cluvfy



olsnodes


    On a cluster - to list active nodes

# cd /u01/app/11.2.0/grid/bin/

#./olsnodes


# ./olsnodes -i


# ./olsnodes -n

rac1    1

rac2    2

rac3    3


# ./olsnodes -s

rac1    Active

rac2    Active

rac3    Inactive

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


Oracle Interface Configuration Tool (OIFCFG)

        to adminstrate the network interfaces.


    # oifcfg iflist (For listing interfaces)


   

# ./oifcfg iflist

eth0  192.169.2.0

eth1  10.10.10.0


# ./oifcfg getif ( verify - list of public/private interfaces)

eth0  192.169.2.0  global  public

eth1  10.10.10.0  global  cluster_interconnect



#./oifcfg setif xxxxxx private


Verify - scan configuration

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

su - oracle

. grid_env

$ srvctl config scan



Cluster Verification Utility – Environment Integrity Check tool

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

Before installation , how to ensure the cluster integrity ...

    how we verify cluster configuration

        using cluvfy tool....

        comes with in grid software as well. in installed binaries.

   

    two Stages

    pre

    post - failed - no DNS Server - cluvfy failed.


    cd /u01/app/11.2.0/grid/bin

    ls –ltr cluvfy*

    cluvfy

   

    to be ran with oracle user *


    Verifying shared storage accessibility

   

    $cluvfy comp ssa -n all -verbose



    Cluster Verification Utility Connectivity Verifications    


    $cluvfy comp nodereach -n rac1,rac2,rac3 -verbose

    $cluvfy comp nodecon -n all -verbose


    Post - stage

    cluvfy stage -post crsinst -n rac1,rac2 -verbose


    Cluster integrity

     ./cluvfy comp clu




Crsctl to manage grid services

srvctl to manage/monitor resources - db,listener,scan,vip.


Check the Status of the RAC

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

$ srvctl config database -d prod

$ srvctl status database -d prod


SQL> SELECT inst_id,inst_name FROM v$active_instances;


Verify instances status using views in grid.

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

SQL> select inst_id,instance_name,status,thread# from gv$instance;


$srvctl status instance -d prod -i prod1,prod2

$srvctl status instance -d prod -n rac1



Note : Info on olsnodes it may be differ from your environment prod,dev,test,naming conventions and directories etc


THANKS FOR VIEWING MY BLOG FOR MORE UPDATES FOLLOW ME




Oracle oratab file

 Oracle oratab file

Introduction

oratab:


oratab file is created by the root.sh script during oracle database installation ,and it is updated by the database configuration assistant DBCA when creating or deleting  a database ,the oratab file entry is also created automatically by the database agent 


When does oratab file created?

What are the contents of oratab file?

how to read oratab file?

How do we verify number of databases on server? (from oratab file)

How to locate the binaries installed on a server for a database?



oratab file get created when root.sh script executed while install.

Will read using more command

eg: $more /etc/oratab


The contents are

SID:$ORACLE_HOME:Y/N


Note: SID - database name, System identifier

The path of oracle binaries located using ORACLE_HOME parameter


eg: /u01/app/oracle/product/12.1.0/dbhome_1


Can have multiple homes for multiple database , can find from oratab.


prod:/u01/app/oracle/product/12.1.0/dbhome_1:Y

dev:/u01/app/oracle/product/11.2.0/dbhome_1:N


Here N/Y represents, to start on server boot..

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

Y - Yes , to start

N - No, Will not start on boot.


To login to a database , verify the SID value from ORACLE_SID using echo command.

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

$echo $ORACLE_SID

If the value is prod

the database connected to prod


IF its dev

the db is dev

If not dev,then how to connect/set


using export command can set the environment variable...to login to aparticular db.

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

$export ORACLE_SID=dev

then verify

$echo $ORACLE_SID


Which location to verify , the db installed ?

using variable ORACLE_HOME

how to verify ?

$echo $ORACLE_HOME


Conclusion:


Number of databases on a server

.bash_profile

root scripts while install

Binaries path

/etc/oratab

export - to set environment variable

echo - to verify the variable

$ORACLE_SID

$ORACLE_HOME


THANKS FOR VIEWING MY BLOG FOR MORE UPDATES FOLLOW ME

Oracle Database Post Installation Root scripts

 

Oracle Database Post Installation Root scripts 


Introduction:


 when we install oracle Database standalone and RAC environment part of post installtion steps we execute two Root scripts oracle also suggest to backup the 'orainstroot.sh' and 'root.sh',these two scripts are executed as a root user in linux and it displays after the,oracle software installation complete 


Two scripts root.sh,orainstroot.sh


What is oratab file?

What are the contents of oratab file?

When the oratab file got created?


While installation, will execute two root scripts.

1. orainstroot.sh

will remove the permissions on inventory files from world(public).

Will change permissions to oinstall OS group.


 Importance of orainstroot.sh


 The first script that we run is  "orainstroot.sh" which is located in 


$ORACLE_BASE/oraInventory(/u01/app/oracle/orainventory)path we execute "orainstroot.sh " script for following purpose


 1)it creates the inventory pointer file(/etc/oraInst.loc) this file shows the inventory location and group is linked to 


 2)it changes the groupname of the oraInventory directory to oinstall group


 

2. root.sh

will create oratab file while installation using root script.


/etc/oratab

will read using

$more /etc/oratab


The contents are oratab file are the database entries.


Importance of root.sh


The second script that we run is "root.sh"  script which is located  in $ORACLE_HOME(/u01/app/oracle/product/11.2.0/db_1)path  we execute "root.sh" for the following purpose


1)it will creates /etc/oratab file.This is the file which we use to make automatic database shutdown and startup it is very important file


2)it sets the Oracle base and Home environments


3)it sets an appropriate permission to the OCR base directory


4) creates the OCR backup and network socket directories


5)modifies the ownership to "root" user on the Oracle base and Cluster home file systems


6)it configures the OCR and Voting disk (only on the first node )


7)starts the Clusterware daemons


8)it adds Clusterware daemons to the inittab file


9)It verifies the whether the Clusterware is up on all nodes


10)it verifies the super user priveliges


First Field | Second | third

ORACLE_SID : ORACLE_HOME : Y/N

prod : /u01/app/oracle/product/12.1.0/dbhome_1 : Y


Here ORACLE_SID is the db name

Y/N - represents - to start the db on server boot.



eg:

prod : /u01/app/oracle/product/12.1.0/dbhome_1 : Y

dev : /u01/app/oracle/product/11.1.0/dbhome_1 : N


In this case, How many databases are there?

Two Databases - prod,dev


Which will get start on boot ? prod

will not ?  dev



how many products are there on server?

12c

11g


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

How do we login to database?



Using tool sqlplus with sys user as sys admin with sysdba role


eg:

su - oracle ( using - will read bash_profile to locate the binary files)

$sqlplus '/as sysdba'


Here / represents sys user

or

$sqlplus sys/sys123 as sysdba

or

$sqlplus sys as sysdba

Paswd : sys123


SQL> select name,open_mode from v$database;



sql> is database prompt

# is root unix prompt




What is .bash_profile ?


is a hidden file for every unix user with dot as prefix.

To list the hidden file using

#ls -ltra


If its root user - /

If its for oracle user :- /home/oracle


Will configure variables to locate the binaries installed


eg:

ORACLE_HOME=/u01/app/oracle/product/12.1.0/dbhome_1

ORACLE_SID=prod

Here the default database was set to prod to login.



Will execute the .bash_profile to set the environment variables for that session.


Can also use manually with export command

eg:

$export ORACLE_SID=dev

Now can verify using echo

$echo $ORACLE_SID



Note : Info on Post Installation root scripts it may be differ from your environment like prod,dev,test,and naming conventions ,directories etc


THANKS FOR VIEWING MY BLOG FOR MORE UPDATES FOLLOW ME



ITIL Process

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