Thursday, 26 April 2018

OPATCHAUTO-72046: No Wallet Option Provided

PROBLEM:

I was applying proactive bundle patch on oracle 12c RAC database. And during execution of opatchauto apply command on rdbms binary, got below error.

$ORACLE_HOME/OPatch/opatchauto apply /softdump/OCTBP2017/26635880 -oh /oracle/app/oracle/product/12.1.0.2/dbhome_1

OPatchauto session is initiated at Wed Nov 8 11:48:21 2017
OPATCHAUTO-72046: No wallet option provided.
OPATCHAUTO-72046: Wallet option is not provided which is required during patching.
OPATCHAUTO-72046: Please provide a wallet option.

SOLUTION:

opatchauto command always needs to be executed by root user. Use of any other user will throw this error.

So login with root and rerun the command.

$ sudo su - root
Oracle Corporation      SunOS 5.11      11.3    March 2017
You have new mail.

-- Go the $ORACLE_HOME/OPatch location . 

root:~# pwd
/root
root:~# cd /oracle/app/oracle/product/12.1.0.2/dbhome_1/OPatch

root:# ./opatchauto apply /softdump/OCTBP2017/26635880 -oh /oracle/app/oracle/product/12.1.0.2/dbhome_1

OPatchauto session is initiated at Wed Nov  8 11:49:09 2017

System initialization log file is /oracle/app/oracle/product/12.1.0.2/dbhome_1/cfgtoollogs/opatchautodb/systemconfig2017-11-08_11-49-13AM.log.

ORA-39166: Object SYS.AUD$ was not found

When trying to backup the SYS.AUD$ table using datapump for my oracle 11g database, this is what i'm getting below

Oradev01:corpqa:/export/corpqa $ expdp directory=EXPDR dumpfile=SYS_AUD_table.dmp logfile=exp_SYS_AUD_table.log tables=AUD$ exclude=statistics

Export: Release 11.2.0.3.0 - Production on Fri Jan 6 15:31:15 2017

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

