Friday, July 31, 2020

RMAN COMMANDS IN ORACLE


RMAN COMMANDS IN ORACLE 
---------------------------------------------

rman target /
rman> show all
rman >backup database plus archivelog;
rman>shutdown immediate;
rman>startup force dba;
rman>shutdown immediate;
rman>startup mount;
rman>backup database;
rman>backup as copy database;
rman>alter database open;


RMAN> BACKUP DATABASE;
RMAN> BACKUP ARCHIVELOG ALL;
RMAN> BACKUP DATABASE PLUS ARCHIVELOG;

Note that the PLUS ARCHIVELOG clause performs the following:

Runs the ALTER SYSTEM ARCHIVE LOG CURRENT command
Runs the BACKUP ARCHIVELOG ALL command. If backup optimization is enabled only backs up logs that have not already been backed up.
Backs up files specified in the BACKUP command
Runs the ALTER SYSTEM ARCHIVE LOG CURRENT command
Backs up any remaining archived logs including those generated during the backup
A FORMAT can be specified for each subclause in the BACKUP DATABASE PLUS ARCHIVELOG command. For example:

RUN
{
  ALLOCATE CHANNEL chan01 TYPE DISK MAXPIECESIZE 10G;
  BACKUP
  FORMAT '/u03/app/oracle/PROD/%d_D_%T_%u_s%s_p%p'
  DATABASE
  PLUS ARCHIVELOG
  FORMAT '/u03/app/oracle/PROD/%d_A_%T_%u_s%s_p%p';
  RELEASE CHANNEL chan01;
}

Note that FORMAT clause precedes the DATABASE clause, but follows the PLUS ARCHIVELOG clause.

The BACKUP command can be extended to backup the current control file and the SPFILE.

For example:

RUN
{
  ALLOCATE CHANNEL chan01 TYPE DISK MAXPIECESIZE 10G;
  BACKUP
  FORMAT '/u03/app/oracle/PROD/%d_D_%T_%u_s%s_p%p'
  DATABASE
  CURRENT CONTROLFILE
  FORMAT '/u03/app/oracle/PROD/%d_C_%T_%u'
  SPFILE
  FORMAT '/u03/app/oracle/PROD/%d_S_%T_%u'
  PLUS ARCHIVELOG
  FORMAT '/u03/app/oracle/PROD/%d_A_%T_%u_s%s_p%p';
  RELEASE CHANNEL chan01;
}

RMAN> BACKUP CURRENT CONTROLFILE;

RMAN> BACKUP SPFILE;

RMAN> BACKUP DATAFILE '/u01/app/oradata/PROD/users01.dbf';

RMAN> BACKUP DATAFILE 4;

Controlfile backups
-------------------------
The current controlfile can be automatically backed up by the BACKUP command by configuring the CONTROLFILE AUTOBACKUP parameters

To backup the current controlfile explicitly use:

RMAN> BACKUP CURRENT CONTROLFILE;
SPFILE backups The SPFILE can be automatically backed up with the control file during database backups by configuring the CONTROLFILE AUTOBACKUP parameters

To backup up the SPFILE explicitly use:

RMAN> BACKUP SPFILE;
Datafile backups To backup a specific data file use BACKUP DATAFILE. For example:

RMAN> BACKUP DATAFILE '/u01/app/oradata/PROD/users01.dbf';
Altermatively specify the data file number. For example:

RMAN> BACKUP DATAFILE 4;
The data file number can be obtained from V$DATAFILE. For example:

SQL> SELECT file#, name FROM v$datafile;
Tablespace Backups
To backup a tablespace use the BACKUP TABLESPACE command. For example:

RMAN> BACKUP TABLESPACE USERS;
Compressed Backups
To compress the backup use:

RMAN> BACKUP AS COMPRESSED BACKUPSET DATABASE;
The resulting compressed backup is around 20%-30% of the size of the uncompressed equivalent.

Format clause
The format clause allows the backup files to be directed to a specific location.

For example:

BACKUP FORMAT '/u01/app/oracle/backup/%U' DATABASE;
The above statement created the following files in /u01/app/oracle/backup:

[oracle@vm3]$ ls -l /u01/app/oracle/backup
total 1161280
-rw-r----- 1 oracle oinstall 1178050560 Jul 31 06:31 15qeibgs_1_1
-rw-r----- 1 oracle oinstall    9928704 Jul 31 06:31 16qeibld_1_1

Other formats can be specified. For example:

BACKUP FORMAT '/backup2/PROD/PROD_df_%t_s%s_p%p' DATABASE;
In the above example %t is the backup set timestamp, %s is the backup set number and %p is the piece number within the backup set.

Tags:A backup tag can optionally be specified with the BACKUP command.

For example:

BACKUP DATABASE TAG = 'Full_Backup';
The tag is reported by the LIST command.

If a tag is not specified then a system-generated tag is assigned.

Incremental Backups
-------------------------------
By default backups are full (level 0). Backups can also be incremental (level 1).

Incremental backups can be:
-----------------------------------

