Friday, November 3, 2017

Applying Oracle PSU patch on AIX server with oracle 12.1 version

Applying Oracle PSU patch on AIX server with oracle 12.1 version
applying oct-2017 patch on oracle 12.1 database.This is similar to  till 11g and 12c they changed the process for loading the sql into database and we will be using another utility called datapatch. 


1.      Pre-request
2.      Create block out on OEM
3.      Based the DB size take the DB backup ,backup normally scheduled under cron –rman backup
4.      Copy the patch binary to target server and make sure you have recent Opatch version.
5.      Create backup pfile from the DB
6.      Spool the invalid object & comp_name  & status details from the DB
7.      Note down the listener name
8.      Ready the read me.html
9.      Run the pre-request script,it should be succeed.
10.   Shutdown the Db services from the home (both  DB & Listener)
11.   If the pre-request succeed then proceed the opatch apply
12.   Once patch applies, start the DB &  load the SQL using ./datapacth(new process in 12c)
13.   Make sure no error from the log
14.    Connect to target & catalog  and upgrade the catalog
15.   Test the backup after catalog upgrade.
16.   Start the DB services (DB +listener) and handover to application team

17./app/oradata/db7.arch/patch_oct17/26636270/26713565

18.select substr(comp_name,1,40) comp_name, status, substr(version,1,10) version from  dba_registry order by comp_name;

19.select substr(object_name,1,40) object_name,substr(owner,1,15) owner,object_type from
           dba_objects where status='INVALID' order by owner,object_type;

- Recompile objects:

SQL> @$ORACLE_HOME/rdbms/admin/utlrp.sql

DONE: 9/11/2017

after utlrp

20.select owner,object_type,count(*) from dba_objects where status='INVALID' group by
    owner,object_type; 


21.SQL> select owner,object_type,count(*) from dba_objects where status='INVALID' group by
    owner,object_type;

listener_db7

lsnrctl stop listener_db7

LSNRCTL for IBM/AIX RISC System/6000: Version 12.1.0.2.0 - Production on 26-OCT-2017 21:52:01

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

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=local_host)(PORT=1522)))
The command completed successfully




export PATH=$PATH:/usr/ccs/bin


   $opatch prereq CheckConflictAgainstOHWithDetail -ph ./
Oracle Interim Patch Installer version 12.2.0.1.8
Copyright (c) 2017, Oracle Corporation.  All rights reserved.

PREREQ session

Oracle Home       : /app/oracle/product/12.1.0
Central Inventory : /app/oracle/oraInventory
   from           : /app/oracle/product/12.1.0/oraInst.loc
OPatch version    : 12.2.0.1.8
OUI version       : 12.1.0.2.0
Log file location : /app/oracle/product/12.1.0/cfgtoollogs/opatch/opatch2017-10-26_21-57-09PM_1.log

Invoking prereq "checkconflictagainstohwithdetail"

Prereq "checkConflictAgainstOHWithDetail" passed.

OPatch succeeded.
AIX cvidfdb7:db7:oracle

rman target / catalog KOMMSQMGR/Cvrmn10d@RMAND.CSCDEV.COM

rman target / catalog outgdmgr/Cvrmn10d@RMAND.CSCDEV.COM


$./datapatch -verbose
SQL Patching tool version 12.1.0.2.0 Production on Thu Oct 26 22:25:13 2017
Copyright (c) 2012, 2016, Oracle.  All rights reserved.

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

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

Current state of SQL patches:
Patch 24917972 (Database PSU 12.1.0.2.170117, Oracle JavaVM Component (JAN2017)):
  ROLLBACK with errors in the SQL registry only
Patch 25437695 (Database PSU 12.1.0.2.170418, Oracle JavaVM Component (APR2017)):
  Not installed in the binary or the SQL registry
Patch 26027162 (Database PSU 12.1.0.2.170718, Oracle JavaVM Component (JUL2017)):
  Installed in the binary registry and the SQL registry
Bundle series PSU:
  ID 171017 in the binary registry and ID 170718 in the SQL registry

Adding patches to installation queue and performing prereq checks...
Installation queue:
  The following patches will be rolled back:
    24917972 (Database PSU 12.1.0.2.170117, Oracle JavaVM Component (JAN2017))
  The following patches will be applied:
    26713565 (DATABASE PATCH SET UPDATE 12.1.0.2.171017)

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

Validating logfiles...
Patch 24917972 rollback: SUCCESS
  logfile: /app/oracle/cfgtoollogs/sqlpatch/24917972/20816605/24917972_rollback_DB7_2017Oct26_22_25_52.log (no errors)
Patch 26713565 apply: SUCCESS
  logfile: /app/oracle/cfgtoollogs/sqlpatch/26713565/21606134/26713565_apply_DB7_2017Oct26_22_25_55.log (no errors)
SQL Patching tool complete on Thu Oct 26 22:26:04 2017
AIX cvidfdb7:db7:oracle

run
{
allocate channel c1 DEVICE TYPE 'SBT_TAPE' TRACE 5 PARMS  'BLKSIZE=1048576,SBT_LIBRARY=/appgend/oracle/product/11.2.0.4/lib/libddobk.so,ENV=(STORAGE_UNIT=cvgend, BACKUP_HOST=cscddr1,ORACLE_HOME=/appgend/oracle/product/11.2.0.4)';
 backup current controlfile;
}




run
{
allocate channel c1 DEVICE TYPE 'SBT_TAPE' TRACE 5 PARMS  'BLKSIZE=1048576, SBT_LIBRARY=/app/oracle/product/12.1.0/lib/libddobk.so, ENV=(STORAGE_UNIT=RMANDev, BACKUP_HOST=xx.com, ORACLE_HOME=/app/oracle/product/12.1.0)';
 backup current controlfile;
}


lsnrctl start listener_db7


[
[oracle@db7]:/appgrid/oracle>ps -ef|grep pmon

oracle 3146230        1   0 20:21:47      -  0:00 ora_pmon_db7
 oracle  7340340 17432840   0 21:42:34  pts/3  0:00 grep pmon
[oracle@db7]:/appgrid/oracle>su - oracle
oracle's Password:
AIX db7:db7:oracle
/app/oracle
   $id
uid=5560(oracle) gid=550(dba) groups=2222(sshlogin),500(edmdba),551(oinstall)
AIX db7:db7:oracle
/app/oracle
   $sqlplus / as sysdba

SQL*Plus: Release 12.1.0.2.0 Production on Thu Oct 26 21:44:59 2017

Copyright (c) 1982, 2014, Oracle.  All rights reserved.


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

SQL> select name,open_mode from v$database;

NAME      OPEN_MODE
--------- --------------------
db7   READ WRITE

SQL> exit
Disconnected from Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options
AIX db7:db7:oracle
/app/oracle
   $cd $ORACLE_HOME/rdbms/admin
AIX db7:db7:oracle
/app/oracle/product/12.1.0/rdbms/admin
   $sqlplus / as sysdba

SQL*Plus: Release 12.1.0.2.0 Production on Thu Oct 26 21:45:58 2017

Copyright (c) 1982, 2014, Oracle.  All rights reserved.


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

SQL> select name,open_mode from v$database;

NAME      OPEN_MODE
--------- --------------------
db7   READ WRITE

SQL> @$ORACLE_HOME/rdbms/admin/utlrp.sql;

TIMESTAMP
--------------------------------------------------------------------------------
COMP_TIMESTAMP UTLRP_BGN  2017-10-26 21:46:23

DOC>   The following PL/SQL block invokes UTL_RECOMP to recompile invalid
DOC>   objects in the database. Recompilation time is proportional to the
DOC>   number of invalid objects in the database, so this command may take
DOC>   a long time to execute on a database with a large number of invalid
DOC>   objects.
DOC>
DOC>   Use the following queries to track recompilation progress:
DOC>
DOC>   1. Query returning the number of invalid objects remaining. This
DOC>      number should decrease with time.
DOC>         SELECT COUNT(*) FROM obj$ WHERE status IN (4, 5, 6);
DOC>
DOC>   2. Query returning the number of objects compiled so far. This number
DOC>      should increase with time.
DOC>         SELECT COUNT(*) FROM UTL_RECOMP_COMPILED;
DOC>
DOC>   This script automatically chooses serial or parallel recompilation
DOC>   based on the number of CPUs available (parameter cpu_count) multiplied
DOC>   by the number of threads per CPU (parameter parallel_threads_per_cpu).
DOC>   On RAC, this number is added across all RAC nodes.
DOC>
DOC>   UTL_RECOMP uses DBMS_SCHEDULER to create jobs for parallel
DOC>   recompilation. Jobs are created without instance affinity so that they
DOC>   can migrate across RAC nodes. Use the following queries to verify
DOC>   whether UTL_RECOMP jobs are being created and run correctly:
DOC>
DOC>   1. Query showing jobs created by UTL_RECOMP
DOC>         SELECT job_name FROM dba_scheduler_jobs
DOC>            WHERE job_name like 'UTL_RECOMP_SLAVE_%';
DOC>
DOC>   2. Query showing UTL_RECOMP jobs that are running
DOC>         SELECT job_name FROM dba_scheduler_running_jobs
DOC>            WHERE job_name like 'UTL_RECOMP_SLAVE_%';
DOC>#
DECLARE
*
ERROR at line 1:
ORA-00955: name is already used by an existing object
ORA-06512: at "SYS.UTL_RECOMP", line 875
ORA-06512: at line 4



TIMESTAMP
--------------------------------------------------------------------------------
COMP_TIMESTAMP UTLRP_END  2017-10-26 21:46:41

DOC> The following query reports the number of objects that have compiled
DOC> with errors.
DOC>
DOC> If the number is higher than expected, please examine the error
DOC> messages reported with each object (using SHOW ERRORS) to see if they
DOC> point to system misconfiguration or resource constraints that must be
DOC> fixed before attempting to recompile these objects.
DOC>#

OBJECTS WITH ERRORS
-------------------
                  0

DOC> The following query reports the number of errors caught during
DOC> recompilation. If this number is non-zero, please query the error
DOC> messages in the table UTL_RECOMP_ERRORS to see if any of these errors
DOC> are due to misconfiguration or resource constraints that must be
DOC> fixed before objects can compile successfully.
DOC>#

ERRORS DURING RECOMPILATION
---------------------------
                          0


Function created.


PL/SQL procedure successfully completed.


Function dropped.

...Database user "SYS", database schema "APEX_040200", user# "98" 21:47:24
...Compiled 0 out of 3014 objects considered, 0 failed compilation 21:47:26
...271 packages
...263 package bodies
...452 tables
...11 functions
...16 procedures
...3 sequences
...457 triggers
...1320 indexes
...211 views
...0 libraries
...6 types
...0 type bodies
...0 operators
...0 index types
...Begin key object existence check 21:47:26
...Completed key object existence check 21:47:27
...Setting DBMS Registry 21:47:27
...Setting DBMS Registry Complete 21:47:27
...Exiting validate 21:47:27

PL/SQL procedure successfully completed.

SQL> select owner,object_type,count(*) from dba_objects where status='INVALID' group by
    owner,object_type;
  2
OWNER
--------------------------------------------------------------------------------
OBJECT_TYPE               COUNT(*)
----------------------- ----------
DW
PROCEDURE                        7

SVUSER
SYNONYM                          1

DDR
PROCEDURE                        2


OWNER
--------------------------------------------------------------------------------
OBJECT_TYPE               COUNT(*)
----------------------- ----------
DW
PACKAGE BODY                     6

DW
VIEW                            15

DDR
VIEW                            38


6 rows selected.

SQL> !ps -ef|grep tns

oracle 17301958        1   0   Jul 20      - 13:31 /app/oracle/product/12.1.0/bin/tnslsnr listener_db7 -inherit

SQL> select name from v$database;

NAME
---------
db7

SQL> shut immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> exit
Disconnected from Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options
AIX db7:db7:oracle
/app/oracle/product/12.1.0/rdbms/admin
   $lsntctl stop listener_db7
ksh: lsntctl:  not found.
AIX db7:db7:oracle
/app/oracle/product/12.1.0/rdbms/admin



   $lsnrctl stop listener_db7

LSNRCTL for IBM/AIX RISC System/6000: Version 12.1.0.2.0 - Production on 26-OCT-2017 21:52:01

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

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=db7oracle)(PORT=1522)))
The command completed successfully
AIX db7:db7:oracle
/app/oracle/product/12.1.0/rdbms/admin
   $cd /app/oradata/db7.arch/patch_oct17
AIX db7:db7:oracle
/app/oradata/db7.arch/patch_oct17
   $ls
26636270                       PatchSearch.xml                p26636270_121020_AIX64-5L.zip
AIX db7:db7:oracle
/app/oradata/db7.arch/patch_oct17
   $cd 26636270
AIX db7:db7:oracle
/app/oradata/db7.arch/patch_oct17/26636270
   $ls
26635845     26713565     README.html  README.txt
AIX db7:db7:oracle
/app/oradata/db7.arch/patch_oct17/26636270
   $cd 26713565
AIX db7:db7:oracle
/app/oradata/db7.arch/patch_oct17/26636270/26713565
   $export PATH=$PATH:/usr/ccs/bin
AIX db7:db7:oracle
/app/oradata/db7.arch/patch_oct17/26636270/26713565
   $opatch prereq CheckConflictAgainstOHWithDetail -ph ./
Oracle Interim Patch Installer version 12.2.0.1.8
Copyright (c) 2017, Oracle Corporation.  All rights reserved.

