Thinking Out Loud

December 4, 2016

Toys for when You & I are bored

Filed under: oracle — mdinh @ 3:36 am

https://github.com/terrywang/vagrantboxes/blob/master/oraclelinux-7-x86_64.md

https://github.com/yasushiyy/vagrant-oracle11g-rac
https://github.com/yasushiyy/vagrant-oracle12c-rac

https://en.wikibooks.org/wiki/RAC_Attack_-_Oracle_Cluster_Database_at_Home/RAC_Attack_Automation

https://github.com/racattack/vagrantfile

http://oracleprof.blogspot.com/2015/08/automation-for-dba-vagrant-part-1.html
http://oracleprof.blogspot.com/2015/09/automation-for-dba-vagrant-part-2.html

http://vxcompany.com/2016/08/12/vagrant-for-you-rac-test-environment/

http://myofwexperiments.blogspot.com/2015/10/oracle-12c-database-installation-on.html

https://www.centos.org/download/

Images

November 30, 2016

Oracle Data Guard Broker and Static Service Registration (Doc ID 1387859.1)

Filed under: 11g,Dataguard — mdinh @ 1:37 pm

This is a quick and dirty note to self about Doc ID 1387859.1 which may be incorrect for Single Instance Database with Oracle Restart.

Please share if you have configuration for Single Instance Database with Oracle Restart using DataGuard Broker and listener registered from Grid – TIA.

Oracle Data Guard Broker and Static Service Registration (Doc ID 1387859.1)	

+++ DO NOT BELIEVE THIS TO BE CORRECT - FAILED FOR TEST CASE.

Single Instance Database with Oracle Restart

Here there is no cluster, but clusterware has been installed to enable the Oracle Restart feature. 

The local listener LISTENER has its LISTENER.ORA located in the /network/admin directory of the Oracle Grid Infrastructure home. 

In this case the static service registration is:
SID_LIST_LISTENER=
  (SID_LIST=
    (SID_DESC=
     (GLOBAL_DBNAME=db_unique_name_DGMGRL.db_domain)
     (ORACLE_HOME=oracle_home)
     (SID_NAME=sid_name)
    )
  )

As with Single Instance databases, the SID_NAME value sid_name will default to the db_unique_name.

+++ SUCCESS
Data Guard & Oracle Restart in 11gR2 https://uhesse.com/2010/09/06/data-guard-oracle-restart-in-11gr2/

DEMO: Listener configured from DB Home and NOT GI Home which failed.

oracle@arrow2:HAWKB:/u01/app/oracle/diag/rdbms/hawkb/HAWKB/trace
$ ll
total 0
-rw-r-----. 1 oracle oinstall 0 Nov 30 05:13 alert_HAWKB.log
-rw-r-----. 1 oracle oinstall 0 Nov 30 05:13 drcHAWKB.log

oracle@arrow2:HAWKB:/u01/app/oracle/diag/rdbms/hawkb/HAWKB/trace
$ srvctl config listener -l listener11g
Name: LISTENER11G
Home: /u01/app/oracle/product/11.2.0.4/db_1
End points: TCP:1551

oracle@arrow2:HAWKB:/u01/app/oracle/diag/rdbms/hawkb/HAWKB/trace
$ lsnrctl status listener11g

LSNRCTL for Linux: Version 11.2.0.4.0 - Production on 30-NOV-2016 05:14:12

Copyright (c) 1991, 2013, Oracle.  All rights reserved.

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1551)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER11G
Version                   TNSLSNR for Linux: Version 11.2.0.4.0 - Production
Start Date                30-NOV-2016 05:03:54
Uptime                    0 days 0 hr. 10 min. 17 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /u01/app/oracle/product/11.2.0.4/db_1/network/admin/listener.ora
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1551)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=arrow2.localdomain)(PORT=1551)))
Services Summary...
Service "HAWKB.localdomain" has 2 instance(s).
  Instance "HAWKB", status UNKNOWN, has 1 handler(s) for this service...
  Instance "HAWKB", status READY, has 1 handler(s) for this service...
Service "HAWKB_DGB.localdomain" has 1 instance(s).
  Instance "HAWKB", status READY, has 1 handler(s) for this service...
Service "HAWKB_DGMGRL.localdomain" has 1 instance(s).
  Instance "HAWKB", status UNKNOWN, has 1 handler(s) for this service...
Service "HAWKB_SVC.localdomain" has 1 instance(s).
  Instance "HAWKB", status READY, has 1 handler(s) for this service...
Service "HAWK_SVC.localdomain" has 1 instance(s).
  Instance "HAWKB", status READY, has 1 handler(s) for this service...
The command completed successfully

oracle@arrow2:HAWKB:/u01/app/oracle/diag/rdbms/hawkb/HAWKB/trace
$ crs_stat
--------------------------------------------------------------------------------
Name           Target  State        Server                   State details
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.LISTENER11G.lsnr
               ONLINE  ONLINE       arrow2                   STABLE
ora.ons
               OFFLINE OFFLINE      arrow2                   STABLE
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.cssd
      1        OFFLINE OFFLINE                               STABLE
ora.diskmon
      1        OFFLINE OFFLINE                               STABLE
ora.evmd
      1        ONLINE  ONLINE       arrow2                   STABLE
ora.hawkb.db
      1        ONLINE  ONLINE       arrow2                   Open,STABLE
ora.hawkb.hawk_svc.svc
      1        ONLINE  ONLINE       arrow2                   STABLE
--------------------------------------------------------------------------------

oracle@arrow2:HAWKB:/u01/app/oracle/diag/rdbms/hawkb/HAWKB/trace
$ dgmgrl sys/oracle@hawka
DGMGRL for Linux: Version 11.2.0.4.0 - 64bit Production

Copyright (c) 2000, 2009, Oracle. All rights reserved.

Welcome to DGMGRL, type "help" for information.
Connected.
DGMGRL> show configuration

Configuration - dg_hawk

  Protection Mode: MaxPerformance
  Databases:
    hawkb - Primary database
    hawka - Physical standby database