Differential - includes all changes since the last full or incremental backup
Cumulative - includes all changes since the last full backup
Differential backups require less space. Cumulative backups are faster to restore

Differential backups are the default.

To run a diffential incremental backup use:

RMAN> BACKUP INCREMENTAL LEVEL 1 DATABASE;
To run a cumulative incremental backup use:

RMAN> BACKUP INCREMENTAL LEVEL 1 CUMULATIVE DATABASE;
Note that in order to take a level 1 backup, a level 0 backup must already exist.

A full backup using BACKUP DATABASE is not the same as a level 0 backup. - the LV column of the LIST BACKUP output is NULL after a full backup.

In order to take a level 0 backup use

RMAN> BACKUP INCREMENTAL LEVEL 0 DATABASE;
To create an image copy of an entire database use:

RMAN> BACKUP AS COPY DATABASE;
To create an image copy of a specific datafile use:

RMAN> BACKUP AS COPY DATAFILE <file#>
For example:

RMAN> BACKUP AS COPY DATAFILE 4 FORMAT '/u01/app/oracle/copy/users01.dbf';
Alternatively specify the source file name. For example:

RMAN> BACKUP AS COPY DATAFILE '/u01/app/oradata/PROD/users01.dbf'
FORMAT '/u01/app/oracle/copy/users01.dbf';
Recovery Area
To backup the recovery area use:

RMAN> BACKUP RECOVERY AREA TO DESTINATION '/u02/app/oracle';
Note that a destination must be specified if the recovery area is being backed up to disk.



Note : Info on Rman commands it may be differ in your environment like production,development,testing


THANK YOU FOR VIEWING MY BLOG FOR MORE UPDATES FOLLOW ME

OEM ORACLE MONITORING TOOL


 OEM ORACLE MONITORING TOOL
-------------------------------------------------


ORACLE ENTERPRISE MANAGER (OEM) ORACLE MONITORING TOOL
--------------------------------------------------------------------------------------------------

Introduction: 

 Oracle Enterprise Manager is a set of web based tools aims at managing software and hardware produced by oracle corporation as well as by non -oracle entitie  OEM is a system management tool which provides an integrated solution for managing your heterogenous environment,it combines a graphical console,agents,common services,and tools to  provide an integrated comprehensive systems management platform for managing oracle products.

           In traditional one  Oracle enterprsise manager in each databases one single enterprise manager in all the database,agent is the mediator for OEM and databases they will constantly monitor The database ,one single web URL which is used to login for entire monitoring environment all your targeted databases,they come with 12c cloud technology,12c OEM has a repository database will hold all the data for agent 


chaitanyaoracledba


1) Monitor other vendor databases also

2)Host monitoring

3)Generate all performance report from OEM itself like AWR at consolidate at one place

4)Schedule jobs

5)Monitoring Templates like any tablespace reach 90% thresh holdvalue set to 90% usage you will get the notify (Templates),you choose what the template you want apply to the target databases

6)Groups-->Target Groups :groups in 12c oem the entire group the entire job will be done in target groups like shutting down the database running queries

7) Monitor the RAC setup

8)Monitor the weblogic 

9)Monitor the fusionware

10)Monitor the other vendors

11)we can configure thresh holds critical medium in the oem itself

12)Mount point utilization 

13)we can take backup using the own scripts 

14)checking blocking session is easy in OEM (performance tuning)

15)all the reports can be generated in OEM like (AWR,ADDM,ASH)

16)Startup and shutdown also be done in OEM

17)OEM also checks the database growth

Let us Start the process
----------------------------

Prerequisites
--------------

Oracle Linux installed in the system

Database should be installed

we will install the Enterprise Manager on a linux platform

chaitanyaoracledba

chaitanyaoracledba



we will get the software from oracle website ---->Downloads---->Enterprsie Manager---->click on oracle enterprise manager downloads----> select on linux x86 64 bit

     

we can get the three zipped files like em12103_linux_disk1.zip,em12103_linux_disk2.zip,em12103_linux_disk2.zip

before starting  the install we need to make sure that there no database control configurataion 

chaitanyaoracledba


we need to set up that

we need to listener is to be started

after that emca -config dbcontrol db


chaitanyaoracledba




started em configuration assistant

chaitanyaoracledba


it will ask like  database sid-->prod

listener port number -->1521

Listener Oracle_Home /u01/app/oracle/product/12.1.0/db

Password for sysuser

Password for DBSNMP user 

Password for SYSMAN user

Email address for notifications

Outgoing mail SMTP server for notifications

You have to specified the following settings

After that emca configuration assistant completed it will get the  OEM url




chaitanyaoracledba


                                    login screen Menu screen



chaitanyaoracledba



 
chaitanyaoracledba



                                     Home Menu  screen 

chaitanyaoracledba

         
                                          Performance Menu screen


chaitanyaoracledba


                                              Availability Menu Screen 

chaitanyaoracledba


                                                       Server Menu Screen


chaitanyaoracledba

                                       Schema Menu Screen



chaitanyaoracledba


                                          Data movement Screen Menu


chaitanyaoracledba


                                          Software and Support Menu



Note : info on OEM it may be differ from your environment like production,testing,development 



THANK YOU FOR VIEWING MY BLOG FOR MORE UPDATES FOLLOW ME 






ORACLE DATABASE HEALTH CHECK SCRIPTS

 ORACLE DATABASE HEALTH CHECK SCRIPTS
-----------------------------------------------------------------


Check the Database Availability
--------------------------------

sqlplus '/as sysdba'

sql>startup

sql>select instance_name,status from v$instance;


check the database read or write mode
-----------------------------------------------

sql>select name,open_mode from v$database;


check the oracle process run or not
-----------------------------------
# ps -ef |grep pmon


Health check of database instance &Listener
------------------------------------------
open terminal in linux machine
# lsnrctl status<listener-name>
if not started
# lsnrctl start <listener-name>

Check Long running process unix process
---------------------------------------
#  ps -ef | grep java 


Check Monitor alert log file in oracle
--------------------------------------
Log will be created in directory below the value of diagnostic_dest_parameter
DIAGNOSTIC_DEST parameter DIAGNOSTIC_DEST/diag/rdbms/db_name/oracle_sid/trace
alert.logfile

trace file is created by the user process and it is written in  USER_DUMP_DEST
alert file is created by server process and it is written in BACKGROUND_DUMP_DEST

You can delete alertsid.log any time while database is running when any log entry occurs it will create automatically no need to startup or shutdown,
The alertlog file also reffered to as the alert.log is chronlogical log of messages and errors written in out by oracle database typically mesages found in the file is 
database startup,shutdown,log switches,space errors etc

Check Monitoring space availability
----------------------------------
my oracle work history

sql>select job_name,session_id,running_instance,elapsed_time,cpu_used from dba_scheduler_running_jobs

Check size of schema
--------------------
sql>select sum(bytes)/1024/1024/1024 as 'size in gb' from dba_segments where owner= 'UPPER';

Check Size of database
----------------------
sql>select round((sum(bytes)/1048576/1024),2) from v$ datafile;

Check Size of table in oracle
-----------------------------
sql>select sum(bytes) from user_segments where segments_type='TABLE';

Check to get size in mb
-------------------------
sql>select segment_name,segment_type,bytes/1024/1024 mb from dba_segments where segment= type='TABLE' and segment_name='emp';

Database, Datafile and Backup
------------------------------
sql>select name,open_mode,log_mode,database_role,force_logging,flashback_on from v$database;
sql>select * from v$recover_file;
sql>select distinct status,count() from v$datafile group by status;
sql>select name, RECOVER from v$datafile_header where RECOVER != 'NO';
sql>select name, ERROR from v$datafile_header where ERROR is NOT NULL;
sql>select name, ts# from v$datafile where upper(name) like '%MISSING%';
sql>select NAME, FILE# from v$datafile where status='RECOVER';
sql>select status,count() from v$backup group by status;



Check DBA Registry
--------------------
sql>set lines 150 pages 500
column COMP_NAME format a45
column version format a15
column status format a12
sql>select comp_name,version,status from dba_registry;



Check DBA Registry History
-----------------------
sql>set lines 150 pages 500
column action format a15
column namespace format a15
column comments format a20 wrap
column ACTION_TIME format a30
col BUNDLE_SERIES format a12
column version format a15
sql>select * from dba_registry_history;


Check Invalid Object
---------------------------

sql>col object_name format a50
col owner format a10
set lines 300
set pages 1000
sql>select object_name,object_type,owner,status from dba_objects where status = 'INVALID';



Queries to check Locks
-----------------------
sql>SELECT DECODE(request,0,'Holder: ','Waiter: ')||sid sess,
id1, id2, lmode, request, type FROM V$LOCK WHERE (id1, id2, type) IN (SELECT id1, id2, type FROM V$LOCK WHERE request>0) ORDER BY id1, request;



Check Library cache locks
--------------------------
sql>select  w1.sid waiting_session,h1.sid holding_session,
w.kgllktype lock_or_pin,
w.kgllkhdl address,
decode(h.kgllkmod, 0, 'None', 1, 'Null', 2, 'Share', 3, 'Exclusive',
'Unknown') mode_held,
decode(w.kgllkreq, 0, 'None', 1, 'Null', 2, 'Share', 3, 'Exclusive',
'Unknown') mode_requested
from dba_kgllock w, dba_kgllock h, v$session w1, v$session h1
where
(((h.kgllkmod != 0) and (h.kgllkmod != 1)
and ((h.kgllkreq = 0) or (h.kgllkreq = 1)))
and
(((w.kgllkmod = 0) or (w.kgllkmod= 1))
and ((w.kgllkreq != 0) and (w.kgllkreq != 1))))
and w.kgllktype = h.kgllktype
and w.kgllkhdl = h.kgllkhdl
and w.kgllkuse = w1.saddr
and h.kgllkuse = h1.saddr;


hcheck.sql – Script to Check for Known Problems in Oracle8i, Oracle9i, Oracle10g, Oracle 11g and Oracle 12c and Above
----------------------------------------------------------------------------------------------------------------------
A)$ sqlplus