PREREQ session

Oracle Home       : /app/oracle/product/12.1.0
Central Inventory : /app/oracle/oraInventory
   from           : /app/oracle/product/12.1.0/oraInst.loc
OPatch version    : 12.2.0.1.8
OUI version       : 12.1.0.2.0
Log file location : /app/oracle/product/12.1.0/cfgtoollogs/opatch/opatch2017-10-26_21-57-09PM_1.log

Invoking prereq "checkconflictagainstohwithdetail"

Prereq "checkConflictAgainstOHWithDetail" passed.

OPatch succeeded.
AIX db7:db7:oracle
/app/oradata/db7.arch/patch_oct17/26636270/26713565
   $opatch apply
Oracle Interim Patch Installer version 12.2.0.1.8
Copyright (c) 2017, Oracle Corporation.  All rights reserved.


Oracle Home       : /app/oracle/product/12.1.0
Central Inventory : /app/oracle/oraInventory
   from           : /app/oracle/product/12.1.0/oraInst.loc
OPatch version    : 12.2.0.1.8
OUI version       : 12.1.0.2.0
Log file location : /app/oracle/product/12.1.0/cfgtoollogs/opatch/opatch2017-10-26_21-58-08PM_1.log

Verifying environment and performing prerequisite checks...
OPatch continues with these patches:   26609783  26713565

Do you want to proceed? [y|n]
y
User Responded with: Y
All checks passed.

Please shutdown Oracle instances running out of this ORACLE_HOME on the local system.
(Oracle Home = '/app/oracle/product/12.1.0')


Is the local system ready for patching? [y|n]
y
User Responded with: Y
Backing up files...
Applying sub-patch '26609783' to OH '/app/oracle/product/12.1.0'

Patching component oracle.rdbms, 12.1.0.2.0...

Patching component oracle.rdbms.rsf, 12.1.0.2.0...

Patching component oracle.oracore.rsf, 12.1.0.2.0...
Applying sub-patch '26713565' to OH '/app/oracle/product/12.1.0'
ApplySession: Optional component(s) [ oracle.oid.client, 12.1.0.2.0 ] , [ oracle.has.crs, 12.1.0.2.0 ]  not present in the Oracle Home or a higher version is found.

Patching component oracle.ldap.client, 12.1.0.2.0...

Patching component oracle.rdbms.crs, 12.1.0.2.0...

Patching component oracle.rdbms.deconfig, 12.1.0.2.0...

Patching component oracle.xdk, 12.1.0.2.0...

Patching component oracle.tfa, 12.1.0.2.0...

Patching component oracle.rdbms, 12.1.0.2.0...

Patching component oracle.rdbms.dbscripts, 12.1.0.2.0...

Patching component oracle.xdk.parser.java, 12.1.0.2.0...

Patching component oracle.xdk.rsf, 12.1.0.2.0...

Patching component oracle.rdbms.rsf, 12.1.0.2.0...

Patching component oracle.rdbms.rman, 12.1.0.2.0...

OPatch found the word "warning" in the stderr of the make command.
Please look at this stderr. You can re-run this make command.
Stderr output:
ld: 0711-415 WARNING: Symbol ldxdts is already exported.
ld: 0711-415 WARNING: Symbol ldxsto is already exported.
ld: 0711-415 WARNING: Symbol lnxadd is already exported.
ld: 0711-415 WARNING: Symbol lnxcopy is already exported.
ld: 0711-415 WARNING: Symbol lnxmin is already exported.
ld: 0711-415 WARNING: Symbol lnxmul is already exported.
ld: 0711-415 WARNING: Symbol lnxnur is already exported.
ld: 0711-415 WARNING: Symbol lnxren is already exported.
ld: 0711-415 WARNING: Symbol lnxsca is already exported.
ld: 0711-415 WARNING: Symbol lnxshift is already exported.
ld: 0711-415 WARNING: Symbol lnxsni is already exported.
ld: 0711-415 WARNING: Symbol sldxgd is already exported.
ld: 0711-224 WARNING: Duplicate symbol: fc_softc
ld: 0711-224 WARNING: Duplicate symbol: __fe_def_env
ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information.
ld: 0711-773 WARNING: Object /app/oracle/product/12.1.0/lib//liboraolap12.a[sxstime.o], imported symbol timezone
        Symbol was expected to be local. Extra instructions
        are being generated to reference the symbol.
ld: 0711-773 WARNING: Object /app/oracle/product/12.1.0/lib//libgeneric12.a[sdbgrfu.o], imported symbol timezone
        Symbol was expected to be local. Extra instructions
        are being generated to reference the symbol.
ld: 0711-773 WARNING: Object /app/oracle/product/12.1.0/lib//libordsdo12.a[mdopp.o], imported symbol ksptblblksizexp2_
        Symbol was expected to be local. Extra instructions
        are being generated to reference the symbol.
ld: 0711-773 WARNING: Object /app/oracle/product/12.1.0/lib//libordsdo12.a[mdopp.o], imported symbol ksptblblksizemod_
        Symbol was expected to be local. Extra instructions
        are being generated to reference the symbol.
ld: 0711-773 WARNING: Object /app/oracle/product/12.1.0/lib//libordsdo12.a[mdutl.o], imported symbol ksudbrmseccnt_
        Symbol was expected to be local. Extra instructions
        are being generated to reference the symbol.
ld: 0711-773 WARNING: Object /app/oracle/product/12.1.0/lib//libordsdo12.a[mdrcnc.o], imported symbol mdrcnccmt_
        Symbol was expected to be local. Extra instructions
        are being generated to reference the symbol.
ld: 0711-783 WARNING: TOC overflow. TOC size: 254856    Maximum size: 65536
        Extra instructions are being generated for each reference to a TOC
        symbol if the symbol is in the TOC overflow area.
ld: 0711-786 WARNING: TLS overflow. TLS size: 232176    Maximum size: 65536
        Extra instructions are being generated for some direct references
        to TLS symbols.




OPatch found the word "warning" in the stderr of the make command.
Please look at this stderr. You can re-run this make command.
Stderr output:
ld: 0711-224 WARNING: Duplicate symbol: .aio_nwait_timeout64
ld: 0711-224 WARNING: Duplicate symbol: aio_nwait_timeout64
ld: 0711-224 WARNING: Duplicate symbol: .aio_nwait64
ld: 0711-224 WARNING: Duplicate symbol: aio_nwait64
ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information.
ld: 0711-773 WARNING: Object /app/oracle/product/12.1.0/lib/libgeneric12.a[sdbgrfu.o], imported symbol timezone
        Symbol was expected to be local. Extra instructions
        are being generated to reference the symbol.
ld: 0711-783 WARNING: TOC overflow. TOC size: 280432    Maximum size: 65536
        Extra instructions are being generated for each reference to a TOC
        symbol if the symbol is in the TOC overflow area.



OPatch found the word "warning" in the stderr of the make command.
Please look at this stderr. You can re-run this make command.
Stderr output:
ld: 0711-773 WARNING: Object /app/oracle/product/12.1.0/lib//libgeneric12.a[sdbgrfu.o], imported symbol timezone
        Symbol was expected to be local. Extra instructions
        are being generated to reference the symbol.
ld: 0711-773 WARNING: Object /app/oracle/product/12.1.0/ldap/lib/s0gsltmod.o, imported symbol optind
        Symbol was expected to be local. Extra instructions
        are being generated to reference the symbol.
ld: 0711-773 WARNING: Object /app/oracle/product/12.1.0/ldap/lib/s0gsltmod.o, imported symbol optarg
        Symbol was expected to be local. Extra instructions
        are being generated to reference the symbol.



OPatch found the word "warning" in the stderr of the make command.
Please look at this stderr. You can re-run this make command.
Stderr output:
ld: 0711-773 WARNING: Object /app/oracle/product/12.1.0/lib//libgeneric12.a[sdbgrfu.o], imported symbol timezone
        Symbol was expected to be local. Extra instructions
        are being generated to reference the symbol.
ld: 0711-773 WARNING: Object /app/oracle/product/12.1.0/ldap/lib/s0gslmod.o, imported symbol optind
        Symbol was expected to be local. Extra instructions
        are being generated to reference the symbol.
ld: 0711-773 WARNING: Object /app/oracle/product/12.1.0/ldap/lib/s0gslmod.o, imported symbol optarg
        Symbol was expected to be local. Extra instructions
        are being generated to reference the symbol.



OPatch found the word "warning" in the stderr of the make command.
Please look at this stderr. You can re-run this make command.
Stderr output:
ld: 0711-773 WARNING: Object /app/oracle/product/12.1.0/lib//libgeneric12.a[sdbgrfu.o], imported symbol timezone
        Symbol was expected to be local. Extra instructions
        are being generated to reference the symbol.
ld: 0711-773 WARNING: Object /app/oracle/product/12.1.0/ldap/lib/s0gslmod.o, imported symbol optind
        Symbol was expected to be local. Extra instructions
        are being generated to reference the symbol.
ld: 0711-773 WARNING: Object /app/oracle/product/12.1.0/ldap/lib/s0gslmod.o, imported symbol optarg
        Symbol was expected to be local. Extra instructions
        are being generated to reference the symbol.



OPatch found the word "warning" in the stderr of the make command.
Please look at this stderr. You can re-run this make command.
Stderr output:
ld: 0711-773 WARNING: Object /app/oracle/product/12.1.0/lib//libgeneric12.a[sdbgrfu.o], imported symbol timezone
        Symbol was expected to be local. Extra instructions
        are being generated to reference the symbol.
ld: 0711-773 WARNING: Object /app/oracle/product/12.1.0/ldap/lib/s0gsltmod.o, imported symbol optind
        Symbol was expected to be local. Extra instructions
        are being generated to reference the symbol.
ld: 0711-773 WARNING: Object /app/oracle/product/12.1.0/ldap/lib/s0gsltmod.o, imported symbol optarg
        Symbol was expected to be local. Extra instructions
        are being generated to reference the symbol.



OPatch found the word "warning" in the stderr of the make command.
Please look at this stderr. You can re-run this make command.
Stderr output:
+ PATH=/bin:/usr/bin:/usr/ccs/bin
+ export PATH
+ lib=/app/oracle/product/12.1.0/lib/libasmclntsh12.so
+ makefile=/app/oracle/product/12.1.0/rdbms/lib/ins_rdbms.mk
+ so_ext=so
+ target=ld_shlib
+ + basename /app/oracle/product/12.1.0/lib/libasmclntsh12.so .so
libname=libasmclntsh12
+ + dirname /app/oracle/product/12.1.0/lib/libasmclntsh12.so
sodir=/app/oracle/product/12.1.0/lib
+ ardir=/app/oracle/product/12.1.0/lib/
+ [ var = ld_shlib ]
+ suffix=LIBS
+ var=
+ [ ! -f /app/oracle/product/12.1.0/lib/libasmclntsh12.a ]
+ [  !=  ]
+ make -f /app/oracle/product/12.1.0/rdbms/lib/ins_rdbms.mk ld_shlib _FULL_LIBNAME=/app/oracle/product/12.1.0/lib/libasmclntsh12.so _LIBNAME=libasmclntsh12 _LIBDIR=/app/oracle/product/12.1.0/lib/ _LIBNAME_LIBS=$(libasmclntsh12LIBS) _LIBNAME_EXTRALIBS=$(libasmclntsh12EXTRALIBS)
ld: 0711-224 WARNING: Duplicate symbol: environ
ld: 0711-224 WARNING: Duplicate symbol: .getgroups
ld: 0711-224 WARNING: Duplicate symbol: getgroups
ld: 0711-224 WARNING: Duplicate symbol: .setgroups
ld: 0711-224 WARNING: Duplicate symbol: setgroups
ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information.
ld: 0711-773 WARNING: Object /app/oracle/product/12.1.0/lib/libasmclntsh12.a[skgdll.o], imported symbol vsnlibnum
        Symbol was expected to be local. Extra instructions
        are being generated to reference the symbol.
ld: 0711-773 WARNING: Object /app/oracle/product/12.1.0/lib/libasmclntsh12.a[kgfo.o], imported symbol vsnnum
        Symbol was expected to be local. Extra instructions
        are being generated to reference the symbol.
ld: 0711-773 WARNING: Object /app/oracle/product/12.1.0/lib/libasmclntsh12.a[kgfz.o], imported symbol vsnnum
        Symbol was expected to be local. Extra instructions
        are being generated to reference the symbol.




OPatch found the word "warning" in the stderr of the make command.
Please look at this stderr. You can re-run this make command.
Stderr output:
ld: 0711-224 WARNING: Duplicate symbol: .aio_nwait_timeout64
ld: 0711-224 WARNING: Duplicate symbol: aio_nwait_timeout64
ld: 0711-224 WARNING: Duplicate symbol: .aio_nwait64
ld: 0711-224 WARNING: Duplicate symbol: aio_nwait64
ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information.
ld: 0711-773 WARNING: Object /app/oracle/product/12.1.0/lib/libgeneric12.a[sdbgrfu.o], imported symbol timezone
        Symbol was expected to be local. Extra instructions
        are being generated to reference the symbol.
ld: 0711-783 WARNING: TOC overflow. TOC size: 280432    Maximum size: 65536
        Extra instructions are being generated for each reference to a TOC
        symbol if the symbol is in the TOC overflow area.



