Thinking Out Loud

December 14, 2017

Using sed to backup file and remove lines

Filed under: awk_sed_grep — mdinh @ 1:13 am
[oracle@racnode-dc1-2 ~]$ cd /u01/app/oracle/12.1.0.2/db1/rdbms/log/

--- DDL will fail since datafile is hard coded!
[oracle@racnode-dc1-2 log]$ cat tablespaces_ddl.sql
-- CONNECT SYS
ALTER SESSION SET EVENTS '10150 TRACE NAME CONTEXT FOREVER, LEVEL 1';
ALTER SESSION SET EVENTS '10904 TRACE NAME CONTEXT FOREVER, LEVEL 1';
ALTER SESSION SET EVENTS '25475 TRACE NAME CONTEXT FOREVER, LEVEL 1';
ALTER SESSION SET EVENTS '10407 TRACE NAME CONTEXT FOREVER, LEVEL 1';
ALTER SESSION SET EVENTS '10851 TRACE NAME CONTEXT FOREVER, LEVEL 1';
ALTER SESSION SET EVENTS '22830 TRACE NAME CONTEXT FOREVER, LEVEL 192 ';
-- new object type path: DATABASE_EXPORT/TABLESPACE
CREATE UNDO TABLESPACE "UNDOTBS1" DATAFILE
  SIZE 26214400
  AUTOEXTEND ON NEXT 5242880 MAXSIZE 32767M
  BLOCKSIZE 8192
  EXTENT MANAGEMENT LOCAL AUTOALLOCATE;

   ALTER DATABASE DATAFILE
  '+DATA/HAWK/DATAFILE/undotbs1.260.962253853' RESIZE 152043520;
CREATE TEMPORARY TABLESPACE "TEMP" TEMPFILE
  SIZE 213909504
  AUTOEXTEND ON NEXT 655360 MAXSIZE 32767M
  EXTENT MANAGEMENT LOCAL UNIFORM SIZE 1048576;
CREATE UNDO TABLESPACE "UNDOTBS2" DATAFILE
  SIZE 26214400
  AUTOEXTEND ON NEXT 26214400 MAXSIZE 32767M
  BLOCKSIZE 8192
  EXTENT MANAGEMENT LOCAL AUTOALLOCATE;

   ALTER DATABASE DATAFILE
  '+DATA/HAWK/DATAFILE/undotbs2.265.962254263' RESIZE 235929600;
CREATE TABLESPACE "USERS" DATAFILE
  SIZE 5242880
  AUTOEXTEND ON NEXT 1310720 MAXSIZE 32767M,
  SIZE 4194304
  LOGGING ONLINE PERMANENT BLOCKSIZE 8192
  EXTENT MANAGEMENT LOCAL AUTOALLOCATE DEFAULT
 NOCOMPRESS  SEGMENT SPACE MANAGEMENT AUTO;

   ALTER DATABASE DATAFILE
  '+DATA/HAWK/DATAFILE/users.269.962674885' RESIZE 5242880;

--- Remove ALTER and RESIZE from sql file.
--- Most likely the incorrect way to do this since TBS may be undersized.

12.2 Datapump Improvements actually does this the right way.

[oracle@racnode-dc1-2 log]$ sed -i.bak '/ALTER DATABASE DATAFILE\|RESIZE/ d' tablespaces_ddl.sql

[oracle@racnode-dc1-2 log]$ ls -l tablespace*
-rw-r--r-- 1 oracle dba 1214 Dec 14 02:03 tablespaces_ddl.sql
-rw-r--r-- 1 oracle dba 1488 Dec 14 01:45 tablespaces_ddl.sql.bak

[oracle@racnode-dc1-2 log]$ diff tablespaces_ddl.sql tablespaces_ddl.sql.bak
14a15,16
>    ALTER DATABASE DATAFILE
>   '+DATA/HAWK/DATAFILE/undotbs1.260.962253853' RESIZE 152043520;
24a27,28
>    ALTER DATABASE DATAFILE
>   '+DATA/HAWK/DATAFILE/undotbs2.265.962254263' RESIZE 235929600;
32a37,38
>    ALTER DATABASE DATAFILE
>   '+DATA/HAWK/DATAFILE/users.269.962674885' RESIZE 5242880;

[oracle@racnode-dc1-2 log]$ cat tablespaces_ddl.sql
-- CONNECT SYS
ALTER SESSION SET EVENTS '10150 TRACE NAME CONTEXT FOREVER, LEVEL 1';
ALTER SESSION SET EVENTS '10904 TRACE NAME CONTEXT FOREVER, LEVEL 1';
ALTER SESSION SET EVENTS '25475 TRACE NAME CONTEXT FOREVER, LEVEL 1';
ALTER SESSION SET EVENTS '10407 TRACE NAME CONTEXT FOREVER, LEVEL 1';
ALTER SESSION SET EVENTS '10851 TRACE NAME CONTEXT FOREVER, LEVEL 1';
ALTER SESSION SET EVENTS '22830 TRACE NAME CONTEXT FOREVER, LEVEL 192 ';
-- new object type path: DATABASE_EXPORT/TABLESPACE
CREATE UNDO TABLESPACE "UNDOTBS1" DATAFILE
  SIZE 26214400
  AUTOEXTEND ON NEXT 5242880 MAXSIZE 32767M
  BLOCKSIZE 8192
  EXTENT MANAGEMENT LOCAL AUTOALLOCATE;

CREATE TEMPORARY TABLESPACE "TEMP" TEMPFILE
  SIZE 213909504
  AUTOEXTEND ON NEXT 655360 MAXSIZE 32767M
  EXTENT MANAGEMENT LOCAL UNIFORM SIZE 1048576;
CREATE UNDO TABLESPACE "UNDOTBS2" DATAFILE
  SIZE 26214400
  AUTOEXTEND ON NEXT 26214400 MAXSIZE 32767M
  BLOCKSIZE 8192
  EXTENT MANAGEMENT LOCAL AUTOALLOCATE;

CREATE TABLESPACE "USERS" DATAFILE
  SIZE 5242880
  AUTOEXTEND ON NEXT 1310720 MAXSIZE 32767M,
  SIZE 4194304
  LOGGING ONLINE PERMANENT BLOCKSIZE 8192
  EXTENT MANAGEMENT LOCAL AUTOALLOCATE DEFAULT
 NOCOMPRESS  SEGMENT SPACE MANAGEMENT AUTO;

[oracle@racnode-dc1-2 log]$
Advertisements

12.2 Datapump Improvements

Filed under: 12.2,DataPump — mdinh @ 1:00 am

Datafile for tablespace USERS was resize to 5242880.

12.2.0.1.0
5242880 size is part of create tablespace.

Why is this important?
Manual intervention is no longer required to resize datafiles.

CREATE TABLESPACE "USERS" DATAFILE
  SIZE 5242880
  AUTOEXTEND ON NEXT 1310720 MAXSIZE 32767M,
  SIZE 5242880
  LOGGING ONLINE PERMANENT BLOCKSIZE 8192
  EXTENT MANAGEMENT LOCAL AUTOALLOCATE DEFAULT
 NOCOMPRESS  SEGMENT SPACE MANAGEMENT AUTO;

12.1.0.2.0
5242880 size is part of alter tablespace.

 
CREATE TABLESPACE "USERS" DATAFILE
  SIZE 5242880
  AUTOEXTEND ON NEXT 1310720 MAXSIZE 32767M,
  SIZE 4194304
  LOGGING ONLINE PERMANENT BLOCKSIZE 8192
  EXTENT MANAGEMENT LOCAL AUTOALLOCATE DEFAULT
 NOCOMPRESS  SEGMENT SPACE MANAGEMENT AUTO;

   ALTER DATABASE DATAFILE
  '+DATA/HAWK/DATAFILE/users.269.962674885' RESIZE 5242880;

Test Case:

01:01:05 SYS @ owl:>select bytes,tablespace_name,autoextensible,maxbytes from dba_data_files where tablespace_name='USERS';

     BYTES TABLESPACE_NAME                AUT   MAXBYTES
---------- ------------------------------ --- ----------
   5242880 USERS                          YES 3.4360E+10

01:01:57 SYS @ owl:>alter tablespace users add datafile size 4m;

Tablespace altered.

01:02:43 SYS @ owl:>select file_id,bytes from dba_data_files where tablespace_name='USERS';

   FILE_ID      BYTES
---------- ----------
         7    5242880
         5    4194304

01:04:09 SYS @ owl:>alter database datafile 5 resize 5242880;

Database altered.

01:05:08 SYS @ owl:>select file_id,bytes from dba_data_files where tablespace_name='USERS';

   FILE_ID      BYTES
---------- ----------
         7    5242880
         5    5242880

01:05:15 SYS @ owl:>

+++++++++++

[oracle@db-asm-1 ~]$ expdp parfile=expdp_tbs.par

Export: Release 12.2.0.1.0 - Production on Thu Dec 14 01:31:12 2017

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_FULL_01":  /******** AS SYSDBA parfile=expdp_tbs.par
W-1 Startup took 1 seconds
W-1 Processing object type DATABASE_EXPORT/TABLESPACE
W-1      Completed 3 TABLESPACE objects in 0 seconds
W-1 Master table "SYS"."SYS_EXPORT_FULL_01" successfully loaded/unloaded
******************************************************************************
Dump file set for SYS.SYS_EXPORT_FULL_01 is:
  /u01/app/oracle/admin/owl/dpdump/tbs.dmp
Job "SYS"."SYS_EXPORT_FULL_01" successfully completed at Thu Dec 14 01:31:19 2017 elapsed 0 00:00:06

+++++++++++

[oracle@db-asm-1 ~]$ impdp parfile=impdp_tbs.par

