Michael Dinh

Subscribe to Michael Dinh feed Michael Dinh
Michael T. Dinh, Oracle DBA
Updated: 17 hours 20 min ago

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

Wed, 2016-11-30 07:37

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
$


Online Redo Log Switching from RMAN Backup

Sat, 2016-11-26 11:28

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 …

 

 


VirtualBox OEL 7.3 Minimal Install for 12c

Wed, 2016-11-23 21:47

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

Will you try it and let me know?

Happy Thanksgivings!

 


Playing with SUBSTR and INSTR

Thu, 2016-11-17 01:18
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>

OGG Activity Logging Tracing (Doc ID 1204284.1)

Mon, 2016-11-14 19:54

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


srvctl start/stop/status home

Sun, 2016-11-06 20:40

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

Using opatch report feature

Sat, 2016-11-05 13:51

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]
$

Instance Name changes during RAC One Node Failover/Switchover

Thu, 2016-11-03 07:07

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


Oracle 12c CRS-4995: The command ‘Modify resource’ is invalid in crsctl.

Wed, 2016-11-02 21:23

So there I was playing with 12c Oracle restart and ran into
CRS-4995: The command ‘Modify resource’ is invalid in crsctl. Use srvctl for this command.

For 12c, this expected as crsctl shouldn’t be used to modify ora.* resource.

Couldn’t figure out how to modify resource using svrctl.

However, I did learn about -unsupported for crsctl.

hawk:(SYS@hawk):PRIMARY> show parameter db%name

NAME                                 TYPE                           VALUE
------------------------------------ ------------------------------ ------------------------------
db_file_name_convert                 string
db_name                              string                         hawk
db_unique_name                       string                         sgn_hawk
pdb_file_name_convert                string
hawk:(SYS@hawk):PRIMARY>

oracle@arrow1:hawk:/home/oracle
$ echo $ORACLE_SID;echo $ORACLE_HOME
hawk
/u01/app/oracle/product/12.1.0.2/db_1

oracle@arrow1:hawk:/home/oracle
$ srvctl add database -db sgn_hawk -o $ORACLE_HOME -p $ORACLE_HOME/dbs/spfile$ORACLE_SID.ora -startoption open -stopoption immediate -dbname hawk

++++++++++

oracle@arrow1:hawk:/u01/app/oracle/product/12.1.0.2/db_1/network/admin
$ echo $ORACLE_HOME
/u01/app/oracle/product/12.1.0.2/db_1

oracle@arrow1:hawk:/u01/app/oracle/product/12.1.0.2/db_1/network/admin
$ cat listener.ora
listener=(description=(address=(protocol=tcp)(host=)(port=1521)
LISTENER_12C =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1551))
      (ADDRESS=(PROTOCOL=tcp)(HOST=arrow1.localdomain)(PORT=1551)(SEND_BUF_SIZE=32767)(RECV_BUF_SIZE=32767))
    )
  )

SID_LIST_LISTENER_12C =
  (SID_LIST =
    (SID_DESC =
      (SDU=32767)
      (GLOBAL_DBNAME = sgn_hawk_DGMGRL)
      (ORACLE_HOME=/u01/app/oracle/product/12.1.0.2/db_1)
      (SID_NAME = hawk)
    )
    (SID_DESC =
      (SDU=32767)
      (GLOBAL_DBNAME = test2)
      (ORACLE_HOME=/u01/app/oracle/product/12.1.0.2/db_1)
      (SID_NAME = test2)
    )
  )

USE_SID_AS_SERVICE_LISTENER_12C = ON
INBOUND_CONNECT_TIMEOUT_LISTENER_12C = 120
SUBSCRIBE_FOR_NODE_DOWN_EVENT_LISTENER_12C = OFF
DIAG_ADR_ENABLED_LISTENER_12C = OFF
LOGGING_LISTENER_12C = OFF
TRACE_LEVEL_LISTENER_12C = OFF
SAVE_CONFIG_ON_STOP_LISTENER_12C = TRUE

oracle@arrow1:hawk:/u01/app/oracle/product/12.1.0.2/db_1/network/admin
$ srvctl add listener -l LISTENER_12C -p TCP:1551 -o $ORACLE_HOME
oracle@arrow1:hawk:/u01/app/oracle/product/12.1.0.2/db_1/network/admin
$

++++++++++
oracle@arrow1:grid:/home/oracle
$ srvctl config database
sgn_hawk

oracle@arrow1:grid:/home/oracle
$ srvctl config listener
Name: LISTENER_12C
Type: Database Listener
Home: /u01/app/oracle/product/12.1.0.2/db_1
End points: TCP:1551
Listener is enabled.

+++++++++

oracle@arrow1:grid:/home/oracle
$ crsctl stat res -t -w "TYPE = ora.listener.type"|grep lsnr
ora.LISTENER_12C.lsnr

oracle@arrow1:grid:/home/oracle
$ crsctl stat res -t -w "TYPE = ora.database.type"|grep db
ora.sgn_hawk.db

oracle@arrow1:grid:/home/oracle
$ crsctl stat res ora.sgn_hawk.db -p | grep AUTO_START
AUTO_START=restore

++++++++++

Why database not startup automatic 11gR2 Grid Infrastructure?
http://surachartopun.com/2011/04/why-database-not-startup-automatic.html

AUTO_START
- always: 
Restarts the resource when the server restarts regardless of the state of the resource when the server stopped.

- restore: 
Restores the resource to the same state that it was in when the server stopped. 
Oracle Clusterware attempts to restart the resource if the value of TARGET was ONLINE before the server stopped.

- never: 
Oracle Clusterware never restarts the resource regardless of the state of the resource when the server stopped.

++++++++++

oracle@arrow1:grid:/home/oracle
$ crsctl modify resource ora.sgn_hawk.db -attr AUTO_START=always
CRS-4995:  The command 'Modify  resource' is invalid in crsctl. Use srvctl for this command.

++++++++++

crsctl modify ora.* resource fails with CRS-4995 in 12.1.0.2 and above (Doc ID 1918102.1)
Alternative Procedure To Install and Configure ASM 12.1.0.2.0 On Unix/Linux Configurations (Standalone) (Doc ID 1954213.1)

oracle@arrow1:grid:/home/oracle
$ crsctl modify resource ora.sgn_hawk.db -attr AUTO_START=always -unsupported

oracle@arrow1:grid:/home/oracle
$ crsctl stat res ora.sgn_hawk.db -p | grep AUTO_START
AUTO_START=always

Identify SQL_ID from Failed Per-SQL Time Limit SQL_TUNING_TASK

Tue, 2016-11-01 21:32

First, many thanks to Ivica Arsov from Pythian for all his help is solving the issue.

The objective is to find the 2 SQLs failed due to time limit.

Advance apologies for lazy post as I am just going to only provide references and results from triage.

$ oerr ora 16957
16957, 00000, "SQL Analyze time limit interrupt"
// *Cause: This is an internal error code used indicate that SQL analyze has
//         reached its time limit.
// *Action:

$ oerr ora 13639
13639, 00000, "The current operation was interrupted because it timed out."
// *Cause:  The task or object operation timed out.
// *Action: None

+++++++++++

SQL> 
SELECT DBMS_AUTO_SQLTUNE.report_auto_tuning_task FROM dual;

REPORT_AUTO_TUNING_TASK
--------------------------------------------------------------------------------
GENERAL INFORMATION SECTION
-------------------------------------------------------------------------------
Tuning Task Name                        : SYS_AUTO_SQL_TUNING_TASK
Tuning Task Owner                       : SYS
Workload Type                           : Automatic High-Load SQL Workload
Execution Count                         : 39
Current Execution                       : EXEC_17554
Execution Type                          : TUNE SQL
Scope                                   : COMPREHENSIVE
Global Time Limit(seconds)              : 14400
Per-SQL Time Limit(seconds)             : 2700
Completion Status                       : INTERRUPTED
Started at                              : 10/20/2016 22:00:01
Completed at                            : 10/21/2016 02:00:03
Number of Candidate SQLs                : 248
Cumulative Elapsed Time of SQL (s)      : 4837418

-------------------------------------------------------------------------------
Error: ORA-13639: The current operation was interrupted because it timed out.
-------------------------------------------------------------------------------

-------------------------------------------------------------------------------
SUMMARY SECTION
-------------------------------------------------------------------------------
                      Global SQL Tuning Result Statistics
-------------------------------------------------------------------------------
Number of SQLs Analyzed                      : 130
Number of SQLs in the Report                 : 23
Number of SQLs with Findings                 : 22
Number of SQLs with Statistic Findings       : 2
Number of SQLs with Alternative Plan Findings: 5
Number of SQLs with SQL profiles recommended : 14
Number of SQLs with Index Findings           : 11
Number of SQLs with SQL Restructure Findings : 3
Number of SQLs with Timeouts                 : 2
Number of SQLs with Errors                   : 1


Here are the references and what have been attempted.
It looks like attr7 varies by versions.

+++++++++

Automatic SQL Tune Job Fails With ORA-13639 (Doc ID 1363111.1)
Increase the job "Time Limit" Parameter to appropriate higher value to allow the tuning task to complete , using the following command :

Global Time Limit(seconds)              : 14400
Per-SQL Time Limit(seconds)             : 2700
Number of SQLs with Timeouts            : 2

+++++++

https://anargodjaev.wordpress.com/2014/07/22/ora-16957-sql-analyze-time-limit-interrupt-2/

SQL> r
  1  SELECT sql_id, sql_text FROM dba_hist_sqltext
  2  WHERE sql_id IN (SELECT attr1 FROM dba_advisor_objects
  3  WHERE execution_name = 'EXEC_17554'
  4  AND task_name = 'SYS_AUTO_SQL_TUNING_TASK'
  5  AND type = 'SQL' AND bitand(attr7,64) <> 0 )
  6*

no rows selected

SQL>

++++++++++

Bug 9874145 : PROCESS 0X0X00000002E2392938 APPEARS TO BE HUNG IN AUTO SQL TUNING TASK   
Product Version    11.1.0.7