Fast-Start Failover: DISABLED

Configuration Status:
SUCCESS

DGMGRL> show database hawkb

Database - hawkb

  Role:            PRIMARY
  Intended State:  TRANSPORT-ON
  Instance(s):
    HAWKB

Database Status:
SUCCESS

DGMGRL> show database hawka

Database - hawka

  Role:            PHYSICAL STANDBY
  Intended State:  APPLY-ON
  Transport Lag:   0 seconds (computed 1 second ago)
  Apply Lag:       0 seconds (computed 1 second ago)
  Apply Rate:      0 Byte/s
  Real Time Query: ON
  Instance(s):
    HAWKA

Database Status:
SUCCESS

DGMGRL> switchover to hawka
Performing switchover NOW, please wait...
New primary database "hawka" is opening...
Operation requires startup of instance "HAWKB" on database "hawkb"
Starting instance "HAWKB"...
ORACLE instance started.
Database mounted.
Database opened.
Switchover succeeded, new primary is "hawka"
DGMGRL> show configuration

Configuration - dg_hawk

  Protection Mode: MaxPerformance
  Databases:
    hawka - Primary database
    hawkb - Physical standby database

Fast-Start Failover: DISABLED

Configuration Status:
SUCCESS

DGMGRL> show database hawka

Database - hawka

  Role:            PRIMARY
  Intended State:  TRANSPORT-ON
  Instance(s):
    HAWKA

Database Status:
SUCCESS

DGMGRL> show database hawkb

Database - hawkb

  Role:            PHYSICAL STANDBY
  Intended State:  APPLY-ON
  Transport Lag:   0 seconds (computed 1 second ago)
  Apply Lag:       (unknown)
  Apply Rate:      (unknown)
  Real Time Query: ON
  Instance(s):
    HAWKB

Database Status:
SUCCESS

DGMGRL> exit

oracle@arrow2:HAWKB:/u01/app/oracle/diag/rdbms/hawkb/HAWKB/trace
$ crs_stat
--------------------------------------------------------------------------------
Name           Target  State        Server                   State details
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.LISTENER11G.lsnr
               ONLINE  ONLINE       arrow2                   STABLE
ora.ons
               OFFLINE OFFLINE      arrow2                   STABLE
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.cssd
      1        OFFLINE OFFLINE                               STABLE
ora.diskmon
      1        OFFLINE OFFLINE                               STABLE
ora.evmd
      1        ONLINE  ONLINE       arrow2                   STABLE
ora.hawkb.db
      1        ONLINE  ONLINE       arrow2                   Open,Readonly,STABLE
ora.hawkb.hawk_svc.svc
      1        ONLINE  ONLINE       arrow2                   STABLE
--------------------------------------------------------------------------------
oracle@arrow2:HAWKB:/u01/app/oracle/diag/rdbms/hawkb/HAWKB/trace
$

++++++++++

oracle@arrow1:HAWKA:/u01/app/oracle/diag/rdbms/hawka/HAWKA/trace
$ ll
total 0
-rw-r--r--. 1 oracle oinstall 0 Nov 30 05:12 alert_HAWKA.log
-rw-r-----. 1 oracle oinstall 0 Nov 30 05:12 drcHAWKA.log

oracle@arrow1:HAWKA:/u01/app/oracle/diag/rdbms/hawka/HAWKA/trace
$ srvctl config listener -l listener11g
Name: LISTENER11G
Home: /u01/app/oracle/product/11.2.0.4/db_1
End points: TCP:1551

oracle@arrow1:HAWKA:/u01/app/oracle/diag/rdbms/hawka/HAWKA/trace
$ lsnrctl status listener11g

LSNRCTL for Linux: Version 11.2.0.4.0 - Production on 30-NOV-2016 05:14:39

Copyright (c) 1991, 2013, Oracle.  All rights reserved.

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1551)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER11G
Version                   TNSLSNR for Linux: Version 11.2.0.4.0 - Production
Start Date                30-NOV-2016 05:04:43
Uptime                    0 days 0 hr. 9 min. 55 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /u01/app/oracle/product/11.2.0.4/db_1/network/admin/listener.ora
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1551)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=arrow1.localdomain)(PORT=1551)))
Services Summary...
Service "HAWKA.localdomain" has 2 instance(s).
  Instance "HAWKA", status UNKNOWN, has 1 handler(s) for this service...
  Instance "HAWKA", status READY, has 1 handler(s) for this service...
Service "HAWKA_DGB.localdomain" has 1 instance(s).
  Instance "HAWKA", status READY, has 1 handler(s) for this service...
Service "HAWKA_DGMGRL.localdomain" has 1 instance(s).
  Instance "HAWKA", status UNKNOWN, has 1 handler(s) for this service...
Service "HAWKA_SVC.localdomain" has 1 instance(s).
  Instance "HAWKA", status READY, has 1 handler(s) for this service...
Service "HAWK_SVC.localdomain" has 1 instance(s).
  Instance "HAWKA", status READY, has 1 handler(s) for this service...
The command completed successfully

oracle@arrow1:HAWKA:/u01/app/oracle/diag/rdbms/hawka/HAWKA/trace
$ crs_stat
--------------------------------------------------------------------------------
Name           Target  State        Server                   State details
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.LISTENER11G.lsnr
               ONLINE  ONLINE       arrow1                   STABLE
ora.ons
               OFFLINE OFFLINE      arrow1                   STABLE
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.cssd
      1        OFFLINE OFFLINE                               STABLE
ora.diskmon
      1        OFFLINE OFFLINE                               STABLE
ora.evmd
      1        ONLINE  ONLINE       arrow1                   STABLE
ora.hawka.db
      1        ONLINE  ONLINE       arrow1                   Open,Readonly,STABLE
ora.hawka.hawk_svc.svc
      1        ONLINE  ONLINE       arrow1                   STABLE
--------------------------------------------------------------------------------

oracle@arrow1:HAWKA:/u01/app/oracle/diag/rdbms/hawka/HAWKA/trace
$ crs_stat
--------------------------------------------------------------------------------
Name           Target  State        Server                   State details
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.LISTENER11G.lsnr
               ONLINE  ONLINE       arrow1                   STABLE
ora.ons
               OFFLINE OFFLINE      arrow1                   STABLE
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.cssd
      1        OFFLINE OFFLINE                               STABLE
ora.diskmon
      1        OFFLINE OFFLINE                               STABLE
ora.evmd
      1        ONLINE  ONLINE       arrow1                   STABLE
ora.hawka.db
      1        ONLINE  ONLINE       arrow1                   Open,STABLE
ora.hawka.hawk_svc.svc
      1        ONLINE  ONLINE       arrow1                   STABLE
--------------------------------------------------------------------------------
oracle@arrow1:HAWKA:/u01/app/oracle/diag/rdbms/hawka/HAWKA/trace
$

November 26, 2016

Online Redo Log Switching from RMAN Backup

Filed under: 11g,RMAN — mdinh @ 5:28 pm

I was troubleshooting backup from standby databases and encountered an oddity which I wanted to verify.

Backing Up Archived Redo Logs with RMAN

Before beginning the backup, RMAN switches out of the current redo log group, and archives all online redo logs that have not yet been archived, up to and including the redo log group that was current when BACKUP command with any of the following clauses:
PLUS ARCHIVELOG
ARCHIVELOG ALL
ARCHIVELOG FROM …

 

 

November 24, 2016

VirtualBox OEL 7.3 Minimal Install for 12c

Filed under: 12c,OEL7 — mdinh @ 3:47 am

Finally, I was able to configure OEL 7.3 Minimal Install.

OEL 7.3 was a challenge since NAT and Host Only Networking from VirtualBox was not working.

I broke down and ended up using Bridged Adapter.

Next, blogs out there were using Server with GUI installation which is a really bloated option.

Even tried CentOS 7.0 Gnome and did not like having to install UEK or rebuild RPM.

Did it work?

VirtualBox OEL 7.3 Minimal Install for 12c

Silent Install CRS_SWONLY 12c using OEL 7.3 Minimal Install

Silent Install DB 12c using OEL 7.3 Minimal Install

Will you try it and let me know?

Happy Thanksgivings!

 

November 17, 2016

Playing with SUBSTR and INSTR

Filed under: oracle — mdinh @ 7:18 am
hawk:(SYS@hawk):PRIMARY> r
  1  SELECT handle,
  2  SUBSTR(handle, INSTR(handle,'/',-1)+1)                extract_last_field,
  3  SUBSTR(handle, 1, (INSTR(handle,'/',-1,1)-1))         remove_last_field,
  4  SUBSTR(handle, 1, (INSTR(handle,'/',1,2))-1)          extract_first_field,
  5  SUBSTR(handle, INSTR(handle,'/',1,2), length(handle)) remove_first_field
  6* FROM v$backup_piece_details

HANDLE
--------------------------------------------------------------------------------
EXTRACT_LAST_FIELD
--------------------------------------------------------------------------------
REMOVE_LAST_FIELD
--------------------------------------------------------------------------------
EXTRACT_FIRST_FIELD
--------------------------------------------------------------------------------
REMOVE_FIRST_FIELD
--------------------------------------------------------------------------------
/oradata/backup/HAWK_3183859104_20161116_24rl3690_1_1.bsu
HAWK_3183859104_20161116_24rl3690_1_1.bsu
/oradata/backup
/oradata
/backup/HAWK_3183859104_20161116_24rl3690_1_1.bsu

/oradata/backup/HAWK_3183859104_20161116_1vrl35ev_2_1.bkp
HAWK_3183859104_20161116_1vrl35ev_2_1.bkp
/oradata/backup
/oradata
/backup/HAWK_3183859104_20161116_1vrl35ev_2_1.bkp

hawk:(SYS@hawk):PRIMARY> r
  1  SELECT name,
  2  SUBSTR(name, INSTR(name,'/',-1)+1)              extract_last_field,
  3  SUBSTR(name, 1, (INSTR(name,'/',-1,1)-1))       remove_last_field,
  4  SUBSTR(name, 1, (INSTR(name,'/',1,2))-1)        extract_first_field,
  5  SUBSTR(name, INSTR(name,'/',1,2), length(name)) remove_first_field
  6* FROM v$datafile

NAME
--------------------------------------------------------------------------------
EXTRACT_LAST_FIELD
--------------------------------------------------------------------------------
REMOVE_LAST_FIELD
--------------------------------------------------------------------------------
EXTRACT_FIRST_FIELD
--------------------------------------------------------------------------------
REMOVE_FIRST_FIELD
--------------------------------------------------------------------------------
/oradata/SGN_HAWK/datafile/o1_mf_system_d00pchld_.dbf
o1_mf_system_d00pchld_.dbf
/oradata/SGN_HAWK/datafile
/oradata
/SGN_HAWK/datafile/o1_mf_system_d00pchld_.dbf

/oradata/SGN_HAWK/datafile/o1_mf_sysaux_d00pdw4l_.dbf
o1_mf_sysaux_d00pdw4l_.dbf
/oradata/SGN_HAWK/datafile
/oradata
/SGN_HAWK/datafile/o1_mf_sysaux_d00pdw4l_.dbf

hawk:(SYS@hawk):PRIMARY>

November 15, 2016

OGG Activity Logging Tracing (Doc ID 1204284.1)

Filed under: GoldenGate — mdinh @ 1:54 am

I just came across MOS Doc for tracing OGG processes.

Just thought I would compare the old versus new.

You can find comparison and my preference here

November 7, 2016

srvctl start/stop/status home

Filed under: 11g,oracle,RAC1Node — mdinh @ 2:40 am

Learning new things by actually reading the log files.