Username: / as sysdba

Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
Starting "SYS"."SYS_EXPORT_TABLE_01":  /******** AS SYSDBA directory=EXPDR dumpfile=SYS_AUD_table.dmp logfile=exp_SYS_AUD_table.log tables=AUD$ exclude=statistics
Estimate in progress using BLOCKS method...
Total estimation using BLOCKS method: 0 KB
ORA-39166: Object SYS.AUD$ was not found.
ORA-31655: no data or metadata objects selected for job
Job "SYS"."SYS_EXPORT_TABLE_01" completed with 2 error(s) at 15:31:18

Cause:

According to Oracle there is a restriction on dataPump export. It cannot export schemas like SYS, ORDSYS, EXFSYS, MDSYS, DMSYS, CTXSYS, ORDPLUGINS, LBACSYS, XDB, SI_INFORMTN_SCHEMA, DIP, DBSNMP and WMSYS in any mode.


Solution:

Export the table SYS.AUD$ using the traditional export:

Oradev01: corpqa:/export/corpqa $ exp file=SYS_AUD_table.dmp log=exp_SYS_AUD_table.log tables=AUD$ statistics=none

Export: Release 11.2.0.3.0 - Production on Fri Jan 6 16:24:40 2017

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


Username: / as sysdba

Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
Export done in US7ASCII character set and AL16UTF16 NCHAR character set
server uses WE8ISO8859P15 character set (possible charset conversion)

About to export specified tables via Conventional Path ...
. . exporting table                           AUD$  504728389 rows exported
Export terminated successfully without warnings.

Reference:
  
DataPump Export (EXPDP) Fails With Error ORA-39165: Schema SYS Was Not Found (Doc ID 553402.1)
How to Export the AUD$ Table (Doc ID 745540.1)

Thursday, 19 April 2018

Snapshot Standby Database -How To Convert Physical Standby Database To Snapshot Standby Database (READ WRITE Mode)

convert physical standby database to snapshot standby database, physical standby database in READ WRITE mode, snapshot standby, standby in READ WRITE mode
Oracle provides an unique feature where the physical standby database can be opened in READ WRITE mode to perform update able transactions. Quite often we have the standby database opened in READ Only mode for reporting purposes and optionally have the active dataguard implemented, but a snapshot standby database can be used to perform both READ and WRITE activities. Most importantly, a snapshot standby database keeps receiving the redo data from the primary database but does not apply them. These redo data received from the primary database would be applied only when the snapshot standby database is converted back to the Physical standby mode. There by the snapshot standby database provides data protection on primary database.

A snapshot standby database will allow you to make use of the data available on the physical standby database (which is a mirrored copy of the primary database). This allows the users to test the application on a standby database which has the primary data before implementing it in the Real production environment. When a physical standby database is converted to a snapshot standby database, a guaranteed restore point is automatically created. Once when the updateable transactions are completed for testing purposes on the snapshot standby database and when you are converting back the snapshot standby to physical standby, oracle flashbacks to the restore point that was created earlier which means that the transactions that were made when the standby database was opened in READ WRITE mode will be flushed out.
The only requirement to have the snapshot standby is that FRA (Flash Recovery Area) must be configured on physical standby database. It is not necessary to have flashback enabled. Below are the steps on how to convert a physical standby database to a snapshot standby database and viceversa.
Primary database Details:
Oracle Database version: 11.2.0.3 Enterprise Edition
Primary database: SRPRIM
Details with respect to the primary database:

SQL> select status,instance_name,database_role,open_mode from v$database,v$Instance;

 STATUS       INSTANCE_NAME    DATABASE_ROLE    OPEN_MODE
 ------------ ---------------- -------------    ----------
 OPEN         srprim           PRIMARY          READ WRITE

SQL> select thread#,max(sequence#) from v$archived_log group by thread#;

THREAD# MAX(SEQUENCE#)
 ---------- ----------

 1            206
Standby database Details:
Oracle database version: 11.2.0.3 Enterprise Edition
Standby database name: SRPS
Details with respect to the physical standby database:

SQL> select status,instance_name,database_role,open_mode from v$database,v$Instance;

STATUS       INSTANCE_NAME    DATABASE_ROLE    OPEN_MODE
------------ ---------------- ---------------- --------------------
OPEN         srps             PHYSICAL STANDBY READ ONLY WITH APPLY

SQL> select thread#,max(sequence#) from v$archived_log where applied='YES' group by thread#;

THREAD# MAX(SEQUENCE#)
 ---------- ----------
 1            206

SQL> select flashback_on from v$database;

FLASHBACK_ON
------------

NO
You can observe that the standby database is in sync with the primary database. Below outcome shows that the Flash Recovery Area is configured on the physical standby database.

SQL> show parameter db_recovery_file_dest

NAME                         TYPE         VALUE
---------------------------  -----------  -------------
db_recovery_file_dest        string       +FRA_NEW
db_recovery_file_dest_size   big integer  4122M


Step 1: Cancel the Managed Recovery Process (MRP) on the physical standby database, shut it down and place it in Mount mode.

SQL> alter database recover managed standby database cancel;

Database altered.

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

SQL> startup mount
ORA-32004: obsolete or deprecated parameter(s) specified for RDBMS instance
ORACLE instance started.
Total System Global Area 1269366784 bytes
Fixed Size                  2227984 bytes
Variable Size             805306608 bytes
Database Buffers          452984832 bytes
Redo Buffers                8847360 bytes

Database mounted.

Step 2: Once the standby database is mounted, convert the Physical standby database to snapshot standby database.

SQL> alter database convert to snapshot standby;

Database altered.

Step 3: You can now open the snapshot standby database and check its mode.

SQL> alter database open;

Database altered.

SQL> select status,instance_name,database_role,open_mode from v$database,v$Instance;

STATUS      INSTANCE_NAME   DATABASE_ROLE    OPEN_MODE
----------- --------------- ---------------- ----------

OPEN        srps            SNAPSHOT STANDBY READ WRITE


Small Test on the snapshot standby database:


1. Create a user called “SNAPTEST”

2. Create a table called “TEST” whose owner is “SNAPTEST” and insert some records in it. You can also update some of the records as well.

SQL> create user snaptest identified by oracle;

User created.

SQL> grant connect,resource to snaptest;

Grant succeeded.

SQL> conn snaptest/oracle;

Connected.

SQL> create table test(code number, name char(20));

Table created.

SQL> insert into test values (100,'ARUN');

1 row created.

SQL> insert into test values(200,'SHIVU');

1 row created.

SQL> commit;

Commit complete.

SQL> select * from test;
CODE       NAME
---------- --------------------
100        ARUN
200        SHIVU

SQL> update snaptest.test set code=500 where name='ARUN';

1 row updated.

SQL> commit;

Commit complete.

SQL> select * from snaptest.test;
CODE       NAME
---------- --------------------
500        ARUN
200        SHIVU

In the mean time, you can also see that the redo data from the primary database is received by the snapshot standby database but would not be applied.
On primary database the latest sequence generated is 208 and that on the standby database, the RFS process is idle for sequence 209.

Primary:

SQL> select status,instance_name,database_role,open_mode from v$database,v$Instance;


 STATUS       INSTANCE_NAME    DATABASE_ROLE    OPEN_MODE
 ------------ ---------------- -------------    ----------
 OPEN         srprim           PRIMARY          READ WRITE

SQL> select thread#,max(sequence#) from v$archived_log group by thread#;

THREAD#    MAX(SEQUENCE#)
---------- --------------
 1         208

Standby:

SQL> select status,instance_name,database_role,open_mode from v$database,v$Instance;


STATUS      INSTANCE_NAME   DATABASE_ROLE    OPEN_MODE
----------- --------------- ---------------- ----------
OPEN        srps            SNAPSHOT STANDBY READ WRITE

SQL> select process,status,sequence# from v$managed_standby;

PROCESS   STATUS        SEQUENCE#
 --------- ------------ ----------
 ARCH      CLOSING               1
 ARCH      CONNECTED             0
 ARCH      CONNECTED             0
 ARCH      CONNECTED             0
 RFS       IDLE                  0
 RFS       IDLE                209
 RFS       IDLE                  0


7 rows selected.


Steps on converting back a snapshot standby database to physical standby database.


Step 1: Shut down the snapshot standby database and open it in Mount mode.

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

SQL> startup mount
ORA-32004: obsolete or deprecated parameter(s) specified for RDBMS instance
ORACLE instance started.

Total System Global Area 1269366784 bytes
Fixed Size                  2227984 bytes
Variable Size             805306608 bytes
Database Buffers          452984832 bytes
Redo Buffers                8847360 bytes
Database mounted.
SQL>

Step 2: Convert the snapshot standby database to physical standby database.

SQL> alter database convert to physical standby;

Database altered.

Step 3: Once done, bounce the physical standby database and start the Managed Recovery Process (MRP) on it.

SQL> shut immediate
ORA-01507: database not mounted

ORACLE instance shut down.
QL> startup
ORA-32004: obsolete or deprecated parameter(s) specified for RDBMS instance
ORACLE instance started.

Total System Global Area 1269366784 bytes
Fixed Size                  2227984 bytes
Variable Size             805306608 bytes
Database Buffers          452984832 bytes
Redo Buffers                8847360 bytes
Database mounted.
Database opened.

SQL> select status,instance_name,database_role,open_mode from v$database,v$Instance;
STATUS       INSTANCE_NAME   DATABASE_ROLE     OPEN_MODE
------------ --------------  ----------------  ---------
OPEN         srps            PHYSICAL STANDBY  READ ONLY

SQL> alter database recover managed standby database disconnect from session;

Database altered.

SQL> select process,status,sequence# from v$managed_standby;
 PROCESS   STATUS        SEQUENCE#
 --------- ------------ ----------
 ARCH      CONNECTED             0
 ARCH      CONNECTED             0
 ARCH      CONNECTED             0
 ARCH      CONNECTED             0
 RFS       IDLE                  0
 RFS       IDLE                  0
 RFS       IDLE                  0
 MRP0      WAIT_FOR_LOG        213

8 rows selected.


Crosscheck whether the physical standby database is in sync with the primary database.


On Primary database:

 STATUS       INSTANCE_NAME    DATABASE_ROLE    OPEN_MODE
------------ ---------------- -------------    ----------
 OPEN         srprim           PRIMARY          READ WRITE

SQL> select thread#,max(sequence#) from v$archived_log group bythread#;

THREAD#    MAX(SEQUENCE#)
---------- --------------
1          212
On Standby database:

SQL> select status,instance_name,database_role,open_mode from v$database,v$Instance;

STATUS       INSTANCE_NAME   DATABASE_ROLE     OPEN_MODE
------------ --------------  ----------------  ---------
OPEN         srps            PHYSICAL STANDBY  READ ONLY
SQL> select thread#,max(sequence#) from v$archived_log where applied='YES' group by thread#;
THREAD#    MAX(SEQUENCE#)
---------- --------------
1          212
You can see below that the transactions that were carried out when the standby database is opened in READ WRITE mode are flushed out after it was converted back to physical standby database mode.

SQL> select * from snaptest.test;
select * from snaptest.test
*
ERROR at line 1:
ORA-00942: table or view does not exist

SQL> select username,account_status from dba_users where username='SNAPTEST';


no rows selected



###############################################  All The Best ###############################################




Wednesday, 18 April 2018

ORA-39358: Export dump file version 12.1.0.2.0 not compatible with target version 11.2.0.4.0

PROBLEM:
While importing dump file, got error as

ORA-39358: Export dump file version 12.1.0.2.0 not compatible with target version 11.2.0.4.0 .

SOLUTION:
1. Check the compatible parameter of both source and target database.

SOURCE DB:
SQL>show parameter compatible

NAME TYPE VALUE
------------------------------------ ----------- ---------
compatible string 12.1.0.2.0
noncdb_compatible boolean FALSE

TARGET DB:

SQL> show parameter compatible

NAME                                 TYPE        VALUE
------------------------------------ ----------- --------
compatible                           string      11.2.0.4.0

We can see the source compatible parameter is higher version(12.1.0.2) and target is lower(11.2.0.4). A dump file generated from database with higher compatible parameter can’t be imported to a database with lower compatible value. Either both should be same or target db compatible can be higher than the source compatible.

To fix it, While taking export use VERSION=11.2 parameter 

expdp dumpfile=test.dmp logfile=test.log directory=EXPDIR full=y version=11.2

Now try to import this, It will succeed without any issues.

###############################################  All The Best ###############################################

Wednesday, 28 February 2018

Installation and Prerequisites to Setup Oracle Goldengate 12c on Linux

In this post we’ll cover step by step approach for installing Golden Gate Software on both Windows based and Unix based operating system. Below are some requirements that should be met before installing the 
Golden Gate software:-

Memory Requirements:

At least between 25 and 55 Mb of RAM memory is required for each GoldenGate Replicat and Extract process. Oracle Goldengate supports up to 300 concurrent processes for Extract and Replicat per Goldengate instance. As a rule of thumb, you will need to take into consideration that at least 1–2 Extract processes and multiple Replicat processes will be required in addition to manager processes for a basic Oracle Goldengate installation. The best way to assess total memory requirement is to run the GGSCI command to view the current report file and to examine the PROCESS AVAIL VM FROM OS (min) to determine if you have sufficient swap memory for your platform.

Disk Space Requirements:

Following are some things you should do to ensure having enough disk space to support your Goldengate replication needs:

• Allocate at least 50–150 MB of disk space for the Oracle GoldenGate software binaries.
• Allocate 40 MB of disk space per instance of Goldengate for working directories and files per server. For a basic configuration with Oracle Goldengate, you will need to allocate 40 MB on the source and 40 MB on the target system for a total requirement of 80 MB of disk space.
• Allocate sufficient disk space to temporary files to accommodate GoldenGate operations. By default, Goldengate stores temporary files in the dirtmp directory under the default installation directory. A good rule of thumb to use for temp file space is around 10 GB of disk space.
• Plan on at least 10 MB per trail file. As a rule of thumb, we recommend that you start with at least 1 GB of disk space allocated per system for trail files. Alternatively, use the following formula that Oracle provides to determine the amount of disk space to set aside:
[log volume in one hour] x [number of hours downtime] x 0.4 = trail disk space.

One way to calculate the total amount required for trail file space is by querying the V$ARCHIVED_LOG view from within the source Oracle database. The following query shows you how to do so:

SQL>select trunc(COMPLETION_TIME),count(*)*100 size_in_MB
from v$archived_log
group by trunc(COMPLETION_TIME);
TRUNC(COM SIZE_IN_MB
--------- ----------
15-MAY-11 500
Run tests after installing Goldengate to measure your specific transaction mix and
load, and to gauge the total disk space required for trail files.

Network Requirements:

Since Oracle Goldengate software operates between source and target systems over networks, you must configure TCP/IP networking to accommodate all hosts within DNS to include host names that will be included in the Oracle Goldengate infrastructure deployed. In the event of firewalls, hosts must be allowed to send and receive data for open ports that the manager, Extract, and Replicat processes require access to in order to send and receive data. This range of ports must be allocated for the Goldengate environments. Also allocate ports for Goldengate manager, Extract, and Replicat processes. By default, manager uses port 7840. The recommendation is that you keep this port available. In addition, keep a record of ports allocated to Goldengate processes to avoid port conflicts.

Operating System Requirements

Linux or UNIX:

Source DB Server:ggate1
DB Name: ORCL1

Target DB Server:ggate2
DB Name: ORCL2


Download Oracle GoldenGate 12.2.0.1.1 for Oracle on Linux X86_64(454MB) Binary file from Oracle official website under Oracle GoldenGate 12.2.0.1 tab

Once we have downloaded, We need to transfer file from your local desk top to Linux Machine where source DB/Target was running 

I have transffered golden gate binaries to source DB server and hosted on /home/oracle

[oracle@ggate1]$ cd /home/oracle
[oracle@ggate1]$ ls -lrt
-rw-r----- 1 oracle oinstall 475611228 Dec 31 13:02 fbo_ggs_x64_shiphome.zip


[oracle@ggate1]$ cd /home/oracle
[oracle@ggate12]$ ls -lrt
-rw-r----- 1 oracle oinstall 475611228 Dec 31 13:02 fbo_ggs_x64_shiphome.zip

Source Side Installation: goldengate1

Unzip binary file

[oracle@ggate1]$pwd
/home/oracle
[oracle@ggate1]$ unzip fbo_ggs_x64_shiphome.zip

Once we unzip tha binary file, A directory will be created with name:fbo_ggs_x64_shiphome 
[oracle@ggate1]$ ls -lrt
-rw-r----- 1 oracle oinstall 475611228 Dec 31 13:02 fbo_ggs_x64_shiphome.zip
drwxr-r--r-- 1 oracle oinstall 475611228 Dec 31 13:02 fbo_ggs_x64_shiphome

Just for installation purpose, we don't require more than 5GB disk space

Once uzip file go to fbo_ggs_x64_shiphome inside directory

[oracle@ggate1]$ cd fbo_ggs_x64_shiphome
[oracle@ggate1]$ ls
Disk1
[oracle@ggate1]$ cd Disk1
[oracle@ggate1]$ ls
install responce runInstaller stage

Let us set the display as root user to enable GUI mode

[root@ggate1]# xhost+
access control disabled, clients can connect from any host
[root@ggate1]#

From 12c onwards golden gate introduced GUI based installation, Till 11gR2 it was command line installation.
Create directory for GG_HOME

[oracle@ggate1]$ cd /u01/app/oracle/product/12.1.0
[oracle@ggate1]$  mkdir ggsource1

Now run runInstaller from oracle user
[oracle@ggate1]$ cd /home/oracle/fbo_ggs_x64_shiphome/Disk1
[oracle@ggate1]$ ls
install responce runInstaller stage
[oracle@ggate1]$./runInstaller
Starting Oracle Universal Installer...

Checking Temp space: must be grater than 120 MB. Actual 7109 MB  Passed
Checking Swap space: must be grater than 150 MB. Actual 8190 MB  Passed
Checking monitor: must be configured to display at least 256 colors.   Actual 167777216  Passed
Preparing to launch Oracle Universal Installer from /tmp/OraInstall2017-05-24 10-20-35PM. Please wait...[oracle@ggate1]$

First it checks prerequesites like temp space and swap space, Once all prerequesites are passed it wll open the GUI window

Oracle 12GoldenGate binaries will support for both 12c and 11g Databases

If  database is 10g or 9i or any other lower version, We need to use lower than 12c GoldenGate binaries

In our case my Oracle databse is 12

Select Oracle GoldenGate for Oracle Database 12c and then click on next button

Once we click on next button it will ask us location for software installation(GG Home),Database Location(ORACLE_HOME) and Manager port(Default-7809)

Provide Location details as below

Software Location:/u01/app/oracle/product/12.1.0/ggsource1

Database Location:/u01/app/oracle/product/12.1.0/db_1

Manager Port:7809

Select Start Manager check box

If we select Start Manager check box , Manager will start 

Port 7809 should be open and provided by the network team

Once all locations defined, Click on Next button

Now it will ask us to review all Locations , Once reviewed click on install button

Now installtion in progress

Once installtion complted we will get the message "GoldedGate installation was successfuly", Now click on close

Till now installtion completed successfully

Now got to location where we have installed GG and connect GG prompt by executing ./ggsci (GoldenGate Software Command Interface)
[oracle@ggate1]$ cd /u01/app/oracle/product/12.1.0/ggsource1
[oracle@ggate1]$./ggsci
Oracle GoldenGate Command Interpreter for Oracle

Version 12.2.0.1.1  OGGCORE_12.2.0.1.0_PLATFORMS_151211.1401_FBO

Linux, x64, 64bit (optimized), Oracle 11g on Sep 25 2015 00:31:13

Operating system character set identified as UTF-8.



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



GGSCI (ggate1) 1>


Now to check what processes are configured run "info all" 
GGSCI (ggate1) 1>
Program   Status Group Lag at Chkpt Time Since Chkpt

MANAGER   Running

Target Side Installation: ggate2



Unzip binary file



[oracle@ggate2]$pwd

/home/oracle

[oracle@ggate2]$ unzip fbo_ggs_x64_shiphome.zip



Once we unzip tha binary file, A directory will be created with name:fbo_ggs_x64_shiphome 

[oracle@ggate2]$ ls -lrt

-rw-r----- 1 oracle oinstall 475611228 Dec 31 13:02 fbo_ggs_x64_shiphome.zip

drwxr-r--r-- 1 oracle oinstall 475611228 Dec 31 13:02 fbo_ggs_x64_shiphome



Just for installation purpose, we don't require more than 5GB disk space



Once uzip file go to fbo_ggs_x64_shiphome inside directory



[oracle@ggate2]$ cd fbo_ggs_x64_shiphome

[oracle@ggate2]$ ls

Disk1

[oracle@ggate2]$ cd Disk1

[oracle@ggate2]$ ls

install responce runInstaller stage



Let us set the display as root user to enable GUI mode



[root@ggate2]# xhost+

access control disabled, clients can connect from any host

[root@ggate2]#



From 12c onwards golden gate introduced GUI based installation, Till 11gR2 it was command line installation.

Create directory for GG_HOME



[oracle@ggate2]$ cd /u01/app/oracle/product/12.1.0

[oracle@ggate2]$  mkdir ggtarget2



Now run runInstaller from oracle user

[oracle@ggate2]$ cd /home/oracle/fbo_ggs_x64_shiphome/Disk1

[oracle@ggate2]$ ls

install responce runInstaller stage

[oracle@ggate2]$./runInstaller

Starting Oracle Universal Installer...



Checking Temp space: must be grater than 120 MB. Actual 7109 MB  Passed

Checking Swap space: must be grater than 150 MB. Actual 8190 MB  Passed

Checking monitor: must be configured to display at least 256 colors.   Actual 167777216  Passed

Preparing to launch Oracle Universal Installer from /tmp/OraInstall2017-05-24 10-20-35PM. Please wait...[oracle@ggate2]$



First it checks prerequesites like temp space and swap space, Once all prerequesites are passed it wll open the GUI window



Oracle 12GoldenGate binaries will support for both 12c and 11g Databases



If  database is 10g or 9i or any other lower version, We need to use lower than 12c GoldenGate binaries



In our case my Oracle databse is 12



Select Oracle GoldenGate for Oracle Database 12c and then click on next button



Once we click on next button it will ask us location for software installation(GG Home),Database Location(ORACLE_HOME) and Manager port(Default-7809)



Provide Location details as below



Software Location:/u01/app/oracle/product/12.1.0/ggtarget2



Database Location:/u01/app/oracle/product/12.1.0/db_1



Manager Port:7809



Select Start Manager check box

Here we will uncheck Start Manager check box


If we uncheck Start Manager check box , Port and Database location will be disabled and Manager won't start automaticall after installation 





Port 7809 should be open and provided by the network team



Once all locations defined, Click on Next button



Now it will ask us to review all Locations , Once reviewed click on install button



Now installtion in progress



Once installtion complted we will get the message "GoldedGate installation was successfuly", Now click on close



Till now installtion completed successfully



Now got to location where we have installed GG and connect GG prompt by executing ./ggsci (GoldenGate Software Command Interface)

[oracle@ggate2]$ cd /u01/app/oracle/product/12.1.0/ggtarget2

[oracle@ggate2]$./ggsci

Oracle GoldenGate Command Interpreter for Oracle



Version 12.2.0.1.1  OGGCORE_12.2.0.1.0_PLATFORMS_151211.1401_FBO



Linux, x64, 64bit (optimized), Oracle 11g on Sep 25 2015 00:31:13



Operating system character set identified as UTF-8.







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







GGSCI (ggate2) 1>





Now to check what processes are configured run "info all" 

GGSCI (ggate2) 1>info all

Program   Status Group Lag at Chkpt Time Since Chkpt


MANAGER   STOPPED

Here Manager stoped , Since we have unchecked "Start Manager check box during installation process"



To start manager we need to define the port number and need to create subdirectories.
GGSCI (ggate2) 1>create subdirs

Creating subdirectories under current directory ggtarget2/u01/app/oracle/product/12.1.0/ggtarget2

Parameter files /u01/app/oracle/product/12.1.0/ggtarget2/dirprm: created
Report files /u01/app/oracle/product/12.1.0/ggtarget2/dirrpt: created
Checkpoint files /u01/app/oracle/product/12.1.0/ggtarget2/dirchk: created
Process status files /u01/app/oracle/product/12.1.0/ggtarget2/dirpcs: created
SQL script files /u01/app/oracle/product/12.1.0/ggtarget2/dirsql: created
Database definitions files /u01/app/oracle/product/12.1.0/ggtarget2/dirdef: created
Extract data files /u01/app/oracle/product/12.1.0/ggtarget2/dirdat: created
Temporary files /u01/app/oracle/product/12.1.0/ggtarget2/dirtmp: created
Credenttial store files /u01/app/oracle/product/12.1.0/ggtarget2/dircrd: created
Masterkey wallet files /u01/app/oracle/product/12.1.0/ggtarget2/dirwlt: created
Dump files /u01/app/oracle/product/12.1.0/ggtarget2/dirdmp: created

Subdirectories create , Now define port numer by editing MGR process and save and quite param file


GGSCI (ggate2) 1>edit param mgr


Now start manager and check

GGSCI (ggate2) 1>start mgr
Manager started.

GGSCI (ggate2) 1>info all

Program   Status Group Lag at Chkpt Time Since Chkpt


MANAGER   STOPPED


Finally Manager process is successfully running at source and target

DML Replication using GoldenGate 12c Multitenant Architecture:

Aim:Replicate data from TEST1@ORACL1 to TEST2@ORACL2 

Prerequisites:

At Database Level:

At Source DB Side:

1. SQL>alter system set enable_goldengate_replication=True;

System altered.

We need to create new user for Goldengate on both source and target, Which is responsible to read data from multiple schemas.

In 12c in multitenant architecture it needs to be created on a container database.

So create a user in container database with prefix c##. 
In 12c this user is common to all the pluggable presents

2. SQL>create user c##ggadmin1 identified by ggadmin1 default tablespace gg_tbps;

If it's non multitenant architecure we can use any name, no need any prefix.

3. SQL>grant dba to c##ggadmin1 container=ALL;

Grant succeeded.

We need to add supplemental logging .

4. SQL>Alter database add supplemental log data(all) columns.

Database altered.

We can check whether supplemental enabled or not using below query

SQL>select supplemental_Log_data_all from v$database;

SUP
----
YES

5. DB must be in archivelog mode.

SQL>select log_mode from v$database;

LOG_MODE
---------
ARCHIVELOG

At Target DB Side:

1. SQL>alter system set enable_goldengate_replication=True;
  
   System altered.

2. SQL>create user c##ggadmin2 identified by ggadmin2 default              tablespace gg_tbps;

3. SQL>grant dba to c##ggadmin1;

Grant succeeded.