SQL> select attr1 SQL_ID from dba_advisor_objects
  where task_name ='SYS_AUTO_SQL_TUNING_TASK'
  and type = 'SQL'
  and attr7 = 32
  order by 1;
 
SQL> r
  1* select attr7, count(*) from DBA_ADVISOR_OBJECTS where execution_name='EXEC_17554' and task_name ='SYS_AUTO_SQL_TUNING_TASK' and type='SQL' group by attr7

     ATTR7   COUNT(*)
---------- ----------
    32       99
     0       31

SQL> r
  1  SELECT count(sql_id)  FROM dba_hist_sqltext
  2  WHERE sql_id IN (SELECT attr1 FROM dba_advisor_objects
  3  WHERE execution_name = 'EXEC_17554'
  4  AND task_name = 'SYS_AUTO_SQL_TUNING_TASK'
  5  AND type = 'SQL' AND bitand(attr7,32) <> 0 )
  6*

COUNT(SQL_ID)
-------------
       99

SQL> r
  1  select  distinct sql_id
  2  from    DBA_ADVISOR_SQLPLANS
  3  where   execution_name = 'EXEC_17554'
  4         and sql_id not in (select sql_id from dba_advisor_sqlstats where execution_name = 'EXEC_17554')
  5*

SQL_ID
-------------
2dhfrqwrv0m16
58h2g858zqckc
apzyk43bfp6np
g84pgjy5ycw2g
20ypq7mzad6ah
cr1s7zpp7285p
ag01z6qn8450d
4z3gq9xh9a5jr
byav70kx3bj8w
8m3qru4z4687w
d28dgmyr5910n
5mgq2hd4xz6vv

12 rows selected.

SQL>

++++++++++

SQL> select sql_id from DBA_ADVISOR_SQLPLANS where EXECUTION_NAME='EXEC_17554'
minus
select sql_id from DBA_ADVISOR_SQLSTATS where EXECUTION_NAME='EXEC_17554'
;  2    3    4

SQL_ID
-------------
20ypq7mzad6ah
2dhfrqwrv0m16
4z3gq9xh9a5jr
58h2g858zqckc
5mgq2hd4xz6vv
8m3qru4z4687w
ag01z6qn8450d
apzyk43bfp6np
byav70kx3bj8w
cr1s7zpp7285p
d28dgmyr5910n
g84pgjy5ycw2g

12 rows selected.

SQL> select sql_id from DBA_ADVISOR_SQLSTATS where EXECUTION_NAME='EXEC_17554'
minus
select sql_id from DBA_ADVISOR_SQLPLANS where EXECUTION_NAME='EXEC_17554'
;  2    3    4

no rows selected

SQL>

++++++++++

case when finding_type = 3 AND bitand(finding_flags, 2) <> 0 then 1 else 0 end

1 - has timeout
0 - no timeout

finding_type and finding_flags are from sys.wri$_adv_findings table.

SQL> r
  1* select distinct TYPE, FLAGS from sys.wri$_adv_findings

      TYPE    FLAGS
---------- ----------
     4        1
     1        0
     4
     4        4
     2        0
     5        0
     2
     3        0
     4        0
     3        2
     4        9
     1
     3       16

13 rows selected.

SQL> r
  1  SELECT oe.*,
  2          f.id finding_id,
  3          f.type finding_type,
  4          f.flags finding_flags
  5  FROM
  6    (SELECT
  7       o.exec_name ,
  8        o.id object_id,
  9        o.attr1 sql_id,
 10        o.attr3 parsing_schema,
 11        to_number(NVL(o.attr5, '0')) phv,
 12        NVL(o.attr8,0) obj_attr8
 13      FROM  sys.wri$_adv_objects o
 14      WHERE o.exec_name = 'EXEC_17554'
 15      AND o.type      = 7
 16    ) oe,
 17    wri$_adv_findings f
 18  WHERE  f.exec_name (+)  = oe.exec_name
 19  AND f.obj_id (+)     = oe.object_id
 20  AND type             = 3
 21  AND bitand(flags,2) <> 0
 22*

EXEC_NAME        OBJECT_ID SQL_ID          PARSING_SCHEMA         PHV  OBJ_ATTR8 FINDING_ID FINDING_TYPE FINDING_FLAGS
--------------- ---------- --------------- --------------- ---------- ---------- ---------- ------------ -------------
EXEC_17554           29975 bxurwhv4muqj5   DEMO1234        2724156332 2438782765      31681            3             2
EXEC_17554           30015 1gzgzfuxn18v1   DEMO345670      4228937525 3182936792      31724            3             2

SQL> 

GoldenGate 12.2 EXCLUDEUSER

Sun, 2016-10-30 16:02

Here’s a good reason to always use the latest version.

GoldenGate 12c Integrated EXTRACT: How To EXCLUDEUSER (Doc ID 2008420.1)

APPLIES TO:

Oracle GoldenGate – Version 12.1.2.0.2 to 12.1.2.1.9 [Release 12.1]
Information in this document applies to any platform.

GOAL

We are trying to exclude the REPLICAT user in OGG 12.1.2 capturing from Oracle 12.1.0.2 bi-directional. But using EXTRACT TRANLOGOPTIONS EXCLUDEUSER to exclude a user in one of the PDBs:

TRANLOGOPTIONS EXCLUDEUSER ZEPP01.ZE_GG

EXTRACT is returning the message:

2015-03-25 15:44:27 ERROR OGG-00303 Could not find USER_ID corresponding to USERNAME ‘ZEPP01.ZE_GG’.

SOLUTION

When using Integrated EXTRACT, EXCLUDEUSER is currently not supported in OGG V12.1.2. We have a enhancement request tracked via Bug 21891811 – Support EXCLUDEUSER in Integrated Extract (IE) for DDL records which has been implementd in OGG v12.2.0.1.

For excluding users in a 12c multitenant DB, OGG v12.1.2  has a new EXTRACT param TRANLOGOPTIONS EXCLUDETAG <nn>. This is typically used to exclude the REPLICAT user in bi-directional configurations.

Changes made by Integrated REP are tagged by default in redo as 00. So adding the EXTRACT param TRANLOGOPTIONS EXCLUDETAG 00

Would exclude those operations.

The tag can also be explicitly set in REPLICAT using:

DBOPTIONS SETTAG 0935

Then in EXTRACT param:

TRANLOGOPTIONS EXCLUDETAG 0935

With OGG v12.2.0.1+, you can use the earlier option of TRANLOGOPTIONS EXCLUDEUSER ZEPP01.ZE_GG

Reference:

(2016, October 18). Retrieved October 30, 2016, from https://support.oracle.com/epmos/faces/DocContentDisplay?id=2008420.1


Working With Interval Datatype

Sat, 2016-10-29 10:41

Here is the scope:

The job takes 42m to complete and monitoring threshold is 30m.

If 42m is the typical to complete, then we should increase the threshold to avoid noise.

If 42m is not the typical time to complete, then we should investigate to see if this is an anomaly.

From dba_scheduler_job_run_details, RUN_DURATION  data type is INTERVAL DAY(3) TO SECOND(0).

Querying dba_scheduler_job_run_details provides the following result.

This seems to be a lot of work trying to identify jobs running longer that 30m, plus there can be errors as a run could have been missed which I did not highlight.

This test case was for 10.2.0.4 but imagine it would for all versions higher.

-- dba_scheduler_jobs
Enter value for 1: PURGE_JOB

OWNER			        JOB_NAME 		      STATE	      REPEAT_INTERVAL						   NEXT_RUN_DATE
------------------------------ ------------------------------ --------------- ------------------------------------------------------------ --------------------------------------------------
DEMODB01		       PURGE_JOB	      SCHEDULED       Freq=Hourly						   28-OCT-16 02.00.00.000000 PM -05:00

-- dba_scheduler_job_run_details

