Tuesday, February 4, 2020

expdp on RAC database with PARALLEL option throws error ORA-19505: failed to identify file ORA-06512 ORA-27037

If you have come across situation where in expdp with PARALLEL option for RAC database throws below errors on you:

Problem Scenario:

oracle@TESTHOSTDB01:[/backup/EXPDIR]$cat expdp_MD_parfile.par
"expdp_MD_parfile.par" 3 lines, 237 characters
DIRECTORY=EXPDIR DUMPFILE=expdp_MD.dmp LOGFILE=EXPDIR:expdp_MD.log EXCLUDE=STATISTICS CONTENT=METADATA_ONLY PARALLEL=6 SCHEMAS=ITESTK,ITESTB,IPTESTK,ITESTN


oracle@TESTHOSTDB01:[/backup/EXPDIR]$expdp \'/ as sysdba \' PARFILE="expdp_MD_parfile.par" 
'
Export: Release 12.2.0.1.0 - Production on Tue Feb 4 09:12:30 2020

Copyright (c) 1982, 2017, Oracle and/or its affiliates.  All rights reserved.

Connected to: Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production
Starting "SYS"."SYS_EXPORT_SCHEMA_02":  "/******** AS SYSDBA" PARFILE=expdp_MD_parfile.par
Processing object type SCHEMA_EXPORT/USER
Processing object type SCHEMA_EXPORT/SYSTEM_GRANT
Processing object type SCHEMA_EXPORT/ROLE_GRANT
Processing object type SCHEMA_EXPORT/PRE_SCHEMA/PROCACT_SCHEMA
Processing object type SCHEMA_EXPORT/DEFAULT_ROLE
Processing object type SCHEMA_EXPORT/TABLESPACE_QUOTA
ORA-39126: Worker unexpected fatal error in KUPW$WORKER.CREATE_OBJECT_ROWS [DEFAULT_ROLE]
DEFAULT_ROLE:"IPYEGOV"
ORA-19505: failed to identify file "/backup/EXPDIR/expdp_MD.dmp"
ORA-27037: unable to obtain file status
IBM AIX RISC System/6000 Error: 2: No such file or directory
Additional information: 7

ORA-06512: at "SYS.DBMS_SYS_ERROR", line 105
ORA-06512: at "SYS.KUPW$WORKER", line 12098
ORA-06512: at "SYS.DBMS_SYS_ERROR", line 105
ORA-06512: at "SYS.KUPF$FILE", line 9298
ORA-06512: at "SYS.KUPF$FILE_INT", line 1111
ORA-06512: at "SYS.KUPF$FILE", line 9241
ORA-06512: at "SYS.KUPW$WORKER", line 10727

----- PL/SQL Call Stack -----
  object      line  object
  handle    number  name
7000103bf33ed18     32239  package body SYS.KUPW$WORKER.WRITE_ERROR_INFORMATION
7000103bf33ed18     12119  package body SYS.KUPW$WORKER.DETERMINE_FATAL_ERROR
7000103bf33ed18     11099  package body SYS.KUPW$WORKER.CREATE_OBJECT_ROWS
7000103bf33ed18     14526  package body SYS.KUPW$WORKER.FETCH_XML_OBJECTS
7000103bf33ed18      3689  package body SYS.KUPW$WORKER.UNLOAD_METADATA
7000103bf33ed18     13063  package body SYS.KUPW$WORKER.DISPATCH_WORK_ITEMS
7000103bf33ed18      2311  package body SYS.KUPW$WORKER.MAIN
700010067a5a2d0         2  anonymous block

Object row index into parse items is: 13
Parse item count is: 39
In function CHECK_FOR_REMAP_NETWORK
Nothing to remap
In procedure BUILD_OBJECT_STRINGS - non-base info
In procedure BUILD_SUBNAME_LIST with DEFAULT_ROLE:IPYEGOV.
In function NEXT_PO_NUMBER
PO number assigned: 3013
KUPF$FILE.WRITE_LOB
In procedure DETERMINE_FATAL_ERROR with ORA-19505: failed to identify file "/backup/EXPDIR/expdp_MD.dmp"
ORA-06512: at "SYS.KUPF$FILE", line 9298
ORA-27037: unable to obtain file status
IBM AIX RISC System/6000 Error: 2: No such file or directory
Additional information: 7
ORA-06512: at "SYS.KUPF$FILE_INT", line 1111
ORA-06512: at "SYS.KUPF$FILE", line 9241