Import: Release 12.2.0.1.0 - Production on Thu Dec 14 01:32:51 2017

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
W-1 Startup took 0 seconds
W-1 Master table "SYS"."SYS_SQL_FILE_FULL_01" successfully loaded/unloaded
Starting "SYS"."SYS_SQL_FILE_FULL_01":  /******** AS SYSDBA parfile=impdp_tbs.par
W-1 Processing object type DATABASE_EXPORT/TABLESPACE
W-1      Completed 3 TABLESPACE objects in 0 seconds
Job "SYS"."SYS_SQL_FILE_FULL_01" successfully completed at Thu Dec 14 01:32:54 2017 elapsed 0 00:00:02

+++++++++++

[oracle@db-asm-1 ~]$ cat /u01/app/oracle/admin/owl/dpdump/tablespaces_ddl.sql
-- CONNECT SYS
ALTER SESSION SET EVENTS '10150 TRACE NAME CONTEXT FOREVER, LEVEL 1';
ALTER SESSION SET EVENTS '10904 TRACE NAME CONTEXT FOREVER, LEVEL 1';
ALTER SESSION SET EVENTS '25475 TRACE NAME CONTEXT FOREVER, LEVEL 1';
ALTER SESSION SET EVENTS '10407 TRACE NAME CONTEXT FOREVER, LEVEL 1';
ALTER SESSION SET EVENTS '10851 TRACE NAME CONTEXT FOREVER, LEVEL 1';
ALTER SESSION SET EVENTS '22830 TRACE NAME CONTEXT FOREVER, LEVEL 192 ';
-- new object type path: DATABASE_EXPORT/TABLESPACE
CREATE UNDO TABLESPACE "UNDOTBS1" DATAFILE
  SIZE 73400320
  AUTOEXTEND ON NEXT 73400320 MAXSIZE 32767M
  BLOCKSIZE 8192
  EXTENT MANAGEMENT LOCAL AUTOALLOCATE;


CREATE TEMPORARY TABLESPACE "TEMP" TEMPFILE
  SIZE 33554432
  AUTOEXTEND ON NEXT 655360 MAXSIZE 32767M
  EXTENT MANAGEMENT LOCAL UNIFORM SIZE 1048576;
CREATE TABLESPACE "USERS" DATAFILE
  SIZE 5242880
  AUTOEXTEND ON NEXT 1310720 MAXSIZE 32767M,
  SIZE 5242880
  LOGGING ONLINE PERMANENT BLOCKSIZE 8192
  EXTENT MANAGEMENT LOCAL AUTOALLOCATE DEFAULT
 NOCOMPRESS  SEGMENT SPACE MANAGEMENT AUTO;


[oracle@db-asm-1 ~]$

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

01:40:59 SYS @ hawk2:>select bytes,tablespace_name,autoextensible,maxbytes from dba_data_files where tablespace_name='USERS';

     BYTES TABLESPACE_NAME                AUT   MAXBYTES
---------- ------------------------------ --- ----------
   5242880 USERS                          YES 3.4360E+10

01:41:17 SYS @ hawk2:>alter tablespace users add datafile size 4m;

Tablespace altered.

01:41:24 SYS @ hawk2:>select file_id,bytes from dba_data_files where tablespace_name='USERS';

   FILE_ID      BYTES
---------- ----------
         6    5242880
         2    4194304


01:41:34 SYS @ hawk2:>alter database datafile 2 resize 5242880;

Database altered.

01:41:56 SYS @ hawk2:>select file_id,bytes from dba_data_files where tablespace_name='USERS';

   FILE_ID      BYTES
---------- ----------
         6    5242880
         2    5242880

01:42:02 SYS @ hawk2:>

++++++++++

[oracle@racnode-dc1-2 ~]$ expdp parfile=expdp_tbs.par

Export: Release 12.1.0.2.0 - Production on Thu Dec 14 01:43:19 2017

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

Connected to: Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Advanced Analytics and Real Application Testing options

Starting "SYS"."SYS_EXPORT_FULL_01":  /******** AS SYSDBA parfile=expdp_tbs.par
Startup took 12 seconds
Estimate in progress using BLOCKS method...
Total estimation using BLOCKS method: 0 KB
Processing object type DATABASE_EXPORT/TABLESPACE
     Completed 4 TABLESPACE objects in 2 seconds
Master table "SYS"."SYS_EXPORT_FULL_01" successfully loaded/unloaded
******************************************************************************
Dump file set for SYS.SYS_EXPORT_FULL_01 is:
  /u01/app/oracle/12.1.0.2/db1/rdbms/log/tbs.dmp
Job "SYS"."SYS_EXPORT_FULL_01" successfully completed at Thu Dec 14 01:44:34 2017 elapsed 0 00:00:43

++++++++++

[oracle@racnode-dc1-2 ~]$ impdp parfile=impdp_tbs.par

Import: Release 12.1.0.2.0 - Production on Thu Dec 14 01:45:48 2017

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

Connected to: Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Advanced Analytics and Real Application Testing options
Startup took 1 seconds
Master table "SYS"."SYS_SQL_FILE_FULL_01" successfully loaded/unloaded
Starting "SYS"."SYS_SQL_FILE_FULL_01":  /******** AS SYSDBA parfile=impdp_tbs.par
Processing object type DATABASE_EXPORT/TABLESPACE
     Completed 4 TABLESPACE objects in 1 seconds
Job "SYS"."SYS_SQL_FILE_FULL_01" successfully completed at Thu Dec 14 01:45:57 2017 elapsed 0 00:00:05

[oracle@racnode-dc1-2 ~]$

++++++++++

[oracle@racnode-dc1-2 ~]$ cat /u01/app/oracle/12.1.0.2/db1/rdbms/log/tablespaces_ddl.sql
-- CONNECT SYS
ALTER SESSION SET EVENTS '10150 TRACE NAME CONTEXT FOREVER, LEVEL 1';
ALTER SESSION SET EVENTS '10904 TRACE NAME CONTEXT FOREVER, LEVEL 1';
ALTER SESSION SET EVENTS '25475 TRACE NAME CONTEXT FOREVER, LEVEL 1';
ALTER SESSION SET EVENTS '10407 TRACE NAME CONTEXT FOREVER, LEVEL 1';
ALTER SESSION SET EVENTS '10851 TRACE NAME CONTEXT FOREVER, LEVEL 1';
ALTER SESSION SET EVENTS '22830 TRACE NAME CONTEXT FOREVER, LEVEL 192 ';
-- new object type path: DATABASE_EXPORT/TABLESPACE
CREATE UNDO TABLESPACE "UNDOTBS1" DATAFILE
  SIZE 26214400
  AUTOEXTEND ON NEXT 5242880 MAXSIZE 32767M
  BLOCKSIZE 8192
  EXTENT MANAGEMENT LOCAL AUTOALLOCATE;

   ALTER DATABASE DATAFILE
  '+DATA/HAWK/DATAFILE/undotbs1.260.962253853' RESIZE 152043520;
CREATE TEMPORARY TABLESPACE "TEMP" TEMPFILE
  SIZE 213909504
  AUTOEXTEND ON NEXT 655360 MAXSIZE 32767M
  EXTENT MANAGEMENT LOCAL UNIFORM SIZE 1048576;
CREATE UNDO TABLESPACE "UNDOTBS2" DATAFILE
  SIZE 26214400
  AUTOEXTEND ON NEXT 26214400 MAXSIZE 32767M
  BLOCKSIZE 8192
  EXTENT MANAGEMENT LOCAL AUTOALLOCATE;

   ALTER DATABASE DATAFILE
  '+DATA/HAWK/DATAFILE/undotbs2.265.962254263' RESIZE 235929600;
  
CREATE TABLESPACE "USERS" DATAFILE
  SIZE 5242880
  AUTOEXTEND ON NEXT 1310720 MAXSIZE 32767M,
  SIZE 4194304
  LOGGING ONLINE PERMANENT BLOCKSIZE 8192
  EXTENT MANAGEMENT LOCAL AUTOALLOCATE DEFAULT
 NOCOMPRESS  SEGMENT SPACE MANAGEMENT AUTO;

   ALTER DATABASE DATAFILE
  '+DATA/HAWK/DATAFILE/users.269.962674885' RESIZE 5242880;
[oracle@racnode-dc1-2 ~]$

December 2, 2017

Goldengate 12.3 Automatic CDR

Filed under: 12.2,GoldenGate,oracle — mdinh @ 11:51 pm

Automatic Conflict Detection and Resolution

Requirements: GoldenGate 12c (12.3.0.1) and Oracle Database 12c Release 2 (12.2) and later.

Automatic conflict detection and resolution does not require application changes for the following reasons:

  • Oracle Database automatically creates and maintains invisible timestamp columns.
  • Inserts, updates, and deletes use the delete tombstone log table to determine if a row was deleted.
  • LOB column conflicts can be detected.
  • Oracle Database automatically configures supplemental logging on required columns.

I have not had the chance to play with this yet and just only notice the documentation has been updated with details.

 

 

November 26, 2017

RMAN Backup To FRA Repercussions

Filed under: 10g,11g,12c,RMAN — mdinh @ 3:50 pm

Common advice is to backup to FRA.
Before following advice, evaluate to determine fit and understand any repercussions.
Doesn’t this potentially create SPOF and may require restore from tape unnecessarily?

HINT:

Make sure the following commands are part of backup when backup to FRA.

CONFIGURE CHANNEL DEVICE TYPE DISK CLEAR;
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK CLEAR;

DEMO:

Recovery Manager: Release 12.1.0.2.0 - Production on Sun Nov 26 16:02:17 2017

RMAN> show controlfile autobackup;

RMAN configuration parameters for database with db_unique_name HAWK are:
CONFIGURE CONTROLFILE AUTOBACKUP ON;

RMAN> show controlfile autobackup format;

RMAN configuration parameters for database with db_unique_name HAWK are:
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '%F'; # default

RMAN> backup datafile 1;

Starting backup at 26-NOV-17
using channel ORA_DISK_1
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00001 name=+DATA/HAWK/DATAFILE/system.258.960967651
channel ORA_DISK_1: starting piece 1 at 26-NOV-17
channel ORA_DISK_1: finished piece 1 at 26-NOV-17
piece handle=+FRA/HAWK/BACKUPSET/2017_11_26/nnndf0_tag20171126t160327_0.274.961085007 tag=TAG20171126T160327 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:07
Finished backup at 26-NOV-17

--- Control File and SPFILE Autobackup to FRA
Starting Control File and SPFILE Autobackup at 26-NOV-17
piece handle=+FRA/HAWK/AUTOBACKUP/2017_11_26/s_961085014.275.961085015 comment=NONE
Finished Control File and SPFILE Autobackup at 26-NOV-17

RMAN> CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '%F';

new RMAN configuration parameters:
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '%F';
new RMAN configuration parameters are successfully stored

RMAN> show controlfile autobackup format;

RMAN configuration parameters for database with db_unique_name HAWK are:
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '%F';
--- CONTROLFILE AUTOBACKUP FORMAT is same but ***NOT*** DEFAULT
RMAN> backup datafile 1;

Starting backup at 26-NOV-17
using channel ORA_DISK_1
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00001 name=+DATA/HAWK/DATAFILE/system.258.960967651
channel ORA_DISK_1: starting piece 1 at 26-NOV-17
channel ORA_DISK_1: finished piece 1 at 26-NOV-17
piece handle=+FRA/HAWK/BACKUPSET/2017_11_26/nnndf0_tag20171126t160655_0.276.961085215 tag=TAG20171126T160655 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:07
Finished backup at 26-NOV-17

--- Control File and SPFILE Autobackup to ***DISK***
Starting Control File and SPFILE Autobackup at 26-NOV-17
piece handle=/u01/app/oracle/12.1.0.2/db1/dbs/c-3219666184-20171126-01 comment=NONE
Finished Control File and SPFILE Autobackup at 26-NOV-17

RMAN> CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK CLEAR;

old RMAN configuration parameters:
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '%F';
RMAN configuration parameters are successfully reset to default value

RMAN> show controlfile autobackup format;

RMAN configuration parameters for database with db_unique_name HAWK are:
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '%F'; # default <-- 

RMAN> backup datafile 1 FORMAT '%d_%I_%T_%U';

Starting backup at 26-NOV-17
using channel ORA_DISK_1
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00001 name=+DATA/HAWK/DATAFILE/system.258.960967651
channel ORA_DISK_1: starting piece 1 at 26-NOV-17
channel ORA_DISK_1: finished piece 1 at 26-NOV-17
piece handle=/u01/app/oracle/12.1.0.2/db1/dbs/HAWK_3219666184_20171126_0oski093_1_1 tag=TAG20171126T161531 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:07
Finished backup at 26-NOV-17

Starting Control File and SPFILE Autobackup at 26-NOV-17
piece handle=+FRA/HAWK/AUTOBACKUP/2017_11_26/s_961085738.277.961085739 comment=NONE
Finished Control File and SPFILE Autobackup at 26-NOV-17

RMAN>

REFERENCE:

How to KEEP a backup created in the Flash Recovery Area (FRA)? (Doc ID 401163.1)	
A backup needed to be KEPT, must be created outside the flash recovery area.

Why are backups going to $ORACLE_HOME/dbs rather than Flash recovery area via Rman or EM Grid control /FRA not considering Archivelog part of it (Doc ID 404854.1)
 1. Do not use a FORMAT clause on backup commands.
 
RMAN Uses Flash Recovery Area for Autobackup When Using Format '%F' (Doc ID 338483.1)	 

November 23, 2017

rman checksyntax not reliable

Filed under: RMAN,12c — mdinh @ 4:42 pm

There is no syntax error reported but backup will fail.
Can you spot where the error is at?

[oracle@racnode-dc1-1 backup]$ rman checksyntax @ bkupinc0.rman

Recovery Manager: Release 12.1.0.2.0 - Production on Thu Nov 23 17:14:31 2017

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

RMAN> connect target;
2> set echo on
3> set command id to "LEVEL0";
4> show all;
5> run {
6> set controlfile autobackup format for device type disk to '/sf_working/backup/%d_%I_%F.ctl';
7> allocate channel d1 device type disk format '/sf_working/backup/%d_%I_%T_%U.LEVEL0' MAXPIECESIZE 512 M MAXOPEMFILES 1;
8> backup as compressed backupset
9> incremental level 0 check logical database
10> filesperset 1 tag="LEVEL0"
11> tag="LEVEL0"
12> plus archivelog
13> filesperset 8 tag="LEVEL0"
14> tag="LEVEL0"
15> ;
16> alter database backup controlfile to trace as '/sf_working/backup/cf_@.sql' REUSE RESETLOGS;
17> create pfile='/sf_working/backup/init@.ora' from spfile;
18> }
19> report schema;
20> list backup summary;
21> exit
The cmdfile has no syntax errors

Recovery Manager complete.
[oracle@racnode-dc1-1 backup]$

CRS-2674: Start of dbfs_mount failed

Filed under: 12c,GoldenGate,oracle,RAC — mdinh @ 1:04 am

$ crsctl start resource dbfs_mount
CRS-2672: Attempting to start ‘dbfs_mount’ on ‘node2’
CRS-2672: Attempting to start ‘dbfs_mount’ on ‘node1’
CRS-2674: Start of ‘dbfs_mount’ on ‘node1’ failed
CRS-2679: Attempting to clean ‘dbfs_mount’ on ‘node1’
CRS-2674: Start of ‘dbfs_mount’ on ‘node2’ failed
CRS-2679: Attempting to clean ‘dbfs_mount’ on ‘node2’
CRS-2681: Clean of ‘dbfs_mount’ on ‘node1’ succeeded
CRS-2681: Clean of ‘dbfs_mount’ on ‘node2’ succeeded
CRS-4000: Command Start failed, or completed with errors.

Check to make sure DBFS_USER password is not expired.

November 12, 2017

opatchauto Hell

Filed under: 12c — mdinh @ 8:10 pm

I have been investigating new opatchauto apply for 12.1 RAC system.

Was overjoyed to see services relocated to instance2 when instance1 was being patched.

The joy became dismay to find relocated services on instance2 were stopped to perform datapatch.

I am definitely not an expert, but why shutdown services running on other instances?

What if services are manually relocated, would they still be shutdown?

From Oplan:

In-Place Patching: Apply Patch to Existing Oracle HomesIn this option, the patch will be applied directly to the specified Oracle Homes. 
This is the least time-consuming option. 
The procedures available for this option are outlined below.

    Rolling Mode: Apply Patch to Each Node In A Cluster Sequentially Resources running on each node in the cluster will be stopped, patched and then restarted, one at a time in sequence. 
      By patching only one node at a time, this approach ensures that multi-instance databases remain available during the patching process, but it will take longer to complete.

        Apply Patch In-Place using OPatch Auto Command in Rolling Mode:
            Advantages: No downtime while patching; fewer patching steps.
            Disadvantages: May be time consuming; less-than-optimal diagnosability of issues during patching; slower recovery from failures.
            Total number of steps required: 29
                During the full availability of services: 23
                During the partial availability of services: 6 

Step 2: Patch Apply Phase (Limited services will be available)

Instance orclcdb1 is running on node racnode-dc1-1 with online services DBA_TEST,testsvc11,testsvc12,testsvc13,testsvc14,testsvc15. Instance status: Open.

What does Oracle mean by limited? The services are shutdown and not restarted!

Update: services run on correct instance when restarted.

[oracle@racnode-dc1-1 ~]$ srvctl start service -d orclcdb
PRCD-1133 : Failed to start services for database
CRS-5702: Resource 'ora.orclcdb.testsvc26.svc' is already running on 'racnode-dc1-2'
CRS-5702: Resource 'ora.orclcdb.testsvc27.svc' is already running on 'racnode-dc1-2'
CRS-5702: Resource 'ora.orclcdb.testsvc28.svc' is already running on 'racnode-dc1-2'
CRS-5702: Resource 'ora.orclcdb.testsvc29.svc' is already running on 'racnode-dc1-2'

[oracle@racnode-dc1-1 ~]$ date; srvctl status database -d orclcdb -v
Sun Nov 12 21:17:52 CET 2017
Instance orclcdb1 is running on node racnode-dc1-1 with online services DBA_TEST,testsvc11,testsvc12,testsvc13,testsvc14,testsvc15. Instance status: Open.
Instance orclcdb2 is running on node racnode-dc1-2 with online services testsvc26,testsvc27,testsvc28,testsvc29. Instance status: Open.
[oracle@racnode-dc1-1 ~]$

[root@racnode-dc1-1 ~]# $GRID_HOME/OPatch/opatchauto apply /sf_OracleSoftware/12.1.0.2_PatchSet_Linux_x64/OCT2017PSU/26635880


OPatchauto session is initiated at Sun Nov 12 18:07:15 2017

System initialization log file is /u01/app/12.1.0.2/grid/cfgtoollogs/opatchautodb/systemconfig2017-11-12_06-08-14PM.log.

Session log file is /u01/app/12.1.0.2/grid/cfgtoollogs/opatchauto/opatchauto2017-11-12_06-09-00PM.log
The id for this session is YKRN


Executing OPatch prereq operations to verify patch applicability on home /u01/app/12.1.0.2/grid

Executing OPatch prereq operations to verify patch applicability on home /u01/app/oracle/12.1.0.2/db1
Patch applicability verified successfully on home /u01/app/oracle/12.1.0.2/db1

Patch applicability verified successfully on home /u01/app/12.1.0.2/grid


Verifying SQL patch applicability on home /u01/app/oracle/12.1.0.2/db1
SQL patch applicability verified successfully on home /u01/app/oracle/12.1.0.2/db1


Preparing to bring down database service on home /u01/app/oracle/12.1.0.2/db1
Successfully prepared home /u01/app/oracle/12.1.0.2/db1 to bring down database service


Bringing down CRS service on home /u01/app/12.1.0.2/grid
Prepatch operation log file location: /u01/app/12.1.0.2/grid/cfgtoollogs/crsconfig/crspatch_racnode-dc1-1_2017-11-12_06-20-39PM.log
CRS service brought down successfully on home /u01/app/12.1.0.2/grid


Performing prepatch operation on home /u01/app/oracle/12.1.0.2/db1
Perpatch operation completed successfully on home /u01/app/oracle/12.1.0.2/db1


Start applying binary patch on home /u01/app/oracle/12.1.0.2/db1
Binary patch applied successfully on home /u01/app/oracle/12.1.0.2/db1


Performing postpatch operation on home /u01/app/oracle/12.1.0.2/db1
Postpatch operation completed successfully on home /u01/app/oracle/12.1.0.2/db1


Start applying binary patch on home /u01/app/12.1.0.2/grid

Binary patch applied successfully on home /u01/app/12.1.0.2/grid


Starting CRS service on home /u01/app/12.1.0.2/grid
Postpatch operation log file location: /u01/app/12.1.0.2/grid/cfgtoollogs/crsconfig/crspatch_racnode-dc1-1_2017-11-12_07-20-43PM.log
CRS service started successfully on home /u01/app/12.1.0.2/grid


Preparing home /u01/app/oracle/12.1.0.2/db1 after database service restarted
Prepared home /u01/app/oracle/12.1.0.2/db1 successfully after database service restarted


Trying to apply SQL patch on home /u01/app/oracle/12.1.0.2/db1
SQL patch applied successfully on home /u01/app/oracle/12.1.0.2/db1

OPatchAuto successful.

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

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

Host:racnode-dc1-1
RAC Home:/u01/app/oracle/12.1.0.2/db1
Summary:

==Following patches were SKIPPED:

Patch: /sf_OracleSoftware/12.1.0.2_PatchSet_Linux_x64/OCT2017PSU/26635880/21436941
Reason: This patch is not applicable to this specified target type - "rac_database"

Patch: /sf_OracleSoftware/12.1.0.2_PatchSet_Linux_x64/OCT2017PSU/26635880/26392164
Reason: This patch is not applicable to this specified target type - "rac_database"


==Following patches were SUCCESSFULLY applied:

Patch: /sf_OracleSoftware/12.1.0.2_PatchSet_Linux_x64/OCT2017PSU/26635880/26392192
Log: /u01/app/oracle/12.1.0.2/db1/cfgtoollogs/opatchauto/core/opatch/opatch2017-11-12_18-22-11PM_1.log

Patch: /sf_OracleSoftware/12.1.0.2_PatchSet_Linux_x64/OCT2017PSU/26635880/26717470
Log: /u01/app/oracle/12.1.0.2/db1/cfgtoollogs/opatchauto/core/opatch/opatch2017-11-12_18-22-11PM_1.log


Host:racnode-dc1-1
CRS Home:/u01/app/12.1.0.2/grid
Summary:

==Following patches were SUCCESSFULLY applied:

Patch: /sf_OracleSoftware/12.1.0.2_PatchSet_Linux_x64/OCT2017PSU/26635880/21436941
Log: /u01/app/12.1.0.2/grid/cfgtoollogs/opatchauto/core/opatch/opatch2017-11-12_18-46-41PM_1.log

Patch: /sf_OracleSoftware/12.1.0.2_PatchSet_Linux_x64/OCT2017PSU/26635880/26392164
Log: /u01/app/12.1.0.2/grid/cfgtoollogs/opatchauto/core/opatch/opatch2017-11-12_18-46-41PM_1.log

Patch: /sf_OracleSoftware/12.1.0.2_PatchSet_Linux_x64/OCT2017PSU/26635880/26392192
Log: /u01/app/12.1.0.2/grid/cfgtoollogs/opatchauto/core/opatch/opatch2017-11-12_18-46-41PM_1.log

Patch: /sf_OracleSoftware/12.1.0.2_PatchSet_Linux_x64/OCT2017PSU/26635880/26717470
Log: /u01/app/12.1.0.2/grid/cfgtoollogs/opatchauto/core/opatch/opatch2017-11-12_18-46-41PM_1.log

OPatchauto session completed at Sun Nov 12 19:34:26 2017
Time taken to complete the session 87 minutes, 11 seconds
[root@racnode-dc1-1 ~]#

[root@racnode-dc1-1 opatchauto]# grep -A8 “Executing command as” opatchauto2017-11-12_06-09-00PM.log


Executing command as oracle:
 /u01/app/12.1.0.2/grid/OPatch/opatchauto  apply /sf_OracleSoftware/12.1.0.2_PatchSet_Linux_x64/OCT2017PSU/26635880 -oh /u01/app/12.1.0.2/grid -target_type cluster -binary -invPtrLoc /u01/app/12.1.0.2/grid/oraInst.loc -jre /u01/app/12.1.0.2/grid/OPatch/jre -persistresult /u01/app/12.1.0.2/grid/OPatch/auto/dbsessioninfo/sessionresult_analyze_racnode-dc1-1_crs.ser -analyze -online
2017-11-12 18:09:24,734 INFO  [53] com.oracle.glcm.patch.auto.db.integration.controller.action.OPatchAutoBinaryAction -
Executing command as oracle:
 /u01/app/oracle/12.1.0.2/db1/OPatch/opatchauto  apply /sf_OracleSoftware/12.1.0.2_PatchSet_Linux_x64/OCT2017PSU/26635880 -oh /u01/app/oracle/12.1.0.2/db1 -target_type rac_database -binary -invPtrLoc /u01/app/12.1.0.2/grid/oraInst.loc -jre /u01/app/12.1.0.2/grid/OPatch/jre -persistresult /u01/app/oracle/12.1.0.2/db1/OPatch/auto/dbsessioninfo/sessionresult_analyze_racnode-dc1-1_rac.ser -analyze -online
2017-11-12 18:12:45,263 INFO  [53] com.oracle.glcm.patch.auto.db.integration.controller.action.OPatchAutoBinaryAction - Opatchcore binary return code=0
2017-11-12 18:12:45,265 INFO  [53] com.oracle.glcm.patch.auto.db.integration.controller.action.OPatchAutoBinaryAction - Opatchcore binary output=Oracle Home : /u01/app/oracle/12.1.0.2/db1

OPatchAuto binary patching Tool
Copyright (c)2014, Oracle Corporation. All rights reserved.

OPatchauto Version : 13.9.3.0.0
--
Executing command as oracle:
 /bin/sh -c 'cd /u01/app/oracle/12.1.0.2/db1; ORACLE_HOME=/u01/app/oracle/12.1.0.2/db1 ORACLE_SID=orclcdb1 /u01/app/oracle/12.1.0.2/db1/OPatch/datapatch -prereq -verbose'
2017-11-12 18:19:52,146 INFO  [85] com.oracle.glcm.patch.auto.db.product.executor.PatchingStepExecutor - COMMAND Looks like this: /bin/sh -c 'cd /u01/app/oracle/12.1.0.2/db1; ORACLE_HOME=/u01/app/oracle/12.1.0.2/db1 ORACLE_SID=orclcdb1 /u01/app/oracle/12.1.0.2/db1/OPatch/datapatch -prereq -verbose'
2017-11-12 18:20:20,415 INFO  [85] com.oracle.glcm.patch.auto.db.product.executor.PatchingStepExecutor - status: 0
2017-11-12 18:20:20,415 INFO  [85] com.oracle.glcm.patch.auto.db.product.executor.PatchingStepExecutor - Successfully executed the above command.

2017-11-12 18:20:20,415 INFO  [85] com.oracle.glcm.patch.auto.db.product.executor.PatchingStepExecutor - Output from the command:
2017-11-12 18:20:20,415 INFO  [85] com.oracle.glcm.patch.auto.db.product.executor.PatchingStepExecutor - SQL Patching tool version 12.1.0.2.0 Production on Sun Nov 12 18:19:52 2017
Copyright (c) 2012, 2017, Oracle.  All rights reserved.
--
Executing command as oracle:
 /bin/sh -c 'echo "DECLARE l_count NUMBER(4) :=0; BEGIN SELECT count(*) INTO l_count FROM CDB_PDBS; IF l_count >1 then EXECUTE IMMEDIATE '\''alter pluggable database ALL SAVE STATE'\''; END IF; commit; END;" > /tmp/OraDB12Home1_oracle_orclcdb1.sql'
2017-11-12 18:20:23,665 INFO  [125] com.oracle.glcm.patch.auto.db.product.executor.PatchingStepExecutor - COMMAND Looks like this: /bin/sh -c 'echo "DECLARE l_count NUMBER(4) :=0; BEGIN SELECT count(*) INTO l_count FROM CDB_PDBS; IF l_count >1 then EXECUTE IMMEDIATE '\''alter pluggable database ALL SAVE STATE'\''; END IF; commit; END;" > /tmp/OraDB12Home1_oracle_orclcdb1.sql'
2017-11-12 18:20:23,771 INFO  [125] com.oracle.glcm.patch.auto.db.product.executor.PatchingStepExecutor - status: 0
2017-11-12 18:20:23,771 INFO  [125] com.oracle.glcm.patch.auto.db.product.executor.PatchingStepExecutor - Successfully executed the above command.

2017-11-12 18:20:23,771 INFO  [125] com.oracle.glcm.patch.auto.db.product.executor.PatchingStepExecutor - Output from the command:
2017-11-12 18:20:23,771 INFO  [125] com.oracle.glcm.patch.auto.db.product.executor.PatchingStepExecutor -
2017-11-12 18:20:23,771 INFO  [125] com.oracle.glcm.patch.auto.db.product.executor.PatchingStepExecutor - Command executed successfully.
--
Executing command as oracle:
 /bin/sh -c 'echo "/" >> /tmp/OraDB12Home1_oracle_orclcdb1.sql'
2017-11-12 18:20:23,772 INFO  [125] com.oracle.glcm.patch.auto.db.product.executor.PatchingStepExecutor - COMMAND Looks like this: /bin/sh -c 'echo "/" >> /tmp/OraDB12Home1_oracle_orclcdb1.sql'
2017-11-12 18:20:23,873 INFO  [125] com.oracle.glcm.patch.auto.db.product.executor.PatchingStepExecutor - status: 0
2017-11-12 18:20:23,873 INFO  [125] com.oracle.glcm.patch.auto.db.product.executor.PatchingStepExecutor - Successfully executed the above command.

2017-11-12 18:20:23,873 INFO  [125] com.oracle.glcm.patch.auto.db.product.executor.PatchingStepExecutor - Output from the command:
2017-11-12 18:20:23,873 INFO  [125] com.oracle.glcm.patch.auto.db.product.executor.PatchingStepExecutor -
2017-11-12 18:20:23,873 INFO  [125] com.oracle.glcm.patch.auto.db.product.executor.PatchingStepExecutor - Command executed successfully.
--
Executing command as oracle:
 /bin/sh -c 'echo "EXIT;" >> /tmp/OraDB12Home1_oracle_orclcdb1.sql'
2017-11-12 18:20:23,873 INFO  [125] com.oracle.glcm.patch.auto.db.product.executor.PatchingStepExecutor - COMMAND Looks like this: /bin/sh -c 'echo "EXIT;" >> /tmp/OraDB12Home1_oracle_orclcdb1.sql'
2017-11-12 18:20:23,958 INFO  [125] com.oracle.glcm.patch.auto.db.product.executor.PatchingStepExecutor - status: 0
2017-11-12 18:20:23,958 INFO  [125] com.oracle.glcm.patch.auto.db.product.executor.PatchingStepExecutor - Successfully executed the above command.

2017-11-12 18:20:23,958 INFO  [125] com.oracle.glcm.patch.auto.db.product.executor.PatchingStepExecutor - Output from the command:
2017-11-12 18:20:23,958 INFO  [125] com.oracle.glcm.patch.auto.db.product.executor.PatchingStepExecutor -
2017-11-12 18:20:23,958 INFO  [125] com.oracle.glcm.patch.auto.db.product.executor.PatchingStepExecutor - Command executed successfully.
--
Executing command as oracle:
 /bin/sh -c 'cd /u01/app/oracle/12.1.0.2/db1 ; ORACLE_HOME=/u01/app/oracle/12.1.0.2/db1 ORACLE_SID=orclcdb1 /u01/app/oracle/12.1.0.2/db1/bin/sqlplus / as sysdba @/tmp/OraDB12Home1_oracle_orclcdb1.sql'
2017-11-12 18:20:23,958 INFO  [125] com.oracle.glcm.patch.auto.db.product.executor.PatchingStepExecutor - COMMAND Looks like this: /bin/sh -c 'cd /u01/app/oracle/12.1.0.2/db1 ; ORACLE_HOME=/u01/app/oracle/12.1.0.2/db1 ORACLE_SID=orclcdb1 /u01/app/oracle/12.1.0.2/db1/bin/sqlplus / as sysdba @/tmp/OraDB12Home1_oracle_orclcdb1.sql'
2017-11-12 18:20:24,268 INFO  [125] com.oracle.glcm.patch.auto.db.product.executor.PatchingStepExecutor - status: 0
2017-11-12 18:20:24,268 INFO  [125] com.oracle.glcm.patch.auto.db.product.executor.PatchingStepExecutor - Successfully executed the above command.

2017-11-12 18:20:24,268 INFO  [125] com.oracle.glcm.patch.auto.db.product.executor.PatchingStepExecutor - Output from the command:
2017-11-12 18:20:24,268 INFO  [125] com.oracle.glcm.patch.auto.db.product.executor.PatchingStepExecutor -
SQL*Plus: Release 12.1.0.2.0 Production on Sun Nov 12 18:20:24 2017
--

Executing command as oracle:
 /bin/sh -c 'ORACLE_HOME=/u01/app/oracle/12.1.0.2/db1 /u01/app/oracle/12.1.0.2/db1/bin/srvctl relocate service -d orclcdb -s DBA_TEST -i orclcdb1 -t orclcdb2'
2017-11-12 18:20:24,269 INFO  [125] com.oracle.glcm.patch.auto.db.product.executor.PatchingStepExecutor - COMMAND Looks like this: /bin/sh -c 'ORACLE_HOME=/u01/app/oracle/12.1.0.2/db1 /u01/app/oracle/12.1.0.2/db1/bin/srvctl relocate service -d orclcdb -s DBA_TEST -i orclcdb1 -t orclcdb2'
2017-11-12 18:20:26,771 INFO  [125] com.oracle.glcm.patch.auto.db.product.executor.PatchingStepExecutor - status: 0
2017-11-12 18:20:26,771 INFO  [125] com.oracle.glcm.patch.auto.db.product.executor.PatchingStepExecutor - Successfully executed the above command.

2017-11-12 18:20:26,771 INFO  [125] com.oracle.glcm.patch.auto.db.product.executor.PatchingStepExecutor - Output from the command:
2017-11-12 18:20:26,809 INFO  [125] com.oracle.glcm.patch.auto.db.product.executor.PatchingStepExecutor -
2017-11-12 18:20:26,809 INFO  [125] com.oracle.glcm.patch.auto.db.product.executor.PatchingStepExecutor - Command executed successfully.
--
Executing command as oracle:
 /bin/sh -c 'ORACLE_HOME=/u01/app/oracle/12.1.0.2/db1 /u01/app/oracle/12.1.0.2/db1/bin/srvctl relocate service -d orclcdb -s testsvc11 -i orclcdb1 -t orclcdb2'
2017-11-12 18:20:26,809 INFO  [125] com.oracle.glcm.patch.auto.db.product.executor.PatchingStepExecutor - COMMAND Looks like this: /bin/sh -c 'ORACLE_HOME=/u01/app/oracle/12.1.0.2/db1 /u01/app/oracle/12.1.0.2/db1/bin/srvctl relocate service -d orclcdb -s testsvc11 -i orclcdb1 -t orclcdb2'
2017-11-12 18:20:28,931 INFO  [125] com.oracle.glcm.patch.auto.db.product.executor.PatchingStepExecutor - status: 0
2017-11-12 18:20:28,932 INFO  [125] com.oracle.glcm.patch.auto.db.product.executor.PatchingStepExecutor - Successfully executed the above command.

2017-11-12 18:20:28,932 INFO  [125] com.oracle.glcm.patch.auto.db.product.executor.PatchingStepExecutor - Output from the command:
2017-11-12 18:20:28,932 INFO  [125] com.oracle.glcm.patch.auto.db.product.executor.PatchingStepExecutor -
2017-11-12 18:20:28,932 INFO  [125] com.oracle.glcm.patch.auto.db.product.executor.PatchingStepExecutor - Command executed successfully.
--
Executing command as oracle:
 /bin/sh -c 'ORACLE_HOME=/u01/app/oracle/12.1.0.2/db1 /u01/app/oracle/12.1.0.2/db1/bin/srvctl relocate service -d orclcdb -s testsvc12 -i orclcdb1 -t orclcdb2'
2017-11-12 18:20:28,932 INFO  [125] com.oracle.glcm.patch.auto.db.product.executor.PatchingStepExecutor - COMMAND Looks like this: /bin/sh -c 'ORACLE_HOME=/u01/app/oracle/12.1.0.2/db1 /u01/app/oracle/12.1.0.2/db1/bin/srvctl relocate service -d orclcdb -s testsvc12 -i orclcdb1 -t orclcdb2'
2017-11-12 18:20:31,027 INFO  [125] com.oracle.glcm.patch.auto.db.product.executor.PatchingStepExecutor - status: 0
2017-11-12 18:20:31,027 INFO  [125] com.oracle.glcm.patch.auto.db.product.executor.PatchingStepExecutor - Successfully executed the above command.

2017-11-12 18:20:31,027 INFO  [125] com.oracle.glcm.patch.auto.db.product.executor.PatchingStepExecutor - Output from the command:
2017-11-12 18:20:31,027 INFO  [125] com.oracle.glcm.patch.auto.db.product.executor.PatchingStepExecutor -
2017-11-12 18:20:31,027 INFO  [125] com.oracle.glcm.patch.auto.db.product.executor.PatchingStepExecutor - Command executed successfully.
--
Executing command as oracle:
 /bin/sh -c 'ORACLE_HOME=/u01/app/oracle/12.1.0.2/db1 /u01/app/oracle/12.1.0.2/db1/bin/srvctl relocate service -d orclcdb -s testsvc13 -i orclcdb1 -t orclcdb2'
2017-11-12 18:20:31,027 INFO  [125] com.oracle.glcm.patch.auto.db.product.executor.PatchingStepExecutor - COMMAND Looks like this: /bin/sh -c 'ORACLE_HOME=/u01/app/oracle/12.1.0.2/db1 /u01/app/oracle/12.1.0.2/db1/bin/srvctl relocate service -d orclcdb -s testsvc13 -i orclcdb1 -t orclcdb2'
2017-11-12 18:20:33,346 INFO  [125] com.oracle.glcm.patch.auto.db.product.executor.PatchingStepExecutor - status: 0
2017-11-12 18:20:33,346 INFO  [125] com.oracle.glcm.patch.auto.db.product.executor.PatchingStepExecutor - Successfully executed the above command.

2017-11-12 18:20:33,346 INFO  [125] com.oracle.glcm.patch.auto.db.product.executor.PatchingStepExecutor - Output from the command:
2017-11-12 18:20:33,346 INFO  [125] com.oracle.glcm.patch.auto.db.product.executor.PatchingStepExecutor -
2017-11-12 18:20:33,346 INFO  [125] com.oracle.glcm.patch.auto.db.product.executor.PatchingStepExecutor - Command executed successfully.
--
Executing command as oracle:
 /bin/sh -c 'ORACLE_HOME=/u01/app/oracle/12.1.0.2/db1 /u01/app/oracle/12.1.0.2/db1/bin/srvctl relocate service -d orclcdb -s testsvc14 -i orclcdb1 -t orclcdb2'
2017-11-12 18:20:33,346 INFO  [125] com.oracle.glcm.patch.auto.db.product.executor.PatchingStepExecutor - COMMAND Looks like this: /bin/sh -c 'ORACLE_HOME=/u01/app/oracle/12.1.0.2/db1 /u01/app/oracle/12.1.0.2/db1/bin/srvctl relocate service -d orclcdb -s testsvc14 -i orclcdb1 -t orclcdb2'
2017-11-12 18:20:35,327 INFO  [125] com.oracle.glcm.patch.auto.db.product.executor.PatchingStepExecutor - status: 0
2017-11-12 18:20:35,328 INFO  [125] com.oracle.glcm.patch.auto.db.product.executor.PatchingStepExecutor - Successfully executed the above command.

2017-11-12 18:20:35,328 INFO  [125] com.oracle.glcm.patch.auto.db.product.executor.PatchingStepExecutor - Output from the command:
2017-11-12 18:20:35,328 INFO  [125] com.oracle.glcm.patch.auto.db.product.executor.PatchingStepExecutor -
2017-11-12 18:20:35,328 INFO  [125] com.oracle.glcm.patch.auto.db.product.executor.PatchingStepExecutor - Command executed successfully.
--
Executing command as oracle:
 /bin/sh -c 'ORACLE_HOME=/u01/app/oracle/12.1.0.2/db1 /u01/app/oracle/12.1.0.2/db1/bin/srvctl relocate service -d orclcdb -s testsvc15 -i orclcdb1 -t orclcdb2'
2017-11-12 18:20:35,328 INFO  [125] com.oracle.glcm.patch.auto.db.product.executor.PatchingStepExecutor - COMMAND Looks like this: /bin/sh -c 'ORACLE_HOME=/u01/app/oracle/12.1.0.2/db1 /u01/app/oracle/12.1.0.2/db1/bin/srvctl relocate service -d orclcdb -s testsvc15 -i orclcdb1 -t orclcdb2'
2017-11-12 18:20:37,885 INFO  [125] com.oracle.glcm.patch.auto.db.product.executor.PatchingStepExecutor - status: 0
2017-11-12 18:20:37,885 INFO  [125] com.oracle.glcm.patch.auto.db.product.executor.PatchingStepExecutor - Successfully executed the above command.

2017-11-12 18:20:37,885 INFO  [125] com.oracle.glcm.patch.auto.db.product.executor.PatchingStepExecutor - Output from the command:
2017-11-12 18:20:37,885 INFO  [125] com.oracle.glcm.patch.auto.db.product.executor.PatchingStepExecutor -
2017-11-12 18:20:37,885 INFO  [125] com.oracle.glcm.patch.auto.db.product.executor.PatchingStepExecutor - Command executed successfully.

--
Executing command as root:
 /u01/app/12.1.0.2/grid/perl/bin/perl -I/u01/app/12.1.0.2/grid/perl/lib -I/u01/app/12.1.0.2/grid/OPatch/auto/dbtmp/bootstrap_racnode-dc1-1/patchwork/crs/install /u01/app/12.1.0.2/grid/OPatch/auto/dbtmp/bootstrap_racnode-dc1-1/patchwork/crs/install/rootcrs.pl -prepatch
2017-11-12 18:20:38,384 INFO  [206] com.oracle.glcm.patch.auto.db.product.executor.PatchingStepExecutor - COMMAND Looks like this: /u01/app/12.1.0.2/grid/perl/bin/perl -I/u01/app/12.1.0.2/grid/perl/lib -I/u01/app/12.1.0.2/grid/OPatch/auto/dbtmp/bootstrap_racnode-dc1-1/patchwork/crs/install /u01/app/12.1.0.2/grid/OPatch/auto/dbtmp/bootstrap_racnode-dc1-1/patchwork/crs/install/rootcrs.pl -prepatch
2017-11-12 18:22:05,710 INFO  [206] com.oracle.glcm.patch.auto.db.product.executor.PatchingStepExecutor - status: 0
2017-11-12 18:22:05,711 INFO  [206] com.oracle.glcm.patch.auto.db.product.executor.PatchingStepExecutor - Successfully executed the above command.

2017-11-12 18:22:05,711 INFO  [206] com.oracle.glcm.patch.auto.db.product.executor.PatchingStepExecutor - Output from the command:
2017-11-12 18:22:05,711 INFO  [206] com.oracle.glcm.patch.auto.db.product.executor.PatchingStepExecutor - Using configuration parameter file: /u01/app/12.1.0.2/grid/OPatch/auto/dbtmp/bootstrap_racnode-dc1-1/patchwork/crs/install/crsconfig_params
Oracle Clusterware active version on the cluster is [12.1.0.2.0]. The cluster upgrade state is [NORMAL]. The cluster active patch level is [0].
--
Executing command as oracle:
 /sf_OracleSoftware/12.1.0.2_PatchSet_Linux_x64/OCT2017PSU/26635880/26392192/custom/scripts/prepatch.sh -dbhome /u01/app/oracle/12.1.0.2/db1
2017-11-12 18:22:05,758 INFO  [224] com.oracle.glcm.patch.auto.db.product.executor.PatchingStepExecutor - COMMAND Looks like this: /sf_OracleSoftware/12.1.0.2_PatchSet_Linux_x64/OCT2017PSU/26635880/26392192/custom/scripts/prepatch.sh -dbhome /u01/app/oracle/12.1.0.2/db1
2017-11-12 18:22:05,793 INFO  [224] com.oracle.glcm.patch.auto.db.product.executor.PatchingStepExecutor - status: 0
2017-11-12 18:22:05,793 INFO  [224] com.oracle.glcm.patch.auto.db.product.executor.PatchingStepExecutor - Successfully executed the above command.

2017-11-12 18:22:05,793 INFO  [224] com.oracle.glcm.patch.auto.db.product.executor.PatchingStepExecutor - Output from the command:
2017-11-12 18:22:05,793 INFO  [224] com.oracle.glcm.patch.auto.db.product.executor.PatchingStepExecutor - /sf_OracleSoftware/12.1.0.2_PatchSet_Linux_x64/OCT2017PSU/26635880/26392192/custom/scripts/prepatch.sh completed successfully.

--
Executing command as oracle:
 /u01/app/oracle/12.1.0.2/db1/OPatch/opatchauto  apply /sf_OracleSoftware/12.1.0.2_PatchSet_Linux_x64/OCT2017PSU/26635880 -oh /u01/app/oracle/12.1.0.2/db1 -target_type rac_database -binary -invPtrLoc /u01/app/12.1.0.2/grid/oraInst.loc -jre /u01/app/12.1.0.2/grid/OPatch/jre -persistresult /u01/app/oracle/12.1.0.2/db1/OPatch/auto/dbsessioninfo/sessionresult_racnode-dc1-1_rac.ser -analyzedresult /u01/app/oracle/12.1.0.2/db1/OPatch/auto/dbsessioninfo/sessionresult_analyze_racnode-dc1-1_rac.ser
2017-11-12 18:46:34,790 INFO  [238] com.oracle.glcm.patch.auto.db.integration.controller.action.OPatchAutoBinaryAction - Opatchcore binary return code=0
2017-11-12 18:46:34,801 INFO  [238] com.oracle.glcm.patch.auto.db.integration.controller.action.OPatchAutoBinaryAction - Opatchcore binary output=Oracle Home : /u01/app/oracle/12.1.0.2/db1

OPatchAuto binary patching Tool
Copyright (c)2014, Oracle Corporation. All rights reserved.

OPatchauto Version : 13.9.3.0.0
--
Executing command as oracle:
 /sf_OracleSoftware/12.1.0.2_PatchSet_Linux_x64/OCT2017PSU/26635880/26392192/custom/scripts/postpatch.sh -dbhome /u01/app/oracle/12.1.0.2/db1
2017-11-12 18:46:35,048 INFO  [281] com.oracle.glcm.patch.auto.db.product.executor.PatchingStepExecutor - COMMAND Looks like this: /sf_OracleSoftware/12.1.0.2_PatchSet_Linux_x64/OCT2017PSU/26635880/26392192/custom/scripts/postpatch.sh -dbhome /u01/app/oracle/12.1.0.2/db1
2017-11-12 18:46:35,337 INFO  [281] com.oracle.glcm.patch.auto.db.product.executor.PatchingStepExecutor - status: 0
2017-11-12 18:46:35,337 INFO  [281] com.oracle.glcm.patch.auto.db.product.executor.PatchingStepExecutor - Successfully executed the above command.

2017-11-12 18:46:35,337 INFO  [281] com.oracle.glcm.patch.auto.db.product.executor.PatchingStepExecutor - Output from the command:
2017-11-12 18:46:35,337 INFO  [281] com.oracle.glcm.patch.auto.db.product.executor.PatchingStepExecutor - Reading /u01/app/oracle/12.1.0.2/db1/install/params.ora..
Reading /u01/app/oracle/12.1.0.2/db1/install/params.ora..
--
Executing command as oracle:
 /u01/app/12.1.0.2/grid/OPatch/opatchauto  apply /sf_OracleSoftware/12.1.0.2_PatchSet_Linux_x64/OCT2017PSU/26635880 -oh /u01/app/12.1.0.2/grid -target_type cluster -binary -invPtrLoc /u01/app/12.1.0.2/grid/oraInst.loc -jre /u01/app/12.1.0.2/grid/OPatch/jre -persistresult /u01/app/12.1.0.2/grid/OPatch/auto/dbsessioninfo/sessionresult_racnode-dc1-1_crs.ser -analyzedresult /u01/app/12.1.0.2/grid/OPatch/auto/dbsessioninfo/sessionresult_analyze_racnode-dc1-1_crs.ser
2017-11-12 19:20:43,366 INFO  [361] com.oracle.glcm.patch.auto.db.integration.controller.action.OPatchAutoBinaryAction - Opatchcore binary return code=0
2017-11-12 19:20:43,369 INFO  [361] com.oracle.glcm.patch.auto.db.integration.controller.action.OPatchAutoBinaryAction - Opatchcore binary output=Oracle Home : /u01/app/12.1.0.2/grid

OPatchAuto binary patching Tool
Copyright (c)2014, Oracle Corporation. All rights reserved.

OPatchauto Version : 13.9.3.0.0
--
Executing command as root:
 /u01/app/12.1.0.2/grid/rdbms/install/rootadd_rdbms.sh
2017-11-12 19:20:43,522 INFO  [414] com.oracle.glcm.patch.auto.db.product.executor.PatchingStepExecutor - COMMAND Looks like this: /u01/app/12.1.0.2/grid/rdbms/install/rootadd_rdbms.sh
2017-11-12 19:20:43,574 INFO  [414] com.oracle.glcm.patch.auto.db.product.executor.PatchingStepExecutor - status: 0
2017-11-12 19:20:43,574 INFO  [414] com.oracle.glcm.patch.auto.db.product.executor.PatchingStepExecutor - Successfully executed the above command.

2017-11-12 19:20:43,574 INFO  [414] com.oracle.glcm.patch.auto.db.product.executor.PatchingStepExecutor - Output from the command:
2017-11-12 19:20:43,574 INFO  [414] com.oracle.glcm.patch.auto.db.product.executor.PatchingStepExecutor -
2017-11-12 19:20:43,574 INFO  [414] com.oracle.glcm.patch.auto.db.product.executor.PatchingStepExecutor - Command executed successfully.
--
Executing command as root:
 /u01/app/12.1.0.2/grid/perl/bin/perl -I/u01/app/12.1.0.2/grid/perl/lib -I/u01/app/12.1.0.2/grid/OPatch/auto/dbtmp/bootstrap_racnode-dc1-1/patchwork/crs/install /u01/app/12.1.0.2/grid/OPatch/auto/dbtmp/bootstrap_racnode-dc1-1/patchwork/crs/install/rootcrs.pl -postpatch
2017-11-12 19:20:43,574 INFO  [414] com.oracle.glcm.patch.auto.db.product.executor.PatchingStepExecutor - COMMAND Looks like this: /u01/app/12.1.0.2/grid/perl/bin/perl -I/u01/app/12.1.0.2/grid/perl/lib -I/u01/app/12.1.0.2/grid/OPatch/auto/dbtmp/bootstrap_racnode-dc1-1/patchwork/crs/install /u01/app/12.1.0.2/grid/OPatch/auto/dbtmp/bootstrap_racnode-dc1-1/patchwork/crs/install/rootcrs.pl -postpatch
2017-11-12 19:33:19,090 INFO  [414] com.oracle.glcm.patch.auto.db.product.executor.PatchingStepExecutor - status: 0
2017-11-12 19:33:19,097 INFO  [414] com.oracle.glcm.patch.auto.db.product.executor.PatchingStepExecutor - Successfully executed the above command.

2017-11-12 19:33:19,098 INFO  [414] com.oracle.glcm.patch.auto.db.product.executor.PatchingStepExecutor - Output from the command:
2017-11-12 19:33:19,098 INFO  [414] com.oracle.glcm.patch.auto.db.product.executor.PatchingStepExecutor - Using configuration parameter file: /u01/app/12.1.0.2/grid/OPatch/auto/dbtmp/bootstrap_racnode-dc1-1/patchwork/crs/install/crsconfig_params
2017/11/12 19:20:51 CLSRSC-4015: Performing install or upgrade action for Oracle Trace File Analyzer (TFA) Collector.
--

Executing command as oracle:
 /bin/sh -c 'ORACLE_HOME=/u01/app/oracle/12.1.0.2/db1 /u01/app/oracle/12.1.0.2/db1/bin/srvctl stop service -d orclcdb -s DBA_TEST -i orclcdb2'
2017-11-12 19:33:19,393 INFO  [454] com.oracle.glcm.patch.auto.db.product.executor.PatchingStepExecutor - COMMAND Looks like this: /bin/sh -c 'ORACLE_HOME=/u01/app/oracle/12.1.0.2/db1 /u01/app/oracle/12.1.0.2/db1/bin/srvctl stop service -d orclcdb -s DBA_TEST -i orclcdb2'
2017-11-12 19:33:20,976 INFO  [454] com.oracle.glcm.patch.auto.db.product.executor.PatchingStepExecutor - status: 0
2017-11-12 19:33:20,977 INFO  [454] com.oracle.glcm.patch.auto.db.product.executor.PatchingStepExecutor - Successfully executed the above command.

2017-11-12 19:33:20,980 INFO  [454] com.oracle.glcm.patch.auto.db.product.executor.PatchingStepExecutor - Output from the command:
2017-11-12 19:33:20,980 INFO  [454] com.oracle.glcm.patch.auto.db.product.executor.PatchingStepExecutor -
2017-11-12 19:33:20,980 INFO  [454] com.oracle.glcm.patch.auto.db.product.executor.PatchingStepExecutor - Command executed successfully.
--
Executing command as oracle:
 /bin/sh -c 'ORACLE_HOME=/u01/app/oracle/12.1.0.2/db1 /u01/app/oracle/12.1.0.2/db1/bin/srvctl stop service -d orclcdb -s testsvc11 -i orclcdb2'
2017-11-12 19:33:20,980 INFO  [454] com.oracle.glcm.patch.auto.db.product.executor.PatchingStepExecutor - COMMAND Looks like this: /bin/sh -c 'ORACLE_HOME=/u01/app/oracle/12.1.0.2/db1 /u01/app/oracle/12.1.0.2/db1/bin/srvctl stop service -d orclcdb -s testsvc11 -i orclcdb2'
2017-11-12 19:33:22,262 INFO  [454] com.oracle.glcm.patch.auto.db.product.executor.PatchingStepExecutor - status: 0
2017-11-12 19:33:22,262 INFO  [454] com.oracle.glcm.patch.auto.db.product.executor.PatchingStepExecutor - Successfully executed the above command.

2017-11-12 19:33:22,262 INFO  [454] com.oracle.glcm.patch.auto.db.product.executor.PatchingStepExecutor - Output from the command:
2017-11-12 19:33:22,263 INFO  [454] com.oracle.glcm.patch.auto.db.product.executor.PatchingStepExecutor -
2017-11-12 19:33:22,263 INFO  [454] com.oracle.glcm.patch.auto.db.product.executor.PatchingStepExecutor - Command executed successfully.
--
Executing command as oracle:
 /bin/sh -c 'ORACLE_HOME=/u01/app/oracle/12.1.0.2/db1 /u01/app/oracle/12.1.0.2/db1/bin/srvctl stop service -d orclcdb -s testsvc12 -i orclcdb2'
2017-11-12 19:33:22,263 INFO  [454] com.oracle.glcm.patch.auto.db.product.executor.PatchingStepExecutor - COMMAND Looks like this: /bin/sh -c 'ORACLE_HOME=/u01/app/oracle/12.1.0.2/db1 /u01/app/oracle/12.1.0.2/db1/bin/srvctl stop service -d orclcdb -s testsvc12 -i orclcdb2'
2017-11-12 19:33:23,539 INFO  [454] com.oracle.glcm.patch.auto.db.product.executor.PatchingStepExecutor - status: 0
2017-11-12 19:33:23,539 INFO  [454] com.oracle.glcm.patch.auto.db.product.executor.PatchingStepExecutor - Successfully executed the above command.

2017-11-12 19:33:23,539 INFO  [454] com.oracle.glcm.patch.auto.db.product.executor.PatchingStepExecutor - Output from the command:
2017-11-12 19:33:23,539 INFO  [454] com.oracle.glcm.patch.auto.db.product.executor.PatchingStepExecutor -
2017-11-12 19:33:23,540 INFO  [454] com.oracle.glcm.patch.auto.db.product.executor.PatchingStepExecutor - Command executed successfully.
--
Executing command as oracle:
 /bin/sh -c 'ORACLE_HOME=/u01/app/oracle/12.1.0.2/db1 /u01/app/oracle/12.1.0.2/db1/bin/srvctl stop service -d orclcdb -s testsvc13 -i orclcdb2'
2017-11-12 19:33:23,540 INFO  [454] com.oracle.glcm.patch.auto.db.product.executor.PatchingStepExecutor - COMMAND Looks like this: /bin/sh -c 'ORACLE_HOME=/u01/app/oracle/12.1.0.2/db1 /u01/app/oracle/12.1.0.2/db1/bin/srvctl stop service -d orclcdb -s testsvc13 -i orclcdb2'
2017-11-12 19:33:24,764 INFO  [454] com.oracle.glcm.patch.auto.db.product.executor.PatchingStepExecutor - status: 0
2017-11-12 19:33:24,764 INFO  [454] com.oracle.glcm.patch.auto.db.product.executor.PatchingStepExecutor - Successfully executed the above command.

2017-11-12 19:33:24,764 INFO  [454] com.oracle.glcm.patch.auto.db.product.executor.PatchingStepExecutor - Output from the command:
2017-11-12 19:33:24,764 INFO  [454] com.oracle.glcm.patch.auto.db.product.executor.PatchingStepExecutor -
2017-11-12 19:33:24,764 INFO  [454] com.oracle.glcm.patch.auto.db.product.executor.PatchingStepExecutor - Command executed successfully.
--
Executing command as oracle:
 /bin/sh -c 'ORACLE_HOME=/u01/app/oracle/12.1.0.2/db1 /u01/app/oracle/12.1.0.2/db1/bin/srvctl stop service -d orclcdb -s testsvc14 -i orclcdb2'
2017-11-12 19:33:24,764 INFO  [454] com.oracle.glcm.patch.auto.db.product.executor.PatchingStepExecutor - COMMAND Looks like this: /bin/sh -c 'ORACLE_HOME=/u01/app/oracle/12.1.0.2/db1 /u01/app/oracle/12.1.0.2/db1/bin/srvctl stop service -d orclcdb -s testsvc14 -i orclcdb2'
2017-11-12 19:33:26,003 INFO  [454] com.oracle.glcm.patch.auto.db.product.executor.PatchingStepExecutor - status: 0
2017-11-12 19:33:26,003 INFO  [454] com.oracle.glcm.patch.auto.db.product.executor.PatchingStepExecutor - Successfully executed the above command.

2017-11-12 19:33:26,003 INFO  [454] com.oracle.glcm.patch.auto.db.product.executor.PatchingStepExecutor - Output from the command:
2017-11-12 19:33:26,003 INFO  [454] com.oracle.glcm.patch.auto.db.product.executor.PatchingStepExecutor -
2017-11-12 19:33:26,003 INFO  [454] com.oracle.glcm.patch.auto.db.product.executor.PatchingStepExecutor - Command executed successfully.
--
Executing command as oracle:
 /bin/sh -c 'ORACLE_HOME=/u01/app/oracle/12.1.0.2/db1 /u01/app/oracle/12.1.0.2/db1/bin/srvctl stop service -d orclcdb -s testsvc15 -i orclcdb2'
2017-11-12 19:33:26,004 INFO  [454] com.oracle.glcm.patch.auto.db.product.executor.PatchingStepExecutor - COMMAND Looks like this: /bin/sh -c 'ORACLE_HOME=/u01/app/oracle/12.1.0.2/db1 /u01/app/oracle/12.1.0.2/db1/bin/srvctl stop service -d orclcdb -s testsvc15 -i orclcdb2'
2017-11-12 19:33:27,227 INFO  [454] com.oracle.glcm.patch.auto.db.product.executor.PatchingStepExecutor - status: 0
2017-11-12 19:33:27,228 INFO  [454] com.oracle.glcm.patch.auto.db.product.executor.PatchingStepExecutor - Successfully executed the above command.

2017-11-12 19:33:27,228 INFO  [454] com.oracle.glcm.patch.auto.db.product.executor.PatchingStepExecutor - Output from the command:
2017-11-12 19:33:27,228 INFO  [454] com.oracle.glcm.patch.auto.db.product.executor.PatchingStepExecutor -
2017-11-12 19:33:27,228 INFO  [454] com.oracle.glcm.patch.auto.db.product.executor.PatchingStepExecutor - Command executed successfully.

--
Executing command as oracle:
 /bin/sh -c 'cd /u01/app/oracle/12.1.0.2/db1;ORACLE_HOME=/u01/app/oracle/12.1.0.2/db1 ORACLE_SID=orclcdb1 /u01/app/oracle/12.1.0.2/db1/OPatch/datapatch -verbose'
2017-11-12 19:33:28,659 INFO  [524] com.oracle.glcm.patch.auto.db.product.executor.PatchingStepExecutor - COMMAND Looks like this: /bin/sh -c 'cd /u01/app/oracle/12.1.0.2/db1;ORACLE_HOME=/u01/app/oracle/12.1.0.2/db1 ORACLE_SID=orclcdb1 /u01/app/oracle/12.1.0.2/db1/OPatch/datapatch -verbose'
2017-11-12 19:34:26,362 INFO  [524] com.oracle.glcm.patch.auto.db.product.executor.PatchingStepExecutor - status: 0
2017-11-12 19:34:26,362 INFO  [524] com.oracle.glcm.patch.auto.db.product.executor.PatchingStepExecutor - Successfully executed the above command.

2017-11-12 19:34:26,362 INFO  [524] com.oracle.glcm.patch.auto.db.product.executor.PatchingStepExecutor - Output from the command:
2017-11-12 19:34:26,362 INFO  [524] com.oracle.glcm.patch.auto.db.product.executor.PatchingStepExecutor - SQL Patching tool version 12.1.0.2.0 Production on Sun Nov 12 19:33:29 2017
Copyright (c) 2012, 2017, Oracle.  All rights reserved.
[root@racnode-dc1-1 opatchauto]#

November 11, 2017

That’s How We’ve Always Done It Before

Filed under: Uncategorized — mdinh @ 11:13 am

Thanksgiving is coming up and to this day, I still remembered anecdote from former manager.

Daughter is helping mother prepare for Thanksgiving dinner which they do together for many years.

This year, daughter decided to ask, “Why do we cut off the turkey legs and wings before putting it the oven?”

Mom responded, “That’s how we’ve always done it before. Let’s call grandma and find out.”

On the phone with grandma and grandma’s response was, “I can’t believe you’re still doing that! I cut off the legs and wings because my oven was too small.”

Happy Thanksgiving.

 

 

November 5, 2017

GoldenGate Naming Convention P03

Filed under: GoldenGate — mdinh @ 4:44 pm

GoldenGate Naming Convention P01
GoldenGate Naming Convention P02

Here I provide an example for how I would implement 3-way replication.
I used capitalization for some clarity in trail – not tested yet.

N-way Replication calculations:
Primary Extract for each silo: 1
Pump Extract for each silo: N-1 
Replicats for each silo: N-1 
Total proceses for each silo: 2N-1
Sequence start value: (1001-100N), increment by 100

++++++++++

3-way Replication:
Primary Extract for each silo: 1
Pump Extract for each silo: 3-1=2
Replicats for each silo: 3-1=2
Total proceses for each silo: 2*3-1=5
Sequence start value: (1001,1002,1003) increment by 100

++++++++++

(Silo 1 - NYPRD) E_NY(aa) | pump (aB):(aC) | replicate (bA):(cA) | 1001+100 (sequence)
(Silo 2 - DCPRD) E_DC(bb) | pump (bA):(bC) | replicate (aB):(cB) | 1002+100 (sequence)
(Silo 3 - STDBY) E_SB(cc) | pump (cA):(cB) | replicAte (aC)|(bC) | 1003+100 (sequence)

++++++++++

E_NY1 (aa)

-- Pump include all other silos except current silo
P_NY2 (aB)
P_NY3 (aC)  

-- ReplicAt include all other silos except current silo
R_DC2 (bA)
R_SB3 (cA)

++++++++++

E_DC2 (bb)

P_DC1 (bA)
P_DC3 (bC)

R_NY1 (aB)
R_SB3 (cB)

++++++++++

E_SB3 (cc)

P_SB1 (cA)
P_SB2 (cB)

R_DC2 (bC)
R_NY1 (aC)

++++++++++

Stop replication from NYPRD:
(Silo 1) stop *NY* (stops E_NY1/P_NY2/P_NY3)

-- This may be optional depending on requirements.
-- If nothing is extracted, then nothing is replicated.
(Silo 2) stop *NY* (stops R_NY1) 
(Silo 3) stop *NY* (stops R_NY1)

Relocate Services Back To Instance Before Patching

Filed under: 12c,RAC — mdinh @ 1:16 pm

This will only work for 2-nodes RAC!

Prerequisite:
Patching starts at instance1, services failover to instance2.
Patching completed at instance1, restart instance1.
Patching starts at instance2, services failover to instance1.
Patching completed at instance2, restart instance2.
All services are now running at instance1.
Relocate services from instance2 back to where it belongs.

Save existing service configuration before patching.
[oracle@racnode-dc1-2 rac_relocate]$ ./save_service.sh

 

+ srvctl status database -d orclcdb -v
+ srvctl status database -d orclcdb -v
+ awk '-F ' '{print $2}'
+ cat /tmp/services.conf
Instance orclcdb1 is running on node racnode-dc1-1 with online services DBA_TEST,testsvc11,testsvc12,testsvc13,testsvc14,testsvc15. Instance status: Open.
Instance orclcdb2 is running on node racnode-dc1-2 with online services testsvc26,testsvc27,testsvc28,testsvc29. Instance status: Open.
+ cat /tmp/instance.conf
orclcdb1
orclcdb2
++ tail -1 /tmp/services.conf
++ awk '-F ' '{print $11}'
++ awk '{$0=substr($0,1,length($0)-1); print $0}'
+ svc=testsvc26,testsvc27,testsvc28,testsvc29
+ exit
[oracle@racnode-dc1-2 rac_relocate]$

 

Patching completed at instance1 and starting at instance2.
All services are running on instance1 after failover of instance2.

 

[oracle@racnode-dc1-2 rac_relocate]$ srvctl stop instance -db orclcdb -instance orclcdb2 -failover
[oracle@racnode-dc1-2 rac_relocate]$ srvctl status database -d orclcdb -v
Instance orclcdb1 is running on node racnode-dc1-1 with online services DBA_TEST,testsvc11,testsvc12,testsvc13,testsvc14,testsvc15,testsvc26,testsvc27,testsvc28,testsvc29. Instance status: Open.
Instance orclcdb2 is not running on node racnode-dc1-2
[oracle@racnode-dc1-2 rac_relocate]$

 

Patching completed at instance2, start instance2, all services running from instance1.

[oracle@racnode-dc1-2 rac_relocate]$ srvctl start instance -db orclcdb -instance orclcdb2
[oracle@racnode-dc1-2 rac_relocate]$ srvctl status database -d orclcdb -v
Instance orclcdb1 is running on node racnode-dc1-1 with online services DBA_TEST,testsvc11,testsvc12,testsvc13,testsvc14,testsvc15,testsvc26,testsvc27,testsvc28,testsvc29. Instance status: Open.
Instance orclcdb2 is running on node racnode-dc1-2. Instance status: Open.
[oracle@racnode-dc1-2 rac_relocate]$

Verify relocate services will work as intended by testing first – print but not execute commands.

[oracle@racnode-dc1-2 rac_relocate]$ ./test_relocate.sh
================================================================================
++++++ Saved Configuration
-rw-r--r-- 1 oracle oinstall  18 Nov  5 13:01 /tmp/instance.conf
-rw-r--r-- 1 oracle oinstall 291 Nov  5 13:01 /tmp/services.conf
Instance orclcdb1 is running on node racnode-dc1-1 with online services DBA_TEST,testsvc11,testsvc12,testsvc13,testsvc14,testsvc15. Instance status: Open.
Instance orclcdb2 is running on node racnode-dc1-2 with online services testsvc26,testsvc27,testsvc28,testsvc29. Instance status: Open.
orclcdb1
orclcdb2
================================================================================
++++++ Relocate Configuration
newinst=orclcdb2
oldinst=orclcdb1
svc=testsvc26,testsvc27,testsvc28,testsvc29
================================================================================
Instance orclcdb1 is running on node racnode-dc1-1 with online services DBA_TEST,testsvc11,testsvc12,testsvc13,testsvc14,testsvc15,testsvc26,testsvc27,testsvc28,testsvc29. Instance status: Open.
Instance orclcdb2 is running on node racnode-dc1-2. Instance status: Open.
srvctl relocate service -db orclcdb -service testsvc26 -oldinst orclcdb1 -newinst orclcdb2
srvctl relocate service -db orclcdb -service testsvc27 -oldinst orclcdb1 -newinst orclcdb2
srvctl relocate service -db orclcdb -service testsvc28 -oldinst orclcdb1 -newinst orclcdb2
srvctl relocate service -db orclcdb -service testsvc29 -oldinst orclcdb1 -newinst orclcdb2
[oracle@racnode-dc1-2 rac_relocate]$

Relocate services to orginal saved configuration.

[oracle@racnode-dc1-2 rac_relocate]$ ./relocate_service.sh
================================================================================
++++++ Saved Configuration
-rw-r--r-- 1 oracle oinstall  18 Nov  5 13:01 /tmp/instance.conf
-rw-r--r-- 1 oracle oinstall 291 Nov  5 13:01 /tmp/services.conf
Instance orclcdb1 is running on node racnode-dc1-1 with online services DBA_TEST,testsvc11,testsvc12,testsvc13,testsvc14,testsvc15. Instance status: Open.
Instance orclcdb2 is running on node racnode-dc1-2 with online services testsvc26,testsvc27,testsvc28,testsvc29. Instance status: Open.
orclcdb1
orclcdb2
================================================================================
++++++ Relocate Configuration
newinst=orclcdb2
oldinst=orclcdb1
svc=testsvc26,testsvc27,testsvc28,testsvc29
================================================================================
+ srvctl status database -d orclcdb -v
Instance orclcdb1 is running on node racnode-dc1-1 with online services DBA_TEST,testsvc11,testsvc12,testsvc13,testsvc14,testsvc15,testsvc26,testsvc27,testsvc28,testsvc29. Instance status: Open.
Instance orclcdb2 is running on node racnode-dc1-2. Instance status: Open.
+ IFS=,
+ for s in '${svc}'
+ srvctl relocate service -db orclcdb -service testsvc26 -oldinst orclcdb1 -newinst orclcdb2
+ for s in '${svc}'
+ srvctl relocate service -db orclcdb -service testsvc27 -oldinst orclcdb1 -newinst orclcdb2
+ for s in '${svc}'
+ srvctl relocate service -db orclcdb -service testsvc28 -oldinst orclcdb1 -newinst orclcdb2
+ for s in '${svc}'
+ srvctl relocate service -db orclcdb -service testsvc29 -oldinst orclcdb1 -newinst orclcdb2
+ srvctl status database -d orclcdb -v
Instance orclcdb1 is running on node racnode-dc1-1 with online services DBA_TEST,testsvc11,testsvc12,testsvc13,testsvc14,testsvc15. Instance status: Open.
Instance orclcdb2 is running on node racnode-dc1-2 with online services testsvc26,testsvc27,testsvc28,testsvc29. Instance status: Open.
+ exit
[oracle@racnode-dc1-2 rac_relocate]$

I have rant about hardcoding before.
YES! I hardcoded conf file location to provide a permanent and consistent location for all environments.

I don’t like to have to dig through code for find such information.
ex:
SCRIPT_DIR=/u01/app/oracle/scripts
LOG_DIR=$SCRIPT_DIR/log

save_service.sh


#!/bin/sh -x
srvctl status database -d ${db} -v > /tmp/services.conf
srvctl status database -d ${db} -v|awk -F" " '{print $2}' > /tmp/instance.conf
cat /tmp/services.conf
cat /tmp/instance.conf
svc=`tail -1 /tmp/services.conf | awk -F" " '{print $11}'|awk '{$0=substr($0,1,length($0)-1); print $0}'`
exit

 

test_relocate.sh


#!/bin/sh
echo "================================================================================"
echo "++++++ Saved Configuration"
ls -l /tmp/*.conf
cat /tmp/services.conf
cat /tmp/instance.conf
echo "================================================================================"
echo "++++++ Relocate Configuration"
export svc=`tail -1 /tmp/services.conf | awk -F" " '{print $11}'|awk '{$0=substr($0,1,length($0)-1); print $0}'`
export oldinst=`head -1 /tmp/instance.conf`
export newinst=`tail -1 /tmp/instance.conf`
env|egrep 'svc|inst'|sort
echo "================================================================================"
srvctl status database -d ${db} -v
IFS=","
for s in ${svc}
do
echo "srvctl relocate service -db ${db} -service ${s} -oldinst ${oldinst} -newinst ${newinst}"
done
exit

 

relocate_service.sh


#!/bin/sh
echo "================================================================================"
echo "++++++ Saved Configuration"
ls -l /tmp/*.conf
cat /tmp/services.conf
cat /tmp/instance.conf
echo "================================================================================"
echo "++++++ Relocate Configuration"
export svc=`tail -1 /tmp/services.conf | awk -F" " '{print $11}'|awk '{$0=substr($0,1,length($0)-1); print $0}'`
export oldinst=`head -1 /tmp/instance.conf`
export newinst=`tail -1 /tmp/instance.conf`
env|egrep 'svc|inst'|sort
echo "================================================================================"
set -x
srvctl status database -d ${db} -v
IFS=","
for s in ${svc}
do
srvctl relocate service -db ${db} -service ${s} -oldinst ${oldinst} -newinst ${newinst}
done
srvctl status database -d ${db} -v
exit

 

Next Page »

Create a free website or blog at WordPress.com.