OPatch found the word "fail" in the stderr of the make command.
Please look at this stderr. You can re-run this make command.
Stderr output:
ld: 0711-224 WARNING: Duplicate symbol: p_xargc
ld: 0711-224 WARNING: Duplicate symbol: p_xargv
ld: 0711-224 WARNING: Duplicate symbol: lsfmai
ld: 0711-224 WARNING: Duplicate symbol: .lfiwr
ld: 0711-224 WARNING: Duplicate symbol: lfiwr
ld: 0711-224 WARNING: Duplicate symbol: .lempfrec
ld: 0711-224 WARNING: Duplicate symbol: lempfrec
ld: 0711-224 WARNING: Duplicate symbol: .lpmmkpri
ld: 0711-224 WARNING: Duplicate symbol: lpmmkpri
ld: 0711-224 WARNING: Duplicate symbol: .lemfaa
ld: 0711-224 WARNING: Duplicate symbol: lemfaa
ld: 0711-224 WARNING: Duplicate symbol: .lxldini
ld: 0711-224 WARNING: Duplicate symbol: lxldini
ld: 0711-224 WARNING: Duplicate symbol: .lpmexitprog
ld: 0711-224 WARNING: Duplicate symbol: lpmexitprog
ld: 0711-224 WARNING: Duplicate symbol: .lxlinit
ld: 0711-224 WARNING: Duplicate symbol: lxlinit
ld: 0711-224 WARNING: Duplicate symbol: .lxinitc
ld: 0711-224 WARNING: Duplicate symbol: lxinitc
ld: 0711-224 WARNING: Duplicate symbol: .lxhLangEnv
ld: 0711-224 WARNING: Duplicate symbol: lxhLangEnv
ld: 0711-224 WARNING: Duplicate symbol: .lpmloadpkg
ld: 0711-224 WARNING: Duplicate symbol: lpmloadpkg
ld: 0711-224 WARNING: Duplicate symbol: .lsfini
ld: 0711-224 WARNING: Duplicate symbol: lsfini
ld: 0711-224 WARNING: Duplicate symbol: .lmsaicmt
ld: 0711-224 WARNING: Duplicate symbol: lmsaicmt
ld: 0711-224 WARNING: Duplicate symbol: .lrminit
ld: 0711-224 WARNING: Duplicate symbol: lrminit
ld: 0711-224 WARNING: Duplicate symbol: .lmmtophp
ld: 0711-224 WARNING: Duplicate symbol: lmmtophp
ld: 0711-224 WARNING: Duplicate symbol: .skgfrgsz
ld: 0711-224 WARNING: Duplicate symbol: .skgfrpini
ld: 0711-224 WARNING: Duplicate symbol: .skgdllInit
ld: 0711-224 WARNING: Duplicate symbol: .lstprintf
ld: 0711-224 WARNING: Duplicate symbol: lstprintf
ld: 0711-224 WARNING: Duplicate symbol: .slosDep2Mesg
ld: 0711-224 WARNING: Duplicate symbol: slosDep2Mesg
ld: 0711-224 WARNING: Duplicate symbol: .skgfrsini
ld: 0711-224 WARNING: Duplicate symbol: .skgfrsaiolmt
ld: 0711-224 WARNING: Duplicate symbol: .skgfrsetioparam
ld: 0711-224 WARNING: Duplicate symbol: .skgfrpdstry
ld: 0711-224 WARNING: Duplicate symbol: .skgfgfsz
ld: 0711-224 WARNING: Duplicate symbol: .skgfrcre
ld: 0711-224 WARNING: Duplicate symbol: .skgfifi
ld: 0711-224 WARNING: Duplicate symbol: .skgfofi
ld: 0711-224 WARNING: Duplicate symbol: .skgfcfi
ld: 0711-224 WARNING: Duplicate symbol: .skgfask
ld: 0711-224 WARNING: Duplicate symbol: .skgfqio
ld: 0711-224 WARNING: Duplicate symbol: .skgfqio_failure_check
ld: 0711-224 WARNING: Duplicate symbol: .skgfrwat
ld: 0711-224 WARNING: Duplicate symbol: .skgfrsz
ld: 0711-224 WARNING: Duplicate symbol: .skgfrfb
ld: 0711-224 WARNING: Duplicate symbol: .skgfrfhblk
ld: 0711-224 WARNING: Duplicate symbol: .sslssreghdlr
ld: 0711-224 WARNING: Duplicate symbol: sslssreghdlr
ld: 0711-224 WARNING: Duplicate symbol: .saix_get_file_type
ld: 0711-224 WARNING: Duplicate symbol: saix_get_file_type
ld: 0711-224 WARNING: Duplicate symbol: .saix_no_lvcbf
ld: 0711-224 WARNING: Duplicate symbol: saix_no_lvcbf
ld: 0711-224 WARNING: Duplicate symbol: .bcopy
ld: 0711-224 WARNING: Duplicate symbol: .lstclo
ld: 0711-224 WARNING: Duplicate symbol: lstclo
ld: 0711-224 WARNING: Duplicate symbol: .skgdllDestroy
ld: 0711-224 WARNING: Duplicate symbol: .skgdllClose
ld: 0711-224 WARNING: Duplicate symbol: .skgdllOpen
ld: 0711-224 WARNING: Duplicate symbol: .skgdllSym
ld: 0711-224 WARNING: Duplicate symbol: .slosFillErr
ld: 0711-224 WARNING: Duplicate symbol: slosFillErr
ld: 0711-224 WARNING: Duplicate symbol: .slosOtherInfo
ld: 0711-224 WARNING: Duplicate symbol: slosOtherInfo
ld: 0711-224 WARNING: Duplicate symbol: .slosFillInt
ld: 0711-224 WARNING: Duplicate symbol: slosFillInt
ld: 0711-224 WARNING: Duplicate symbol: .lstup
ld: 0711-224 WARNING: Duplicate symbol: lstup
ld: 0711-224 WARNING: Duplicate symbol: .lsttokr
ld: 0711-224 WARNING: Duplicate symbol: lsttokr
ld: 0711-224 WARNING: Duplicate symbol: .slcgems
ld: 0711-224 WARNING: Duplicate symbol: slcgems
ld: 0711-224 WARNING: Duplicate symbol: .slzgetevar
ld: 0711-224 WARNING: Duplicate symbol: slzgetevar
ld: 0711-224 WARNING: Duplicate symbol: .gethrtime
ld: 0711-224 WARNING: Duplicate symbol: gethrtime
ld: 0711-224 WARNING: Duplicate symbol: .lpminit
ld: 0711-224 WARNING: Duplicate symbol: lpminit
ld: 0711-224 WARNING: Duplicate symbol: .lsfcln
ld: 0711-224 WARNING: Duplicate symbol: lsfcln
ld: 0711-224 WARNING: Duplicate symbol: .lpmdelete
ld: 0711-224 WARNING: Duplicate symbol: lpmdelete
ld: 0711-224 WARNING: Duplicate symbol: .lsfp
ld: 0711-224 WARNING: Duplicate symbol: lsfp
ld: 0711-224 WARNING: Duplicate symbol: .lemptfs
ld: 0711-224 WARNING: Duplicate symbol: lemptfs
ld: 0711-224 WARNING: Duplicate symbol: .lemptfr
ld: 0711-224 WARNING: Duplicate symbol: lemptfr
ld: 0711-224 WARNING: Duplicate symbol: .lempbas
ld: 0711-224 WARNING: Duplicate symbol: lempbas
ld: 0711-224 WARNING: Duplicate symbol: .lempbar
ld: 0711-224 WARNING: Duplicate symbol: lempbar
ld: 0711-224 WARNING: Duplicate symbol: .lmmcalloc
ld: 0711-224 WARNING: Duplicate symbol: lmmcalloc
ld: 0711-224 WARNING: Duplicate symbol: .lmmfree
ld: 0711-224 WARNING: Duplicate symbol: lmmfree
ld: 0711-224 WARNING: Duplicate symbol: .lrmhcb
ld: 0711-224 WARNING: Duplicate symbol: lrmhcb
ld: 0711-224 WARNING: Duplicate symbol: .lrmpaa
ld: 0711-224 WARNING: Duplicate symbol: lrmpaa
ld: 0711-224 WARNING: Duplicate symbol: .lrmhorv
ld: 0711-224 WARNING: Duplicate symbol: lrmhorv
ld: 0711-224 WARNING: Duplicate symbol: .lstmclo
ld: 0711-224 WARNING: Duplicate symbol: lstmclo
ld: 0711-224 WARNING: Duplicate symbol: .lficls
ld: 0711-224 WARNING: Duplicate symbol: lficls
ld: 0711-224 WARNING: Duplicate symbol: .lfifno
ld: 0711-224 WARNING: Duplicate symbol: lfifno
ld: 0711-224 WARNING: Duplicate symbol: .lstmup
ld: 0711-224 WARNING: Duplicate symbol: lstmup
ld: 0711-224 WARNING: Duplicate symbol: .lstss
ld: 0711-224 WARNING: Duplicate symbol: lstss
ld: 0711-224 WARNING: Duplicate symbol: .lembem
ld: 0711-224 WARNING: Duplicate symbol: lembem
ld: 0711-224 WARNING: Duplicate symbol: .slemdsp
ld: 0711-224 WARNING: Duplicate symbol: slemdsp
ld: 0711-224 WARNING: Duplicate symbol: .lrmgsv
ld: 0711-224 WARNING: Duplicate symbol: lrmgsv
ld: 0711-224 WARNING: Duplicate symbol: .lrmgbv
ld: 0711-224 WARNING: Duplicate symbol: lrmgbv
ld: 0711-224 WARNING: Duplicate symbol: .lrmgiv
ld: 0711-224 WARNING: Duplicate symbol: lrmgiv
ld: 0711-224 WARNING: Duplicate symbol: .lrmg8v
ld: 0711-224 WARNING: Duplicate symbol: lrmg8v
ld: 0711-224 WARNING: Duplicate symbol: .slztln
ld: 0711-224 WARNING: Duplicate symbol: slztln
ld: 0711-224 WARNING: Duplicate symbol: .lfimknam
ld: 0711-224 WARNING: Duplicate symbol: lfimknam
ld: 0711-224 WARNING: Duplicate symbol: .lfifini
ld: 0711-224 WARNING: Duplicate symbol: lfifini
ld: 0711-224 WARNING: Duplicate symbol: .lfiopn
ld: 0711-224 WARNING: Duplicate symbol: lfiopn
ld: 0711-224 WARNING: Duplicate symbol: .lemces
ld: 0711-224 WARNING: Duplicate symbol: lemces
ld: 0711-224 WARNING: Duplicate symbol: .lfidlb
ld: 0711-224 WARNING: Duplicate symbol: lfidlb
ld: 0711-224 WARNING: Duplicate symbol: .lfidel
ld: 0711-224 WARNING: Duplicate symbol: lfidel
ld: 0711-224 WARNING: Duplicate symbol: .lmsagbf
ld: 0711-224 WARNING: Duplicate symbol: lmsagbf
ld: 0711-224 WARNING: Duplicate symbol: .lempfsec
ld: 0711-224 WARNING: Duplicate symbol: lempfsec
ld: 0711-224 WARNING: Duplicate symbol: .lfird
ld: 0711-224 WARNING: Duplicate symbol: lfird
ld: 0711-224 WARNING: Duplicate symbol: .sslpminit
ld: 0711-224 WARNING: Duplicate symbol: sslpminit
ld: 0711-224 WARNING: Duplicate symbol: .sslslini
ld: 0711-224 WARNING: Duplicate symbol: sslslini
ld: 0711-224 WARNING: Duplicate symbol: .lpmpgif
ld: 0711-224 WARNING: Duplicate symbol: lpmpgif
ld: 0711-224 WARNING: Duplicate symbol: .lpmpmai
ld: 0711-224 WARNING: Duplicate symbol: lpmpmai
ld: 0711-224 WARNING: Duplicate symbol: p_xrcfg
ld: 0711-224 WARNING: Duplicate symbol: p_xrc
ld: 0711-224 WARNING: Duplicate symbol: sslssunreghdlr
ld: 0711-224 WARNING: Duplicate symbol: .sslssunreghdlr
ld: 0711-224 WARNING: Duplicate symbol: sslssalck
ld: 0711-224 WARNING: Duplicate symbol: .sslssalck
ld: 0711-224 WARNING: Duplicate symbol: slosDep2String
ld: 0711-224 WARNING: Duplicate symbol: .slosDep2String
ld: 0711-224 WARNING: Duplicate symbol: SlfFclose
ld: 0711-224 WARNING: Duplicate symbol: .SlfFclose
ld: 0711-224 WARNING: Duplicate symbol: SlfFgts
ld: 0711-224 WARNING: Duplicate symbol: .SlfFgts
ld: 0711-224 WARNING: Duplicate symbol: SlfFopen2
ld: 0711-224 WARNING: Duplicate symbol: .SlfFopen2
ld: 0711-224 WARNING: Duplicate symbol: SlfFread
ld: 0711-224 WARNING: Duplicate symbol: .SlfFread
ld: 0711-224 WARNING: Duplicate symbol: SlfFseekn
ld: 0711-224 WARNING: Duplicate symbol: .SlfFseekn
ld: 0711-224 WARNING: Duplicate symbol: lcv42b
ld: 0711-224 WARNING: Duplicate symbol: .lcv42b
ld: 0711-224 WARNING: Duplicate symbol: lcvb24
ld: 0711-224 WARNING: Duplicate symbol: .lcvb24
ld: 0711-224 WARNING: Duplicate symbol: lcvb2w
ld: 0711-224 WARNING: Duplicate symbol: .lcvb2w
ld: 0711-224 WARNING: Duplicate symbol: lcvb2werr
ld: 0711-224 WARNING: Duplicate symbol: .lcvb2werr
ld: 0711-224 WARNING: Duplicate symbol: lsrsrt
ld: 0711-224 WARNING: Duplicate symbol: .lsrsrt
ld: 0711-224 WARNING: Duplicate symbol: lrmckv
ld: 0711-224 WARNING: Duplicate symbol: .lrmckv
ld: 0711-224 WARNING: Duplicate symbol: lrmcvv
ld: 0711-224 WARNING: Duplicate symbol: .lrmcvv
ld: 0711-224 WARNING: Duplicate symbol: lrmgsp
ld: 0711-224 WARNING: Duplicate symbol: .lrmgsp
ld: 0711-224 WARNING: Duplicate symbol: lrmgps
ld: 0711-224 WARNING: Duplicate symbol: .lrmgps
ld: 0711-224 WARNING: Duplicate symbol: lrmpfi
ld: 0711-224 WARNING: Duplicate symbol: .lrmpfi
ld: 0711-224 WARNING: Duplicate symbol: lrmt2b
ld: 0711-224 WARNING: Duplicate symbol: .lrmt2b
ld: 0711-224 WARNING: Duplicate symbol: lrmt2i
ld: 0711-224 WARNING: Duplicate symbol: .lrmt2i
ld: 0711-224 WARNING: Duplicate symbol: lrmtrm
ld: 0711-224 WARNING: Duplicate symbol: .lrmtrm
ld: 0711-224 WARNING: Duplicate symbol: slputcpwrite
ld: 0711-224 WARNING: Duplicate symbol: .slputcpwrite
ld: 0711-224 WARNING: Duplicate symbol: .skgsninit
ld: 0711-224 WARNING: Duplicate symbol: .skgsnisize
ld: 0711-224 WARNING: Duplicate symbol: .skgsnqnuma
ld: 0711-224 WARNING: Duplicate symbol: .dbgdInitParse
ld: 0711-224 WARNING: Duplicate symbol: .dbgdParseCmd
ld: 0711-224 WARNING: Duplicate symbol: .dbgdChkEventIntV
ld: 0711-224 WARNING: Duplicate symbol: .dbgdEndParse
ld: 0711-224 WARNING: Duplicate symbol: .dbgdInitEventGrp
ld: 0711-224 WARNING: Duplicate symbol: .dbgdGetPostArgById
ld: 0711-224 WARNING: Duplicate symbol: .dbgdChkEventIntVa
ld: 0711-224 WARNING: Duplicate symbol: .dbgdDiagNfy
ld: 0711-224 WARNING: Duplicate symbol: .dbgdDmpEventsDiagInfo
ld: 0711-224 WARNING: Duplicate symbol: .dbgdTargetFuncUb4
ld: 0711-224 WARNING: Duplicate symbol: .dbgdTargetFuncEnum
ld: 0711-224 WARNING: Duplicate symbol: .dbgdRecoverEventGrp
ld: 0711-224 WARNING: Duplicate symbol: .dbgdRdbmsErrMarshall
ld: 0711-224 WARNING: Duplicate symbol: .dbgdErrArgFilterCbk
ld: 0711-224 WARNING: Duplicate symbol: .dbgdOccFilterCbk
ld: 0711-224 WARNING: Duplicate symbol: .dbgdCskFilterCbk
ld: 0711-224 WARNING: Duplicate symbol: .dbgdTagFilterCbk
ld: 0711-224 WARNING: Duplicate symbol: .dbgdEQFilterCbk
ld: 0711-224 WARNING: Duplicate symbol: .dbgdNEFilterCbk
ld: 0711-224 WARNING: Duplicate symbol: .dbgdGTFilterCbk
ld: 0711-224 WARNING: Duplicate symbol: .dbgdLTFilterCbk
ld: 0711-224 WARNING: Duplicate symbol: .dbgdGEFilterCbk
ld: 0711-224 WARNING: Duplicate symbol: .dbgdLEFilterCbk
ld: 0711-224 WARNING: Duplicate symbol: .dbgdBEFilterCbk
ld: 0711-224 WARNING: Duplicate symbol: .dbgdNBEFilterCbk
ld: 0711-224 WARNING: Duplicate symbol: .dbgdINFilterCbk
ld: 0711-224 WARNING: Duplicate symbol: .dbgdNINFilterCbk
ld: 0711-224 WARNING: Duplicate symbol: .dbgdAnyBFilterCbk
ld: 0711-224 WARNING: Duplicate symbol: .dbgdAllBFilterCbk
ld: 0711-224 WARNING: Duplicate symbol: .dbgdNoBFilterCbk
ld: 0711-224 WARNING: Duplicate symbol: .dbgdStrEQFilterCbk
ld: 0711-224 WARNING: Duplicate symbol: .dbgdStrNEQFilterCbk
ld: 0711-224 WARNING: Duplicate symbol: .dbgdHelp
ld: 0711-224 WARNING: Duplicate symbol: .dbgdEventGroupDump
ld: 0711-224 WARNING: Duplicate symbol: .lstmlo
ld: 0711-224 WARNING: Duplicate symbol: lstmlo
ld: 0711-224 WARNING: Duplicate symbol: .skgsnsimnuma
ld: 0711-224 WARNING: Duplicate symbol: .skgsn_ndnc
ld: 0711-224 WARNING: Duplicate symbol: .skgsnlookuprset
ld: 0711-224 WARNING: Duplicate symbol: .skgsnreleaserset
ld: 0711-224 WARNING: Duplicate symbol: .skgsn_rev_omap
ld: 0711-224 WARNING: Duplicate symbol: .skgsnnim
ld: 0711-224 WARNING: Duplicate symbol: .skgsn_numa_set_procgrp_affinity
ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information.
ld: 0711-773 WARNING: Object /app/oracle/product/12.1.0/lib//libgeneric12.a[skgfr.o], imported symbol slts_runmode
        Symbol was expected to be local. Extra instructions
        are being generated to reference the symbol.