LOG_DATE			    JOB_NAME			   STATUS     ACTUAL_START_DATE 				 RUN_DURATION
----------------------------------- ------------------------------ ---------- -------------------------------------------------- ---------------
28-OCT-16 01.18.34.766342 PM -05:00 PURGE_JOB		   SUCCEEDED  28-OCT-16 01.00.00.101332 PM -05:00		 +000 00:18:35
28-OCT-16 12.18.50.630375 PM -05:00 PURGE_JOB		   SUCCEEDED  28-OCT-16 12.00.00.128330 PM -05:00		 +000 00:18:50
28-OCT-16 11.19.39.302422 AM -05:00 PURGE_JOB		   SUCCEEDED  28-OCT-16 11.00.00.096290 AM -05:00		 +000 00:19:39
28-OCT-16 10.19.06.631086 AM -05:00 PURGE_JOB		   SUCCEEDED  28-OCT-16 10.00.00.098943 AM -05:00		 +000 00:19:07
28-OCT-16 09.21.55.042321 AM -05:00 PURGE_JOB		   SUCCEEDED  28-OCT-16 09.00.00.142871 AM -05:00		 +000 00:21:55
28-OCT-16 08.22.05.168894 AM -05:00 PURGE_JOB		   SUCCEEDED  28-OCT-16 08.00.00.114841 AM -05:00		 +000 00:22:05
28-OCT-16 07.20.58.795685 AM -05:00 PURGE_JOB		   SUCCEEDED  28-OCT-16 07.00.00.615018 AM -05:00		 +000 00:20:58
28-OCT-16 06.19.32.286364 AM -05:00 PURGE_JOB		   SUCCEEDED  28-OCT-16 06.00.04.355748 AM -05:00		 +000 00:19:28
28-OCT-16 05.22.12.990840 AM -05:00 PURGE_JOB		   SUCCEEDED  28-OCT-16 05.00.00.108447 AM -05:00		 +000 00:22:13
28-OCT-16 04.22.46.316064 AM -05:00 PURGE_JOB		   SUCCEEDED  28-OCT-16 04.00.00.822142 AM -05:00		 +000 00:22:45
28-OCT-16 03.23.49.518493 AM -05:00 PURGE_JOB		   SUCCEEDED  28-OCT-16 03.00.00.767310 AM -05:00		 +000 00:23:49
28-OCT-16 02.33.20.747873 AM -05:00 PURGE_JOB		   SUCCEEDED  28-OCT-16 02.00.00.689275 AM -05:00		 +000 00:33:20
28-OCT-16 01.42.40.477522 AM -05:00 PURGE_JOB		   SUCCEEDED  28-OCT-16 01.00.00.687059 AM -05:00		 +000 00:42:40
28-OCT-16 12.24.03.200350 AM -05:00 PURGE_JOB		   SUCCEEDED  28-OCT-16 12.00.00.687291 AM -05:00		 +000 00:24:03
27-OCT-16 11.21.45.310127 PM -05:00 PURGE_JOB		   SUCCEEDED  27-OCT-16 11.00.00.174274 PM -05:00		 +000 00:21:45
27-OCT-16 10.22.04.226755 PM -05:00 PURGE_JOB		   SUCCEEDED  27-OCT-16 10.00.00.100101 PM -05:00		 +000 00:22:04
27-OCT-16 09.20.46.491481 PM -05:00 PURGE_JOB		   SUCCEEDED  27-OCT-16 09.00.00.095188 PM -05:00		 +000 00:20:46
27-OCT-16 08.20.11.936472 PM -05:00 PURGE_JOB		   SUCCEEDED  27-OCT-16 08.00.01.162137 PM -05:00		 +000 00:20:11
27-OCT-16 07.16.30.836698 PM -05:00 PURGE_JOB		   SUCCEEDED  27-OCT-16 07.00.00.122310 PM -05:00		 +000 00:16:31
27-OCT-16 06.17.19.315011 PM -05:00 PURGE_JOB		   SUCCEEDED  27-OCT-16 06.00.00.683161 PM -05:00		 +000 00:17:19
27-OCT-16 05.17.40.010428 PM -05:00 PURGE_JOB		   SUCCEEDED  27-OCT-16 05.00.00.093667 PM -05:00		 +000 00:17:40
27-OCT-16 04.18.08.064115 PM -05:00 PURGE_JOB		   SUCCEEDED  27-OCT-16 04.00.00.227937 PM -05:00		 +000 00:18:08
27-OCT-16 03.19.58.561961 PM -05:00 PURGE_JOB		   SUCCEEDED  27-OCT-16 03.00.00.136952 PM -05:00		 +000 00:19:58
27-OCT-16 02.17.30.492761 PM -05:00 PURGE_JOB		   SUCCEEDED  27-OCT-16 02.00.00.149822 PM -05:00		 +000 00:17:30
27-OCT-16 01.17.44.490772 PM -05:00 PURGE_JOB		   SUCCEEDED  27-OCT-16 01.00.00.084995 PM -05:00		 +000 00:17:44
27-OCT-16 12.19.29.486819 PM -05:00 PURGE_JOB		   SUCCEEDED  27-OCT-16 12.00.00.665087 PM -05:00		 +000 00:19:29
27-OCT-16 11.19.43.126793 AM -05:00 PURGE_JOB		   SUCCEEDED  27-OCT-16 11.00.00.095392 AM -05:00		 +000 00:19:43
27-OCT-16 10.20.28.096927 AM -05:00 PURGE_JOB		   SUCCEEDED  27-OCT-16 10.00.00.098227 AM -05:00		 +000 00:20:28
27-OCT-16 09.20.59.774236 AM -05:00 PURGE_JOB		   SUCCEEDED  27-OCT-16 09.00.00.087305 AM -05:00		 +000 00:21:00
27-OCT-16 08.20.11.194525 AM -05:00 PURGE_JOB		   SUCCEEDED  27-OCT-16 08.00.00.095362 AM -05:00		 +000 00:20:11
27-OCT-16 07.21.19.440710 AM -05:00 PURGE_JOB		   SUCCEEDED  27-OCT-16 07.00.00.093116 AM -05:00		 +000 00:21:19
27-OCT-16 06.21.21.777725 AM -05:00 PURGE_JOB		   SUCCEEDED  27-OCT-16 06.00.00.729176 AM -05:00		 +000 00:21:21
27-OCT-16 05.22.00.235810 AM -05:00 PURGE_JOB		   SUCCEEDED  27-OCT-16 05.00.00.093358 AM -05:00		 +000 00:22:00
27-OCT-16 04.22.41.035983 AM -05:00 PURGE_JOB		   SUCCEEDED  27-OCT-16 04.00.00.109282 AM -05:00		 +000 00:22:41
27-OCT-16 03.23.03.747790 AM -05:00 PURGE_JOB		   SUCCEEDED  27-OCT-16 03.00.00.740992 AM -05:00		 +000 00:23:03
27-OCT-16 02.28.28.902795 AM -05:00 PURGE_JOB		   SUCCEEDED  27-OCT-16 02.00.00.098180 AM -05:00		 +000 00:28:29
27-OCT-16 01.38.20.999365 AM -05:00 PURGE_JOB		   SUCCEEDED  27-OCT-16 01.00.00.618087 AM -05:00		 +000 00:38:20
27-OCT-16 12.22.48.596935 AM -05:00 PURGE_JOB		   SUCCEEDED  27-OCT-16 12.00.00.134944 AM -05:00		 +000 00:22:48
26-OCT-16 11.22.39.417841 PM -05:00 PURGE_JOB		   SUCCEEDED  26-OCT-16 11.00.00.601951 PM -05:00		 +000 00:22:39
26-OCT-16 10.21.24.088692 PM -05:00 PURGE_JOB		   SUCCEEDED  26-OCT-16 10.00.00.700209 PM -05:00		 +000 00:21:23
26-OCT-16 09.21.48.083949 PM -05:00 PURGE_JOB		   SUCCEEDED  26-OCT-16 09.00.00.108737 PM -05:00		 +000 00:21:48
26-OCT-16 08.20.36.600056 PM -05:00 PURGE_JOB		   SUCCEEDED  26-OCT-16 08.00.00.599238 PM -05:00		 +000 00:20:36
26-OCT-16 07.21.26.973000 PM -05:00 PURGE_JOB		   SUCCEEDED  26-OCT-16 07.00.00.170795 PM -05:00		 +000 00:21:27
26-OCT-16 06.21.13.513245 PM -05:00 PURGE_JOB		   SUCCEEDED  26-OCT-16 06.00.00.661959 PM -05:00		 +000 00:21:13
26-OCT-16 05.20.38.611174 PM -05:00 PURGE_JOB		   SUCCEEDED  26-OCT-16 05.00.00.095111 PM -05:00		 +000 00:20:39
26-OCT-16 04.19.43.026097 PM -05:00 PURGE_JOB		   SUCCEEDED  26-OCT-16 04.00.00.647115 PM -05:00		 +000 00:19:42
26-OCT-16 03.22.25.930388 PM -05:00 PURGE_JOB		   SUCCEEDED  26-OCT-16 03.00.00.099210 PM -05:00		 +000 00:22:26
26-OCT-16 02.22.28.929046 PM -05:00 PURGE_JOB		   SUCCEEDED  26-OCT-16 02.00.00.084756 PM -05:00		 +000 00:22:29
26-OCT-16 01.22.35.673399 PM -05:00 PURGE_JOB		   SUCCEEDED  26-OCT-16 01.00.00.092354 PM -05:00		 +000 00:22:36
26-OCT-16 12.22.51.518382 PM -05:00 PURGE_JOB		   SUCCEEDED  26-OCT-16 12.00.00.098155 PM -05:00		 +000 00:22:51
26-OCT-16 11.25.12.885694 AM -05:00 PURGE_JOB		   SUCCEEDED  26-OCT-16 11.00.00.097514 AM -05:00		 +000 00:25:13
26-OCT-16 10.25.30.697623 AM -05:00 PURGE_JOB		   SUCCEEDED  26-OCT-16 10.00.00.109984 AM -05:00		 +000 00:25:31
26-OCT-16 09.25.48.331970 AM -05:00 PURGE_JOB		   SUCCEEDED  26-OCT-16 09.00.00.650305 AM -05:00		 +000 00:25:48
26-OCT-16 08.23.00.786181 AM -05:00 PURGE_JOB		   SUCCEEDED  26-OCT-16 08.00.00.092182 AM -05:00		 +000 00:23:01
26-OCT-16 07.23.09.292134 AM -05:00 PURGE_JOB		   SUCCEEDED  26-OCT-16 07.00.00.706906 AM -05:00		 +000 00:23:09
26-OCT-16 06.23.26.838110 AM -05:00 PURGE_JOB		   SUCCEEDED  26-OCT-16 06.00.00.737269 AM -05:00		 +000 00:23:26
26-OCT-16 05.23.46.628555 AM -05:00 PURGE_JOB		   SUCCEEDED  26-OCT-16 05.00.00.779244 AM -05:00		 +000 00:23:46
26-OCT-16 04.26.10.248261 AM -05:00 PURGE_JOB		   SUCCEEDED  26-OCT-16 04.00.00.118811 AM -05:00		 +000 00:26:10
26-OCT-16 03.26.45.574405 AM -05:00 PURGE_JOB		   SUCCEEDED  26-OCT-16 03.00.00.868199 AM -05:00		 +000 00:26:45
26-OCT-16 02.29.59.220470 AM -05:00 PURGE_JOB		   SUCCEEDED  26-OCT-16 02.00.00.716143 AM -05:00		 +000 00:29:59
26-OCT-16 01.41.19.190372 AM -05:00 PURGE_JOB		   SUCCEEDED  26-OCT-16 01.00.00.671400 AM -05:00		 +000 00:41:19
26-OCT-16 12.40.14.668943 AM -05:00 PURGE_JOB		   SUCCEEDED  26-OCT-16 12.00.00.686242 AM -05:00		 +000 00:40:14
25-OCT-16 11.25.01.222486 PM -05:00 PURGE_JOB		   SUCCEEDED  25-OCT-16 11.00.00.094405 PM -05:00		 +000 00:25:01
25-OCT-16 10.25.16.188272 PM -05:00 PURGE_JOB		   SUCCEEDED  25-OCT-16 10.00.00.093149 PM -05:00		 +000 00:25:16
25-OCT-16 09.22.50.957227 PM -05:00 PURGE_JOB		   SUCCEEDED  25-OCT-16 09.00.00.685572 PM -05:00		 +000 00:22:50
25-OCT-16 08.23.24.366195 PM -05:00 PURGE_JOB		   SUCCEEDED  25-OCT-16 08.00.00.681146 PM -05:00		 +000 00:23:24
25-OCT-16 07.21.34.877025 PM -05:00 PURGE_JOB		   SUCCEEDED  25-OCT-16 07.00.00.679188 PM -05:00		 +000 00:21:34
25-OCT-16 06.22.01.687270 PM -05:00 PURGE_JOB		   SUCCEEDED  25-OCT-16 06.00.00.705931 PM -05:00		 +000 00:22:01
25-OCT-16 05.22.59.985410 PM -05:00 PURGE_JOB		   SUCCEEDED  25-OCT-16 05.00.00.058401 PM -05:00		 +000 00:23:00
25-OCT-16 04.23.47.510414 PM -05:00 PURGE_JOB		   SUCCEEDED  25-OCT-16 04.00.00.117113 PM -05:00		 +000 00:23:47
25-OCT-16 03.23.04.877802 PM -05:00 PURGE_JOB		   SUCCEEDED  25-OCT-16 03.00.00.099222 PM -05:00		 +000 00:23:05
25-OCT-16 02.26.03.301910 PM -05:00 PURGE_JOB		   SUCCEEDED  25-OCT-16 02.00.00.116152 PM -05:00		 +000 00:26:03
25-OCT-16 01.24.27.430723 PM -05:00 PURGE_JOB		   SUCCEEDED  25-OCT-16 01.00.00.117626 PM -05:00		 +000 00:24:27
25-OCT-16 12.24.36.971637 PM -05:00 PURGE_JOB		   SUCCEEDED  25-OCT-16 12.00.00.664118 PM -05:00		 +000 00:24:36
25-OCT-16 11.23.58.307402 AM -05:00 PURGE_JOB		   SUCCEEDED  25-OCT-16 11.00.00.096260 AM -05:00		 +000 00:23:58
25-OCT-16 10.24.31.716126 AM -05:00 PURGE_JOB		   SUCCEEDED  25-OCT-16 10.00.00.092256 AM -05:00		 +000 00:24:32
25-OCT-16 09.24.10.974503 AM -05:00 PURGE_JOB		   SUCCEEDED  25-OCT-16 09.00.00.100348 AM -05:00		 +000 00:24:11
25-OCT-16 08.22.53.833215 AM -05:00 PURGE_JOB		   SUCCEEDED  25-OCT-16 08.00.00.082274 AM -05:00		 +000 00:22:54
25-OCT-16 07.24.30.938431 AM -05:00 PURGE_JOB		   SUCCEEDED  25-OCT-16 07.00.00.692159 AM -05:00		 +000 00:24:30
25-OCT-16 06.23.52.431531 AM -05:00 PURGE_JOB		   SUCCEEDED  25-OCT-16 06.00.00.093246 AM -05:00		 +000 00:23:52
25-OCT-16 05.24.41.532133 AM -05:00 PURGE_JOB		   SUCCEEDED  25-OCT-16 05.00.00.729381 AM -05:00		 +000 00:24:41
25-OCT-16 04.23.25.958305 AM -05:00 PURGE_JOB		   SUCCEEDED  25-OCT-16 04.00.00.208211 AM -05:00		 +000 00:23:26
25-OCT-16 03.25.01.192060 AM -05:00 PURGE_JOB		   SUCCEEDED  25-OCT-16 03.00.00.106130 AM -05:00		 +000 00:25:01
25-OCT-16 02.28.53.376223 AM -05:00 PURGE_JOB		   SUCCEEDED  25-OCT-16 02.00.00.662053 AM -05:00		 +000 00:28:53
25-OCT-16 01.40.10.906657 AM -05:00 PURGE_JOB		   SUCCEEDED  25-OCT-16 01.00.00.690348 AM -05:00		 +000 00:40:10
25-OCT-16 12.26.06.567009 AM -05:00 PURGE_JOB		   SUCCEEDED  25-OCT-16 12.00.00.101229 AM -05:00		 +000 00:26:06
24-OCT-16 11.23.44.968956 PM -05:00 PURGE_JOB		   SUCCEEDED  24-OCT-16 11.00.00.112954 PM -05:00		 +000 00:23:45
24-OCT-16 10.25.27.790486 PM -05:00 PURGE_JOB		   SUCCEEDED  24-OCT-16 10.00.02.818356 PM -05:00		 +000 00:25:25
24-OCT-16 09.21.43.329295 PM -05:00 PURGE_JOB		   SUCCEEDED  24-OCT-16 09.00.00.143735 PM -05:00		 +000 00:21:43
24-OCT-16 08.23.53.456424 PM -05:00 PURGE_JOB		   SUCCEEDED  24-OCT-16 08.00.00.699357 PM -05:00		 +000 00:23:53
24-OCT-16 07.22.46.201840 PM -05:00 PURGE_JOB		   SUCCEEDED  24-OCT-16 07.00.00.108008 PM -05:00		 +000 00:22:46
24-OCT-16 06.24.31.090402 PM -05:00 PURGE_JOB		   SUCCEEDED  24-OCT-16 06.00.00.712135 PM -05:00		 +000 00:24:30
24-OCT-16 05.22.41.748800 PM -05:00 PURGE_JOB		   SUCCEEDED  24-OCT-16 05.00.00.092252 PM -05:00		 +000 00:22:42
24-OCT-16 04.24.25.687414 PM -05:00 PURGE_JOB		   SUCCEEDED  24-OCT-16 04.00.00.093241 PM -05:00		 +000 00:24:26
24-OCT-16 03.24.51.693561 PM -05:00 PURGE_JOB		   SUCCEEDED  24-OCT-16 03.00.00.734264 PM -05:00		 +000 00:24:51
24-OCT-16 02.23.25.886242 PM -05:00 PURGE_JOB		   SUCCEEDED  24-OCT-16 02.00.00.689991 PM -05:00		 +000 00:23:25
24-OCT-16 01.26.34.238241 PM -05:00 PURGE_JOB		   SUCCEEDED  24-OCT-16 01.00.00.097179 PM -05:00		 +000 00:26:34
24-OCT-16 12.26.56.946893 PM -05:00 PURGE_JOB		   SUCCEEDED  24-OCT-16 12.00.00.097951 PM -05:00		 +000 00:26:57

98 rows selected.

SQL >

Here’s the better way for  doing this using extract function.

Datatype is data type is INTERVAL DAY(3) TO SECOND(0)..

24 hours per day and 60 minutes per hour.

SQL > r
  1  SELECT log_date, job_name, extract(day from 24*60*RUN_DURATION) mins
  2  FROM dba_scheduler_job_run_details
  3  WHERE extract(day from 24*60*RUN_DURATION)>30
  4  AND job_name='PURGE_JOB'
  5  and log_date>sysdate-90
  6  ORDER BY 1 DESC
  7*

LOG_DATE			    JOB_NAME				 MINS
----------------------------------- ------------------------------ ----------
28-OCT-16 02.33.20.747873 AM -05:00 PURGE_JOB			   33
28-OCT-16 01.42.40.477522 AM -05:00 PURGE_JOB			   42
27-OCT-16 01.38.20.999365 AM -05:00 PURGE_JOB			   38
26-OCT-16 01.41.19.190372 AM -05:00 PURGE_JOB			   41
26-OCT-16 12.40.14.668943 AM -05:00 PURGE_JOB			   40
25-OCT-16 01.40.10.906657 AM -05:00 PURGE_JOB			   40
24-OCT-16 03.31.51.372573 AM -05:00 PURGE_JOB			   31
24-OCT-16 02.31.55.268260 AM -05:00 PURGE_JOB			   31
24-OCT-16 01.45.33.525611 AM -05:00 PURGE_JOB			   45
22-OCT-16 05.39.23.980162 AM -05:00 PURGE_JOB			   39
22-OCT-16 04.31.25.202116 AM -05:00 PURGE_JOB			   31
21-OCT-16 01.38.29.977490 AM -05:00 PURGE_JOB			   38
20-OCT-16 01.40.58.167010 AM -05:00 PURGE_JOB			   40
19-OCT-16 01.32.25.295604 AM -05:00 PURGE_JOB			   32
18-OCT-16 01.32.53.733495 AM -05:00 PURGE_JOB			   32
17-OCT-16 01.31.49.296251 AM -05:00 PURGE_JOB			   31
14-OCT-16 03.31.43.274818 AM -05:00 PURGE_JOB			   31
14-OCT-16 02.36.02.084047 AM -05:00 PURGE_JOB			   36
14-OCT-16 01.40.30.270864 AM -05:00 PURGE_JOB			   40
13-OCT-16 01.40.32.792297 AM -05:00 PURGE_JOB			   40
12-OCT-16 03.31.59.942443 AM -05:00 PURGE_JOB			   31
12-OCT-16 02.35.10.422916 AM -05:00 PURGE_JOB			   35
12-OCT-16 01.44.37.543112 AM -05:00 PURGE_JOB			   44
11-OCT-16 01.37.06.018139 AM -05:00 PURGE_JOB			   37
10-OCT-16 03.31.07.278843 AM -05:00 PURGE_JOB			   31
10-OCT-16 02.33.08.974312 AM -05:00 PURGE_JOB			   33
10-OCT-16 01.44.18.952183 AM -05:00 PURGE_JOB			   44
08-OCT-16 05.34.36.615095 AM -05:00 PURGE_JOB			   34
03-OCT-16 02.34.54.308012 AM -05:00 PURGE_JOB			   34
03-OCT-16 01.38.21.388805 AM -05:00 PURGE_JOB			   38
02-OCT-16 04.33.57.111031 PM -05:00 PURGE_JOB			   33
02-OCT-16 03.31.53.305048 AM -05:00 PURGE_JOB			   31
02-OCT-16 01.38.53.896792 AM -05:00 PURGE_JOB			   38
30-SEP-16 04.31.26.036246 AM -05:00 PURGE_JOB			   31
30-SEP-16 01.42.47.725811 AM -05:00 PURGE_JOB			   42
29-SEP-16 01.35.00.663317 AM -05:00 PURGE_JOB			   35

36 rows selected.

SQL > 

Quarterly CPU – To Patch or Not

Wed, 2016-10-26 08:13

If the organization is mandated by regulation, e.g. PCI, then it’s a no brainer.

What if the is no regulation and system is stable?

At this point, it depends on risk tolerance.

Review Oracle Critical Patch Update Advisory – October 2016 and search for Oracle Database Server Risk Matrix.

This example is for Oracle Database Server and please search accordingly for the required components.

Remote Exploit without Auth.? NO for all except Application Express

How much time is spent assessing risk and is it more efficient to spend the time patching?

It all boils down to time and tolerance.


Isolate Your Code

Tue, 2016-10-25 19:19

I fail to understand anonymous PL/SQL block is used with dbms_scheduler.

Here is an example:
hawk:(SYSTEM@hawk):PRIMARY> @x.sql
hawk:(SYSTEM@hawk):PRIMARY> set echo on
hawk:(SYSTEM@hawk):PRIMARY> BEGIN
  2  DBMS_SCHEDULER.CREATE_PROGRAM(
  3  program_name=>'TESTING',
  4  program_action=>'DECLARE
  5  x NUMBER := 100;
  6  BEGIN
  7     FOR i IN 1..10 LOOP
  8        IF MOD(i,2) = 0 THEN
  9           INSERT INTO temp VALUES (i);
 10        ELSE
 11           INSERT INTO temp VALUES (i);
 12        END IF;
 13        x := x + 100;
 14     END LOOP;
 15     COMMIT;
 16  END;',
 17  program_type=>'PLSQL_BLOCK',
 18  number_of_arguments=>0
 19  );
 20  END;
 21  /

PL/SQL procedure successfully completed.

hawk:(SYSTEM@hawk):PRIMARY> show error
No errors.
hawk:(SYSTEM@hawk):PRIMARY> -- exec DBMS_SCHEDULER.DROP_PROGRAM('TESTING');
Nothing wrong, right? What happens when we strip out and run the anonymous PL/SQL block?
hawk:(SYSTEM@hawk):PRIMARY> @y.sql
hawk:(SYSTEM@hawk):PRIMARY> DECLARE
  2     x NUMBER := 100;
  3  BEGIN
  4     FOR i IN 1..10 LOOP
  5        IF MOD(i,2) = 0 THEN
  6           INSERT INTO temp VALUES (i);
  7        ELSE
  8           INSERT INTO temp VALUES (i);
  9        END IF;
 10        x := x + 100;
 11     END LOOP;
 12     COMMIT;
 13  END;
 14  /
         INSERT INTO temp VALUES (i);
                     *
ERROR at line 6:
ORA-06550: line 6, column 22:
PL/SQL: ORA-00942: table or view does not exist
ORA-06550: line 6, column 10:
PL/SQL: SQL Statement ignored
ORA-06550: line 8, column 22:
PL/SQL: ORA-00942: table or view does not exist
ORA-06550: line 8, column 10:
PL/SQL: SQL Statement ignored


hawk:(SYSTEM@hawk):PRIMARY> desc temp;
ERROR:
ORA-04043: object temp does not exist


hawk:(SYSTEM@hawk):PRIMARY>
Why not create stored procedure or package?
hawk:(SYSTEM@hawk):PRIMARY> @z.sql
hawk:(SYSTEM@hawk):PRIMARY> create or replace procedure SP_TESTING
  2  AS
  3  x NUMBER := 100;
  4  BEGIN
  5     FOR i IN 1..10 LOOP
  6        IF MOD(i,2) = 0 THEN
  7           INSERT INTO temp VALUES (i);
  8        ELSE
  9           INSERT INTO temp VALUES (i);
 10        END IF;
 11        x := x + 100;
 12     END LOOP;
 13     COMMIT;
 14  END;
 15  /

Warning: Procedure created with compilation errors.

hawk:(SYSTEM@hawk):PRIMARY> show error
Errors for PROCEDURE SP_TESTING:

LINE/COL ERROR
-------- -----------------------------------------------------------------
7/10     PL/SQL: SQL Statement ignored
7/22     PL/SQL: ORA-00942: table or view does not exist
9/10     PL/SQL: SQL Statement ignored
9/22     PL/SQL: ORA-00942: table or view does not exist

hawk:(SYSTEM@hawk):PRIMARY> create table temp(id int);

Table created.

hawk:(SYSTEM@hawk):PRIMARY> alter procedure SP_TESTING compile;

Procedure altered.

hawk:(SYSTEM@hawk):PRIMARY> show error
No errors.
hawk:(SYSTEM@hawk):PRIMARY> @a.sql
hawk:(SYSTEM@hawk):PRIMARY> BEGIN
  2  DBMS_SCHEDULER.CREATE_PROGRAM(
  3  program_name=>'TESTING2',
  4  program_action=>'BEGIN SP_TESTING; END;',
  5  program_type=>'PLSQL_BLOCK',
  6  number_of_arguments=>0
  7  );
  8  END;
  9  /

PL/SQL procedure successfully completed.

hawk:(SYSTEM@hawk):PRIMARY> show error
No errors.
hawk:(SYSTEM@hawk):PRIMARY> BEGIN SP_TESTING; END;
  2  /

PL/SQL procedure successfully completed.

hawk:(SYSTEM@hawk):PRIMARY> select * from temp;

        ID
----------
         1
         2
         3
         4
         5
         6
         7
         8
         9
        10

10 rows selected.

hawk:(SYSTEM@hawk):PRIMARY>

Oracle Health Check

Sat, 2016-10-22 07:44

Currently, I am working on health check for ODA and find there are too many tools with disparate information.

I am sure there are more than the ones listed below and stopped searching.

ODA Oracle Database Appliance orachk Healthcheck (Doc ID 2126926.1)
Multiplexing Redolog and Control File on ODA (Doc ID 2086289.1)

ORAchk – Health Checks for the Oracle Stack (Doc ID 1268927.2)
How to Perform a Health Check on the Database (Doc ID 122669.1)
Health Monitor (Doc ID 466920.1)

Oracle Configuration Manager Quick Start Guide (Doc ID 728988.5)
Pre-12+ OCM Collectors to Be Decommissioned Summer of 2015 (Doc ID 1986521.1)

cluvfy comp healthcheck

One example found:  ORAchk will report if less than 3 SCANs configured while cluvfy comp healthcheck (11.2) does not.

Intesteresting side track: < 3 not escaped is  ❤

Complete cluvfy comp healthcheck  results plus how to create database user CVUSYS (WARNING: ~1600 lines).

Some failures from cluvfy comp healthcheck.

******************************************************************************************
Database recommendation checks for "emu"
******************************************************************************************

Verification Check        :  DB Log Mode
Verification Description  :  Checks the database log archiving mode
Verification Result       :  NOT MET
Verification Summary      :  Check for DB Log Mode failed
Additional Details        :  If the database is in log archiving mode, then it is
                             always desirable and advisable to upgrade the database in
                             noarchivelog mode as that will reduce the time taken to
                             upgrade the database. After the upgrade, the database can
                             be reverted to the archivelog mode.
References (URLs/Notes)   :  https://support.oracle.com/CSP/main/article?cmd=show&type=N
                             OT&id=429825.1

Database(Instance)  Status    Expected Value                Actual Value
------------------------------------------------------------------------------------------

emu                 FAILED    db_log_mode = NOARCHIVELOG    db_log_mode = ARCHIVELOG

__________________________________________________________________________________________

Database(Instance)  Error details
------------------------------------------------------------------------------------------

emu                 Error - NOARCHIVELOG mode is recommended when upgrading
                    Cause - Cause Of Problem Not Available
                    Action - User Action Not Available
__________________________________________________________________________________________

Verification Check        :  Users Granted CONNECT Role
Verification Description  :  Checks for the presence of any users with CONNECT role
Verification Result       :  NOT MET
Verification Summary      :  Check for Users Granted CONNECT Role failed

Database(Instance)  Status    Expected Value                Actual Value
------------------------------------------------------------------------------------------

emu                 FAILED    connect_role_grantees = 0     connect_role_grantees = 5

__________________________________________________________________________________________

Database(Instance)  Error details
------------------------------------------------------------------------------------------

emu                 Error - CONNECT role granted users found
                    Cause - Cause Of Problem Not Available
                    Action - User Action Not Available
__________________________________________________________________________________________

Does Oracle itself needs a health check?


OTN Appreciation Day : Create Database Using SQL | Thinking Out Loud Blog

Tue, 2016-10-11 07:30

Do you ever wonder how to get all parameters for CREATE DATABASE Statement ?

I will be sharing some of the reverse engineering done to create a duplicate copy of the database.

Some of you may be thinking, “Why not just duplicate database or backup and restore?”

For the project I was working on, this was not feasible since Extended Data Types (12c NF) was enabled and there is no going back.

Restoring database from backup would result in too much data loss.

This leaves the only option is to create new database with max_string_size=standard, and perform full export/import.

From backup controlfile to trace:
SYS@DB1> alter database backup controlfile to trace as '/tmp/cf_@.sql' reuse resetlogs;
Database altered.

SYS@DB1>
From /tmp/cf_DB1.sql:
$ ll /tmp/cf_DB1.sql
-rw-r--r--. 1 oracle oinstall 2955 Oct 11 04:45 /tmp/cf_DB1.sql

STARTUP NOMOUNT
CREATE CONTROLFILE REUSE DATABASE "DB1" RESETLOGS  ARCHIVELOG
    MAXLOGFILES 32
    MAXLOGMEMBERS 4
    MAXDATAFILES 400
    MAXINSTANCES 1
    MAXLOGHISTORY 292
LOGFILE
  GROUP 1 '/oradata/DB1A/onlinelog/o1_mf_1_czl4h9sg_.log'  SIZE 200M BLOCKSIZE 512,
  GROUP 2 '/oradata/DB1A/onlinelog/o1_mf_2_czl4h9yr_.log'  SIZE 200M BLOCKSIZE 512,
  GROUP 3 '/oradata/DB1A/onlinelog/o1_mf_3_czl4hbdb_.log'  SIZE 200M BLOCKSIZE 512
From DBA_REGISTRY:
DB1:(SYS@DB1):PRIMARY> select name,comp_id,comp_name,version,schema,status
  2  from v$database,dba_registry
  3  order by 2
  4  ;

NAME       COMP_ID      COMP_NAME                                VERSION    SCHEMA     STATUS
---------- ------------ ---------------------------------------- ---------- ---------- --------
DB1        CATALOG      Oracle Database Catalog Views            12.1.0.2.0 SYS        VALID
DB1        CATJAVA      Oracle Database Java Packages            12.1.0.2.0 SYS        VALID
DB1        CATPROC      Oracle Database Packages and Types       12.1.0.2.0 SYS        VALID
DB1        JAVAVM       JServer JAVA Virtual Machine             12.1.0.2.0 SYS        VALID
DB1        XDB          Oracle XML Database                      12.1.0.2.0 XDB        VALID
DB1        XML          Oracle XDK                               12.1.0.2.0 SYS        VALID

6 rows selected.

DB1:(SYS@DB1):PRIMARY>
From DATABASE_PROPERTIES:
DB1:(SYS@DB1):PRIMARY> select property_name,property_value from DATABASE_PROPERTIES;

PROPERTY_NAME                            PROPERTY_VALUE
---------------------------------------- ----------------------------------------
DICT.BASE                                2
DEFAULT_TEMP_TABLESPACE                  TEMP
DEFAULT_PERMANENT_TABLESPACE             USERS
DEFAULT_EDITION                          ORA$BASE
Flashback Timestamp TimeZone             GMT
TDE_MASTER_KEY_ID
EXPORT_VIEWS_VERSION                     8
DEFAULT_TBS_TYPE                         SMALLFILE
GLOBAL_DB_NAME                           DB1
NLS_RDBMS_VERSION                        12.1.0.2.0
NLS_NCHAR_CHARACTERSET                   AL16UTF16
NLS_NCHAR_CONV_EXCP                      FALSE
NLS_LENGTH_SEMANTICS                     BYTE
NLS_COMP                                 BINARY
NLS_DUAL_CURRENCY                        $
NLS_TIMESTAMP_TZ_FORMAT                  DD-MON-RR HH.MI.SSXFF AM TZR
NLS_TIME_TZ_FORMAT                       HH.MI.SSXFF AM TZR
NLS_TIMESTAMP_FORMAT                     DD-MON-RR HH.MI.SSXFF AM
NLS_TIME_FORMAT                          HH.MI.SSXFF AM
NLS_SORT                                 BINARY
NLS_DATE_LANGUAGE                        AMERICAN
NLS_DATE_FORMAT                          DD-MON-RR
NLS_CALENDAR                             GREGORIAN
NLS_CHARACTERSET                         AL32UTF8
NLS_NUMERIC_CHARACTERS                   .,
NLS_ISO_CURRENCY                         AMERICA
NLS_CURRENCY                             $
NLS_TERRITORY                            AMERICA
NLS_LANGUAGE                             AMERICAN
DST_SECONDARY_TT_VERSION                 0
DST_PRIMARY_TT_VERSION                   18
DST_UPGRADE_STATE                        NONE
MAX_STRING_SIZE                          STANDARD
DBTIMEZONE                               US/Mountain
WORKLOAD_CAPTURE_MODE
WORKLOAD_REPLAY_MODE
NO_USERID_VERIFIER_SALT                  88C7FDB8D44CA60E05624A08A177722C

37 rows selected.

DB1:(SYS@DB1):PRIMARY>
From V$DATABASE:
DB1:(SYS@DB1):PRIMARY> r
  1  select log_mode,flashback_on,force_logging,created
  2  from V$DATABASE
  3*

LOG_MODE     FLASHBACK_ON       FORCE_LOGGING                           CREATED
------------ ------------------ --------------------------------------- -------------------
ARCHIVELOG   NO                 NO                                      2016-10-08 08:34:02

DB1:(SYS@DB1):PRIMARY>
From: V$BLOCK_CHANGE_TRACKING:
DB1:(SYS@DB1):PRIMARY> r
  1  select status, filename
  2  from V$BLOCK_CHANGE_TRACKING
  3*

STATUS     FILENAME
---------- --------------------
DISABLED

DB1:(SYS@DB1):PRIMARY>
From DBA_SCHEDULER_GLOBAL_ATTRIBUTE:
DB1:(SYS@DB1):PRIMARY> r
  1  select *
  2  from DBA_SCHEDULER_GLOBAL_ATTRIBUTE
  3  order by 1
  4*

ATTRIBUTE_NAME                           VALUE
---------------------------------------- ----------------------------------------
CURRENT_OPEN_WINDOW
DEFAULT_TIMEZONE                         US/Mountain
EMAIL_SENDER
EMAIL_SERVER
EMAIL_SERVER_CREDENTIAL
EMAIL_SERVER_ENCRYPTION                  NONE
EVENT_EXPIRY_TIME
FILE_WATCHER_COUNT                       0
LAST_OBSERVED_EVENT
LOG_HISTORY                              30
MAX_JOB_SLAVE_PROCESSES

11 rows selected.

DB1:(SYS@DB1):PRIMARY>
The finished SQL: crdb.sql
spool crdbp.log
set echo on timing on time on
host echo $ORACLE_SID
host sysresv
create spfile from pfile;
startup force nomount;
CREATE DATABASE
MAXINSTANCES 1
MAXLOGFILES 32
MAXLOGMEMBERS 4
MAXLOGHISTORY 292
MAXDATAFILES 400
ARCHIVELOG
CHARACTER SET AL32UTF8
NATIONAL CHARACTER SET AL16UTF16
SET TIME_ZONE='US/Mountain'
USER SYS IDENTIFIED BY oracle
USER SYSTEM IDENTIFIED BY oracle
EXTENT MANAGEMENT LOCAL
DATAFILE SIZE 513M AUTOEXTEND ON NEXT 128M MAXSIZE 8193M
SYSAUX DATAFILE SIZE 257M AUTOEXTEND ON NEXT 128M MAXSIZE 8193M
LOGFILE GROUP 1 SIZE 200M,GROUP 2 SIZE 200M,GROUP 3 SIZE 200M
DEFAULT TEMPORARY TABLESPACE temp TEMPFILE SIZE 256M AUTOEXTEND ON NEXT 128M MAXSIZE 8192M
DEFAULT TABLESPACE users DATAFILE SIZE 129M AUTOEXTEND ON NEXT 128M MAXSIZE 8193M
UNDO TABLESPACE undotbs1 DATAFILE SIZE 256M AUTOEXTEND ON NEXT 128M MAXSIZE 8192M;
spool off
@?/rdbms/admin/catalog.sql
@?/rdbms/admin/catproc.sql
@?/javavm/install/initjvm.sql
@?/xdk/admin/initxml.sql
@?/xdk/admin/xmlja.sql
@?/rdbms/admin/catjava.sql
@?/rdbms/admin/catxdbj.sql
@?/rdbms/admin/utlrp.sql
exec dbms_scheduler.set_scheduler_attribute(attribute=>'default_timezone',value=>'US/Mountain');

-- alter system set nls_length_semantics=CHAR scope=both sid='*';
-- alter database flashback on;
-- alter database FORCE LOGGING;
-- alter database enable block change tracking;

connect system/oracle @?/sqlplus/admin/pupbld.sql 
exit

cluvfy is your friend

Sun, 2016-10-09 18:54

Just a reminder to self to use cluvfy

olsnodes -i -n -s -t
grep 'master node' $CRS_HOME/log/`hostname -s`/cssd/ocssd.*|tail -1

cluvfy stage -pre help
cluvfy stage -post  help

++++++++++


[grid@rac01:+ASM1:/home/grid]
$ olsnodes -i -n -s -t
rac01   1       rac01-vip       Active  Unpinned
rac02   2       rac02-vip       Active  Unpinned

++++++++++

[grid@rac01:+ASM1:/home/grid]
$ env|grep HOME
CRS_HOME=/u01/app/11.2.0.4/grid
HOME=/home/grid
XAG_HOME=/u01/app/grid/xag
ORACLE_HOME=/u01/app/11.2.0.4/grid

++++++++++

[grid@rac01:+ASM1:/home/grid]
$ grep 'master node' $CRS_HOME/log/`hostname -s`/cssd/ocssd.*|tail -1
/u01/app/11.2.0.4/grid/log/rac01/cssd/ocssd.log:2016-10-09 10:48:55.837: [    CSSD][28161792]clssgmCMReconfig: reconfiguration successful, incarnation 371471500 with 2 nodes, local node number 1, master node number 1

++++++++++

[grid@rac01:+ASM1:/home/grid]
$ cluvfy stage -pre help

ERROR:
Unexpected symbol "help". See usage for detail.

USAGE:
cluvfy stage {-pre|-post}    [-verbose]

SYNTAX (for Stages):
cluvfy stage -pre cfs -n  -s  [-verbose]
cluvfy stage -pre
                   crsinst -file  [-fixup [-fixupdir ]] [-verbose]
                   crsinst -upgrade [-n ] [-rolling] -src_crshome  -dest_crshome 
                           -dest_version  [-fixup [-fixupdir ]] [-verbose]
                   crsinst -n  [-r {10gR1|10gR2|11gR1|11gR2}]
                           [-c ] [-q ]
                           [-osdba ] [-orainv ]
                           [-asm [-asmgrp ] [-asmdev ]] [-crshome ]
                           [-fixup [-fixupdir ]] [-networks ]
                           [-verbose]
cluvfy stage -pre acfscfg -n  [-asmdev ] [-verbose]
cluvfy stage -pre
                   dbinst -n  [-r {10gR1|10gR2|11gR1|11gR2}] [-osdba ] [-d ]
                          [-fixup [-fixupdir ]] [-verbose]
                   dbinst -upgrade -src_dbhome  [-dbname ] -dest_dbhome  -dest_version 
                          [-fixup [-fixupdir ]] [-verbose]
cluvfy stage -pre dbcfg -n  -d  [-fixup [-fixupdir ]] [-verbose]
cluvfy stage -pre hacfg [-osdba ] [-orainv ] [-fixup [-fixupdir ]] [-verbose]
cluvfy stage -pre nodeadd -n  [-vip ] [-fixup [-fixupdir ]] [-verbose]
cluvfy stage -post hwos -n  [-s ] [-verbose]
cluvfy stage -post cfs -n  -f  [-verbose]
cluvfy stage -post crsinst -n  [-verbose]
cluvfy stage -post acfscfg -n  [-verbose]
cluvfy stage -post hacfg [-verbose]
cluvfy stage -post nodeadd -n  [-verbose]
cluvfy stage -post nodedel -n  [-verbose]

++++++++++

[grid@rac01:+ASM1:/home/grid]
$ cluvfy stage -post  help

ERROR:
Unexpected symbol "help". See usage for detail.

USAGE:
cluvfy stage {-pre|-post}    [-verbose]

SYNTAX (for Stages):
cluvfy stage -pre cfs -n  -s  [-verbose]
cluvfy stage -pre
                   crsinst -file  [-fixup [-fixupdir ]] [-verbose]
                   crsinst -upgrade [-n ] [-rolling] -src_crshome  -dest_crshome 
                           -dest_version  [-fixup [-fixupdir ]] [-verbose]
                   crsinst -n  [-r {10gR1|10gR2|11gR1|11gR2}]
                           [-c ] [-q ]
                           [-osdba ] [-orainv ]
                           [-asm [-asmgrp ] [-asmdev ]] [-crshome ]
                           [-fixup [-fixupdir ]] [-networks ]
                           [-verbose]
cluvfy stage -pre acfscfg -n  [-asmdev ] [-verbose]
cluvfy stage -pre
                   dbinst -n  [-r {10gR1|10gR2|11gR1|11gR2}] [-osdba ] [-d ]
                          [-fixup [-fixupdir ]] [-verbose]
                   dbinst -upgrade -src_dbhome  [-dbname ] -dest_dbhome  -dest_version 
                          [-fixup [-fixupdir ]] [-verbose]
cluvfy stage -pre dbcfg -n  -d  [-fixup [-fixupdir ]] [-verbose]
cluvfy stage -pre hacfg [-osdba ] [-orainv ] [-fixup [-fixupdir ]] [-verbose]
cluvfy stage -pre nodeadd -n  [-vip ] [-fixup [-fixupdir ]] [-verbose]
cluvfy stage -post hwos -n  [-s ] [-verbose]
cluvfy stage -post cfs -n  -f  [-verbose]
cluvfy stage -post crsinst -n  [-verbose]
cluvfy stage -post acfscfg -n  [-verbose]
cluvfy stage -post hacfg [-verbose]
cluvfy stage -post nodeadd -n  [-verbose]
cluvfy stage -post nodedel -n  [-verbose]

++++++++++

[grid@rac01:+ASM1:/home/grid]
$ cluvfy stage -pre crsinst -n rac01,rac02 -fixup

Performing pre-checks for cluster services setup

Checking node reachability...
Node reachability check passed from node "rac01"


Checking user equivalence...
User equivalence check passed for user "grid"

Checking node connectivity...

Checking hosts config file...

Verification of the hosts config file successful

Check: Node connectivity for interface "eth1"
Node connectivity passed for interface "eth1"
TCP connectivity check passed for subnet "192.168.56.0"


Check: Node connectivity for interface "eth2"
Node connectivity passed for interface "eth2"
TCP connectivity check passed for subnet "10.0.0.0"

Checking subnet mask consistency...
Subnet mask consistency check passed for subnet "192.168.56.0".
Subnet mask consistency check passed for subnet "10.0.0.0".
Subnet mask consistency check passed.

Node connectivity check passed

Checking multicast communication...

Checking subnet "192.168.56.0" for multicast communication with multicast group "230.0.1.0"...
Check of subnet "192.168.56.0" for multicast communication with multicast group "230.0.1.0" passed.

Checking subnet "10.0.0.0" for multicast communication with multicast group "230.0.1.0"...
Check of subnet "10.0.0.0" for multicast communication with multicast group "230.0.1.0" passed.

Check of multicast communication passed.

Checking ASMLib configuration.
Check for ASMLib configuration passed.
Total memory check passed
Available memory check passed
Swap space check passed
Free disk space check passed for "rac02:/u01/app/11.2.0.4/grid,rac02:/tmp"
Free disk space check passed for "rac01:/u01/app/11.2.0.4/grid,rac01:/tmp"
Check for multiple users with UID value 54322 passed
User existence check passed for "grid"
Group existence check passed for "oinstall"
Group existence check passed for "dba"
Membership check for user "grid" in group "oinstall" [as Primary] passed
Membership check for user "grid" in group "dba" passed
Run level check passed
Hard limits check passed for "maximum open file descriptors"
Soft limits check passed for "maximum open file descriptors"
Hard limits check passed for "maximum user processes"
Soft limits check passed for "maximum user processes"
System architecture check passed
Kernel version check passed
Kernel parameter check passed for "semmsl"
Kernel parameter check passed for "semmns"
Kernel parameter check passed for "semopm"
Kernel parameter check passed for "semmni"
Kernel parameter check passed for "shmmax"
Kernel parameter check passed for "shmmni"
Kernel parameter check passed for "shmall"
Kernel parameter check passed for "file-max"
Kernel parameter check passed for "ip_local_port_range"
Kernel parameter check passed for "rmem_default"
Kernel parameter check passed for "rmem_max"
Kernel parameter check passed for "wmem_default"
Kernel parameter check passed for "wmem_max"
Kernel parameter check passed for "aio-max-nr"
Package existence check passed for "binutils"
Package existence check passed for "compat-libcap1"
Package existence check passed for "compat-libstdc++-33(x86_64)"
Package existence check passed for "libgcc(x86_64)"
Package existence check passed for "libstdc++(x86_64)"
Package existence check passed for "libstdc++-devel(x86_64)"
Package existence check passed for "sysstat"
Package existence check passed for "gcc"
Package existence check passed for "gcc-c++"
Package existence check passed for "ksh"
Package existence check passed for "make"
Package existence check passed for "glibc(x86_64)"
Package existence check passed for "glibc-devel(x86_64)"
Package existence check passed for "libaio(x86_64)"
Package existence check passed for "libaio-devel(x86_64)"
Check for multiple users with UID value 0 passed
Current group ID check passed

Starting check for consistency of primary group of root user

Check for consistency of root user's primary group passed

Starting Clock synchronization checks using Network Time Protocol(NTP)...

NTP Configuration file check started...
No NTP Daemons or Services were found to be running

Clock synchronization check using Network Time Protocol(NTP) passed

Core file name pattern consistency check passed.

User "grid" is not part of "root" group. Check passed
Default user file creation mask check failed
Check failed on nodes:
        rac02,rac01
Checking consistency of file "/etc/resolv.conf" across nodes

File "/etc/resolv.conf" does not have both domain and search entries defined
domain entry in file "/etc/resolv.conf" is consistent across nodes
search entry in file "/etc/resolv.conf" is consistent across nodes
All nodes have one search entry defined in file "/etc/resolv.conf"
The DNS response time for an unreachable node is within acceptable limit on all nodes

File "/etc/resolv.conf" is consistent across nodes

Time zone consistency check passed

Starting check for Reverse path filter setting ...

Check for Reverse path filter setting passed

Pre-check for cluster services setup was unsuccessful on all the nodes.

++++++++++

[grid@rac01:+ASM1:/home/grid]
$ umask
0002
[grid@rac01:+ASM1:/home/grid]
$ ssh rac02 "umask"
0022
[grid@rac0

+++++++++

[grid@rac01:+ASM1:/home/grid]
$ cluvfy stage -post hwos -n rac01,rac02

Performing post-checks for hardware and operating system setup

Checking node reachability...
Node reachability check passed from node "rac01"


Checking user equivalence...
User equivalence check passed for user "grid"

Checking node connectivity...

Checking hosts config file...

Verification of the hosts config file successful

Check: Node connectivity for interface "eth1"
Node connectivity passed for interface "eth1"
TCP connectivity check passed for subnet "192.168.56.0"


Check: Node connectivity for interface "eth2"
Node connectivity passed for interface "eth2"
TCP connectivity check passed for subnet "10.0.0.0"

Checking subnet mask consistency...
Subnet mask consistency check passed for subnet "192.168.56.0".
Subnet mask consistency check passed for subnet "10.0.0.0".
Subnet mask consistency check passed.

Node connectivity check passed

Checking multicast communication...

Checking subnet "192.168.56.0" for multicast communication with multicast group "230.0.1.0"...
Check of subnet "192.168.56.0" for multicast communication with multicast group "230.0.1.0" passed.

Checking subnet "10.0.0.0" for multicast communication with multicast group "230.0.1.0"...
Check of subnet "10.0.0.0" for multicast communication with multicast group "230.0.1.0" passed.

Check of multicast communication passed.
Check for multiple users with UID value 0 passed
Time zone consistency check passed

Checking shared storage accessibility...

  Disk                                  Sharing Nodes (2 in count)
  ------------------------------------  ------------------------
  /dev/sde                              rac02 rac01

  Disk                                  Sharing Nodes (2 in count)
  ------------------------------------  ------------------------
  /dev/sdd                              rac02 rac01

  Disk                                  Sharing Nodes (2 in count)
  ------------------------------------  ------------------------
  /dev/sdg                              rac02 rac01

  Disk                                  Sharing Nodes (2 in count)
  ------------------------------------  ------------------------
  /dev/sdh                              rac02 rac01

  Disk                                  Sharing Nodes (2 in count)
  ------------------------------------  ------------------------
  /dev/sdi                              rac02 rac01

  Disk                                  Sharing Nodes (2 in count)
  ------------------------------------  ------------------------
  /dev/sdf                              rac02 rac01

  Disk                                  Sharing Nodes (2 in count)
  ------------------------------------  ------------------------
  /dev/sdb                              rac02 rac01

  Disk                                  Sharing Nodes (2 in count)
  ------------------------------------  ------------------------
  /dev/sdc                              rac02 rac01

  ACFS                                  Sharing Nodes (2 in count)
  ------------------------------------  ------------------------
  /acfsmount                            rac02 rac01


Shared storage check was successful on nodes "rac02,rac01"

Checking integrity of name service switch configuration file "/etc/nsswitch.conf" ...
All nodes have same "hosts" entry defined in file "/etc/nsswitch.conf"
Check for integrity of name service switch configuration file "/etc/nsswitch.conf" passed


Post-check for hardware and operating system setup was successful.
[grid@rac01:+ASM1:/home/grid]
$

Troubleshooting Goldengate Memory Usage

Fri, 2016-10-07 11:35

I was paged for GoldenGate processes memory RSS 4507248 KBytes

Here are a few ways to check memory usage.

Initially, I used ps aux –sort -rss|head -5 and Goldengate process was at the top.

After extract was restarted, I used ps ax -o rss,user,command | grep [e]xtract to determine memory usage for Goldengate/

Before: 4,763,432 
After:     31,528  

++++++++++++++++++++++++++++++

$ ps aux --sort -rss|head -5
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
ggsuser  59102 13.2  0.8 4763432 4461212 ?     Ss   Jun19 20905:40 $GG_HOME/extract PARAMFILE $GG_HOME/e_test.prm REPORTFILE $GG_HOME/dirrpt/E_TEST.rpt PROCESSID E_TEST USESUBDIRS

++++++++++++++++++++++++++++++

$ ps ax -o rss,user,command | grep [e]xtract
31528 ggsuser  $GG_HOME/extract PARAMFILE $GG_HOME/dirprm/e_test.prm REPORTFILE $GG_HOME/dirrpt/E_TEST.rpt PROCESSID E_TEST USESUBDIRS

 

Attempting to stop extract during long running transactions resulted in WARNINGS and SEND EXTRACT E_TEST, FORCESTOP

I don’t really like using FORCESTOP or KILL since it will result in recovery not knowing how long this will be.

 

$ ./ggsci

Oracle GoldenGate Command Interpreter for Oracle
Version 10.4.0.19 Build 002
Linux, x64, 64bit (optimized), Oracle 10 on Sep 17 2009 23:52:18

Copyright (C) 1995, 2009, Oracle and/or its affiliates.  All rights reserved.



GGSCI (localhost) 1> info all

Program     Status      Group       Lag           Time Since Chkpt

MANAGER     RUNNING                                          
EXTRACT     RUNNING     E_TEST      00:00:00      00:00:04   

GGSCI (localhost) 2> lag e*

Sending GETLAG request to EXTRACT E_TEST ...
Last record lag: 0 seconds.
At EOF, no more records to process.


GGSCI (localhost) 3> send e* status

Sending STATUS request to EXTRACT E_TEST ...


  EXTRACT E_TEST (PID 59102)
  Current status: Recovery complete: At EOF
  Sequence #: 142474
  RBA: 1291502592
  Timestamp: 2016-10-06 15:47:38.000000

  Output trail #1
  Current write position:
  Sequence #: 27484
  RBA: 20092406
  Timestamp: 2016-10-06 15:47:29.717308
  Extract Trail: ./dirdat/aa



GGSCI (localhost) 4> stop e*

Sending STOP request to EXTRACT E_TEST ...

There are open, long-running transactions. 
Before you stop Extract, make the archives containing data for those transactions available for when Extract restarts. 
To force Extract to stop, use the SEND EXTRACT E_TEST, FORCESTOP command.

Oldest redo log file necessary to restart Extract is:

Redo Log Sequence Number 142472, RBA 542064656.


GGSCI (localhost) 5> send extract e*, showtrans duration 10 MIN

Sending showtrans request to EXTRACT E_TEST ...


Oldest redo log file necessary to restart Extract is:

Redo Log Sequence Number 142472, RBA 542064656

------------------------------------------------------------
XID:                  57.29.20520692
Items:                122554  
Extract:              E_TEST   
Redo Thread:          1     
Start Time:           2016-10-06:15:32:26 
SCN:                  143.1016911815 (615197235143)    
Redo Seq:             142472
Redo RBA:             542064656          
Status:               Running            


------------------------------------------------------------
XID:                  64.35.9949688
Items:                131751  
Extract:              E_TEST   
Redo Thread:          1     
Start Time:           2016-10-06:15:33:29 
SCN:                  143.1017267252 (615197590580)    
Redo Seq:             142472
Redo RBA:             1450478608         
Status:               Running            


GGSCI (localhost) 6> send extract e*, showtrans duration 20 MIN

Sending showtrans request to EXTRACT E_TEST ...
No transactions found

Oldest redo log file necessary to restart Extract is:

Redo Log Sequence Number 142472, RBA 542064656.


GGSCI (localhost) 7> send extract e*, showtrans duration 15 MIN

Sending showtrans request to EXTRACT E_TEST ...


Oldest redo log file necessary to restart Extract is:

Redo Log Sequence Number 142472, RBA 542064656

------------------------------------------------------------
XID:                  57.29.20520692
Items:                123453  
Extract:              E_TEST   
Redo Thread:          1     
Start Time:           2016-10-06:15:32:26 
SCN:                  143.1016911815 (615197235143)    
Redo Seq:             142472
Redo RBA:             542064656          
Status:               Running            


------------------------------------------------------------
XID:                  64.35.9949688
Items:                133438  
Extract:              E_TEST   
Redo Thread:          1     
Start Time:           2016-10-06:15:33:29 
SCN:                  143.1017267252 (615197590580)    
Redo Seq:             142472
Redo RBA:             1450478608         
Status:               Running            


GGSCI (localhost) 8> info all

Program     Status      Group       Lag           Time Since Chkpt

MANAGER     RUNNING                                          
EXTRACT     RUNNING     E_TEST      00:00:00      00:00:06   

GGSCI (localhost) 9>

 

Wait a little bit and try to stop extract again and this time succeeded.

 

GGSCI (localhost) 9> send extract e*, showtrans duration 15 MIN

Sending showtrans request to EXTRACT E_TEST ...
No transactions found

Oldest redo log file necessary to restart Extract is:

Redo Log Sequence Number 142472, RBA 542064656.

-- In hindsight, I should have "send extract e*, showtrans duration 1 MIN" before stopping extract !!!
GGSCI (localhost) 10> stop e*

Sending STOP request to EXTRACT E_TEST ...
Request processed.


GGSCI (localhost) 11> info all

Program     Status      Group       Lag           Time Since Chkpt

MANAGER     RUNNING                                           
EXTRACT     STOPPED     E_TEST      00:00:00      00:00:03    

GGSCI (localhost) 12> exit

++++++++++++++++++++++++++++++

Top RSS memory consumer is from Agent.

$ ps aux --sort -rss|head -5
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
oracle   89345  0.5  0.0 1055812 441812 ?      Sl   Jun10 854:16 /u01/app/oracle/product/12.1/cc_agent/core/12.1.0.3.0/jdk/bin/java 

++++++++++++++++++++++++++++++

GGSCI (localhost) 1> info all

Program     Status      Group       Lag           Time Since Chkpt

MANAGER     RUNNING                                           
EXTRACT     STOPPED     E_TEST      00:00:00      00:00:28    

GGSCI (localhost) 2> start e*

Sending START request to MANAGER ...
EXTRACT E_TEST starting


GGSCI (localhost) 3> info all

Program     Status      Group       Lag           Time Since Chkpt

MANAGER     RUNNING                                           
EXTRACT     RUNNING     E_TEST      00:00:35      00:00:01    

GGSCI (localhost) 4> lag e*

Sending GETLAG request to EXTRACT E_TEST ...
No records yet processed.


GGSCI (localhost) 5> info all

Program     Status      Group       Lag           Time Since Chkpt

MANAGER     RUNNING                                           
EXTRACT     RUNNING     E_TEST      00:00:45      00:00:01    

GGSCI (localhost) 6> send e* status

Sending STATUS request to EXTRACT E_TEST ...

-- Note Sequence 142475 is much better than 142472. Also, how large is REDO?

  EXTRACT E_TEST (PID 82213)
  Current status: In recovery[1]: Reading from data source
  Sequence #: 142475
  RBA: 594610192
  Timestamp: 2016-10-06 15:53:00.000000

  Output trail #1
  Current write position:
  Sequence #: 27485
  RBA: 1033
  Timestamp: 2016-10-06 15:55:22.043495
  Extract Trail: ./dirdat/aa

GGSCI (localhost) 7> exit

++++++++++++++++++++++++++++++

$ ps ax -o rss,user,command | grep [e]xtract
31220 ggsuser  $GG_HOME/extract PARAMFILE $GG_HOME/dirprm/e_test.prm REPORTFILE $GG_HOME/dirrpt/E_TEST.rpt PROCESSID E_TEST USESUBDIRS

++++++++++++++++++++++++++++++

GGSCI (localhost) 1> info all

Program     Status      Group       Lag           Time Since Chkpt

MANAGER     RUNNING                                           
EXTRACT     RUNNING     E_TEST      00:00:00      00:00:03    

GGSCI (localhost) 2> send e* status

Sending STATUS request to EXTRACT E_TEST ...


  EXTRACT E_TEST (PID 82213)
  Current status: Recovery complete: At EOF
  Sequence #: 142475
  RBA: 3804984832
  Timestamp: 2016-10-06 16:00:44.000000

  Output trail #1
  Current write position:
  Sequence #: 27485
  RBA: 163836918
  Timestamp: 2016-10-06 16:00:42.310056
  Extract Trail: ./dirdat/aa

GGSCI (localhost) 3> lag e*

Sending GETLAG request to EXTRACT E_TEST ...
Last record lag: 0 seconds.
At EOF, no more records to process.


GGSCI (localhost) 4> exit

++++++++++++++++++++++++++++++

$ ps ax -o rss,user,command | grep [e]xtract 31528 ggsuser $GG_HOME/extract PARAMFILE $GG_HOME/dirprm/e_test.prm REPORTFILE $GG_HOME/dirrpt/E_TEST.rpt PROCESSID E_TEST USESUBDIRS

Pages