Job "SYS"."SYS_EXPORT_SCHEMA_02" stopped due to fatal error at Tue Feb 4 09:13:48 2020 elapsed 0 00:01:15

Solution:

Use cluster=n parameter along with.

oracle@TESTHOSTDB01:[/backup/EXPDIR]$vi expdp_MD_parfile.par
"expdp_MD_parfile.par" 3 lines, 237 characters
DIRECTORY=EXPDIR DUMPFILE=expdp_MD.dmp LOGFILE=EXPDIR:expdp_MD.log EXCLUDE=STATISTICS CONTENT=METADATA_ONLY PARALLEL=6 cluster=n

SCHEMAS=ITESTK,ITESTB,IPTESTK,ITESTN


Even after using cluster=n not working then try dropping existing dormant export tables using below method:

 SELECT owner_name, job_name, operation, job_mode, 
      state, attached_sessions 
      FROM dba_datapump_jobs 
   where owner_name='SYS' and state='NOT RUNNING';
   
09:30:36 SQL> col OWNER_NAME for a20
09:30:47 SQL> cl JOB_NAME for a30
SP2-0158: unknown CLEAR option "JOB_NAME"
SP2-0158: unknown CLEAR option "for"
SP2-0158: unknown CLEAR option "a30"
09:30:56 SQL> col  JOB_NAME for a30
09:31:01 SQL> col JOB_MODE for a20
09:31:14 SQL> col OPERATION for a20
09:31:23 SQL> /

OWNER_NAME    JOB_NAME                  OPERATION     JOB_MODE      STATE        ATTACHED_SESSIONS
------------- ------------------------- ------------- ------------- ------------ -----------------
SYS           SYS_EXPORT_SCHEMA_02      EXPORT        SCHEMA        NOT RUNNING                  0
SYS           SYS_EXPORT_SCHEMA_01      EXPORT        SCHEMA        NOT RUNNING                  0


2 rows selected.

Elapsed: 00:00:00.03
09:31:24 SQL>

drop table SYS_EXPORT_SCHEMA_01;
drop table SYS_EXPORT_SCHEMA_02;
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Output of the Drop SYS_EXPORT_SCHEMA_01 ~~~~~~~~~~~~~~~~~~~~~~~~~~
09:33:22 SQL> drop table SYS_EXPORT_SCHEMA_01;

Table dropped.

Elapsed: 00:00:00.57
09:33:28 SQL> drop table SYS_EXPORT_SCHEMA_02;

Table dropped.


Elapsed: 00:00:00.78

oracle@TESTHOSTDB01:[/backup/EXPDIR]$vi expdp_MD_parfile.par
"expdp_MD_parfile.par" 3 lines, 237 characters
DIRECTORY=EXPDIR DUMPFILE=expdp_MD.dmp LOGFILE=EXPDIR:expdp_MD.log EXCLUDE=STATISTICS CONTENT=METADATA_ONLY PARALLEL=6 cluster=n
SCHEMAS=ITESTK,ITESTB,IPTESTK,ITESTN


Monday, February 3, 2020

datapatch execution takes time and fails with ORA-04021 as AQ jobs are running while PSU Patching on 12c

It's now quite common on 12cR2 database, that your execution of datapatch step on PSU patching may wait for a long time and eventually fail with "ORA-04021: timeout occurred while waiting to lock object SYS.DBMS_AQ"

This happened to me during last 2 patching Oct'19 and Jan'20 PSU patching for RAC environment and had to struggle a lot to have it fixed.

I have outlined the solution below for you so you do not have to go through the same pain I have gone through it during critical patching activity.

After completing GI and RDBMS patching for both the nodes of the RAC as you know last step is to apply datapatch as below. (If you are not clear about applying PSU patching on RAC I will post shortly on how to apply patch on 12cR2 very soon)

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