ld: 0711-773 WARNING: Object /lib/crt0_64.o, imported symbol p_xargc
        Symbol was expected to be local. Extra instructions
        are being generated to reference the symbol.
ld: 0711-773 WARNING: Object /lib/crt0_64.o, imported symbol p_xargv
        Symbol was expected to be local. Extra instructions
        are being generated to reference the symbol.
ld: 0711-773 WARNING: Object /lib/crt0_64.o, imported symbol p_xrcfg
        Symbol was expected to be local. Extra instructions
        are being generated to reference the symbol.
ld: 0711-773 WARNING: Object /lib/crt0_64.o, imported symbol p_xrc
        Symbol was expected to be local. Extra instructions
        are being generated to reference the symbol.
ld: 0711-773 WARNING: Object /app/oracle/product/12.1.0/lib//libgeneric12.a[skgdll.o], imported symbol vsnlibnum
        Symbol was expected to be local. Extra instructions
        are being generated to reference the symbol.



OPatch found the word "warning" in the stderr of the make command.
Please look at this stderr. You can re-run this make command.
Stderr output:
ld: 0711-773 WARNING: Object /app/oracle/product/12.1.0/lib//libgeneric12.a[sdbgrfu.o], imported symbol timezone
        Symbol was expected to be local. Extra instructions
        are being generated to reference the symbol.
ld: 0711-783 WARNING: TOC overflow. TOC size: 69504     Maximum size: 65536
        Extra instructions are being generated for each reference to a TOC
        symbol if the symbol is in the TOC overflow area.


Composite patch 26713565 successfully applied.
OPatch Session completed with warnings.
Log file location: /app/oracle/product/12.1.0/cfgtoollogs/opatch/opatch2017-10-26_21-58-08PM_1.log

OPatch completed with warnings.



AIX db7:db7:oracle
/app/oradata/db7.arch/patch_oct17/26636270/26713565
   $
AIX db7:db7:oracle
/app/oradata/db7.arch/patch_oct17/26636270/26713565
   $
AIX db7:db7:oracle
/app/oradata/db7.arch/patch_oct17/26636270/26713565
   $
AIX db7:db7:oracle
/app/oradata/db7.arch/patch_oct17/26636270/26713565
  


   $sqlplus Connect / as sysdba


AIX db7:db7:oracle
/app/oradata/db7.arch/patch_oct17/26636270/26713565
   $echo $ORACLE_SID
db7
AIX db7:db7:oracle
/app/oradata/db7.arch/patch_oct17/26636270/26713565
   $sqlplus / as sysdba

SQL*Plus: Release 12.1.0.2.0 Production on Thu Oct 26 22:22:54 2017

Copyright (c) 1982, 2014, Oracle.  All rights reserved.

Connected to an idle instance.

SQL> startup
ORACLE instance started.

Total System Global Area 1627389952 bytes
Fixed Size                  2998544 bytes
Variable Size            1442844400 bytes
Database Buffers          167772160 bytes
Redo Buffers               13774848 bytes
Database mounted.
Database opened.
SQL> select * from v$recover_file;

no rows selected

SQL> exit
Disconnected from Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options
AIX db7:db7:oracle
/app/oradata/db7.arch/patch_oct17/26636270/26713565
   $cd $ORACLE_HOME/OPatch
AIX db7:db7:oracle

/app/oracle/product/12.1.0/OPatch

   $./datapatch -verbose
SQL Patching tool version 12.1.0.2.0 Production on Thu Oct 26 22:25:13 2017
Copyright (c) 2012, 2016, Oracle.  All rights reserved.

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

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

Current state of SQL patches:
Patch 24917972 (Database PSU 12.1.0.2.170117, Oracle JavaVM Component (JAN2017)):
  ROLLBACK with errors in the SQL registry only
Patch 25437695 (Database PSU 12.1.0.2.170418, Oracle JavaVM Component (APR2017)):
  Not installed in the binary or the SQL registry
Patch 26027162 (Database PSU 12.1.0.2.170718, Oracle JavaVM Component (JUL2017)):
  Installed in the binary registry and the SQL registry
Bundle series PSU:
  ID 171017 in the binary registry and ID 170718 in the SQL registry

Adding patches to installation queue and performing prereq checks...
Installation queue:
  The following patches will be rolled back:
    24917972 (Database PSU 12.1.0.2.170117, Oracle JavaVM Component (JAN2017))
  The following patches will be applied:
    26713565 (DATABASE PATCH SET UPDATE 12.1.0.2.171017)

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

Validating logfiles...
Patch 24917972 rollback: SUCCESS
  logfile: /app/oracle/cfgtoollogs/sqlpatch/24917972/20816605/24917972_rollback_db7_2017Oct26_22_25_52.log (no errors)
Patch 26713565 apply: SUCCESS
  logfile: /app/oracle/cfgtoollogs/sqlpatch/26713565/21606134/26713565_apply_db7_2017Oct26_22_25_55.log (no errors)
SQL Patching tool complete on Thu Oct 26 22:26:04 2017
AIX db7:db7:oracle
/app/oracle/product/12.1.0/OPatch
   
   $echo $ORACLE_SID
db7
AIX db7:db7:oracle
/app/oracle/product/12.1.0/OPatch
   $rman target / catalog rman/rman0d@RMANDoracle

Recovery Manager: Release 12.1.0.2.0 - Production on Thu Oct 26 22:29:19 2017

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

connected to target database: db7 (DBID=996996358)
connected to recovery catalog database

RMAN> UPGRADE CATALOG;

recovery catalog owner is rman
enter UPGRADE CATALOG command again to confirm catalog upgrade

RMAN> UPGRADE CATALOG;

recovery catalog upgraded to version 12.01.00.02
DBMS_RCVMAN package upgraded to version 12.01.00.02
DBMS_RCVCAT package upgraded to version 12.01.00.02.

RMAN> SHOW ALL;

RMAN configuration parameters for database with db_unique_name db7 are:
CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 30 DAYS;
CONFIGURE BACKUP OPTIMIZATION OFF; # default
CONFIGURE DEFAULT DEVICE TYPE TO DISK; # default
CONFIGURE CONTROLFILE AUTOBACKUP ON;
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE 'SBT_TAPE' TO '%d_cf_%F';
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '%F'; # default
CONFIGURE DEVICE TYPE DISK PARALLELISM 1 BACKUP TYPE TO BACKUPSET; # default
CONFIGURE DEVICE TYPE SBT_TAPE PARALLELISM 1 BACKUP TYPE TO BACKUPSET; # default
CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE SBT_TAPE TO 1; # default
CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE SBT_TAPE TO 1; # default
CONFIGURE CHANNEL DEVICE TYPE 'SBT_TAPE' PARMS  'BLKSIZE=1048576, SBT_LIBRARY=/app/oracle/product/12.1.0/lib/libddobk.so, ENV=(STORAGE_UNIT=RMANDev, BACKUP_HOST=xxxx.com, ORACLE_HOME=//app/oracle/product/12.1.0)';
CONFIGURE MAXSETSIZE TO UNLIMITED; # default
CONFIGURE ENCRYPTION FOR DATABASE OFF; # default
CONFIGURE ENCRYPTION ALGORITHM 'AES128'; # default
CONFIGURE COMPRESSION ALGORITHM 'BASIC' AS OF RELEASE 'DEFAULT' OPTIMIZE FOR LOAD TRUE ; # default
CONFIGURE RMAN OUTPUT TO KEEP FOR 7 DAYS; # default
CONFIGURE ARCHIVELOG DELETION POLICY TO NONE; # default
CONFIGURE SNAPSHOT CONTROLFILE NAME TO '/app/oracle/product/12.1.0/dbs/snapcf_db7.f'; # default