sql> spool hcheck.log
sql> @hcheck
sql> spool off

For 12c with Multitenant, connect to each PDB to run the script. 
----------------------------------------------------------------

sql> show pdbs
CON_ID   CON_NAME     OPEN MODE      RESTRICTED
-------- ------------ -------------- -------------
2        PDB$SEED     READ ONLY      NO
3        CDB1_PDB1    READ WRITE     NO
4        CDB1_PDB2    READ WRITE     NO

sql> alter session set container=CDB1_PDB1;
Session altered.
sql> spool hcheck.log
sql> @hcheck
sql> spool off



Note: info on database health check it may be differ from your environment like production,testing ,development


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

Thursday, July 30, 2020

ADDM REPORT IN ORACLE FOR PERFORMANCE TUNING


ADDM REPORT IN ORACLE FOR PERFORMANCE TUNING
---------------------------------------------------------------------------------

Introduction
----------------

ADDM : Aotomatic Database Diagnostic Monitor is a self Diagnostic engine built in oracle database ,ADDM examines and analyze data captured in the AWR to determine possible performance problems

  In oracle database,ADDM uses database time statastics to identify performance problems,ADDM compares the difference between snapshots,by default AWR generates snapshots of performance data ,once every hour,alternatively you can modify the default values of both the interval between snapshots and their retention period,analyze your current database prformance when its hanging or  running slow using ADDM is a server based expert that reviews the database performance every 1 hr by default, its goal is to detect possible bottle necks early and recommended fixes before  system performance degrades noticably.


ADDM Analysis Include following
-------------------------------------------

Cpu load

Memory Usage

I/O Usage

Resources intensive sql

Rseources Intensive pl/sql ,java

RAC issues

Application Issues

Database configuration issues

Concurrency issues

Hardware Changes

Schema Changes

Application Changes

Using other advisors

Sql tuning advisor

Sql acecss advisor

Memory advisor----------> pga advisor----->buffer cache advisor,shared pool advisor,java pool advisor,streams pool advisor

Space advisor-----------> segmemt advisor,undo advisor

Backup -----------------> MTTR advisor


ADDM report can be generated from sql* plus using addmrpt.sql

$ ORACLE_HOME/rdbms/admin/

$ ls -ltr

$ ls -ltr | grep addmrpt*

$ sqlplus '/as sysdba'

connected to database


chaitanyaoracledba


sql>@?/rdbms/admin/addmrpt.sql

when run the script itshows the current instance like dbid  ,dbname ,instnum, instance . Instance in the workload repository schema  and host name also

we can query in sql also snapshots by using  sql query


chaitanyaoracledba


sql>select snap_id from dba_hist_snapshot;



specify the begin and end snapshot ids

chaitanyaoracledba


enter the value for begin_snap :8

begin snapshot id specified:8

             
chaitanyaoracledba

enter value for end_snap: 11

end snapshot id specified: 11

specify the report name : dccaddmrpt.html 

it will generate the report in dccaddmrpt.html format using winscp we can copy this file 


    
chaitanyaoracledba


chaitanyaoracledba


chaitanyaoracledba

chaitanyaoracledba

chaitanyaoracledba

chaitanyaoracledba

chaitanyaoracledba







Note : Info on ADDMRPT it may be differ from your environment like production, development and testing 




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


AWR REPORT PERFORMANCE TUNING

 AWR REPORT PERFORMANCE TUNING
-----------------------------------------------------

Introduction
---------------

 Automatic work load Repository report or AWR report collects,processes and maintain performance statistics for problem detection and self tuning process.This gathered data is stored both in memory and in the database,and is dispalyed in both reports and views. 

 AWR was introduced in oracle 10g  and it is still being used in present versions and AWR is comes with enterprise edition

 Performance Tuning in oracle database

 The AWR is a source for information and other oracle feature it includes

 Wait events for identity performance problems

 Time model statstics

 AWR is used to collect performance statastics

 Storing dataabase statastics performance tuning

 Active session history (ASH)

AWR Snapshots performance and dash board database load instanse status and top wait events( snapshot exactly tells the what happening in database in particular time)

AWR snapshot everthing will be recorded in snapshot id like we taking any RMAN backups,blockings,deadlock) for that snapshotid we can take exact time what happening

AWR Report will be genated database should be coninuos running . 

AWR Report comes with enterprsie addition (licencesing that diagnostics and performance)

AWR reports will be stored in sysaux tables when the time of installation.

every hour snapshot will taken


let us go the process
---------------------------------------------


                               whether my database is up and running 

chaitanyaoracledba


                       

$ ps - ef | grep pmon

let us connect with sql plus

$ sqlplus '/as sysdba'

check my database version

chaitanyaoracledba



sql>select * from v$ version;

sql >oracle database 12c enterprise edition release 12.1.0.2.0  64 bit production

 parameter statastics_level


chaitanyaoracledba


sql>show parameter control_management_pack_access;

value -->DIAGNOSTIC+TUNING



$ cd $ /ORACLE_HOME



chaitanyaoracledba


$ cd /data/oracle/app/oracle/product/12.1.0/db_home/rdbms/admin/

$ ls - ltr

$ ls - lrt | grep awrrpt *


chaitanyaoracledba


@ awrrpt.sql  lets run the sequel


 
chaitanyaoracledba

 it will shows the current instance---->DBID 22850381 DBNAME -->prod  instnum-->1

AWR report can be genated in the following formats like  html,txt


enter the value of report type : html

enter the value of num days    :2


                       
chaitanyaoracledba





chaitanyaoracledba


specify the begin snapshot  and end snapshot id

enter the value of begin snapshot id :135

enter the value  for end snaphot id :137

enter the value for report _name :dcc.html

exit

$ cd /data/oracle/app/oracle/product/12.1.0/db_home/rdbms/admin/


$ ls -ltr

dcc.html


sql>$ oracle_home/dbms/admin/awrrpt.sql



chaitanyaoracledba


we cannot see htmll file here in linux platform  so that we can go winscp toool copy that file to desktop you will see the dcc.html and open the report in windows platform


chaitanyaoracledba





chaitanyaoracledba


Note :  info on AWR report performance tuning it may be differ from your environment like production,testing,development directory structures



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

Wednesday, July 29, 2020

ORACLE RAC INTRODUCTION & RAC NODE SETUP


ORACLE RAC INTRODUCTION  & RAC NODE SETUP
----------------------------------------------------------------------


 Supports multiple instances in a clustered environment( upto 100 instances)

 Supports high availability and scalibility

 
To install Rac Two softwares needed
-------------------------------------

  Grid Infrastructure ($ GRID_HOME)  ---> Grid infrastucture bundles with both clusterware and ASM software with a separate home

                           /u01/app/12.1.0.1/grid/bin

                                       --->RDBMS Software(12cdb)(ORACLE_HOME)

                            /u01/app/12.1.0.1/rdbms/bin

                           part of grid software with the feature oracle restart  will manage the resources on start/stop 

                           grid to manage resorces (DB,LISTENER,SCAN) use to monitor and manage resources, clusterware software that provides interface  and services that enable and support a cluster

Oracle clusterware components:
-------------------------------------

   Two components in clusterware

    1. Voting disk : keep node membership inforamation when node joins or leaves is located on shared storage available for all nodes can be multiplexed upto 15 voting disks
             
                    # ./CRSCTL css votedisk
                 
         
    2. Oracle cluster Registry:OCR file resides on shared storage ,stores resources information that are database,listener,vip,scan,asm,instanaces can also be multiplexed upto 5 disks 
  
                    # ./OCRCHECK

Oracle Real Application Cluster
-------------------------------------

RAC start up sequnces
--------------------------

   1.lower stack ---->oracle high availability ---level0

                     will spawn ohasd-OHA-service daemon while we installed ,executed root.sh will add on entry in inittab to spawn ohasd service

                     # more/etc/inittab

                      following entry  /etc/init.d/init.ohasd run>/dev/null2 >&1</dev/null

   2.upper stack----->clusterware process ----> OHASD daemon then spawns additional clusterware process at each startup level

                      CRSD-->cluster ready services---->high availability operations in a cluster

                      OCSSD-->Cluster synchronization service--->manage node membership information when node joins or leaves

                      EVMD--->Event management service--->a bg process that publishes events that oracle clusterware creates

                      ONS---> Oracle Notifiation Service--> a publish and subscribe service for communicating fast application notification (FAN )events

                     OPROCD--->Oracle process monitor daemon--->periodically wakes up and checks that the interval since it last awake is with in the expected time if not oprocd resets the processor and restarts the node 

                            an oprocd failure results in oracle clusterware restarting the node

                         # ./crsctl check crs

                         # ./ crsctl check cssd

Rac Tools
------------
         
      CRSCTL--->root user --->cluster ready service control utility

      SRVCTL--->oracle user--->service control utility



RAC NODE SETUP
------------------------

Insatllation of SAN Software (we are using openfiler 64 bit san Software on vmware ,all the nodes create and access the centralized SAN storage ,we can download openfiler software 
from www.openfiler.com ,4 node set up cloning from 1 node to rest 4 nodes)



Node1
---------

1)Oracle linux installed operating system

2)Three Network Adapters

  public 

  private

  Asm 

  
3) vm configuration 

   4 gb ram

   processor 1
   
   hdd 100gb

4) adding kernel paameters

5)installing RPMS

6)asm libs

7)asm configure  fdisk ,label,scan,list

  oracle real application cluster 12c r1 grid installation(12cr1)


Node2
-----

# xhost +
# neat

 Network configuration   (we have taken from the node 1 cloning and network configuration and created delete old eth0.bkp,eth1.bkp.eth2.bkp  and configure to eth0,eth1,eth2 after that once deactivated and activate ethernetcard
 ----------------------
                       and DNS  search path  cluster.com   ,node2.cluster.com)
eth0   public ip
-----------------------

ip address     147.43.0.2
subnetmask  255.255.255.0


ip address     147.43.0.3
subnetmask  255.255.255.0



ip address     147.43.0.4
subnetmask  255.255.255.0

eth1  private ip
------------------

ip address    192.168.0.2
subnetmask  255.255.255.0


ip address    192.168.0.3
subnetmask  255.255.255.0



ip address    192.168.0.4
subnetmask  255.255.255.0


eth2 asm network
----------------

ip address   192.168.1.2
subnet mask  255.255.255.0

ip address   192.168.1.3
subnet mask  255.255.255.0


ip address   192.168.1.4
subnet mask  255.255.255.0


Node 1 : configure etc/hosts file  in vi editor and assign ip address of public ,private,asmip,vip,scanip and local host.localdomain
------

# cat etc/hosts

vi etc/hosts

      127.0.0.1                           localhost.localdomain                localhost

##  PUBLIC IP 

147.43.0.1                                  node1.cluster.com                    node1
147.43.0.2                                  node2.cluster.com                    node2
147.43.0.3                                  node3.cluster.com                    node3
147.43.0.4                                  node4.cluster.com                    node4

## PRIVATE IP
192.168.0.1                                 node1-pri.cluster                   node1-pri
192.168.0.2                                 node2-pri.cluster                   node2-pri
192.168.0.3                                 node3-pri.cluster                   node3-pri
192.168.0.4                                 node4-pri.cluster                   node4-pri

## ASM IP

192.168.1.1                                 node1-asm.cluster.com              node1-asm
192.168.1.2                                 node2-asm.cluster.com              node2-asm
192.168.1.3                                 node3-asm.cluster.com              node3-asm
192.168.1.4                                 node4-asm.cluster.com              node4-asm

##VIP

147.43.0.11                                 node1-vip.cluster.com            node1-vip 
147.43.0.12                                 node2-vip.cluster.com            node2-vip
147.43.0.13                                 node3-vip.cluster.com            node3-vip
147.43.0.14                                 node4-vip.cluster.com            node4-vip

## SCANIP 

147.43.0.51                                node-scan.cluster.com             node-scan
147.43.0.52                                node-scan.cluster.com             node-scan
147.43.0.53                                node-scan.cluster.com             node-scan

save and quit the file
  
copy the  /etc/hosts file to node 2,node3,node4 it will reflect all the nodes check wheter all the nodes are reflected or not and ll ip address are set or not using cat command
         

# scp /etc/hosts node2 : /etc/hosts


# cat etc/hosts

node1
------

To access san in gui web based administration throug node1

# firefox https://147.43.0.5:446/               (firefoz will open the san openfiler  and enter the username and password credintials

                     username : openfiler
                     pwd       :openfiler

 San information  :  san.cluster.com  (147.43.0.5)

 mount     type                  partition

/         ext3                   /dev/sd1
/var      ext3                   /dev/sd2
/tmp      ext3                   /dev/sd3
/usr      ext3                   /dev/sd5
/dev/sdm  tmpfs                  tmpfs

in san openfiler  menu  under systemtab

   Network interface configuration


interface     bootprotocol       ip address  network mask    speed  mtu link
eth0           static             147.43.0.5  255.255.255.0   100mbps


        Network access configuratioin

device  name            networkhost(publicip)     subnetmask               

node1.cluster.com        147.43.0.1        255.255.255.255

node2.cluster.com        147.43.0.2        255.255.255.255

node3.cluster.com        147.43.0.3        255.255.255.255

node4.cluster.com        147.43.0.4        255.255.255.255


adding all nodes in san network 

and after that click on -->volume tab  

create  a new volume group

     under block device management

/dev/sda   scsi  ata vmware virtual          12 gb --->creating san            6----> partion
/dev/sdb   scsi  vmware vmware virtual       60 gb                              0

click on dev/sdb  create a partion in dev/sdb

  click to create --->click on volume manager tab  --->volume group name--->volgroup -->/dev/sdb1  57.22 gb --->add volume group

click on services tab

          under ---->    manage services

 scsci   enabled --->start

click on  volume tab 

   create a volume in volgroup
             vol 1--->for rac 58560 -->file--> scsi

 Right click on Iscsi target
             |
             |-----------> add new Iscsi target

     click on LUN Mapping----->map the LUN   (logical unit number)

     click on null ---> click on Network & Acl

      node1.cluster.com 147.43.0.5-------> Allow
       node2.cluster.com 147.43.0.5------->Allow
      node3.cluster.com 147.43.0.5-------> Allow
      node4.cluster.com 147.43.0.5-------> Allow

    click on --->update

     log out SAN (openfiler)

Node1
------

# ISCSIADM -m discovery - t  st-p  147.43.0.5   (we have iscsi number should reflecton all nodes by using this command ,similarly command check  to all nodes node1,node2,node3,node4 to access the san)

Node1
-----

# service iscsi restart     (reset the iscsi services to all the access the partition)

Node1
----

# fdisk -l

/dev/sda1
/dev/sda2
/dev/sda3
/dev/sda4
/dev/sda5
/dev/sda6
/dev/sda7


disk /dev/sdb

# fdisk /dev/sdb

primary partion p
partition number 1
using defaultvalue 1
last cylinder orsize +40g
command for help  n
 primary partition - p
partition number -2
lastcylinder size  +20g
save  w                               (creating the partions over)

check all nodes to fdisk -l to reflect the partion 40g and 20 g

node1
-----
# partprobe/dev/sdb


node1
-----

creating the users & groups

# userdel -r oracle
# groupdel oinstall
#id
#gid=0(root) groups=0(root),1(bin),2(daemon),3(sys),4(adm),6(disk),10(wheel),101(pkcs11)
# groupdel dba

# groupadd -g 5001 Oinstall
# groupadd -g 5002  dba
# groupadd -g 5003  Oper
# groupadd -g 5004  asmdba
# groupadd -g 5005  asmadmin
# groupadd -g 5006  asmoper

# useradd -U 5007 -g Oinsatll -G asmadmin,asmdba,dba-d /u01/home -m grid
# chown  -R grid: Oinsatll/u01/home
# chmod -R  777 /u01/home

passwd grid

new passwd grid@123

all the users are groups should be craeted in all nodes node1,node2,node3,node4 and permissions to the users

copy all 6 ASM RPMS to all nodes

next step is the ASM RPMS to install all the RPMS to all the nodes copy all rpms to all nodes

node1
-------

# rpm -ivh oracleasmlib-2.0.4.1.el5_x86_64.rpm ..nodeps ..force 

# rpm -ivh oracleasmlib-2.0.4.1.el5_x86_64.rpm ..nodeps ..force 


# scp oracleasm* node2:/u01/home
# scp oracleasm* node3:/u01/home
# scp oracleasm* node4:/u01/home 

node2
-----

cd /uo1/home

ls

next step to configure the linux asm libraies

# oracleasm configure -h
# oracleasm -exec -path
# oracleasm -h
# oracleasm -v

# oracleasm configure -1
 default user driverinterface :grid
   deafult group to own the driver interface : Oinsatll
 start oracle asm library driver on boot : y
  scan for oracle asm disks on boot  : y
writting oracle asm library driver configuration : done

# oracleasm exit
# oarcleasm init
# oracleasm createdisk DATA/dev/sdb1
# oracleasm creatdisk  OCR_VD/dev/sdb2
# oracleasm listdisks

node2
-----

# oracleasm scandisks
# oracleasm configure -1

# oracleasm exit
# oracleasm init
# oracleasm listdisks
# oracleasm scandisks
# oracleasm listdisk

DATA
OCR_VD

same for node 3 and node4

node1
------
# mv /etc/ntp.conf/etc/ntp.conf_bkp
# service ntpd restart
# service ntpd restart
     failed

shuttingdown ntpd:

ssh setup connectivity passwordless connectivity in all nodes ssh setup is not establishement node1,node2,node3,node4 will not be get node information

node1
-----
# su -grid
# rm -rfv .ssh/

removed 'ssh/known-hosts*
removed directory '.ssh/*

ssh setup folder sshUserset.sh

# cd /mgt/hgfs/grid_12c/
 ls
# sshsetup
  ls
SShUsersetup.sh

#SShUsersetup.sh -hosts "node1" grid user    (ssh verification is completed for node1 who are allowed connected this command will used in all nodes)

# cd /u01/home
 cd .SSh/
ls
authorized_keys

$ vi authorized_keys

$ cd /mnt/hgfs/grid_12c
 ls
$ scp SShUsersetup.sh node2:/u01/home
$ scp SShUsersetup.sh node3:/u01/home
$ scp SShUsersetup.sh node4:/u01/home

copy all the sshusers setup 

node1
------

$ vi authorized_keys   (in authorized_keys open the file we found binary information and signature combine in this copied all the 4 nodes binary information and signature   like authorized_keys without password prompt we can connect to the any node these authorized_keys should be copied to all nodes like wise node2,node3 and node 4 we have to removethe authorized_keys and copy the fresh authorized_keys after that we have to connect with outpassword prompt  to all nodes authorized_keys look like this( ssh-rsa AAAAABBCl+fdvi6+n7yntps+=grid@node1.cluster.com) similar to node2,node3,node4)

$ scp authorized_keys node2:/u01.home/.ssh

node2
-----

$ rm -rfv authorized_keys

 removed authorized_keys

$ scp authorized_keys node3: /u01/home/.ssh


node3
-----

$ rm -rfv authorized_keys

 removed authorized_keys

$ scp authorized_keys node4: /u01/home/.ssh

grid@node1.ssh]ssh node4
grid@node4~] ssh node1

node1
------

cd/mnt/hgfs/grid_12c/
ls runCluvfy.sh        (in grid_12c folder runCluvfy.sh file is there performing pre checks for cluster services )

checking node reachability
checking node reachability check passed from node " node1"
checking user equivalence
user equivalency check passed to user grid
checking node conncectivity
checking multicast communication passed
checking asm lib configuration passed
package existence check
kernel parameters

node1
-----

xhost +

./runInstaller

skip software updates

install and configure oracle grid infrastructure for a cluster( 12c release1 oraclegrid infrastructure )

configure standard cluster

advanced installation

english

uncheck configure GNS

 cluster name: node-cluster
  scanname  :node-scan
 scanport :1521

public host name                   virtual host name 

node1.cluster.com                   node1-vip.cluster.com
node2.cluster.com                   node2-vip.cluster.com
node3.cluster.com                   node3-vip.cluster.com
node4.cluster.com                   node4-vip.cluster.com


ssh connectivity

os user : grid   os password : grid@123

click on -->next 

eth0   147.43.0.0       public
eth1   192.168.0.0      private
eth2   192.168.1.0      asm

click on--> next

configure grid infrastucture management repository

use standard asm for storage

use oracle flex asm for storage--click on this 

select disk group

disk group name  DATA

redundancy   -->external

candidate disk

 ORCLDATA---->click on this
 ORCLODB_VD

use same password

oraclebase   /u01/home/grid

software location : /u01/home/12.1.0/grid

inventory location : /u01/home/oraInventory

automatically run configuration scripts   ( run installer scripts will automatically run in 12c in all nodes)

use root use credintials --->select this

# /tmp/cvu_12.1.0.1.0_grid/runfixup.sh ( this script wil run all nodes)

grid infrasture is completed


node1
-----

# pwd
/root

vi grid.env

export GRID_HOME =/u01/home/12.1.0./grid
export PATH =$ gRID_HOME/bin: $PATh:

save and exit

# chown -r grid:oinstall grid.env
# chown -R grid: oinstall grid.env
#chmod - R 777 grid.env

now copygrid.env file to all nodes grid home loaction


# scp grid.env node2 :/u01/home/12.1.0/grid
# scp grid.env node3 :/u01/home/12.1.0/grid
# scp grid.env node4 :/u01/home/12.1.0/grid

# cp grid.env /u01/home/12.1.0/grid/

# su - grid

$ cd /u01/home/12.1.0/grid/

 ls
$ .grid.env

# crsctl check cluster -all
$ cd bin /
# crsctl check cluster -all

cluster ready service
cluster synchronization
event management


# crsctl stat res -t

grid@node1 bin]$ srvctl status asm
 asm is running on node 1,node2,node2

$ ps - ef | grep -i smon


node2
-----

su - grid

cd 12.1.0/grid
$.grid.env

$ ps - ef | grep - i  smon  

Insatlled SAN storage added two disks ISCI shared storage linux installed on

oarcle 12c database software installation in cluster environment 

node1
-----

# su - grid

$ cd /u01/home/12.1.0/grid

$ .grid.env

$ asmca

$ asmca   (by using this command runs the asm configuration assistant)

disk group name  size

DATA

click on create

disk group name  OCR

external

ORCLOCR_VD click on this 

disk group OCR created   ( high ---> 3copies normal ---> 2 copies extended---> no copies

DATA
OCR

node1
------

# useradd - U 5008 -g oinstall -G dba,asmdba,oracle

#chown -R oracle: oinstall/u01/home    (Repeat the same steps user creation permissions to this oracle in all nodes) 

# chmod -R 777 /u01/home/

# passwd oracle

install the oracle soft login as a oracle user

# su - oracle 

cd /mgt/hgfs/
ls
grid12c  grid 12c database

ls

./runInstaller     (launch oracle universal installer 12crelease 1)


skip software update

install database software only

oracle real application cluster database installation  by deafault local node is always selected

node 2
node 3
node 4
select all nodes

ssh connectivity 

os oracle user  pwd  ----
 password ssh set up  (establish ssh connectivity between the selected nodes)

click on next

 product language : english

enterprise edition

oracle base  /u01/home/oracle

software location  /u01/home/oracle/12.1.0/db_home_1

privileged operating system group

osdba ---> dba
osoper----> oper,dba

installing the 12cdatabase
 
node1
-----
$ login as a rootuser 
 /u01/home/oracle/12.1.0/db_home_1/rrot.sh  (login as a root user runInstaller will run the scriprt in all nodes manually)


node1
-----

vi rdbms.env

export ORACLE_HOME=/u01/home/oracle/12.1.0/dbhome_1
export PATH = $ORACLE_HOME/bin:$PATH:

cat rdbms.env

# chown oracle:oinstall rdbms.env
# chmod -R 777 rdbms.env

# scp rdbms.env node2:/u01/home/oracle/12.1.0/dbhome_1   

copy rdbms.env file to all nodes

# su - oracle

cd /u01/home/oracle/12.1.0/dbhome_1/
ls
# cp rdbms.env /u01/home/12.1.0/dbhome_1/

su - oracle
cd /u01/home/oracle/12.1.0/dbhome_1/

ls
 rdbms.env

$ dbca  database configuration assistant will assist the installation process 



Note : info on Rac node setup it may be different on your environment like production,testing,development, ipaddress,directory structures,




THANK YOU 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 ...