oracle@PRODHOSTDB02:[/u01/app/oracle/product/12.2.0.1/dbhome_1/OPatch]$./datapatch -verbose
SQL Patching tool version 12.2.0.1.0 Production on Sun Feb  2 15:21:24 2020
Copyright (c) 2012, 2020, Oracle.  All rights reserved.

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

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

Current state of SQL patches:
Bundle series DBRU:
  ID 200114 in the binary registry and not installed in the SQL registry

Adding patches to installation queue and performing prereq checks...
Installation queue:
  Nothing to roll back
  The following patches will be applied:
    30593149 (DATABASE JAN 2020 RELEASE UPDATE 12.2.0.1.200114)

Installing patches...

<=========AT this point it waited for more than 2 hours and failed with below error and automatically tried to rerun the same patch

Patch installation complete.  Total patches installed: 1

Validating logfiles...
Patch 30593149 apply: WITH ERRORS (RETRYABLE)
  logfile: /u01/app/oracle/cfgtoollogs/sqlpatch/30593149/23339232/30593149_apply_DBPROD_2020Feb02_15_22_57.log (errors)
    Error at line 10007: ORA-04021: timeout occurred while waiting to lock object SYS.DBMS_AQ
    Error at line 10051: ORA-04021: timeout occurred while waiting to lock object SYS.DBMS_AQADM_VAR
    Error at line 10057: ORA-04021: timeout occurred while waiting to lock object SYS.DBMS_AQADM_SYS

Adding patches to retry installation queue...
Retry installation queue:
  Nothing to roll back
  The following patches will be applied:
    30593149 (DATABASE JAN 2020 RELEASE UPDATE 12.2.0.1.200114)

<=========AT this point I new what was the issue as same issue was encounted during Oct'19 PSU run and implemented below workaround to fix the issue which resulted in successfully execution of datapatch.

Solution/Workaround:

==> Check if any AQ job are running while execution of datapatch is going on:

SQL> set pagesize 500
SQL> col JOB_NAME for a40
SQL>  select JOB_NAME, STATE, LAST_START_DATE from all_scheduler_jobs where job_name like 'AQ%';


JOB_NAME                                 STATE                LAST_START_DATE
---------------------------------------- -------------------- ---------------------------------------------------------------------------
AQ$_PLSQL_NTFN_3566554670                RUNNING              30-JAN-20 01.03.35.623482 PM ASIA/KUWAIT


run below SQL to generate script to execute:

set pagesize 0
set linesize 200
set echo off
set heading off
select 'EXEC DBMS_SCHEDULER.STOP_JOB ('''|| job_name ||''', force => TRUE);' from dba_scheduler_jobs where job_name like 'AQ$_PLSQL_NTFN_%';

Which generated below SQLs which needs to be executed to stop and drop the AQ jobs. first check if just stopping the job solves the issue if not then run the drop job. 

EXEC DBMS_SCHEDULER.STOP_JOB ('AQ$_PLSQL_NTFN_3566554670', force => TRUE);

EXEC DBMS_SCHEDULER.DROP_JOB ('AQ$_PLSQL_NTFN_3566554670');


SQL> EXEC DBMS_SCHEDULER.STOP_JOB ('AQ$_PLSQL_NTFN_3566554670', force => TRUE);

PL/SQL procedure successfully completed.

SQL>  EXEC DBMS_SCHEDULER.DROP_JOB ('AQ$_PLSQL_NTFN_3566554670');
BEGIN DBMS_SCHEDULER.DROP_JOB ('AQ$_PLSQL_NTFN_3566554670'); END;

*
ERROR at line 1:
ORA-27475: unknown job "SYS"."AQ$_PLSQL_NTFN_3566554670"
ORA-06512: at "SYS.DBMS_ISCHED", line 274
ORA-06512: at "SYS.DBMS_SCHEDULER", line 753
ORA-06512: at line 1

Note: Probably you may also get error for dropping job, but that should be fine. 

Post execution of above work around datapatch completed successfully within minute. 

--below are the remaining execution output of the datapatch. 
---------
Installing patches...


Patch installation complete.  Total patches installed: 1

Validating logfiles...
Patch 30593149 apply: SUCCESS
  logfile: /u01/app/oracle/cfgtoollogs/sqlpatch/30593149/23339232/30593149_apply_DBPROD_2020Feb02_16_11_06.log (no errors)
SQL Patching tool complete on Sun Feb  2 16:21:59 2020
oracle@PRODHOSTDB02:[/u01/app/oracle/product/12.2.0.1/dbhome_1/OPatch]$

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Please note that post execution of datapatch you may get one row of failed output as below, but that should be fine as subsequent row depicts successful  execution. 


set line 500
col patch_id for 9999999999
col patch_uid for 9999999999
col version for a10
col action for a10
col install_id  for 99
col action_time for a30
col description for a60
col bundle_series for a20
col status for a30

select patch_id, patch_uid, version, action, install_id, action_time, description, bundle_series,status  from dba_registry_sqlpatch;


Note: After stopping/dropping AQ running job , we did not find any issue with the database. AQ$_PLSQL_NTFN jobs deals with the PLSQL notification engine. 

fix for sar command does not work for non root user on IBM AIX:

At one of the client I wasn't able to use sar for oracle and grid user for performance monitoring and with help of System admin we fixed the issue and below is the solution and workaround for it.


Problem statement:

oracle@TESTDB02:[/home/oracle]$sar 1 10
sar: The file access permissions do not allow the specified action.


Solution:

root@TESTDB02:[/var/adm/sa]#cd /usr/lib/sa
root@TESTDB02:[/usr/lib/sa]#ls -lrt
total 72
-r-xr-x---    1 bin      adm            1106 Jun 01 2015  sa2
-r-xr-x---    1 bin      adm            1033 Jun 01 2015  sa1
-r-sr-x---    1 root     adm           25576 Oct 14 21:57 sadc

root@TESTDB02:[/usr/lib/sa]#chmod o+x /usr/lib/sa/sadc

root@TESTDB02:[/usr/lib/sa]#ls -lrt
total 72
-r-xr-x---    1 bin      adm            1106 Jun 01 2015  sa2
-r-xr-x---    1 bin      adm            1033 Jun 01 2015  sa1
-r-sr-x--x    1 root     adm           25576 Oct 14 21:57 sadc

root@TESTDB02:[/usr/lib/sa]#su - oracle
oracle@TESTDB02:[/home/oracle]$ls -lrt
total 8
-rw-r--r--    1 oracle   oinstall          0 Feb 03 13:35 smit.script
-rw-r--r--    1 oracle   oinstall          0 Feb 03 13:35 smit.transaction
-rw-r--r--    1 oracle   oinstall        197 Feb 03 13:35 smit.log

oracle@TESTDB02:[/home/oracle]$sar 1 10

AIX TESTDB02 2 7 00C6C7004B00    02/03/20

System configuration: lcpu=32 ent=2.00 mode=Uncapped

14:07:22    %usr    %sys    %wio   %idle   physc   %entc
14:07:23       1       1       0      98    0.16     8.2
14:07:24       2       1       0      98    0.18     9.2
14:07:25       2       2       0      96    0.30    15.1


Optionally you can use alternative to sar for AIX which is lparstat command without rustling with any permission or ownership issue:


oracle@TESTDB02:[/home/oracle]$lparstat 1 10

System configuration: type=Shared mode=Uncapped smt=8 lcpu=32 mem=102400MB psize=10 ent=2.00

%user  %sys  %wait  %idle physc %entc  lbusy   app  vcsw phint  %nsp  %utcyc
----- ----- ------ ------ ----- ----- ------   --- ----- ----- -----  ------
  2.0   1.0    0.3   96.7  0.20   9.9    0.6  9.31  2480     0   150  33.19
  1.5   0.7    0.1   97.7  0.19   9.4    0.3  9.44  2324     0   150  33.24
  2.5   1.3    0.1   96.2  0.27  13.5    0.8  9.40  2315     0   150  33.21
  2.2   0.9    0.0   96.8  0.21  10.4    0.5  9.36  2363     0   149  33.11
  7.3   2.7    0.1   89.9  0.68  34.1    2.2  8.95  3103     0   150  33.14
  2.7   1.6    0.1   95.6  0.31  15.5    0.8  9.37  2526     0   150  33.19
  1.6   0.7    0.0   97.7  0.17   8.7    0.6  9.42  2472     0   150  33.22
  1.5   0.7    0.0   97.8  0.17   8.6    0.5  9.50  2416     0   150  33.22
  2.6   1.3    0.0   96.1  0.27  13.7    0.7  9.32  2506     0   150  33.12

  1.6   1.8    0.0   96.6  0.26  13.0    0.6  9.28  3419     0   150  33.16



Sunday, February 2, 2020

ORA-00205: error in identifying control file after GI PSU 12.2.0.1.200114 upon instance startup

Problem Statement:

Today, I encountered interesting but weird problem while successfully applying Patch 30501932 - GI Jan 2020 Release Update 12.2.0.1.200114 on node-1  when I tried to shutdown immediate for instance -2 for applying patch, it did not shutdown and session and was keep waiting for shutdown so I had to abnormally stop shutdown and issued shutdown abort, but post shutdown when I tried to start up instance-2, it throw below set of errors:

SQL> startup
ORA-01078: failure in processing system parameters
LRM-00109: could not open parameter file '/u01/app/oracle/product/12.2.0.1/dbhome_1/dbs/inittestdb2.ora'
SQL> exit


Created pfile from SPFILE on node-1 and copied to node-2 and tried starting instance 2 using newly created pfile:

SQL> startup
ORA-01078: failure in processing system parameters
LRM-00109: could not open parameter file '/u01/app/oracle/product/12.2.0.1/dbhome_1/dbs/inittestdb2.ora'
SQL>
SQL>  startup pfile='/tmp/inittestdb.ora';
ORACLE instance started.

Total System Global Area 5.5298E+10 bytes
Fixed Size                 29964104 bytes
Variable Size            8724154552 bytes
Database Buffers         4.6439E+10 bytes
Redo Buffers              104251392 bytes

ORA-00205: error in identifying control file, check alert log for more info

Below is the list of Error reported in  alert.log file:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
WARNING: failed to register ASMB0 with ASM instance
2020-01-30T14:32:27.133429+03:00
Errors in file /u01/app/oracle/diag/rdbms/testdb/testdb2/trace/testdb2_asmb_31261082.trc:
ORA-12547: TNS:lost contact
ORA-12547: TNS:lost contact
WARNING: ASMB0 exiting with error
2020-01-30T14:32:27.137941+03:00
ORA-00210: cannot open the specified control file
ORA-00202: control file: '+DATA/testdb/CONTROLFILE/current.261.1030897861'
ORA-17503: ksfdopn:2 Failed to open file +DATA/testdb/CONTROLFILE/current.261.1030897861
ORA-15001: diskgroup "DATA" does not exist or is not mounted
ORA-12547: TNS:lost contact
ORA-12547: TNS:lost contact
ORA-00210: cannot open the specified control file
ORA-00202: control file: '+DATA/testdb/CONTROLFILE/current.262.1030897861'
ORA-17503: ksfdopn:2 Failed to open file +DATA/testdb/CONTROLFILE/current.262.1030897861
ORA-15001: diskgroup "DATA" does not exist or is not mounted
ORA-12547: TNS:lost contact
ORA-12547: TNS:lost contact
2020-01-30T14:32:27.145437+03:00
ORA-205 signalled during: ALTER DATABASE   MOUNT...
2020-01-30T14:44:12.824562+03:00
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Issue Observation:

I observed that even though +ASM2 was up and all disks were mounted on node-2 still Instance-2 was not able to access diskgroups and hence upon DB startup  it could not access SPFILE located on ASM diskgroup and hence oracle tried to start Instance with default PFILE but still it couldn't start as controlfile was not accessible due to diskgroup accessibility issue. 

Further more Observed that after successfully applying GI Jan 2020 PATCH on node-1, even without applying patch on node-2, it had changed setuid permission  for GI oracle binary file on node-2 and because of that Oracle was not able to access diskgroup upon instance startup, please find below evidence:


setuid permission for owner and group is changed from s to x and that's the issue.

On Node-2:

oracle@TESTHOST02:[/u01/app/12.2.0/grid/bin]$ls -rlta |grep oracle
-rw-------    1 grid     oinstall  579571814 Jan 27 13:45 oracleO
-rwxr-x--x    1 grid     oinstall  579571814 Jan 27 14:29 oracle
oracle@TESTHOST02:[/u01/app/12.2.0/grid/bin]$


Please observe setuid for GI Oracle binary on node-1, which is proper.

On Node-1:
===================
root@TESTHOST01:[/]#ls -lrta /u01/app/12.2.0/grid/bin/oracle
-rwsr-s--x    1 grid     oinstall  583710697 Jan 30 12:27 /u01/app/12.2.0/grid/bin/oracle
root@TESTHOST01:[/]#

Solution:

Perform below steps on node-2, (affected node), which should fix the issue and Instance on node-2 should come up just fine without any issue.

1.shutdown CRS as root

root@TESTHOST02:[/]#/u01/app/12.2.0/grid/bin/crsctl stop crs

2. Set setuid  for Grid oracle binary. 


root@TESTHOST02:[/u01/app/12.2.0/grid/bin]$ls -rlta |grep oracle
-rwxr-x--x    1 grid     oinstall  579571814 Jan 27 14:29 oracle


root@TESTHOST02:[/]#chmod 6751 /u01/app/12.2.0/grid/bin/oracle

root@TESTHOST02:[/]#ls -lrta /u01/app/12.2.0/grid/bin/oracle
-rwsr-s--x    1 grid     oinstall  579571814 Jan 27 14:29 /u01/app/12.2.0/grid/bin/oracle

3. Start the CRS

root@TESTHOST02:[/]#/u01/app/12.2.0/grid/bin/crsctl start crs

Friday, January 3, 2020

Oracle RAC Cluster Startup Sequence

     In an Oracle 10g clusterware, remember how oracle clusterware was locating OCR and Voting file in? You probably know that location of these files were maintained in /etc/oracle/ocr.loc file and clusterware in 10g was able to start OCSSD (Oracle Cluster Synchronization Service Daemon) using voting disks/files and OCRSD  (Oracle Cluster Registry Service Daemon) using OCR files upon startup.
      However from Oracle 11gR2, clusterware architecture and startup process have changed a bit, which is described in this article.

       Let's first understand the main components involved in 11gR2 (and did not change much in 12c) clusterware startup.

Four Important Clusterware files used during startup:


1. Voting Files:  Stores information about node membership. You can have multiple voting disks/files and each files must be accessible by all the nodes in the cluster for nodes to be members of the cluster. When cluster is running, voting files are used to check heartbeat among all available nodes in a cluster over cluster interconnect network to avoid split brain scenario. 

2. OCR (Oracle Cluster Registry) files : Stores Oracle clusterware and RAC database configuration information such as node membership, s/w version, configuration and status of RAC DB resources i.e. instances, listener, services, etc.

3. OLR (Oracle Local Registry) file: In Oracle 11gR2, additional component related to the OCR called the OLR is installed on each node of the cluster.
  The OLR is a local registry for node specific resources. Location of OLR is CRS_HOME/cdata/<hostname>.olr and the location of the OLR is stored in /etc/oracle/olr.loc and used by OHASD (Oracle High Availability Service Daemon) to startup cluster resources.

     Few important info which OLR Contains are active CRS version, CRS_HOMES, GPnP details, Node names, OCR latest backup time and location etc. 

     If OLR is missing or corrupted, clusterware can't be started on that node.

Note: Please use this article- "How to restore local OLR in Oracle 11gR2 RAC?",in case your OLR gets corrupted or missing.

4. GPnP Profile: Grid Plug aNd Play (GPnP) is a XML file located at CRS_HOME/profiles/peer/profile.xml which is known as GPnP profile. Each node in the cluster maintains a copy of this profile locally and is maintained by ora.gpnpd (GPnP daemon) together with ora.mdnsd (mdns daemon).

This GPNP profile.xml contains info like: Network interfaces/IPs for public and private interconnects, ASM Server Parameter (SP) file, CSS voting disks, cluster name, cluster id, hostname, ASM diskgroup discovery string, Name of the ASM diskgroup containing voting files, etc.
     Now You know 4 important file components of the clusterware, now it will be easy for us to understand the sequence of clusterware startup.

     There are many clusterware processes, however we will concentrate here mainly 4 important processes involved in clusterware startup, namely init.d/systemd, OHASD, OCCSD and OCRSD. 
     
1. init.d/systemd :  Once your OS finishes the bootstarp process, it reads /etc/init.d file by the initialization daemon init.d.  init.d daemon triggers the startup of OHASD.

Note: In latest Linux distributions init.d has been replaced by systemd daemon. For more details on init.d and systemd , please read this very good article- The Story Behind ‘init’ and ‘systemd’: Why ‘init’ Needed to be Replaced with ‘systemd’ in Linux

2. OHASD : is the root for bringing up Oracle clusterware. OHASD has access to the OLR stored on the local file system. OLR provides needed data to complete OHASD initialization.

     OHASD triggers GPnPD and CSSD. CSSD daemon has access of GPNP profile from which it locates the well-known pointers for the voting files locations in the ASM disk headers and CSSD is able to complete initialization and joins an existing cluster.

     OHASD now starts ASM instance and ASM can now operate with CSSD initialized and operating. The ASM instance uses special code to locate the contents of the ASM SPFile assuming it's stored in a Diskgroup. 
     With an ASM instance operating and it's diskgroup mounted, access to clusterware OCR file is available to CRSD and hence OHASD starts CRSD. Clusterware completes initialization and brings up other services under it's control.


Please note that ASM does not depend on on OCR or OLR to be online. ASM depends on OCCSD (voting disk/file) to be online.
Also note that there are many more processes/daemons involved in clusterware startup and normal working of it, which is displayed in below mentioned diagram, however we have only covered most important components of clusterware in this article.

For more information on clusterware  startup sequence, please refer Oracle support Doc id:1053147.1

Please refer below 12c Clusterare startup sequence diagram for more info:







Tuesday, December 31, 2019

What is the Fast Sync Oracle Data Guard feature?

FAST SYNC (SYNC NOAFFIRM) :

FAST SYNC is a new Data guard feature introduced in Oracle 12cR1 and it's required Oracle Active Data Guard(ADG) license to use for production. 

Maximum Availability mode now allows the LOG_ARCHIVE_DEST_n attributes SYNC and NOAFFIRM to be used together for redo transport service. This enables asynchronous standby database to be deployed at a farther distance from the primary site without increasing the impact on primary DB performance. 

The attribute NOAFFIRM in LOG_ARCHIVE_DEST_n parameter  instructs the standby to acknowledge the receipt of redo changes without waiting for the Remote File Server (RFS) to write to a Standby  Redo Logs (SRL).

This mode is only available in maximum availability protection mode.

example of SYNC NOAFFIRM attribute in LOG_ARCHIVE_DEST_n param on primary DB:

SQL> show parameter log_archive_dest_2
NAME                                    TYPE        VALUE
------------------------------------ ----------- ------------------------------
log_archive_dest_2                    string       service="STNDBYDB", SYNC NOAFFIRM
                                                   delay=0 optional compression=
                                                   disable max_failure=0 max_conn
                                                   ections=1 reopen=300 db_unique
                                                   _name="PRIMEDB" net_timeout=30,
                                                   valid_for=(online_logfile,all_
                                                   roles)




References:
https://oracleagent.wordpress.com/2021/12/08/data-guard-architecture/


Monday, December 30, 2019

What is the Far Sync Oracle Data Guard feature?

Far Sync: 

Far Sync feature was  first introduced in 12c Release 1 and it requires Oracle Active Data Guard (ADG) License to use for production purpose.

An Oracle Standby Far SYNC instance is a  remote log transport proxy Oracle standby instance that accepts redo changes from the primary DB and write them into Standby Redo Logs (SRLs) at Far Sync instance's  local destination and then ships that redo changes to the target standby DB. It also archives those Standby Redo Logs(SRLs) to local destination at Far SYNC instance.

A far SYNC instance requires only control file and SRLs and it does not have data files and hence you can't open far sync instance to read/write data.

 Far Sync feature will require an Oracle Active Data Guard (ADG) license to use for production purpose.

It's recommended that Far Sync instance to be placed near(1-150 miles apart) to the primary DB so that there is low network latency between primary and Far Sync instance, which will help in minimizing impact on commit response time and guarantees higher data protection.



References: