Advertisement

Monday, January 28, 2019

Linux: OSWatcher

OSWatcher is one of the best utilities provided by Oracle (Free of cost) and runs on almost all Operating Systems (Unix based only)


To Install OSW

Step 1. Download OSWatcher (Doc ID 301137.1)

Step 2. Untar 
# Change version as per latest available. 

$ tar -xf /tmp/oswbb812.tar

Step 3.  Start OSW

$ cd /root/osw/oswbb
$ ./startOSWbb.sh 60 10 gzip


Step 4. Stop OSW
$ cd /root/osw/oswbb
$ ./stopOSWbb.sh 


Other Details
1. CMD OPTIONS

  • First variable is the interval in seconds between 2 samples
  • Second Variable is total hours for which data is kept
  • Third Variable is the utility to zip to compress the files generated (acceps zip,gzip, None)
  • Fourth Variable is the path (optional) where to put the filess, when left blank it is the archive directory where the files are generated and kept. 
  • Fourth variable cannot be provided without 3rd 
I personally recommend 60 seconds interval with 30 days of data kept on the system for you to analyze.

2. Scheduling
To Schedule you can just schedule (cron) the OSWatcher to run every 10 minutes or so.
The key thing is OSWatcher does not starts if an instance of it is running. This makes it by default highly available, or if you want to be advanced you can create it as a service with help of sysadmin team or yourself.


Latest Downloads and Other OSWatcher related information available at - 

OSWatcher (Includes: [Video]) (Doc ID 301137.1)

Wednesday, January 23, 2019

RSS Feeds

You can use below URL's to enable RSS Feeds for my blog.


Atom 1.0 : 
http://o-dba.blogspot.com/feeds/posts/default
https://o-dba.blogspot.com/feeds/posts/default

RSS 2.0: 
http://o-dba.blogspot.com/feeds/posts/default?alt=rss

https://o-dba.blogspot.com/feeds/posts/default?alt=rss


If you wish to know how to subscribe to RSS Feeds - one of the examples is below

Thursday, January 17, 2019

Oracle Database - (Scripts) Log Switches per Hour (by Instance)

This blog talks about Log Switches Script

It will list the count of logswitches done every hour by the instances (Standalone or RAC)

Standalone 
select to_date(to_char(first_time,'DD-MON-YY HH24'),'DD-MON-YY HH24'),count(*)
from v$log_history
group by to_date(to_char(first_time,'DD-MON-YY HH24'),'DD-MON-YY HH24')
order by 1
/

RAC
select inst_id, to_date(to_char(first_time,'DD-MON-YY HH24'),'DD-MON-YY HH24'),count(*)
from gv$log_history
group by to_date(to_char(first_time,'DD-MON-YY HH24'),'DD-MON-YY HH24'), inst_id
order by 2,1
/



select inst_id, to_date(to_char(first_time,'DD-MON-YY HH24'),'DD-MON-YY HH24'),count(*)
from gv$log_history
group by to_date(to_char(first_time,'DD-MON-YY HH24'),'DD-MON-YY HH24'), inst_id
order by 1,2
/  2    3    4    5

   INST_ID TO_DATE(TO_CHAR(FI   COUNT(*)
---------- ------------------ ----------
         1 03-JUL-18 11:00:00         19
         1 03-JUL-18 12:00:00         40
         1 03-JUL-18 13:00:00         39
         1 03-JUL-18 14:00:00         39
         1 03-JUL-18 15:00:00         45

         1 03-JUL-18 16:00:00         40



Oracle Database - Scripts - SID to PID and PID to SID

In this blog I am going to cover a simple script which converts the SID  you mentioned to OS PID . 

SID to PID
set lines 500 pages 500
column sid format 99999
column spid format 99999
column program format a30
column osuser format a30

select a.sid,b.spid,a.username,a.osuser
from v$session a,
v$process b
where a.paddr = b.addr
and a.sid = &SID
order by b.spid;

When Prompted Enter SID


  1  select a.sid,b.spid,a.username,a.osuser
  2  from v$session a,
  3  v$process b
  4  where a.paddr = b.addr
  5  and a.sid = &SID
  6* order by b.spid
Enter value for sid: 31
old   5: and a.sid = &SID
new   5: and a.sid = 31

   SID SPID                     USERNAME                                           OSUSER
------ ------------------------ -------------------------------------------------- ------------------------------

    31 9936                     AS                                                 iisuser



PID to SID

set lines 500 pages 500
column sid format 99999
column spid format 99999
column program format a30
column osuser format a30

select a.sid,b.spid,a.username,a.osuser
from v$session a,
v$process b
where a.paddr = b.addr
and b.spid = &PID
order by b.spid;

When Prompted Enter PID

  1  select a.sid,b.spid,a.username,a.osuser
  2  from v$session a,
  3  v$process b
  4  where a.paddr = b.addr
  5  and b.spid = &PID
  6* order by b.spid
Enter value for pid: 9936
old   5: and b.spid = &PID
new   5: and b.spid = 9936

   SID SPID                     USERNAME                                           OSUSER
------ ------------------------ -------------------------------------------------- ------------------------------

    31 9936                     AS                                                 iisuser



To List all SIDs with their PIDs
set lines 500 pages 500
column sid format 99999
column spid format 99999
column program format a30
column osuser format a30

select a.sid,b.spid,a.username,a.osuser
from v$session a,
v$process b
where a.paddr = b.addr

order by b.spid




Wednesday, January 16, 2019

Oracle Database - 18c - RAC (DB) 18c Patching (Apply OJVM 18.4.0.0.0)

This blog is now in continuation with my previous blog of Patching DB to 18.4.0.0.0

The requirements for this patch are that RU 18.4.0.0.0 should be present on DB
and OPatch must be 12.2.0.1.7


Patch 28502229 - Oracle JavaVM Component Release Update 18.4.0.0.0

Step 1  - Patch Pre-req and Installation[As oracle - On All Nodes Rolling Mode]
(All sub-steps are to be executed on all nodes in the given order)


# cd /tmp
# mv p28502229_180000_Linux-x86-64.zip /tmp/install/
# cd /tmp/install/
# unzip -qq p28502229_180000_Linux-x86-64.zip

# cd /tmp/install/28502229


Pre-req check
# export ORACLE_HOME=/u01/app/oracle/product/180/db/
# export PATH=$ORACLE_HOME/bin:$ORACLE_HOME/OPatch:$PATH

# opatch prereq CheckConflictAgainstOHWithDetail -ph ./


Stop Home on the Node
(Fill the Oracle Home and Node Name Information)
# srvctl stop home -oraclehome /u01/app/oracle/product/180/db -statefile /tmp/state.out -node rac18c01 -stopoption IMMEDIATE


Patch the DB
# opatch apply 


Start Home on the Node
(Fill the Oracle Home and Node Name Information and the name of statefile previously used )

# srvctl start home -oraclehome /u01/app/oracle/product/180/db -statefile /tmp/state.out -node rac18c01 



Step 2 - Patch Post Installation (Steps can be done on any Node - and should be done only one node)
On Step 2 - the Downtime starts for the DB 
Below Steps are only for Standalone DB (i.e. non CDB) 
# sqlplus /nolog
    connect / as sysdba
    alter system set cluster_database=false scope=spfile;

$ORACLE_HOME/bin/srvctl stop database -database orpl -stopoption IMMEDIATE
sqlplus /nolog
    connect / as sysdba
    startup upgrade 

# cd $ORACLE_HOME/OPatch
# ./datapatch -verbose
SQL Patching tool version 18.0.0.0.0 Production on Wed Jan 16 03:01:35 2019
Copyright (c) 2012, 2018, Oracle.  All rights reserved.

Log file for this invocation: /u01/app/oracle/cfgtoollogs/sqlpatch/sqlpatch_75734_2019_01_16_03_01_35/sqlpatch_invocation.log

Connecting to database...OK
Gathering database info...done
Bootstrapping registry and package to current versions...done
Determining current state...done

Current state of interim SQL patches:
Interim patch 27923415 (OJVM RELEASE UPDATE: 18.3.0.0.180717 (27923415)):
  Binary registry: Not installed
  SQL registry: Applied successfully on 03-SEP-18 11.53.04.325168 PM
Interim patch 28502229 (OJVM RELEASE UPDATE: 18.4.0.0.181016 (28502229)):
  Binary registry: Installed
  SQL registry: Not installed

Current state of release update SQL patches:
  Binary registry:
    18.4.0.0.0 Release_Update 1809251743: Installed
  SQL registry:
    Applied 18.4.0.0.0 Release_Update 1809251743 successfully on 16-JAN-19 01.46.15.700202 AM

Adding patches to installation queue and performing prereq checks...done
Installation queue:
  The following interim patches will be rolled back:
    27923415 (OJVM RELEASE UPDATE: 18.3.0.0.180717 (27923415))
  No release update patches need to be installed
  The following interim patches will be applied:
    28502229 (OJVM RELEASE UPDATE: 18.4.0.0.181016 (28502229))

Installing patches...
Patch installation complete.  Total patches installed: 2

Validating logfiles...done
Patch 27923415 rollback: SUCCESS
  logfile: /u01/app/oracle/cfgtoollogs/sqlpatch/27923415/22239273/27923415_rollback_ORPL_2019Jan16_03_01_49.log (no errors)
Patch 28502229 apply: SUCCESS
  logfile: /u01/app/oracle/cfgtoollogs/sqlpatch/28502229/22435400/28502229_apply_ORPL_2019Jan16_03_01_52.log (no errors)

SQL Patching tool complete on Wed Jan 16 03:01:52 2019





Start DB Again
# sqlplus /nolog
    connect / as sysdba
    alter system set cluster_database=true scope=spfile;
    shutdown ;
# $ORACLE_HOME/bin/srvctl start database -d orpl



Recompile DB Objects
sqlplus /nolog
    connect / as sysdba
    @?/rdbms/admin/utlrp.sql



Patch Validation

# opatch lspatches

28502229;OJVM RELEASE UPDATE: 18.4.0.0.181016 (28502229)



Oracle Database - 18c - RAC (DB) 18c Patching (Apply RU 18.4.0.0.0)

This is in continuation with my previous blog on patching of RAC - GI and in this blog we will patch RAC - DB.



[As oracle on All nodes]
# cd /u01/app/oracle/product/180/db
# mv OPatch OPatch.20190116
# unzip -qq /tmp/p6880880_122010_Linux-x86-64.zip
# chown -R oracle:oinstall OPatch


Verify OPatch version

/u01/app/oracle/product/180/db/OPatch/opatch version
OPatch Version: 12.2.0.1.14 

[As root - on all nodes (rolling)]
Patch the Database

# export ORACLE_HOME=/u01/app/oracle/product/180/db/
# export PATH=$ORACLE_HOME/bin:$ORACLE_HOME/OPatch:$PATH
# opatchauto apply /tmp/install/28659165 -oh /u01/app/oracle/product/180/db/

Node 1 - Logs
[root@rac18c01 ~]# opatchauto apply /tmp/install/28659165 -oh /u01/app/oracle/product/180/db/

OPatchauto session is initiated at Wed Jan 16 01:29:23 2019

System initialization log file is /u01/app/oracle/product/180/db/cfgtoollogs/opatchautodb/systemconfig2019-01-16_01-29-26AM.log.


Session log file is /u01/app/oracle/product/180/db/cfgtoollogs/opatchauto/opatchauto2019-01-16_01-30-17AM.log
The id for this session is GVQH

Executing OPatch prereq operations to verify patch applicability on home /u01/app/oracle/product/180/db
Patch applicability verified successfully on home /u01/app/oracle/product/180/db


Verifying SQL patch applicability on home /u01/app/oracle/product/180/db
SQL patch applicability verified successfully on home /u01/app/oracle/product/180/db


Preparing to bring down database service on home /u01/app/oracle/product/180/db
Successfully prepared home /u01/app/oracle/product/180/db to bring down database service


Bringing down database service on home /u01/app/oracle/product/180/db
Following database(s) and/or service(s) are stopped and will be restarted later during the session: orpl
Database service successfully brought down on home /u01/app/oracle/product/180/db


Performing prepatch operation on home /u01/app/oracle/product/180/db
Perpatch operation completed successfully on home /u01/app/oracle/product/180/db


Start applying binary patch on home /u01/app/oracle/product/180/db
Binary patch applied successfully on home /u01/app/oracle/product/180/db


Performing postpatch operation on home /u01/app/oracle/product/180/db
Postpatch operation completed successfully on home /u01/app/oracle/product/180/db


Starting database service on home /u01/app/oracle/product/180/db
Database service successfully started on home /u01/app/oracle/product/180/db


Preparing home /u01/app/oracle/product/180/db after database service restarted
No step execution required.........


Trying to apply SQL patch on home /u01/app/oracle/product/180/db
SQL patch applied successfully on home /u01/app/oracle/product/180/db

OPatchAuto successful.

--------------------------------Summary--------------------------------

Patching is completed successfully. Please find the summary as follows:

Host:rac18c01
RAC Home:/u01/app/oracle/product/180/db
Version:18.0.0.0.0
Summary:

==Following patches were SKIPPED:

Patch: /tmp/install/28659165/28655916
Reason: This patch is not applicable to this specified target type - "rac_database"

Patch: /tmp/install/28659165/28655963
Reason: This patch is not applicable to this specified target type - "rac_database"

Patch: /tmp/install/28659165/28547619
Reason: This patch is not applicable to this specified target type - "rac_database"


==Following patches were SUCCESSFULLY applied:

Patch: /tmp/install/28659165/28655784
Log: /u01/app/oracle/product/180/db/cfgtoollogs/opatchauto/core/opatch/opatch2019-01-16_01-31-29AM_1.log

Patch: /tmp/install/28659165/28656071
Log: /u01/app/oracle/product/180/db/cfgtoollogs/opatchauto/core/opatch/opatch2019-01-16_01-31-29AM_1.log



OPatchauto session completed at Wed Jan 16 01:35:43 2019
Time taken to complete the session 6 minutes, 21 seconds



Node 2 - Logs
[root@rac18c02 ~]# opatchauto apply /tmp/install/28659165 -oh /u01/app/oracle/product/180/db/

OPatchauto session is initiated at Wed Jan 16 01:39:13 2019

System initialization log file is /u01/app/oracle/product/180/db/cfgtoollogs/opatchautodb/systemconfig2019-01-16_01-39-15AM.log.

Following home(s) will not be included as part of current opatchauto session as it's software only RAC home:
Home path:/u01/app/oracle/product/180/db, Host:rac18c03


Session log file is /u01/app/oracle/product/180/db/cfgtoollogs/opatchauto/opatchauto2019-01-16_01-39-47AM.log
The id for this session is AMR5

Executing OPatch prereq operations to verify patch applicability on home /u01/app/oracle/product/180/db
Patch applicability verified successfully on home /u01/app/oracle/product/180/db


Verifying SQL patch applicability on home /u01/app/oracle/product/180/db
SQL patch applicability verified successfully on home /u01/app/oracle/product/180/db


Preparing to bring down database service on home /u01/app/oracle/product/180/db
Successfully prepared home /u01/app/oracle/product/180/db to bring down database service


Bringing down database service on home /u01/app/oracle/product/180/db
Following database(s) and/or service(s) are stopped and will be restarted later during the session: orpl
Database service successfully brought down on home /u01/app/oracle/product/180/db


Performing prepatch operation on home /u01/app/oracle/product/180/db
Perpatch operation completed successfully on home /u01/app/oracle/product/180/db


Start applying binary patch on home /u01/app/oracle/product/180/db
Binary patch applied successfully on home /u01/app/oracle/product/180/db


Performing postpatch operation on home /u01/app/oracle/product/180/db
Postpatch operation completed successfully on home /u01/app/oracle/product/180/db


Starting database service on home /u01/app/oracle/product/180/db
Database service successfully started on home /u01/app/oracle/product/180/db


Preparing home /u01/app/oracle/product/180/db after database service restarted
No step execution required.........


Trying to apply SQL patch on home /u01/app/oracle/product/180/db
SQL patch applied successfully on home /u01/app/oracle/product/180/db

OPatchAuto successful.

--------------------------------Summary--------------------------------

Patching is completed successfully. Please find the summary as follows:

Host:rac18c02
RAC Home:/u01/app/oracle/product/180/db
Version:18.0.0.0.0
Summary:

==Following patches were SKIPPED:

Patch: /tmp/install/28659165/28655916
Reason: This patch is not applicable to this specified target type - "rac_database"

Patch: /tmp/install/28659165/28655963
Reason: This patch is not applicable to this specified target type - "rac_database"

Patch: /tmp/install/28659165/28547619
Reason: This patch is not applicable to this specified target type - "rac_database"


==Following patches were SUCCESSFULLY applied:

Patch: /tmp/install/28659165/28655784
Log: /u01/app/oracle/product/180/db/cfgtoollogs/opatchauto/core/opatch/opatch2019-01-16_01-41-37AM_1.log

Patch: /tmp/install/28659165/28656071
Log: /u01/app/oracle/product/180/db/cfgtoollogs/opatchauto/core/opatch/opatch2019-01-16_01-41-37AM_1.log



OPatchauto session completed at Wed Jan 16 01:46:15 2019
Time taken to complete the session 7 minutes, 3 seconds





Verify the Patching 
/u01/app/oracle/product/180/db/OPatch/opatch lspatches
28656071;OCW RELEASE UPDATE 18.4.0.0.0 (28656071)
28655784;Database Release Update : 18.4.0.0.181016 (28655784)
27908644;UPDATE 18.3 DATABASE CLIENT JDK IN ORACLE HOME TO JDK8U171

Tuesday, January 15, 2019

Oracle Database - 18c - RAC (GI) 18c Patching (Apply RU 18.4.0.0.0)

In this blog I am going to cover Patching of Oracle RAC 18c (fresh installation)


Download Patches 
1. Patch 6880880: OPatch 12.2.0.1.14 for DB 12.2 releases (JUL 2018) (or higher)
2. Patch 28659165: GI RELEASE UPDATE 18.4.0.0.0


Step 1 - [As grid] - Unzip Opatch (on both nodes)

[As root]
# cd /u01/app/180/grid/
# mv OPatch OPatch.20190115

[As grid]
# unzip -qq /tmp/p6880880_122010_Linux-x86-64.zip
# chown -R grid:oinstall OPatch

[As grid]
Verify OPatch version
# /u01/app/180/grid/OPatch/opatch version
OPatch Version: 12.2.0.1.14


2. Step 2 [As Grid - on Both Nodes ]
# mkdir /tmp/install
# chmod 777 /tmp/install
# mv p28659165_180000_Linux-x86-64.zip /tmp/install 
# cd /tmp/install

# unzip -qq p28659165_180000_Linux-x86-64.zip
# chmod -R 777 28659165
# cd 28659165/

# export ORACLE_HOME=/u01/app/180/grid
# export PATH=$ORACLE_HOME/bin:$ORACLE_HOME/OPatch:$PATH


3. Step 3 [As Grid - On All Nodes]
Run - Pre-req check to ensure all is fine. 


# $ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail  -phBaseDir /tmp/install/28659165/28655784
# $ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir /tmp/install/28659165/28656071
# $ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir /tmp/install/28659165/28655916

[As oracle - on all Nodes]
# export ORACLE_HOME=/u01/app/oracle/product/180/db/
# export PATH=$ORACLE_HOME/bin:$ORACLE_HOME/OPatch:$PATH
# $ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir /tmp/install/28659165/28655784

# $ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir /tmp/install/28659165/28656071

4. Step 4 [As Grid - On All Nodes] 
Run System Space Check and ensure they pass on all nodes for both users
Create File 


# cat  /tmp/patch_list_gihome.txt
/tmp/install/28659165/28655784
/tmp/install/28659165/28656071
/tmp/install/28659165/28655916

# export ORACLE_HOME=/u01/app/180/grid

# export PATH=$ORACLE_HOME/bin:$ORACLE_HOME/OPatch:$PATH
# $ORACLE_HOME/OPatch/opatch prereq CheckSystemSpace -phBaseFile /tmp/patch_list_gihome.txt

[As oracle - on All nodes]
Create File 

<
# cat /tmp/patch_list_dbhome.txt
/tmp/install/28659165/28655784
/tmp/install/28659165/28656071

# export ORACLE_HOME=/u01/app/oracle/product/180/db/
# export PATH=$ORACLE_HOME/bin:$ORACLE_HOME/OPatch:$PATH
# $ORACLE_HOME/OPatch/opatch prereq CheckSystemSpace -phBaseFile /tmp/patch_list_dbhome.txt

5. Step [As root - On All Nodes Rolling (Node 1 and then Node 2 and 3..4..5)]
Patch the Grid Home
# export ORACLE_HOME=/u01/app/180/grid
# export PATH=$ORACLE_HOME/bin:$ORACLE_HOME/OPatch:$PATH
# opatchauto apply /tmp/install/28659165 -oh /u01/app/180/grid


Node 1

[root@rac18c01 ~]# opatchauto apply /tmp/install/28659165 -oh /u01/app/180/grid

OPatchauto session is initiated at Tue Jan 15 05:07:09 2019

System initialization log file is /u01/app/180/grid/cfgtoollogs/opatchautodb/systemconfig2019-01-15_05-07-12AM.log.

Session log file is /u01/app/180/grid/cfgtoollogs/opatchauto/opatchauto2019-01-15_05-08-00AM.log
The id for this session is VH7W

Executing OPatch prereq operations to verify patch applicability on home /u01/app/180/grid
Patch applicability verified successfully on home /u01/app/180/grid


Bringing down CRS service on home /u01/app/180/grid
CRS service brought down successfully on home /u01/app/180/grid


Start applying binary patch on home /u01/app/180/grid
Binary patch applied successfully on home /u01/app/180/grid


Starting CRS service on home /u01/app/180/grid
CRS service started successfully on home /u01/app/180/grid

OPatchAuto successful.

--------------------------------Summary--------------------------------

Patching is completed successfully. Please find the summary as follows:

Host:rac18c01
CRS Home:/u01/app/180/grid
Version:18.0.0.0.0
Summary:

==Following patches were SUCCESSFULLY applied:

Patch: /tmp/install/28659165/28547619
Log: /u01/app/180/grid/cfgtoollogs/opatchauto/core/opatch/opatch2019-01-15_05-10-21AM_1.log

Patch: /tmp/install/28659165/28655784
Log: /u01/app/180/grid/cfgtoollogs/opatchauto/core/opatch/opatch2019-01-15_05-10-21AM_1.log

Patch: /tmp/install/28659165/28655916
Log: /u01/app/180/grid/cfgtoollogs/opatchauto/core/opatch/opatch2019-01-15_05-10-21AM_1.log

Patch: /tmp/install/28659165/28655963
Log: /u01/app/180/grid/cfgtoollogs/opatchauto/core/opatch/opatch2019-01-15_05-10-21AM_1.log

Patch: /tmp/install/28659165/28656071
Log: /u01/app/180/grid/cfgtoollogs/opatchauto/core/opatch/opatch2019-01-15_05-10-21AM_1.log



OPatchauto session completed at Tue Jan 15 05:18:44 2019

Time taken to complete the session 11 minutes, 36 seconds


Node 2 -

[root@rac18c02 ~]# opatchauto apply /tmp/install/28659165 -oh /u01/app/180/grid

OPatchauto session is initiated at Tue Jan 15 05:50:49 2019

System initialization log file is /u01/app/180/grid/cfgtoollogs/opatchautodb/systemconfig2019-01-15_05-50-51AM.log.

Session log file is /u01/app/180/grid/cfgtoollogs/opatchauto/opatchauto2019-01-15_05-51-29AM.log
The id for this session is RK7B

Executing OPatch prereq operations to verify patch applicability on home /u01/app/180/grid
Patch applicability verified successfully on home /u01/app/180/grid


Bringing down CRS service on home /u01/app/180/grid
CRS service brought down successfully on home /u01/app/180/grid


Start applying binary patch on home /u01/app/180/grid
Binary patch applied successfully on home /u01/app/180/grid


Starting CRS service on home /u01/app/180/grid
CRS service started successfully on home /u01/app/180/grid

OPatchAuto successful.

--------------------------------Summary--------------------------------

Patching is completed successfully. Please find the summary as follows:

Host:rac18c02
CRS Home:/u01/app/180/grid
Version:18.0.0.0.0
Summary:

==Following patches were SUCCESSFULLY applied:

Patch: /tmp/install/28659165/28547619
Log: /u01/app/180/grid/cfgtoollogs/opatchauto/core/opatch/opatch2019-01-15_05-54-10AM_1.log

Patch: /tmp/install/28659165/28655784
Log: /u01/app/180/grid/cfgtoollogs/opatchauto/core/opatch/opatch2019-01-15_05-54-10AM_1.log

Patch: /tmp/install/28659165/28655916
Log: /u01/app/180/grid/cfgtoollogs/opatchauto/core/opatch/opatch2019-01-15_05-54-10AM_1.log

Patch: /tmp/install/28659165/28655963
Log: /u01/app/180/grid/cfgtoollogs/opatchauto/core/opatch/opatch2019-01-15_05-54-10AM_1.log

Patch: /tmp/install/28659165/28656071
Log: /u01/app/180/grid/cfgtoollogs/opatchauto/core/opatch/opatch2019-01-15_05-54-10AM_1.log



OPatchauto session completed at Tue Jan 15 06:01:48 2019

Time taken to complete the session 11 minutes, 0 second





At this stage your Clusterware is patched to latest version, you can check it by running below command as grid user on all your nodes
$ORACLE_HOME/OPatch/opatch lspatches and it will display as below. 

28656071;OCW RELEASE UPDATE 18.4.0.0.0 (28656071)
28655963;DBWLM RELEASE UPDATE 18.4.0.0.0 (28655963)
28655916;ACFS RELEASE UPDATE 18.4.0.0.0 (28655916)
28655784;Database Release Update : 18.4.0.0.181016 (28655784)


The Next Step now is to patch your databases

Oracle Database 18c: RAC Patching: NODE_STATUS::rac18c03:EFAIL

In this blog I am going to talk about issue I faced during patching of a RAC cluster - GI HOME

I have a 3 node cluster which I was trying to patch and faced issue as below 

OPATCHAUTO-72050: System instance creation failed.
OPATCHAUTO-72050: Failed while retrieving system information.
OPATCHAUTO-72050: Please check log file for more details.


019-01-15 05:49:00,386 INFO  [1] oracle.dbsysmodel.driver.sdk.util.OsysUtility - Output message :::
2019-01-15 05:49:36,771 WARNING [1] oracle.dbsysmodel.driver.sdk.util.OsysUtility - Failed:
Verifying '/tmp/' ...FAILED (PRVF-7546)
Verifying Shared Storage Accessibility:/u01/app/180/grid/crs/install ...FAILED

NODE_STATUS::rac18c03:EFAIL


Finally I realized after hours of debugging and going through many blogs, my /tmp directory was full which was causing this. Clearing this on node rac18c03 fixed my issue.

This issue can come due to many reasons such as user equivalence not set and others, so read the log carefully

Performance - Sar - How to Plot Excel Chart (Complete Month)

In this blog I am going to talk about how to excel plot a chart using sar data in an easy 2 step process.

Step 1 - Extract Required Sar data in semicolon separated format

Below is a script which will help you extract data in the format you wish to.
The script is quite clear for the pros, however here is what I am doing

1. Creating a temporary file name variable for data.
2. Creating a CMD variable which is basically sadf comand by sysstat package, this command outputs sar data into semicolon seperated format.
3. Creating OPTION variable - this is basically what data you want to extract from the files. All the options are valid which are used in the "sar command" (so in place of -q you can give, -R, -r, -S, -H, -p etc etc). Do not remove the double '--'
4. Print the header into the file
5. Run the command for all files 


tempfile=sadf_`date "+%Y_%m_%d_%H_%M_%S"`.out
CMD="sadf -dt "
OPTION="-- -q" #This Option is sar option for Stat
#Print header into file
$CMD /var/log/sa/sa21 $OPTION | head -1 | awk '{print $2}' > ${tempfile}

for f in `ls -rt /var/log/sa/sa[0-9][0-9]` ; 
do 
$CMD $f $OPTION | sed -e '/LINUX-RESTART/d' -e '/hostname/d' >> ${tempfile} ;
done

(Note - the sed command deletes the linux restart entries and the headers which follow in the sar file after the restart.)
Now once you run this, you will have 1 month data into a single file with a semicolon format. 

Step 2 - Download the file and copy paste to excel.
The Second step is your excel skills, you copy the data to excel file separate the data using delimiter and plot your charts. 

1. Paste Data into excel and separate using semicolon


2. The data is all yours now and you should use your excel skills (hint - pivot chart or normal chart) to do this.

Here is an example 

Select The data And Create Pivot Chart


Fill in the Chart Details (Extreme Right)
Good luck working.