[oracle@rac02:emu2:/home/oracle]
$ srvctl status home -o /u01/app/oracle/product/11.2.0.4/db_1 -s ~/statushome.txt -n rac01; cat ~/statushome.txt
Service emu_svc is running on node rac01
Database emu is running on node rac01
svc-emu_svc
db-emu


[oracle@rac02:emu2:/home/oracle]
$ srvctl stop home -o /u01/app/oracle/product/11.2.0.4/db_1 -s ~/stophome.txt -n rac01 -t immediate -f
PRKO-3244 : The -s  option value "/home/oracle/stophome.txt" already exists


[oracle@rac02:emu2:/home/oracle]
$ rm -f ~/stophome.txt; srvctl stop home -o /u01/app/oracle/product/11.2.0.4/db_1 -s ~/stophome.txt -n rac01 -t immediate -f; cat ~/stophome.txt
svc-emu_svc
db-emu


[oracle@rac02:emu2:/home/oracle]
$ srvctl start home -o /u01/app/oracle/product/11.2.0.4/db_1 -s ~/stophome.txt -n rac01; cat ~/stophome.txt
svc-emu_svc
db-emu


[oracle@rac02:emu2:/home/oracle]
$ srvctl status home -o /u01/app/oracle/product/11.2.0.4/db_1 -s ~/statushome.txt -n rac01; cat ~/statushome.txt
Service emu_svc is running on node rac01
Database emu is running on node rac01
svc-emu_svc
db-emu

November 5, 2016

Using opatch report feature

Filed under: 11g,oracle,PSU — mdinh @ 6:51 pm

I have been patching a lot lately and started to wonder if this is a simpler way to check for patch conflict.

Reviewing the log from running opatch auto shows opatch auto does perform check; hence, why do we need to check this manually?

What about creating scripts to do this? Done this as well and will required modifications when requirements are changed.

If the post name did not give it away or if you want more details, then take a look at opatch auto report

Here is the script I have to check for conflict if you are still interested.

#!/bin/sh -ex
export PATCH_TOP_DIR=/media/sf_Linux/11.2.0.4/Oct2106PSU
export GRID_HOME=`grep ':' /etc/oratab|grep -v '^#'|awk -F ":" '{print $2}'|grep 'grid'|uniq`
export ORACLE_HOME=`grep ':' /etc/oratab|grep -v '^#'|awk -F ":" '{print $2}'|grep 'db'|uniq`
export AGENT_HOME=
env|egrep 'PATCH|GRID_HOME|ORACLE_HOME|AGENT_HOME'
#
ls -lrt $PATCH_TOP_DIR
ls -ld $GRID_HOME
ls -ld $ORACLE_HOME
#
ps -ef|grep pmon
ps -ef|grep tns
ps -ef|grep agent_inst
#
grep ':' /etc/oratab|grep -v '^#'
grep ':' /etc/oratab|grep -v '^#'|awk -F ":" '{print $2}'|uniq
which make ar ld nm
#
echo "Check OPatch Version"
$GRID_HOME/OPatch/opatch version -oh $GRID_HOME -v2c 11.2.0.3.6
$ORACLE_HOME/OPatch/opatch version -oh $ORACLE_HOME -v2c 11.2.0.3.6
#
echo "Check Conflict for 24436338"
$GRID_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -oh $GRID_HOME -phBaseDir $PATCH_TOP_DIR/24436338
$ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -oh $ORACLE_HOME -phBaseDir $PATCH_TOP_DIR/24436338
#
echo "Check Conflict for 24315821"
$GRID_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -oh $GRID_HOME -phBaseDir $PATCH_TOP_DIR/24315821
$ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -oh $ORACLE_HOME -phBaseDir $PATCH_TOP_DIR/24315821
#
echo "Check lsinventory > /tmp/gi_inv.txt"
$GRID_HOME/OPatch/opatch lspatches -oh $GRID_HOME
$GRID_HOME/OPatch/opatch lsinventory -detail -oh $GRID_HOME > /tmp/gi_inv.txt
#
echo "Check lsinventory > /tmp/db_inv.txt"
$ORACLE_HOME/OPatch/opatch lspatches -oh $ORACLE_HOME
$ORACLE_HOME/OPatch/opatch lsinventory -detail -oh $ORACLE_HOME > /tmp/db_inv.txt
#
head -50 /tmp/gi_inv.txt
tail -50 /tmp/gi_inv.txt
head -50 /tmp/db_inv.txt
tail -50 /tmp/db_inv.txt
echo "******** COMPLETED ********"
exit

 Here are the results from running the script.

[oracle@rac01:emu1:/media/sf_Linux/scripts]
$ ./check_psu.sh
+ export PATCH_TOP_DIR=/media/sf_Linux/11.2.0.4/Oct2106PSU
+ PATCH_TOP_DIR=/media/sf_Linux/11.2.0.4/Oct2106PSU
++ grep : /etc/oratab
++ grep -v '^#'
++ awk -F : '{print $2}'
++ grep grid
++ uniq
+ export GRID_HOME=/u01/app/11.2.0.4/grid
+ GRID_HOME=/u01/app/11.2.0.4/grid
++ grep : /etc/oratab
++ grep db
++ awk -F : '{print $2}'
++ grep -v '^#'
++ uniq
+ export ORACLE_HOME=/u01/app/oracle/product/11.2.0.4/db_1
+ ORACLE_HOME=/u01/app/oracle/product/11.2.0.4/db_1
+ export AGENT_HOME=
+ AGENT_HOME=
+ env
+ egrep 'PATCH|GRID_HOME|ORACLE_HOME|AGENT_HOME'
AGENT_HOME=
GRID_HOME=/u01/app/11.2.0.4/grid
PATCH_TOP_DIR=/media/sf_Linux/11.2.0.4/Oct2106PSU
ORACLE_HOME=/u01/app/oracle/product/11.2.0.4/db_1
+ ls -lrt /media/sf_Linux/11.2.0.4/Oct2106PSU
total 736824
drwxrwx---. 1 root vboxsf      4096 Sep 14 04:40 24436338
drwxrwx---. 1 root vboxsf      4096 Sep 15 09:00 24315821
-rwxrwx---. 1 root vboxsf    112021 Oct 18 07:09 PatchSearch.xml
-rwxrwx---. 1 root vboxsf  42351279 Nov  5 11:25 p24315821_112040_Linux-x86-64.zip
-rwxrwx---. 1 root vboxsf 712035213 Nov  5 11:28 p24436338_112040_Linux-x86-64.zip
+ ls -ld /u01/app/11.2.0.4/grid
drwxr-xr-x. 72 root oinstall 4096 Nov  5 06:40 /u01/app/11.2.0.4/grid
+ ls -ld /u01/app/oracle/product/11.2.0.4/db_1
drwxrwxr-x. 79 oracle oinstall 4096 Nov  5 11:39 /u01/app/oracle/product/11.2.0.4/db_1
+ ps -ef
+ grep pmon
oracle    1969     1  0 10:12 ?        00:00:01 ora_pmon_emu1_1
grid      3654     1  0 06:42 ?        00:00:03 asm_pmon_+ASM1
oracle    9458  9439  0 11:47 pts/0    00:00:00 grep pmon
+ ps -ef
+ grep tns
root        19     2  0 Nov04 ?        00:00:00 [netns]
grid      4234     1  0 06:43 ?        00:00:00 /u01/app/11.2.0.4/grid/bin/tnslsnr LISTENER -inherit
grid      4255     1  0 06:43 ?        00:00:00 /u01/app/11.2.0.4/grid/bin/tnslsnr LISTENER_SCAN1 -inherit
oracle    9460  9439  0 11:47 pts/0    00:00:00 grep tns
+ ps -ef
+ grep agent_inst
oracle    9462  9439  0 11:47 pts/0    00:00:00 grep agent_inst
+ grep : /etc/oratab
+ grep -v '^#'
+ASM1:/u01/app/11.2.0.4/grid:N          # line added by Agent
db01:/u01/app/oracle/product/11.2.0.4/db_1:N
emu1:/u01/app/oracle/product/11.2.0.4/db_1:N
emu1_1:/u01/app/oracle/product/11.2.0.4/db_1:N
emu1_2:/u01/app/oracle/product/11.2.0.4/db_1:N
emu:/u01/app/oracle/product/11.2.0.4/db_1:N             # line added by Agent
+ grep : /etc/oratab
+ grep -v '^#'
+ uniq
+ awk -F : '{print $2}'
/u01/app/11.2.0.4/grid
/u01/app/oracle/product/11.2.0.4/db_1
+ which make ar ld nm
/usr/bin/make
/usr/bin/ar
/usr/bin/ld
/usr/bin/nm
+ echo 'Check OPatch Version'
Check OPatch Version
+ /u01/app/11.2.0.4/grid/OPatch/opatch version -oh /u01/app/11.2.0.4/grid -v2c 11.2.0.3.6
OPatch could not create/open history file for writing.

Oracle Interim Patch Installer version 11.2.0.3.15
Copyright (c) 2016, Oracle Corporation.  All rights reserved.


Oracle Home       : /u01/app/11.2.0.4/grid
Central Inventory : /u01/app/oraInventory
   from           : /u01/app/11.2.0.4/grid/oraInst.loc
OPatch version    : 11.2.0.3.15
OUI version       : 11.2.0.4.0
Log file location : /u01/app/11.2.0.4/grid/cfgtoollogs/opatch/opatch2016-11-05_11-47-31AM_1.log


OPatch version for all Oracle Homes registered in Central Inventory:
Location                   Version
/u01/app/11.2.0.4/grid     11.2.0.3.15


All of the Oracle Home(s) pass the Minimum OPatch Version requirement.


OPatch succeeded.
+ /u01/app/oracle/product/11.2.0.4/db_1/OPatch/opatch version -oh /u01/app/oracle/product/11.2.0.4/db_1 -v2c 11.2.0.3.6
Oracle Interim Patch Installer version 11.2.0.3.12
Copyright (c) 2016, Oracle Corporation.  All rights reserved.


Oracle Home       : /u01/app/oracle/product/11.2.0.4/db_1
Central Inventory : /u01/app/oraInventory
   from           : /u01/app/oracle/product/11.2.0.4/db_1/oraInst.loc
OPatch version    : 11.2.0.3.12
OUI version       : 11.2.0.4.0
Log file location : /u01/app/oracle/product/11.2.0.4/db_1/cfgtoollogs/opatch/opatch2016-11-05_11-47-32AM_1.log


OPatch version for all Oracle Homes registered in Central Inventory:
Location                                  Version
/u01/app/oracle/product/11.2.0.4/db_1     11.2.0.3.12


All of the Oracle Home(s) pass the Minimum OPatch Version requirement.


OPatch succeeded.
+ echo 'Check Conflict for 24436338'
Check Conflict for 24436338
+ /u01/app/11.2.0.4/grid/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -oh /u01/app/11.2.0.4/grid -phBaseDir /media/sf_Linux/11.2.0.4/Oct2106PSU/24436338
OPatch could not create/open history file for writing.

Oracle Interim Patch Installer version 11.2.0.3.15
Copyright (c) 2016, Oracle Corporation.  All rights reserved.

PREREQ session

Oracle Home       : /u01/app/11.2.0.4/grid
Central Inventory : /u01/app/oraInventory
   from           : /u01/app/11.2.0.4/grid/oraInst.loc
OPatch version    : 11.2.0.3.15
OUI version       : 11.2.0.4.0
Log file location : /u01/app/11.2.0.4/grid/cfgtoollogs/opatch/opatch2016-11-05_11-47-33AM_1.log

Invoking prereq "checkconflictagainstohwithdetail"

Prereq "checkConflictAgainstOHWithDetail" passed.

OPatch succeeded.
+ /u01/app/oracle/product/11.2.0.4/db_1/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -oh /u01/app/oracle/product/11.2.0.4/db_1 -phBaseDir /media/sf_Linux/11.2.0.4/Oct2106PSU/24436338
Oracle Interim Patch Installer version 11.2.0.3.12
Copyright (c) 2016, Oracle Corporation.  All rights reserved.

PREREQ session

Oracle Home       : /u01/app/oracle/product/11.2.0.4/db_1
Central Inventory : /u01/app/oraInventory
   from           : /u01/app/oracle/product/11.2.0.4/db_1/oraInst.loc
OPatch version    : 11.2.0.3.12
OUI version       : 11.2.0.4.0
Log file location : /u01/app/oracle/product/11.2.0.4/db_1/cfgtoollogs/opatch/opatch2016-11-05_11-47-39AM_1.log

Invoking prereq "checkconflictagainstohwithdetail"

Prereq "checkConflictAgainstOHWithDetail" passed.

OPatch succeeded.
+ echo 'Check Conflict for 24315821'
Check Conflict for 24315821
+ /u01/app/11.2.0.4/grid/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -oh /u01/app/11.2.0.4/grid -phBaseDir /media/sf_Linux/11.2.0.4/Oct2106PSU/24315821
OPatch could not create/open history file for writing.

Oracle Interim Patch Installer version 11.2.0.3.15
Copyright (c) 2016, Oracle Corporation.  All rights reserved.

PREREQ session

Oracle Home       : /u01/app/11.2.0.4/grid
Central Inventory : /u01/app/oraInventory
   from           : /u01/app/11.2.0.4/grid/oraInst.loc
OPatch version    : 11.2.0.3.15
OUI version       : 11.2.0.4.0
Log file location : /u01/app/11.2.0.4/grid/cfgtoollogs/opatch/opatch2016-11-05_11-47-47AM_1.log

Invoking prereq "checkconflictagainstohwithdetail"

Prereq "checkConflictAgainstOHWithDetail" passed.

OPatch succeeded.
+ /u01/app/oracle/product/11.2.0.4/db_1/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -oh /u01/app/oracle/product/11.2.0.4/db_1 -phBaseDir /media/sf_Linux/11.2.0.4/Oct2106PSU/24315821
Oracle Interim Patch Installer version 11.2.0.3.12
Copyright (c) 2016, Oracle Corporation.  All rights reserved.

PREREQ session

Oracle Home       : /u01/app/oracle/product/11.2.0.4/db_1
Central Inventory : /u01/app/oraInventory
   from           : /u01/app/oracle/product/11.2.0.4/db_1/oraInst.loc
OPatch version    : 11.2.0.3.12
OUI version       : 11.2.0.4.0
Log file location : /u01/app/oracle/product/11.2.0.4/db_1/cfgtoollogs/opatch/opatch2016-11-05_11-47-48AM_1.log

Invoking prereq "checkconflictagainstohwithdetail"

Prereq "checkConflictAgainstOHWithDetail" passed.

OPatch succeeded.
+ echo 'Check lsinventory > /tmp/gi_inv.txt'
Check lsinventory > /tmp/gi_inv.txt
+ /u01/app/11.2.0.4/grid/OPatch/opatch lspatches -oh /u01/app/11.2.0.4/grid
OPatch could not create/open history file for writing.

22502505;ACFS Patch Set Update : 11.2.0.4.160419 (22502505)
22502549;OCW Patch Set Update : 11.2.0.4.160419 (22502549)
22502456;Database Patch Set Update : 11.2.0.4.160419 (22502456)

OPatch succeeded.
+ /u01/app/11.2.0.4/grid/OPatch/opatch lsinventory -detail -oh /u01/app/11.2.0.4/grid
+ echo 'Check lsinventory > /tmp/db_inv.txt'
Check lsinventory > /tmp/db_inv.txt
+ /u01/app/oracle/product/11.2.0.4/db_1/OPatch/opatch lspatches -oh /u01/app/oracle/product/11.2.0.4/db_1
22502549;OCW Patch Set Update : 11.2.0.4.160419 (22502549)
22502456;Database Patch Set Update : 11.2.0.4.160419 (22502456)

OPatch succeeded.
+ /u01/app/oracle/product/11.2.0.4/db_1/OPatch/opatch lsinventory -detail -oh /u01/app/oracle/product/11.2.0.4/db_1
+ head -50 /tmp/gi_inv.txt
OPatch could not create/open history file for writing.

Oracle Interim Patch Installer version 11.2.0.3.15
Copyright (c) 2016, Oracle Corporation.  All rights reserved.


Oracle Home       : /u01/app/11.2.0.4/grid
Central Inventory : /u01/app/oraInventory
   from           : /u01/app/11.2.0.4/grid/oraInst.loc
OPatch version    : 11.2.0.3.15
OUI version       : 11.2.0.4.0
Log file location : /u01/app/11.2.0.4/grid/cfgtoollogs/opatch/opatch2016-11-05_11-47-52AM_1.log

Lsinventory Output file location : /u01/app/11.2.0.4/grid/cfgtoollogs/opatch/lsinv/lsinventory2016-11-05_11-47-52AM.txt

--------------------------------------------------------------------------------
Local Machine Information::
Hostname: rac01
ARU platform id: 226
ARU platform description:: Linux x86-64

Installed Top-level Products (1):

Oracle Grid Infrastructure 11g                                       11.2.0.4.0
There are 1 products installed in this Oracle Home.


Installed Products (89):

Agent Required Support Files                                         10.2.0.4.5
Assistant Common Files                                               11.2.0.4.0
Automatic Storage Management Assistant                               11.2.0.4.0
Bali Share                                                           1.1.18.0.0
Buildtools Common Files                                              11.2.0.4.0
Character Set Migration Utility                                      11.2.0.4.0
Cluster Ready Services Files                                         11.2.0.4.0
Cluster Verification Utility Common Files                            11.2.0.4.0
Cluster Verification Utility Files                                   11.2.0.4.0
Database SQL Scripts                                                 11.2.0.4.0
Deinstallation Tool                                                  11.2.0.4.0
Enterprise Manager Common Core Files                                 10.2.0.4.5
Enterprise Manager Common Files                                      10.2.0.4.5
Enterprise Manager plugin Common Files                               11.2.0.4.0
Expat libraries                                                       2.0.1.0.1
HAS Common Files                                                     11.2.0.4.0
HAS Files for DB                                                     11.2.0.4.0
Installation Common Files                                            11.2.0.4.0
Installation Plugin Files                                            11.2.0.4.0
Installer SDK Component                                              11.2.0.4.0
Java Development Kit                                                1.5.0.51.10
+ tail -50 /tmp/gi_inv.txt
     oraus.msg --> ORACLE_HOME/rdbms/mesg/oraus.msg
     ordim.jar --> ORACLE_HOME/ord/jlib/ordim.jar
     ordimimg.jar --> ORACLE_HOME/ord/jlib/ordimimg.jar
     orion.o --> ORACLE_HOME/rdbms/lib/orion.o
     prvtadv.plb --> ORACLE_HOME/rdbms/admin/prvtadv.plb
     prvtblin.plb --> ORACLE_HOME/rdbms/admin/prvtblin.plb
     prvtbsdp.plb --> ORACLE_HOME/rdbms/admin/prvtbsdp.plb
     prvtbsmt.plb --> ORACLE_HOME/rdbms/admin/prvtbsmt.plb
     prvtbstr.plb --> ORACLE_HOME/rdbms/admin/prvtbstr.plb
     prvtdadv.plb --> ORACLE_HOME/rdbms/admin/prvtdadv.plb
     prvthsdp.plb --> ORACLE_HOME/rdbms/admin/prvthsdp.plb
     prvthsmt.plb --> ORACLE_HOME/rdbms/admin/prvthsmt.plb
     prvthstr.plb --> ORACLE_HOME/rdbms/admin/prvthstr.plb
     prvtlmcb.plb --> ORACLE_HOME/rdbms/admin/prvtlmcb.plb
     prvtlmd.plb --> ORACLE_HOME/rdbms/admin/prvtlmd.plb
     prvtpckl.plb --> ORACLE_HOME/rdbms/admin/prvtpckl.plb
     prvtredacta.plb --> ORACLE_HOME/rdbms/admin/prvtredacta.plb
     prvtutil.plb --> ORACLE_HOME/rdbms/admin/prvtutil.plb
     recover.bsq --> ORACLE_HOME/rdbms/admin/recover.bsq
     schema --> ORACLE_HOME/bin/schema
     sdodbmig.sql --> ORACLE_HOME/md/admin/sdodbmig.sql
     sdopatch.sql --> ORACLE_HOME/md/admin/sdopatch.sql
     sjsex.o --> ORACLE_HOME/rdbms/lib/sjsex.o
     spawrio.sql --> ORACLE_HOME/rdbms/admin/spawrio.sql
     utlu112i.sql --> ORACLE_HOME/rdbms/admin/utlu112i.sql
     utlu112x.sql --> ORACLE_HOME/rdbms/admin/utlu112x.sql
     xml --> ORACLE_HOME/bin/xml
   Patch Location in Inventory:
     /u01/app/11.2.0.4/grid/inventory/oneoffs/22502456
     /u01/app/11.2.0.4/grid/inventory/oneoffs/21948347
     /u01/app/11.2.0.4/grid/inventory/oneoffs/21352635
     /u01/app/11.2.0.4/grid/inventory/oneoffs/20760982
     /u01/app/11.2.0.4/grid/inventory/oneoffs/20299013
     /u01/app/11.2.0.4/grid/inventory/oneoffs/19769489
     /u01/app/11.2.0.4/grid/inventory/oneoffs/19121551
     /u01/app/11.2.0.4/grid/inventory/oneoffs/18522509
     /u01/app/11.2.0.4/grid/inventory/oneoffs/18031668
     /u01/app/11.2.0.4/grid/inventory/oneoffs/17478514
   Patch Location in Storage area:
     /u01/app/11.2.0.4/grid/.patch_storage/22502456_Mar_21_2016_11_49_22



Rac system comprising of multiple nodes
  Local node = rac01
  Remote node = rac02

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

OPatch succeeded.
+ head -50 /tmp/db_inv.txt
Oracle Interim Patch Installer version 11.2.0.3.12
Copyright (c) 2016, Oracle Corporation.  All rights reserved.


Oracle Home       : /u01/app/oracle/product/11.2.0.4/db_1
Central Inventory : /u01/app/oraInventory
   from           : /u01/app/oracle/product/11.2.0.4/db_1/oraInst.loc
OPatch version    : 11.2.0.3.12
OUI version       : 11.2.0.4.0
Log file location : /u01/app/oracle/product/11.2.0.4/db_1/cfgtoollogs/opatch/opatch2016-11-05_11-47-55AM_1.log

Lsinventory Output file location : /u01/app/oracle/product/11.2.0.4/db_1/cfgtoollogs/opatch/lsinv/lsinventory2016-11-05_11-47-55AM.txt

--------------------------------------------------------------------------------
Local Machine Information::
Hostname: rac01
ARU platform id: 226
ARU platform description:: Linux x86-64

Installed Top-level Products (1):

Oracle Database 11g                                                  11.2.0.4.0
There are 1 products installed in this Oracle Home.


Installed Products (136):

Agent Required Support Files                                         10.2.0.4.5
Assistant Common Files                                               11.2.0.4.0
Bali Share                                                           1.1.18.0.0
Buildtools Common Files                                              11.2.0.4.0
Character Set Migration Utility                                      11.2.0.4.0
Cluster Verification Utility Common Files                            11.2.0.4.0
Database Configuration and Upgrade Assistants                        11.2.0.4.0
Database SQL Scripts                                                 11.2.0.4.0
Database Workspace Manager                                           11.2.0.4.0
Deinstallation Tool                                                  11.2.0.4.0
Enterprise Edition Options                                           11.2.0.4.0
Enterprise Manager Agent                                             10.2.0.4.5
Enterprise Manager Agent Core Files                                  10.2.0.4.5
Enterprise Manager Common Core Files                                 10.2.0.4.5
Enterprise Manager Common Files                                      10.2.0.4.5
Enterprise Manager Database Plugin -- Agent Support                  11.2.0.4.0
Enterprise Manager Database Plugin -- Repository Support             11.2.0.4.0
Enterprise Manager Grid Control Core Files                           10.2.0.4.5
Enterprise Manager plugin Common Files                               11.2.0.4.0
Enterprise Manager Repository Core Files                             10.2.0.4.5
Exadata Storage Server                                               11.2.0.1.0
Expat libraries                                                       2.0.1.0.1
Generic Connectivity Common Files                                    11.2.0.4.0
+ tail -50 /tmp/db_inv.txt
     prvtblin.plb --> ORACLE_HOME/rdbms/admin/prvtblin.plb
     prvtbsdp.plb --> ORACLE_HOME/rdbms/admin/prvtbsdp.plb
     prvtbsmt.plb --> ORACLE_HOME/rdbms/admin/prvtbsmt.plb
     prvtbstr.plb --> ORACLE_HOME/rdbms/admin/prvtbstr.plb
     prvtdadv.plb --> ORACLE_HOME/rdbms/admin/prvtdadv.plb
     prvthsdp.plb --> ORACLE_HOME/rdbms/admin/prvthsdp.plb
     prvthsmt.plb --> ORACLE_HOME/rdbms/admin/prvthsmt.plb
     prvthstr.plb --> ORACLE_HOME/rdbms/admin/prvthstr.plb
     prvtlmcb.plb --> ORACLE_HOME/rdbms/admin/prvtlmcb.plb
     prvtlmd.plb --> ORACLE_HOME/rdbms/admin/prvtlmd.plb
     prvtpckl.plb --> ORACLE_HOME/rdbms/admin/prvtpckl.plb
     prvtredacta.plb --> ORACLE_HOME/rdbms/admin/prvtredacta.plb
     prvtutil.plb --> ORACLE_HOME/rdbms/admin/prvtutil.plb
     recover.bsq --> ORACLE_HOME/rdbms/admin/recover.bsq
     schema --> ORACLE_HOME/bin/schema
     sdodbmig.sql --> ORACLE_HOME/md/admin/sdodbmig.sql
     sdopatch.sql --> ORACLE_HOME/md/admin/sdopatch.sql
     sjsex.o --> ORACLE_HOME/rdbms/lib/sjsex.o
     spawrio.sql --> ORACLE_HOME/rdbms/admin/spawrio.sql
     utlu112i.sql --> ORACLE_HOME/rdbms/admin/utlu112i.sql
     utlu112x.sql --> ORACLE_HOME/rdbms/admin/utlu112x.sql
     xml --> ORACLE_HOME/bin/xml
     xmlcg --> ORACLE_HOME/bin/xmlcg
     xmldiff --> ORACLE_HOME/bin/xmldiff
     xmlpatch --> ORACLE_HOME/bin/xmlpatch
     xsl --> ORACLE_HOME/bin/xsl
     xvm --> ORACLE_HOME/bin/xvm
   Patch Location in Inventory:
     /u01/app/oracle/product/11.2.0.4/db_1/inventory/oneoffs/22502456
     /u01/app/oracle/product/11.2.0.4/db_1/inventory/oneoffs/21948347
     /u01/app/oracle/product/11.2.0.4/db_1/inventory/oneoffs/21352635
     /u01/app/oracle/product/11.2.0.4/db_1/inventory/oneoffs/20760982
     /u01/app/oracle/product/11.2.0.4/db_1/inventory/oneoffs/20299013
     /u01/app/oracle/product/11.2.0.4/db_1/inventory/oneoffs/19769489
     /u01/app/oracle/product/11.2.0.4/db_1/inventory/oneoffs/19121551
     /u01/app/oracle/product/11.2.0.4/db_1/inventory/oneoffs/18522509
     /u01/app/oracle/product/11.2.0.4/db_1/inventory/oneoffs/18031668
     /u01/app/oracle/product/11.2.0.4/db_1/inventory/oneoffs/17478514
   Patch Location in Storage area:
     /u01/app/oracle/product/11.2.0.4/db_1/.patch_storage/22502456_Mar_21_2016_11_49_22



Rac system comprising of multiple nodes
  Local node = rac01
  Remote node = rac02

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

OPatch succeeded.
+ echo '******** COMPLETED ********'
******** COMPLETED ********
+ exit
[oracle@rac01:emu1:/media/sf_Linux/scripts]
$

RAC1Node Conversion/Relocation/Termination

Filed under: 11g,oracle,RAC1Node — mdinh @ 3:01 am

RAC1Node Conversion/Relocation/Termination

November 3, 2016

Instance Name changes during RAC One Node Failover/Switchover

Filed under: RAC1Node — mdinh @ 12:07 pm

Just a quick note to self.

INSTANCE / NODE CRASH (FAILOVER):

     When the node goes down due to abnormal termination (  kill -9 or due to unknown reasons) Grid Infrastructure performs the following:

  •  First cluster tries to restart the instance in same node.
  •  If it is unsuccessful then it will start the instance in other node.
  •  If the instance name is orcl_1, when it failover to node 2 it will be still orcl_1.

INSTANCE RELOCATE MANUALLY(SWITCHOVER):

    When Manually switchover is performed for relocating orcl_1 from Node1 to Node 2 (Instance Relocation) Grid Infrastructure performs the following:

  • It will first create pfile( init.ora) automatically in node 2.
  • In node 2 it will use the new pfile and start instance with a new name, i.e. orcl_2, this is due to both instances are required to be up and running for active sessions on the original node to complete or time out.
  • Post switchover, it uses new instance name i.e. orcl_2   

Reference:

(31-May-2016). Retrieved November 3, 2016, from https://support.oracle.com/epmos/faces/DocContentDisplay?id=1540629.1

Next Page »

Blog at WordPress.com.