To test the backup after catalog upgrade
****************************************

RMAN> run
{
allocate channel c1 DEVICE TYPE 'SBT_TAPE' TRACE 5 PARMS  'BLKSIZE=1048576, SBT_LIBRARY=/app/oracle/product/12.1.0/lib/libddobk.so, ENV=(STORAGE_UNIT=RMANDev, BACKUP_HOST=xxxx.com, ORACLE_HOME=/app/oracle/product/12.1.0)';
 b2> 3> 4> ackup current controlfile;
}5>

released channel: ORA_DISK_1
allocated channel: c1
channel c1: SID=542 device type=SBT_TAPE
channel c1: Data Domain Boost API

Starting backup at 26-OCT-17
channel c1: starting full datafile backup set
channel c1: specifying datafile(s) in backup set
including current control file in backup set
channel c1: starting piece 1 at 26-OCT-17
channel c1: finished piece 1 at 26-OCT-17
piece handle=e5si0vaq_1_1 tag=TAG20171026T224234 comment=API Version 2.0,MMS Version 1.3.0.2
channel c1: backup set complete, elapsed time: 00:00:01
Finished backup at 26-OCT-17

Starting Control File and SPFILE Autobackup at 26-OCT-17
piece handle=db7_cf_c-996996358-20171026-04 comment=API Version 2.0,MMS Version 1.3.0.2
Finished Control File and SPFILE Autobackup at 26-OCT-17
released channel: c1

RMAN> exit


Recovery Manager complete.
AIX db7:db7:oracle
/app/oracle/product/12.1.0/OPatch
   $sqlplus "/ as sysdba"

SQL*Plus: Release 12.1.0.2.0 Production on Thu Oct 26 22:43:04 2017

Copyright (c) 1982, 2014, Oracle.  All rights reserved.


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

SQL> select name,open_mode from v$database;

NAME      OPEN_MODE
--------- --------------------
db7   READ WRITE

SQL> select substr(comp_name,1,40) comp_name, status, substr(version,1,10) version from  dba_registry order by comp_name;

COMP_NAME                                STATUS      VERSION
---------------------------------------- ----------- ----------
JServer JAVA Virtual Machine             VALID       12.1.0.2.0
OLAP Analytic Workspace                  VALID       12.1.0.2.0
Oracle Application Express               VALID       4.2.5.00.0
Oracle Database Catalog Views            VALID       12.1.0.2.0
Oracle Database Java Packages            VALID       12.1.0.2.0
Oracle Database Packages and Types       VALID       12.1.0.2.0
Oracle Database Vault                    VALID       12.1.0.2.0
Oracle Label Security                    VALID       12.1.0.2.0
Oracle Multimedia                        VALID       12.1.0.2.0
Oracle OLAP API                          VALID       12.1.0.2.0
Oracle Real Application Clusters         OPTION OFF  12.1.0.2.0

COMP_NAME                                STATUS      VERSION
---------------------------------------- ----------- ----------
Oracle Text                              VALID       12.1.0.2.0
Oracle Workspace Manager                 VALID       12.1.0.2.0
Oracle XDK                               VALID       12.1.0.2.0
Oracle XML Database                      VALID       12.1.0.2.0
Spatial                                  VALID       12.1.0.2.0

16 rows selected.

SQL> exit
Disconnected from Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options
AIX db7:db7:oracle
/app/oracle/product/12.1.0/OPatch
   $opatch lsinventory
Oracle Interim Patch Installer version 12.2.0.1.8
Copyright (c) 2017, Oracle Corporation.  All rights reserved.


Oracle Home       : /app/oracle/product/12.1.0
Central Inventory : /app/oracle/oraInventory
   from           : /app/oracle/product/12.1.0/oraInst.loc
OPatch version    : 12.2.0.1.8
OUI version       : 12.1.0.2.0
Log file location : /app/oracle/product/12.1.0/cfgtoollogs/opatch/opatch2017-10-26_22-56-47PM_1.log

Lsinventory Output file location : /app/oracle/product/12.1.0/cfgtoollogs/opatch/lsinv/lsinventory2017-10-26_22-56-47PM.txt

--------------------------------------------------------------------------------
Local Machine Information::
Hostname: db7
ARU platform id: 212
ARU platform description:: IBM_AIX

Installed Top-level Products (1):

Oracle Database 12c                                                  12.1.0.2.0
There are 1 products installed in this Oracle Home.


Interim patches (2) :

Patch  26713565     : applied on Thu Oct 26 21:58:45 EDT 2017
Unique Patch ID:  21606134
Patch description:  "Database Patch Set Update : 12.1.0.2.171017 (26713565)"
   Created on 1 Oct 2017, 19:55:36 hrs PST8PDT
Sub-patch  26609783; "Database Patch Set Update : 12.1.0.2.170814 (26609783)"
Sub-patch  25755742; "Database Patch Set Update : 12.1.0.2.170718 (25755742)"
Sub-patch  25171037; "Database Patch Set Update : 12.1.0.2.170418 (25171037)"
Sub-patch  24732082; "Database Patch Set Update : 12.1.0.2.170117 (24732082)"
Sub-patch  24006101; "Database Patch Set Update : 12.1.0.2.161018 (24006101)"
Sub-patch  23054246; "Database Patch Set Update : 12.1.0.2.160719 (23054246)"
Sub-patch  22291127; "Database Patch Set Update : 12.1.0.2.160419 (22291127)"
Sub-patch  21948354; "Database Patch Set Update : 12.1.0.2.160119 (21948354)"
Sub-patch  21359755; "Database Patch Set Update : 12.1.0.2.5 (21359755)"
Sub-patch  20831110; "Database Patch Set Update : 12.1.0.2.4 (20831110)"
Sub-patch  20299023; "Database Patch Set Update : 12.1.0.2.3 (20299023)"
Sub-patch  19769480; "Database Patch Set Update : 12.1.0.2.2 (19769480)"
   Bugs fixed:
     23068169, 21220620, 21387964, 19402853, 18840932, 19644859, 18610915
     22380919, 20378086, 22528741, 20543011, 20074391, 23025340, 21106027
     25957038, 20898997, 20952966, 21492036, 18456643, 19018447, 19018206
     19174430, 19469538, 19044962, 14283239, 20509482, 18051556, 20688221
     20557786, 25423453, 20920911, 22529728, 18914624, 18542562, 21450666
     25079710, 21296029, 18990023, 26111842, 21091431, 23533807, 18797519
     21875360, 22842151, 21756661, 18967382, 20315311, 21429602, 20447445
     23713236, 19708632, 21188584, 20361671, 21373473, 18849537, 18202441
     20440930, 20711718, 19777862, 24555417, 19468347, 23260854, 19052488
     19065556, 19074147, 19065677, 20425790, 21329301, 21868720, 21896069
     21756677, 23026585, 19818513, 18607546, 24577566, 21153266, 18440095
     22353346, 20560611, 20122715, 18819908, 19896336, 24350831, 19023822
     19032777, 20139391, 20117253, 21787056, 21899588, 24719736, 17722075
     19518079, 22256431, 19578350, 18885870, 24316947, 19503821, 25161298
     19532017, 17532734, 19076343, 19171086, 19075256, 19658708, 23053606
     22160989, 24560906, 19024808, 22757364, 19606174, 23149541, 19238590
     21756699, 21911701, 25861398, 23338911, 20831538, 19676012, 23501901
     20250147, 22551446, 22366558, 19888853, 16923858, 20331945, 19068970
     19068610, 18250893, 21172913, 25484507, 19399918, 21842017, 20165574
     20830459, 20284155, 20832516, 19805359, 17365043, 20879709, 22365117
     18674024, 18851894, 19687159, 19178851, 18411216, 24285405, 21060755
     26430737, 19077215, 22062517, 19931709, 21419850, 20677396, 20428621
     22815955, 19315691, 21133343, 25600421, 18007682, 22238921, 20245930
     23521523, 18799993, 22923409, 21246723, 21794615, 23294548, 19176326
     19385656, 25606091, 20657441, 22503297, 13542050, 20877664, 18618122
     26446098, 20318889, 20581111, 19908836, 20373598, 20475845, 18674047
     20144308, 19536415, 18436647, 19721304, 20717081, 18371441, 25264559
     19189525, 18964939, 19363645, 21315084, 21299490, 19708342, 20669434
     21241052, 24437510, 19512341, 19534363, 23533524, 20673810, 18499088
     22454326, 22173980, 25429959, 21080143, 18886413, 17890099, 19143550
     19284031, 19176223, 21072646, 20899461, 25093739, 21623164, 19902195
     20558005, 22168163, 25427662, 22223463, 19883092, 21373076, 17551063
     19304354, 20464614, 18899974, 22083366, 19439759, 20938170, 18973548
     19593445, 21294938, 21744290, 21196809, 22855193, 20424183, 19915271
     25655390, 20868862, 20862087, 20859910, 22465352, 20591183, 20844426
     25600342, 21132297, 21354456, 19329654, 21387128, 19308965, 21476308
     25475853, 19197175, 23492665, 16870214, 19371175, 20093776, 18952989
     19243521, 19285025, 19155797, 19189317, 19450314, 20898391, 20878790
     22507210, 22024071, 17835294, 20869721, 19699191, 20328248, 20879889
     20951038, 22353199, 22148226, 20890311, 21780146, 21322887, 18743542
     22950945, 19475971, 18964978, 18288842, 24690216, 19561643, 20919320
     24573817, 21517440, 20437153, 18191823, 20734332, 20842388, 23315889
     20562898, 19022470, 19865345, 23548817, 19879746, 21281532, 18866977
     19067244, 19289642, 19157754, 20977794, 22507234, 20397490, 20513399
     21526048, 20627866, 24642295, 23324000, 22520320, 19307662, 20936905
     21421886, 18306996, 19207117, 18988834, 19154375, 24386767, 21273804
     19180770, 20603431, 19547370, 19524384, 25823754, 16359751, 20356733
     20441797, 20134339, 25110233, 23197103, 26575788, 22961508, 19054077
     20171986, 17274537, 20228093, 21977392, 17409174, 21626377, 18948177
     24523374, 19524158, 19035573, 26544823, 25091141, 18354830, 19028800
     24397438, 19430401, 21380789, 19571367, 19684504, 19670108, 21649497
     21625179, 20368850, 21479753, 20235511, 21632821, 21532755, 19501299
     18966843, 19723336, 20466628, 26444887, 22062026, 16887946, 22077517
     22496904, 19012119, 20569094, 21847223, 22657942, 25056052, 18510194
     20432873, 21915719, 20124446, 25034396, 22087683, 18974476, 19461270
     20880215, 21960504, 24341675, 17319928, 25489607, 19440586, 19001359
     26198926, 19676905, 20746251, 25547060, 22519146, 21266085, 19490948
     21575362, 20387265, 25602488, 24308635, 20596234, 19978542, 21542577
     17867700, 16863642, 21291274, 19016730, 18856999, 19604659, 19791377
     19662635, 19201867, 24808595, 19081128, 21300341, 21795111, 20588502
     20048359, 18940497, 18921743, 21225209, 21260431, 21863727, 20017509
     23240358, 20907061, 19354335, 19258504, 18791688, 18090142, 20936731
     19050649, 20825533, 20603378, 17655240, 22294260, 19058490, 21665897
     25330273, 20101006, 22175564, 23089357, 18043064, 19791273, 22624709
     21142837, 19520602, 19597439, 18893947, 24908321, 21785691, 19769480
     20322560, 18799063, 22762046, 19001390, 23229229, 18845653, 19703301
     19404068, 21184223, 16439813, 20860659, 22165897, 24674955, 25654936
     19124336, 21241829, 21422580, 19272708, 20828947, 20466322, 16619249
     22022760, 19149990, 20882568, 24739928, 19333670, 25643931, 22178855
     22374754, 19124589, 22243719, 19174942, 19326908, 20835241, 19390567
     23314180, 22806698, 20474192, 25612095, 20267166, 22897344, 22862134
     20413820, 24825843, 23108128, 20217801, 19309466, 20181030, 18110491
     19597583, 24411921, 19989009, 20471920, 17414008, 20173897, 18705806
     19048007, 20704450, 22092979, 19280225, 22707244, 20703000, 20922010
     21239530, 21644640, 20401975, 24835538, 21297872, 19706965, 19562381
     21099555, 22296366, 18549238, 20294666, 21263635, 23125826, 23003979
     19303936, 19195895, 20848335, 20708701, 21442094, 20402832, 24693382
     16777441, 19619732, 17008068, 22075064, 19134173, 20281121, 23220453
     24662775, 18122373, 19366375, 18254023, 19873610, 19587324, 23170620
     17210525, 19382851, 20528052, 22809871, 23096938, 22916353, 22816287
     20671094, 22865673, 20446883, 20009833, 20794034, 19013183, 21668627
     19468991, 26546754, 20031873, 22068305, 19577410, 16756406, 19291380
     19487147, 21164318, 20043616, 19841800, 19213447, 26088426, 19185876
     20925795, 19141838, 19383839, 21620471, 20476175, 19649152, 18307021
     25947799, 19409212, 19627012, 19835133, 19869255, 21097043, 22351572
     19279273, 14643995, 25982666, 18990693, 18681056, 19990037, 19183343
     19434529, 18740837, 21917884, 25539063, 22359063, 20798891, 20347562
     19591608, 18909599, 20348653, 24812585, 19639483, 19637186, 22458049
     20076781, 23124895, 21188532, 20897759, 22695831, 16941434, 19928926
     25897615, 21285458, 25459958, 24652769, 19248799, 19335438, 21059919
     19174521, 22905130, 25483815, 21629064, 23084507, 19730508, 20618595
     19188927, 20598042, 21889720, 18417036, 20424899, 26546664, 25766822
     22046677, 23035249, 22179537, 24421668, 25546608, 19358317, 6599380
     19689979, 24413809, 19393542, 25490238, 20904530, 20803014, 20212067
     21514877, 20172151

Patch  26027162     : applied on Thu Jul 20 01:35:38 EDT 2017
Unique Patch ID:  21329074
Patch description:  "Database PSU 12.1.0.2.170718, Oracle JavaVM Component (JUL2017)"
   Created on 5 Jun 2017, 13:19:44 hrs PST8PDT
   Bugs fixed:
     26027162, 26023002, 26023025, 25437695, 25494413, 25494379, 24917972
     25067795, 24534298, 25076732, 25076756, 24315824, 21659726, 24448240
     24448282, 23177536, 22675136, 23265914, 23265965, 23727148, 22674709
     22670413, 22670385, 21188537, 22139226, 22118835, 22118851, 21555660
     21811517, 19623450, 21566993, 21566944, 19176885, 21068507, 21047803
     21047766, 20415564, 20408829, 20408866, 19877336, 19855285, 19909862
     19895362, 19895326, 19153980, 19231857, 19223010, 19245191, 19699946



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

OPatch succeeded.
AIX db7:db7:oracle
/app/oracle/product/12.1.0/OPatch
   $sqlplus / as sysdba

SQL*Plus: Release 12.1.0.2.0 Production on Thu Oct 26 22:57:54 2017

Copyright (c) 1982, 2014, Oracle.  All rights reserved.


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

SQL> select name,open_mode from v$database;

NAME      OPEN_MODE
--------- --------------------
db7   READ WRITE

SQL> shut immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup
ORACLE instance started.

Total System Global Area 1627389952 bytes
Fixed Size                  2998544 bytes
Variable Size            1442844400 bytes
Database Buffers          167772160 bytes
Redo Buffers               13774848 bytes
Database mounted.
Database opened.


SQL> select * from V$recover_file;

no rows selected
star the listener


Thursday, November 2, 2017

script to list privilege belongs to table in oracle database

script to list privilege belongs  to table in oracle database

set lines 400
set pages 0

select coalesce (b.grantee,a.GRANTEE) GRANTEE, table_name, privilege
from dba_tab_privs a
left join dba_role_privs b on a.grantee = b.GRANTED_ROLE
where table_name in (select table_name from dba_tables where  owner not in ('SYSTEM','SYS','TSMSYS','WMSYS','OUTLN','DBSNMP'));

step by step to change the global privilege on Netezza database

step by step to change the global privilege of user  on Netezza database.

SYSTEM(ADMIN)=> \dpu NZ_user1
                                     User object permissions for user 'NZ_user1'
 Database Name | Object Name | L S I U D T L A D B L G O E C R X A | D G U T E X Q Y V M I B R C S H F A L P N S
---------------+-------------+-------------------------------------+---------------------------------------------
 NZ_DB1        | GLOBAL      |                                     |       X
 GLOBAL       | NZ_DB1       | X   X X X                    |
 GLOBAL       | NZ_DB2       | X                                  |
(3 rows)
Object Privileges
    (L)ist (S)elect (I)nsert (U)pdate (D)elete (T)runcate (L)ock
    (A)lter (D)rop a(B)ort (L)oad (G)enstats Gr(O)om (E)xecute
    Label-A(C)cess Label-(R)estrict Label-E(X)pand Execute-(A)s
Administration Privilege
    (D)atabase (G)roup (U)ser (T)able T(E)mp E(X)ternal Se(Q)uence
    S(Y)nonym (V)iew (M)aterialized View (I)ndex (B)ackup (R)estore
    va(C)uum (S)ystem (H)ardware (F)unction (A)ggregate (L)ibrary
    (P)rocedure U(N)fence (S)ecurity


    (P)rocedure U(N)fence (S)ecurity

NZ_DB2(ADMIN)=> alter group  GROUP_READONLY  add user  NZ_user1;
ALTER GROUP


Solution:
just need  you need to remove the respective global privilege from user and global name on the database will away.

scrip to list user groups in Netezza

SYSTEM(ADMIN)=> \dU USER1 (d Ucaptial U)

List of Groups a User is a member
 USERNAME |    GROUPNAME
----------+------------------
 USER1 | GROUP_EXTERNALUSER
 USER1 | GROUP_READONLY
 USER1 | PUBLIC
(3 rows)

Monday, October 23, 2017

How to change the distribution of the table in Netezza database


Here is the step by step to change the distribution of  table

1.create new table with random
2.rename the original  table to new name
3.rename the new table to old name
4.drop the  renamed original table or keep it.

create table NZ_DB1.nz_db1_TABLE_interim_oct4 as select * from NZ_DB1.nz_db1_TABLE DISTRIBUTE ON  random ;

alter table NZ_DB1.nz_db1_TABLE rename to  NZ_DB1.nz_db1_TABLE_orig_4oct17_bk;


alter table NZ_DB1.nz_db1_TABLE_interim_oct4 rename  to  NZ_DB1.nz_db1_TABLE;

drop table  NZ_DB1.nz_db1_TABLE_orig_4oct17_bk;



unable to add data file to golden gate table space

issue:
we could not add  data file to golden gate table space because of golden gate DDL and below is the fix.

ERROR at line 1:
ORA-00604: error occurred at recursive SQL level 1
ORA-01653: unable to extend table GGADM.GGS_MARKER by 8192 in tablespace GG_TABLESPCE
ORA-06512: at line 1314
ORA-01653: unable to extend table GGADM.GGS_MARKER by 8192 in tablespace GG_TABLESPCE





ORA-01653: unable to extend table GGADM.GGS_MARKER by 8192 in tablespace GG_TABLESPCE

Owner=GGADM
Object_Name=GGS_MARKER
Tablespace= GG_TABLESPCE



1* select owner, TRIGGER_NAME, TRIGGER_TYPE, TABLE_OWNER, TRIGGERING_EVENT, TABLE_NAME from dba_triggers where owner='GGADM'
sdmdd> /

OWNER TRIGGER_NAME TRIGGER_TYPE TABLE_OWNER TRIGGERING_EVENT TABLE_NAME
------------------------------ ------------------------------ ---------------- ------------------------------ ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ------------------------------
GGADM GGS_HEARTBEAT_TRIG BEFORE EACH ROW GGADM INSERT OR UPDATE GGS_HEARTBEAT
GGADM GGS_HEARTBEAT_TRIG_HIST BEFORE EACH ROW GGADM INSERT OR UPDATE GGS_HEARTBEAT_HISTORY


Solution:


This is a script which need to be run at the database end these scripts are present in the goldengate home

ddl_disable.sql

Add the datafile to the tablespace

ddl_enable.sql

Sunday, October 22, 2017

step by step golden gate setup for table level replication


step by step golden gate setup for table level replication

The following procedure describes a minimal Oracle Golden Gate configuration. It is intended for research and/or training purposes and is not intended to be a production configuration. Once the basic configuration has been tested, new features can be added incrementally simplifying any troubleshooting.



In the following configuration I have used the following hosts and databases:

Source Target
Hostname SOURCE TARGET
Database Name SOURCE target
Prepare Databases

Enable Forced Logging

Forced logging should be enabled on the source database to ensure that all changes are written to the redo logs. DBCA does not enable force logging during database creation.

To check if FORCE_LOGGING is enabled in the source database use:

[oracle@SOURCE]$ sqlplus / as sysdba
SQL> SELECT force_logging FROM v$database;

FORCE_LOGGING
-------------
NO
If not enabled, then enable FORCE_LOGGING using:

[oracle@SOURCE]$ sqlplus / as sysdba
SQL> ALTER DATABASE FORCE LOGGING;

Database altered.
Verify that FORCE_LOGGING has been enabled successfully using:

[oracle@SOURCE]$ sqlplus / as sysdba
SQL> SELECT force_logging FROM v$database;

FORCE_LOGGING
-------------
YES
The documentation recommends performing a redo log switch to ensure that the change is applied in all subsequent redo.

[oracle@SOURCE]$ sqlplus / as sysdba
SQL> ALTER SYSTEM SWITCH LOGFILE;

System altered.
Enable Minimal Supplemental Logging

If minimal supplemental logging is not enabled, the extract process fails to start. DBCA does not enable minimal supplemental during database creation.

Minimal supplemental logging only needs to be configured on the source database. It may be prudent to enable it on the target database as well.

Check if minimal supplemental logging is currently enabled:

[oracle@SOURCE]$ sqlplus / as sysdba
SQL> SELECT supplemental_log_data_min FROM v$database;

SUPPLEMENTAL_LOG_DATA_MIN
-------------------------
NO
If not enabled then configure minimal supplemental logging:

[oracle@SOURCE]$ sqlplus / as sysdba
SQL> ALTER DATABASE ADD SUPPLEMENTAL LOG DATA;

Database altered.
Verify that minimal supplemental logging is now enabled:

[oracle@SOURCE]$ sqlplus / as sysdba
SQL> SELECT supplemental_log_data_min FROM v$database;

SUPPLEMENTAL_LOG_DATA_MIN
-------------------------
YES
Switch the log file again to ensure that all subsequent redo contains minimal supplemental logging:

[oracle@SOURCE]$ sqlplus / as sysdba
SQL> ALTER SYSTEM SWITCH LOGFILE;

System altered.
Prepare Test Environment

Create Test User

In order to test the GoldenGate configuration I created a new schema (sender) containing a new table (T1) as follows. The table is derived from DBA_OBJECTS.

In both databases create a user (schema) called sender. For example:

[oracle@SOURCE]$ sqlplus / as sysdba
SQL> CREATE USER sender IDENTIFIED BY sender;

User created.
In both databases grant the following permissions to the new user. For example:

[oracle@SOURCE]$ sqlplus / as sysdba
SQL> GRANT CONNECT,RESOURCE,DBA TO sender;

Grant succeeded.
As these are test databases, security is not an issue and therefore DBA privilege has been granted to the new user.

Create Test Table

In the source database (SOURCE) create the T1 table using a subset of rows from DBA_OBJECTS

[oracle@SOURCE]$ sqlplus sender/sender
SQL> CREATE TABLE t1 AS
SELECT object_id,owner,object_name,object_type
FROM dba_objects
WHERE object_id <= 10000;

Table created.
In the source database (SOURCE), add a primary key constraint and index to table T1:

[oracle@SOURCE]$ sqlplus sender/sender
SQL> ALTER TABLE t1 ADD CONSTRAINT t1_i1 PRIMARY KEY (object_id);

Table altered.
Start Listener Processes

Before attempting to configure the network, ensure that the listener processes are running on both servers.

[oracle@SOURCE]$ lsnrctl start

[oracle@TARGET]$ lsnrctl start
Configure Network

For this basic configuration, an entry is required in the TNSNAMES.ORA file on each server describing the database on the other server.

On the source database (SOURCE) I added the following entry for the target database to $ORACLE_HOME/network/admin/tnsnames.ora

target =
  (DESCRIPTION=
  (ADDRESS=(PROTOCOL=TCP)(HOST=TARGET)(PORT=1521))
  (CONNECT_DATA=
    (SERVER=DEDICATED)
    (SERVICE_NAME=target)
  )
)
Verify the connection using SQL*Plus. For example:

[oracle@SOURCE]$ sqlplus sender/sender@target
SQL> SELECT name FROM v$database;

NAME
---------
target
On the target database (TARGET), I added the following entry for the SOURCE database to $ORACLE_HOME/network/admin/tnsnames.ora

SOURCE =
(DESCRIPTION=
(ADDRESS=(PROTOCOL=TCP)(HOST=SOURCE)(PORT=1521))
  (CONNECT_DATA=
    (SERVER=DEDICATED)
    (SERVICE_NAME=SOURCE)
  )
)
Verify the connection using SQL*Plus. For example:

[oracle@TARGET]$ sqlplus sender/sender@SOURCE
SQL> SELECT name FROM v$database;

NAME
---------
SOURCE
Create Database Links

On each server create a database link to the other database. This is only required to set up the test data. It is not required for GoldenGate.

On the source server (SOURCE) as the sender user, create the following database link:

[oracle@SOURCE]$ sqlplus sender/sender
SQL> CREATE DATABASE LINK target

CONNECT TO sender IDENTIFIED BY sender USING 'target';
On the target server (TARGET) as the sender user, create the following database link:

[oracle@TARGET]$ sqlplus sender/sender
SQL> CREATE DATABASE LINK SOURCE

CONNECT TO sender IDENTIFIED BY sender USING 'SOURCE';
Copy Test Data to Target Database

Create an initial copy of the test data on the target database

In the target database (target) create a copy of the T1 table using the SQL*Plus command:

[oracle@TARGET]$ sqlplus sender/sender
SQL> CREATE TABLE t1 AS SELECT * FROM t1@SOURCE;
In the target database (target), add a primary key constraint and index to table T1:

[oracle@TARGET]$ sqlplus sender/sender
SQL> ALTER TABLE t1 ADD CONSTRAINT t1_i1 PRIMARY KEY (object_id);
In the source database (SOURCE), verify the number of rows in the original table:

[oracle@SOURCE]$ sqlplus sender/sender
SQL> SELECT COUNT(*) FROM t1;

COUNT(*)
--------
9830
In the target database, verify that there is the same number of rows in the new table:

[oracle@TARGET]$ sqlplus receiver/receiver
SQL> SELECT COUNT(*) FROM t1;

COUNT(*)
--------
9830
Note that the actual number of rows in table T1 should be identical for databases SOURCE and target. However, it may vary in other databases

Configure GoldenGate

Download and Install GoldenGate software

The GoldenGate software can be downloaded from downloads.oracle.com or alternatively from the Oracle E-Delivery website. The software should be installed on both servers.

The 11.2.1.0.1 file for Linux x86-64 is ogg112101_fbo_ggs_Linux_x64_ora11g_64bit.zip

The zip file is around 90MB in size.

On each server, create a new directory for the GoldenGate software:

[oracle@SOURCE]$ mkdir /home/oracle/goldengate
Copy the download file to the new directory and unzip using:

[oracle@SOURCE]$ unzip ogg112101_fbo_ggs_Linux_x64_ora11g_64bit.zip
Archive: ogg112101_fbo_ggs_Linux_x64_ora11g_64bit.zip
inflating: fbo_ggs_Linux_x64_ora11g_64bit.tar
inflating: OGG_WinUnix_Rel_Notes_11.2.1.0.1.pdf
inflating: Oracle GoldenGate 11.2.1.0.1 README.txt
inflating: Oracle GoldenGate 11.2.1.0.1 README.doc
The tar archive is around 230MB in size.

Extract the files from the tar archive using:

[oracle@SOURCE]$ tar xfv fbo_ggs_Linux_x64_ora11g_64bit.tar
Configure Environment Variables

The /home/oracle/.bash_profile should already contain the following environment variables.

export ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1
export PATH=$ORACLE_HOME/bin:$PATH
On the source server add the following entries to /home/oracle/.bash_profile

export ORACLE_SID=SOURCE
export PATH=/home/oracle/goldengate:$PATH
export LD_LIBRARY_PATH=/home/oracle/goldengate:$ORACLE_HOME/lib
Ensure the environment variables are set using:

[oracle@SOURCE]$ source /home/oracle/.bash_profile
On the target server add the following entries to /home/oracle/.profile

export ORACLE_SID=target
export PATH=/home/oracle/goldengate:$PATH
export LD_LIBRARY_PATH=/home/oracle/goldengate:$ORACLE_HOME/lib
Ensure the environment variables are set using:

[oracle@TARGET]$ source /home/oracle/.bash_profile
Create GoldenGate Subdirectories

On each server create subdirectories for GoldenGate using the CREATE SUBDIRS command. For example:

[oracle@SOURCE]$ ggsci
GGSCI (SOURCE) 1> CREATE SUBDIRS
Creating subdirectories under current directory /home/oracle/goldengate

Parameter files /home/oracle/goldengate/dirprm: already exists
Report files /home/oracle/goldengate/dirrpt: created
Checkpoint files /home/oracle/goldengate/dirchk: created
Process status files /home/oracle/goldengate/dirpcs: created
SQL script files /home/oracle/goldengate/dirsql: created
Database definitions files /home/oracle/goldengate/dirdef: created
Extract data files /media/sf_racattack12c/gg/target/targettrail: created
Temporary files /home/oracle/goldengate/dirtmp: created
Stdout files /home/oracle/goldengate/dirout: created
Create the GoldenGate Schema Owner

A new user should be created to own the GoldenGate database objects.

On each server create the GoldenGate schema owner. For example:

[oracle@SOURCE]$ sqlplus / as sysdba
SQL> CREATE USER ggusr IDENTIFIED BY ggusr;

User created.
On each server grant DBA role to the GoldenGate schema owner

[oracle@SOURCE]$ sqlplus / as sysdba
SQL> GRANT CONNECT, RESOURCE, DBA TO ggusr;

Grant succeeded.
On each server set the GGSCHEMA in the global parameter file.

[oracle@SOURCE]$ ggsci
GGSCI (SOURCE) 1> EDIT PARAMS ./GLOBALS
In this example the parameters file is /home/oracle/goldengate/GLOBALS

Add the following entry:

GGSCHEMA ggusr
Save and close the file

Create GoldenGate Tablespace

On the source server create a new tablespace for the GoldenGate objects. Ensure that AUTOEXTEND is enabled.

[oracle@SOURCE]$ sqlplus / as sysdba
SQL> CREATE TABLESPACE goldengate
DATAFILE '/media/sf_racattack12c/gg/target/goldengate01.dbf' SIZE 100M AUTOEXTEND ON; target


CREATE TABLESPACE goldengate
DATAFILE '/media/sf_12cR1/gg/source/goldengate01.dbf' SIZE 100M AUTOEXTEND ON;  source
Tablespace created.
Set the new tablespace as the default for the GoldenGate user:

[oracle@SOURCE]$ sqlplus / as sysdba
SQL> ALTER USER ggusr DEFAULT TABLESPACE goldengate;

User altered.
On the target server create a new tablespace for the GoldenGate objects. Again ensure that AUTOEXTEND is enabled.

[oracle@TARGET]$ sqlplus / as sysdba
SQL> CREATE TABLESPACE goldengate
DATAFILE '/u01/app/oradata/target/goldengate01.dbf'
SIZE 100M
AUTOEXTEND ON;

Tablespace created.
Set the new tablespace as the default for the GoldenGate user:

[oracle@TARGET]$ sqlplus / as sysdba
SQL> ALTER USER ggusr DEFAULT TABLESPACE goldengate;

User altered.
Run Role Setup script

On the source server run the Role setup script. Specify the GoldenGate schema name when prompted.

[oracle@SOURCE]$ sqlplus / as sysdba
SQL> @role_setup

GGS Role setup script

This script will drop and recreate the role GGS_GGSUSER_ROLE
To use a different role name, quit this script and then edit the params.sql script to change the gg_role parameter to the preferred name. (Do not run the script.)
You will be prompted for the name of a schema for the GoldenGate database objects.
NOTE: The schema must be created prior to running this script.
NOTE: Stop all DDL replication before starting this installation.
Enter GoldenGate schema name:ggusr

Wrote file role_setup_set.txt

PL/SQL procedure successfully completed.

Role setup script complete

Grant this role to each user assigned to the Extract, GGSCI, and Manager processes, by using the following SQL command:
GRANT GGS_GGSUSER_ROLE TO
where is the user assigned to the GoldenGate processes.
On the source server grant GGS_GGSUSER_ROLE to the GoldenGate user:

[oracle@SOURCE]$ sqlplus / as sysdba
SQL> GRANT GGS_GGSUSER_ROLE TO ggusr;

Grant succeeded.
Configure Manager Parameters

On both servers configure the MGR parameters:

[oracle@SOURCE]$ ggsci
GGSCI (SOURCE) 1> EDIT PARAMS MGR
The above command created the file /home/oracle/goldengate/dirprm/mgr.prm

Add the following parameters to the parameter file:

PORT 7809
DYNAMICPORTLIST 7810-7820
Save and close the parameter file

Configure Extract Parameters

In this example the extract process will be called "ex1"

On the source server, create the parameter file for Extract ex1:

[oracle@SOURCE]$ ggsci
GGSCI (SOURCE) 1> EDIT PARAMS ex1
The above command created the file /home/oracle/goldengate/dirprm/ex1.prm

Add the following parameters to the new file:

EXTRACT ex1
USERID ggusr, PASSWORD ggusr
EXTTRAIL /media/sf_12cR1/gg/source/extrail/ex
TABLE sender.t1;
Configure Data Pump Parameters

In this example the Data Pump process will be called dp1

On the source server create the parameter file for Data Pump process dp1:

[oracle@SOURCE]$ ggsci
GGSCI (SOURCE) 1> EDIT PARAMS dp1
The above command created the file /home/oracle/goldengate/dirprm/dp1.prm

Add the following parameters to the new file:

EXTRACT dp1
USERID ggusr, PASSWORD ggusr
RMTHOST 192.168.78.52, MGRPORT 7809
RMTTRAIL /media/sf_racattack12c/gg/target/targettrail/rt
TABLE sender.t1;
Save and close the parameter file

Create Check Point Table

The check point table should be created in the target database.

On the target server login as the ggusr user and add the check point table:

[oracle@TARGET]$ ggsci
GGSCI (TARGET) 1> DBLOGIN USERID ggusr, PASSWORD ggusr

Successfully logged into database.

GGSCI (TARGET) 2> ADD CHECKPOINTTABLE ggusr.checkpointtable

Successfully created checkpoint table ggusr.checkpointtable.
The name of the check point table must be added to the GLOBALS file on the target server.

On the target server edit the GLOBALS file

[oracle@TARGET]$ ggsci
GGSCI (TARGET) 1> EDIT PARAMS ./GLOBALS
Add the CHECKPOINTTABLE parameter to the existing file. For example:

GGSCHEMA ggusr
CHECKPOINTTABLE ggusr.checkpointtable
Save and close the GLOBALS parameter file.

Configure Replication Parameters

On the target server create the parameter file for replication process rep1:

[oracle@TARGET]$ ggsci
GGSCI (TARGET) 1> EDIT PARAMS rep1
The above command created the file /home/oracle/goldengate/dirprm/rep1.prm

Add the following parameters to the new file:

REPLICAT rep1
USERID ggusr, PASSWORD ggusr
ASSUMETARGETDEFS
DISCARDFILE /media/sf_racattack12c/gg/target/discardfile, PURGE
MAP sender.t1, TARGET receiver.t1;
Note that the DISCARDFILE parameter includes the PURGE keyword. If PURGE is not specified them the replication process will fail the second time it is started. Alternatively use the APPEND keyword to append output to the existing file.

Configure Supplemental Logging for Replicated Tables

On the source server configure supplemental logging for all tables that will be replicated. In this example there is only one table (T1)

Supplemental logging can be configured by any user that has privileges to modify the underlying database table.

[oracle@SOURCE]$ ggsci
GGSCI (SOURCE) 1> DBLOGIN USERID sender, PASSWORD sender
Successfully logged into database.

GGSCI (SOURCE) 2> ADD TRANDATA t1
Logging of supplemental redo data enabled for table sender.T1.
Add the Extract Process

On the source server add the Extract process (ex1)

[oracle@SOURCE]$ ggsci
GGSCI (SOURCE) 1> ADD EXTRACT ex1, TRANLOG, BEGIN NOW

EXTRACT added.
Add the Extract Trail

On the source server add the Extract trail (/media/sf_12cR1/gg/source/extrail)

[oracle@SOURCE]$ ggsci
GGSCI (SOURCE) 1> ADD EXTTRAIL /media/sf_12cR1/gg/source/extrail/ex, EXTRACT ex1

EXTTRAIL added.
Add the Data Pump Process

On the source server add the Data Pump process (dp1)

[oracle@SOURCE]$ ggsci
GGSCI (SOURCE) 1> ADD EXTRACT dp1 EXTTRAILSOURCE /media/sf_12cR1/gg/source/extrail/ex

EXTRACT added.
Add the Data Pump Trail

On the source server add the Data Pump trail (/home/oracle/gg/dirdat/rt). This trail is created on the target server. However, the name is required in order to set up the Data Pump process on the source server.

[oracle@SOURCE]$ ggsci
GGSCI (SOURCE) 1> ADD RMTTRAIL /media/sf_racattack12c/gg/target/targettrail/rt, EXTRACT dp1

RMTTRAIL added.
Add the Replication Process

On the target server add the Replication process (rep1)

[oracle@TARGET]$ ggsci
GGSCI (TARGET) 1> ADD REPLICAT rep1, EXTTRAIL /media/sf_racattack12c/gg/target/targettrail/rt

REPLICAT added.
Start GoldenGate

Start Manager

On the source server, start the GoldenGate manager:

[oracle@SOURCE]$ ggsci
GGSCI (SOURCE) 1> START MANAGER

Manager started.
On the target server, start the GoldenGate manager:

[oracle@TARGET]$ ggsci
GGSCI (TARGET) 1> START MANAGER

Manager started.
Start Extract Process

On the source server start the Extract (ex1)

[oracle@SOURCE]$ ggsci
GGSCI (SOURCE) 1> START EXTRACT ex1

Sending START request to MANAGER ...

EXTRACT EX1 starting

Verify that the Extract has started successfully using INFO EXTRACT:

[oracle@SOURCE]$ ggsci
GGSCI (SOURCE) 10> INFO EXTRACT ex1
EXTRACT EX1 Last Started 2013-02-27 12:57 Status RUNNING
Checkpoint Lag 00:00:24 (updated 00:00:05 ago)
Log Read Checkpoint Oracle Redo Logs
2013-02-27 12:57:01 Seqno 6, RBA 30736
SCN 0.0 (0)
The status should be RUNNING.

Start Data Pump Process

On the source server, start the Data Pump (dp1):

[oracle@SOURCE]$ ggsci
GGSCI (SOURCE.com) 3> START EXTRACT dp1

Sending START request to MANAGER ...

EXTRACT DP1 starting
Verify that the Data Pump has started successfully using INFO EXTRACT:

[oracle@SOURCE]$ ggsci
GGSCI (SOURCE.com) 2> INFO EXTRACT dp1
EXTRACT DP1 Last Started 2013-02-27 11:57 Status RUNNING
Checkpoint Lag 00:00:00 (updated 00:00:00 ago)
Log Read Checkpoint File /home/oracle/gg/dirdat/ex000000
First Record RBA 0
The status should be RUNNING.

Start Replication Process

On the target server, start the Replicat process (rep1):

[oracle@TARGET]$ ggsci
GGSCI (TARGET) 1> START REPLICAT rep1
Sending START request to MANAGER ...
REPLICAT REP1 starting
Verify that the Replicat process has started successfully using INFO EXTRACT:

[oracle@TARGET]$ ggsci
GGSCI (TARGET) 2> INFO REPLICAT rep1
REPLICAT REP1 Last Started 2013-02-27 11:58 Status RUNNING
Checkpoint Lag 00:00:00 (updated 00:00:04 ago)
Log Read Checkpoint File /home/oracle/gg/dirdat/rt000000
First Record RBA 0
The status should be RUNNING.

Test Replication

On the source server, check the number of rows in table T1:

[oracle@SOURCE]$ sqlplus sender/sender
SQL> SELECT COUNT(*) FROM t1;

COUNT(*)
----------
9830
On the target server, check the number of rows in table T1:

[oracle@TARGET]$ sqlplus sender/sender
SQL> SELECT COUNT(*) FROM t1;

COUNT(*)
----------
9830
On the source server, add some rows to table T1. For example:

[oracle@SOURCE]$ sqlplus sender/sender
SQL> INSERT INTO t1 (object_id,owner,object_name,object_type)
SELECT object_id,owner,object_name,object_type
FROM dba_objects
WHERE object_id BETWEEN 10001 AND 11000;

1000 rows created

SQL> COMMIT;

Commit complete
On the source server check the number of rows in table T1:

[oracle@SOURCE]$ sqlplus sender/sender
SQL> SELECT COUNT(*) FROM t1;

COUNT(*)
----------
10830
On the target server check the number of rows in table T1:

[oracle@TARGET]$ sqlplus sender/sender
SQL> SELECT COUNT(*) FROM t1;

COUNT(*)
----------
10830
The number of rows should be identical in both tables

This completes the basic configuration.


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

TESTING
------
alter replicat rep1 begin now

INSERT INTO t1 (object_id,owner,object_name,object_type)
SELECT object_id,owner,object_name,object_type
FROM dba_objects
WHERE object_id <= 10000;

 INSERT INTO t2 (object_id,object_name,object_type)
SELECT object_id,object_name,object_type
FROM dba_objects
WHERE object_id BETWEEN 12000 AND 13000;

adding new extract and replicat to existing table in golden gate

we wanted to add new extract   & replicat for existing  table on both source and target and both  has records and it has same table structure.

When we add replicate need to add the NODBcheckpoint or will pull the record from previous trail.

Here is the step by step table level replication procedure.


SENDER>create table t3 as select * from t2;

Table created.

SENDER>select count(*) from t3;

  COUNT(*)
----------
        10
RECEIVER>select count(*) from t3;

  COUNT(*)
----------
        10




[oracle@SOURCE]$ ggsci
GGSCI (SOURCE) 1> EDIT PARAMS ex3
The above command created the file /home/oracle/goldengate/dirprm/ex3.prm

Add the following parameters to the new file:

EXTRACT ex3
USERID ggusr, PASSWORD ggusr
EXTTRAIL /media/sf_12cR1/gg/source/extrail/ex
TABLE sender.t3;
Configure Data Pump Parameters

In this example the Data Pump process will be called dp3

On the source server create the parameter file for Data Pump process dp3:

[oracle@SOURCE]$ ggsci
GGSCI (SOURCE) 1> EDIT PARAMS dp3
The above command created the file /home/oracle/goldengate/dirprm/dp3.prm

Add the following parameters to the new file:

EXTRACT dp3
USERID ggusr, PASSWORD ggusr
RMTHOST 192.168.78.52, MGRPORT 7809
RMTTRAIL /gg/target/targettrail/rt
TABLE sender.t3;
Save and close the parameter file

Create Check Point Table

The check point table should be created in the target database.

On the target server login as the ggusr user and add the check point table:

[oracle@TARGET]$ ggsci
GGSCI (TARGET) 1> DBLOGIN USERID ggusr, PASSWORD ggusr

Successfully logged into database.

GGSCI (TARGET) 2> ADD CHECKPOINTTABLE ggusr.checkpointtable

Successfully created checkpoint table ggusr.checkpointtable.
The name of the check point table must be added to the GLOBALS file on the target server.

On the target server edit the GLOBALS file

[oracle@TARGET]$ ggsci
GGSCI (TARGET) 1> EDIT PARAMS ./GLOBALS
Add the CHECKPOINTTABLE parameter to the existing file. For example:

GGSCHEMA ggusr
CHECKPOINTTABLE ggusr.checkpointtable
Save and close the GLOBALS parameter file.

Configure Replication Parameters

On the target server create the parameter file for replication process rep3:

[oracle@TARGET]$ ggsci
GGSCI (TARGET) 1> EDIT PARAMS rep3
The above command created the file /home/oracle/goldengate/dirprm/rep3.prm

Add the following parameters to the new file:

REPLICAT rep3
USERID ggusr, PASSWORD ggusr
ASSUMETARGETDEFS
DISCARDFILE /media/sf_racattack12c/gg/target/discardfile, PURGE
MAP sender.t3, TARGET receiver.t3;
Note that the DISCARDFILE parameter includes the PURGE keyword. If PURGE is not specified them the replication process will fail the second time it is started. Alternatively use the APPEND keyword to append output to the existing file.

Configure Supplemental Logging for Replicated Tables

On the source server configure supplemental logging for all tables that will be replicated. In this example there is only one table (t3)

Supplemental logging can be configured by any user that has privileges to modify the underlying database table.

[oracle@SOURCE]$ ggsci
GGSCI (SOURCE) 1> DBLOGIN USERID sender, PASSWORD sender
Successfully logged into database.

GGSCI (SOURCE) 2> ADD TRANDATA t3
Logging of supplemental redo data enabled for table sender.t3.
Add the Extract Process

GGSCI (collabn1.racattack) 5> ADD TRANDATA t3

2017-10-14 19:26:42  WARNING OGG-06439  No unique key is defined for table t3. All viable columns will be used to represent the key, but may not guarantee uniqueness. KEYCOLS may be used to define the key.

Logging of supplemental redo data enabled for table SENDER.t3.
TRANDATA for scheduling columns has been added on table 'SENDER.t3'.
GGSCI (collabn1.racattack) 6> delete trandata t3

Logging of supplemental redo log data disabled for table SENDER.t3.
TRANDATA for scheduling columns has been disabled on table 'SENDER.t3'.


ALTER TABLE t3 ADD CONSTRAINT t3_ix1 PRIMARY KEY (object_id);

GGSCI (collabn1.racattack) 7> ADD TRANDATA t3

Logging of supplemental redo data enabled for table SENDER.t3.
TRANDATA for scheduling columns has been added on table 'SENDER.t3'.


On the source server add the Extract process (ex3)

[oracle@SOURCE]$ ggsci
GGSCI (SOURCE) 1> ADD EXTRACT ex3, TRANLOG, BEGIN NOW

EXTRACT added.
Add the Extract Trail

On the source server add the Extract trail (/media/sf_12cR1/gg/source/extrail)

[oracle@SOURCE]$ ggsci
GGSCI (SOURCE) 1> ADD EXTTRAIL /media/sf_12cR1/gg/source/extrail/ex, EXTRACT ex3

EXTTRAIL added.
Add the Data Pump Process

On the source server add the Data Pump process (dp3)

[oracle@SOURCE]$ ggsci
GGSCI (SOURCE) 1> ADD EXTRACT dp3 EXTTRAILSOURCE /media/sf_12cR1/gg/source/extrail/ex

EXTRACT added.
Add the Data Pump Trail

On the source server add the Data Pump trail (/home/oracle/gg/dirdat/rt). This trail is created on the target server. However, the name is required in order to set up the Data Pump process on the source server.

[oracle@SOURCE]$ ggsci
GGSCI (SOURCE) 1> ADD RMTTRAIL /gg/target/targettrail/rt, EXTRACT dp3

RMTTRAIL added.
Add the Replication Process

On the target server add the Replication process (rep3)

[oracle@TARGET]$ ggsci
GGSCI (TARGET) 1> ADD REPLICAT rep3, EXTTRAIL /gg/target/targettrail/rt

alter  REPLICAT rep3, EXTTRAIL /gg/target/targettrail/rt

GGSCI (collabn2.racattack) 77> edit params rep3



GGSCI (collabn2.racattack) 78> alter  REPLICAT rep3, EXTTRAIL /gg/target/targettrail/rt
ERROR: REPLICAT rep3 is running and cannot be altered (1,11,Resource temporarily unavailable).


GGSCI (collabn2.racattack) 79> stop rep3

Sending STOP request to REPLICAT rep3 ...
Request processed.


GGSCI (collabn2.racattack) 80> alter  REPLICAT rep3, EXTTRAIL /gg/target/targettrail/rt
REPLICAT altered.


GGSCI (collabn2.racattack) 81> info all

Program     Status      Group       Lag at Chkpt  Time Since Chkpt

MANAGER     RUNNING


REPLICAT added.
Start GoldenGate

Start Manager

On the source server, start the GoldenGate manager:

[oracle@SOURCE]$ ggsci
GGSCI (SOURCE) 1> START MANAGER

Manager started.
On the target server, start the GoldenGate manager:

[oracle@TARGET]$ ggsci
GGSCI (TARGET) 1> START MANAGER

Manager started.
Start Extract Process

On the source server start the Extract (ex3)

[oracle@SOURCE]$ ggsci
GGSCI (SOURCE) 1> START EXTRACT ex3

Sending START request to MANAGER ...

EXTRACT ex3 starting


INSERT INTO t3 (object_id,object_name,object_type)
SELECT object_id,object_name,object_type
FROM dba_objects
WHERE object_id BETWEEN 11000 AND 12000;

INSERT INTO t3 (object_id,object_name,object_type,owner)
SELECT object_id,object_name,object_type
FROM dba_objects WHERE object_id < 10000;


INSERT INTO table_name (column1, column2, column3, ...)
VALUES (value1, value2, value3, ...);

INSERT INTO t3 (OBJECT_ID, OBJECT_NAME, OBJECT_TYPE, OWNER)
VALUES (789644, 'bala', 'bala2', 'GG');

WHERE object_id BETWEEN 12000 AND 12100;

alter table t3 add (place VARCHAR2(128));


INSERT INTO t3 (OBJECT_ID, OBJECT_NAME, OBJECT_TYPE, OWNER,place)
VALUES (289644, '2bala', '2bala2', '2GG','2plano');

REPLICAT rep3
USERID ggusr, PASSWORD ggusr
ASSUMETARGETDEFS
DISCARDFILE /gg/target/discardfile112, PURGE
MAP sender.t3, TARGET receiver.t3;
~
~

GGSCI (collabn2.racattack) 2> delete replicat rep3
ERROR: Could not delete DB checkpoint for REPLICAT rep3 (Database login required to delete database checkpoint).


GGSCI (collabn2.racattack) 3> DBLOGIN USERID ggusr, PASSWORD ggusr
Successfully logged into database.

GGSCI (collabn2.racattack) 4> delete replicat rep3
Deleted REPLICAT rep3.

oracle@collabn2 dirprm]$ ls -ltr
total 48
-rwxr-x--- 1 oracle oinstall 103 Sep 24  2013 jagent.prm
-rw-r--r-- 1 oracle oinstall   9 Dec 19  2015 mgr.prm
-rw-r----- 1 oracle oinstall 336 Dec 19  2015 rep_gg2.prm
-rw-r----- 1 oracle oinstall 120 Dec 25  2015 tar_rep.prm
-rw-r----- 1 oracle oinstall 199 Dec 27  2015 dpump2.prm
-rw-r----- 1 oracle oinstall 292 Dec 27  2015 ext3.prm
-rw-r----- 1 oracle oinstall 348 Feb  2  2016 rep_grp2.prm
-rw-r----- 1 oracle oinstall 197 May  4  2016 load2.prm
-rw-r----- 1 oracle oinstall 181 Oct  9 00:47 load3.prm
-rw-r----- 1 oracle oinstall 159 Oct 14 18:17 rep1.prm
-rw-r----- 1 oracle oinstall 140 Oct 14 20:08 rep3.prm_bak_oct14
-rw-r----- 1 oracle oinstall 140 Oct 14 20:08 rep3.prm
[oracle@collabn2 dirprm]$ cd ..


ADD REPLICAT rep3, EXTTRAIL /gg/target/targettrail/rt


GGSCI (collabn2.racattack) 12> alter replicat rep3 begin now
REPLICAT altered.

alter replicat rep3 begin 2017-10-15 00:04:30



INSERT INTO t3 (OBJECT_ID, OBJECT_NAME, OBJECT_TYPE, OWNER,place)
VALUES (896424, '6bala', '6bala2', '6GG','6plano');


INSERT INTO t3 (OBJECT_ID, OBJECT_NAME, OBJECT_TYPE, OWNER,place)
VALUES (108424, '8bala', '8bala2', '8GG','8plano');


Testing
-------

SENDER>SELECT COUNT(*) FROM T3;

  COUNT(*)
----------
        12

RECEIVER>SELECT COUNT(*) FROM T3;

  COUNT(*)
----------

        12