Thursday, 25 July 2019

Replication in mongoDB step by step.



                                               Replication in mongoDB step by step.

Operating system details:-

Red Hat Enterprise Linux Server release 5.4 (Tikanga)

mongoDB version details:-

MongoDB shell version: 2.6.12

Node details(servers)

node1: mongodb1.example.com

node2: mongodb2.example.com

node3: mongodb3.example.com

note:- i configured DNS server

1) create directory for dbpath (location of files)

Node1:

-bash-3.2$ pwd
/var/lib/mongo

-bash-3.2$ mkdir 1

-bash-3.2$ ls -ltr
total 82020
-rw------- 1 mongod mongod 16777216 Aug 11 05:34 local.ns
-rw------- 1 mongod mongod 67108864 Aug 11 05:34 local.0
-rwxr-xr-x 1 mongod mongod        5 Aug 29 03:29 mongod.lock
drwxr-xr-x 2 mongod mongod     4096 Aug 29 03:29 journal
drwxr-xr-x 2 mongod mongod     4096 Aug 29 04:04 1

Node2:

-bash-3.2$ pwd
/var/lib/mongo
-bash-3.2$ mkdir 2
-bash-3.2$ ls -ltr
total 82020
-rw------- 1 mongod mongod 16777216 Aug 11 05:34 local.ns
-rw------- 1 mongod mongod 67108864 Aug 11 05:34 local.0
-rwxr-xr-x 1 mongod mongod        5 Aug 29 03:29 mongod.lock
drwxr-xr-x 2 mongod mongod     4096 Aug 29 03:29 journal
drwxr-xr-x 2 mongod mongod     4096 Aug 29 04:05 2

Node3:

-bash-3.2$ mkdir 3
-bash-3.2$ pwd
/var/lib/mongo
-bash-3.2$ ls -ltr
total 82020
-rw------- 1 mongod mongod 16777216 Aug 11 05:34 local.ns
-rw------- 1 mongod mongod 67108864 Aug 11 05:34 local.0
-rwxr-xr-x 1 mongod mongod        5 Aug 29 03:28 mongod.lock
drwxr-xr-x 2 mongod mongod     4096 Aug 29 03:28 journal
drwxr-xr-x 2 mongod mongod     4096 Aug 29 04:06 3
-bash-3.2$

2)  Create replication set and start mongod process in each server

Node1:

-bash-3.2$ mongod --port 27001 --replSet abc --dbpath /var/lib/mongo/1 --logpath /var/lib/mongo/log.1 --logappend --oplogSize 50 -smallfiles --fork
about to fork child process, waiting until server is ready for connections.
forked process: 4146
child process started successfully, parent exiting

Node2:

-bash-3.2$ mongod --port 27002 --replSet abc --dbpath /var/lib/mongo/2 --logpath /var/lib/mongo/log.2 --logappend --oplogSize 50 -smallfiles --fork
about to fork child process, waiting until server is ready for connections.
forked process: 8573
child process started successfully, parent exiting

Node3:

-bash-3.2$ mongod --port 27003 --replSet abc --dbpath /var/lib/mongo/3 --logpath /var/lib/mongo/log.3 --logappend --oplogSize 50 -smallfiles --fork
about to fork child process, waiting until server is ready for connections.
forked process: 8499
child process started successfully, parent exiting


3) Connect to mongoDB on primary Server for initiat replication set

-bash-3.2$ mongo --port 27001
MongoDB shell version: 2.6.12
connecting to: 127.0.0.1:27001/test
Welcome to the MongoDB shell.
For interactive help, type "help".
For more comprehensive documentation, see
        http://docs.mongodb.org/
Questions? Try the support group
        http://groups.google.com/group/mongodb-user
                               
> rs.initiate()                    -------initiat replication set
{
        "info2" : "no configuration explicitly specified -- making one",
        "me" : "mongodb1.example.com:27001",
        "info" : "Config now saved locally.  Should come online in about a minute.",
        "ok" : 1
}
> rs.status()
{
        "set" : "abc",
        "date" : ISODate("2016-08-28T22:44:30Z"),
        "myState" : 1,
        "members" : [
                {
                        "_id" : 0,
                        "name" : "mongodb1.example.com:27001",
                        "health" : 1,
                        "state" : 1,
                        "stateStr" : "PRIMARY",
                        "uptime" : 326,
                        "optime" : Timestamp(1472424262, 1),
                        "optimeDate" : ISODate("2016-08-28T22:44:22Z"),
                        "electionTime" : Timestamp(1472424262, 2),
                        "electionDate" : ISODate("2016-08-28T22:44:22Z"),
                        "self" : true
                }
        ],
        "ok" : 1
}
abc:PRIMARY>
abc:PRIMARY>

4)  Add secondary servers to replication set.

abc:PRIMARY> rs.add("mongodb2.example.com:27002")
{ "ok" : 1 }
abc:PRIMARY> rs.add("mongodb3.example.com:27003"
... )
{ "ok" : 1 }

abc:PRIMARY> rs.initiate()
{
        "info" : "try querying local.system.replset to see current configuration",
        "ok" : 0,
        "errmsg" : "already initialized"
}
abc:PRIMARY> rs.status()
{
        "set" : "abc",
        "date" : ISODate("2016-08-28T22:47:58Z"),
        "myState" : 1,
        "members" : [
                {
                        "_id" : 0,
                        "name" : "mongodb1.example.com:27001",
                        "health" : 1,
                        "state" : 1,
                        "stateStr" : "PRIMARY",
                        "uptime" : 534,
                        "optime" : Timestamp(1472424443, 1),
                        "optimeDate" : ISODate("2016-08-28T22:47:23Z"),
                        "electionTime" : Timestamp(1472424262, 2),
                        "electionDate" : ISODate("2016-08-28T22:44:22Z"),
                        "self" : true
                },
                {
                        "_id" : 1,
                        "name" : "mongodb2.example.com:27002",
                        "health" : 1,
                        "state" : 2,
                        "stateStr" : "SECONDARY",
                        "uptime" : 44,
                        "optime" : Timestamp(1472424443, 1),
                        "optimeDate" : ISODate("2016-08-28T22:47:23Z"),
                        "lastHeartbeat" : ISODate("2016-08-28T22:47:57Z"),
                        "lastHeartbeatRecv" : ISODate("2016-08-28T22:47:57Z"),
                        "pingMs" : 14,
                        "syncingTo" : "mongodb1.example.com:27001"
                },
                {
                        "_id" : 2,
                        "name" : "mongodb3.example.com:27003",
                        "health" : 1,
                        "state" : 2,
                        "stateStr" : "SECONDARY",
                        "uptime" : 35,
                        "optime" : Timestamp(1472424443, 1),
                        "optimeDate" : ISODate("2016-08-28T22:47:23Z"),
                        "lastHeartbeat" : ISODate("2016-08-28T22:47:57Z"),
                        "lastHeartbeatRecv" : ISODate("2016-08-28T22:47:57Z"),
                        "pingMs" : 48,
                        "syncingTo" : "mongodb1.example.com:27001"
                }
        ],
        "ok" : 1
}
abc:PRIMARY>

5)  connect to secondary server

Node2:

-bash-3.2$ mongo --port 27002
MongoDB shell version: 2.6.12
connecting to: 127.0.0.1:27002/test
Welcome to the MongoDB shell.
For interactive help, type "help".
For more comprehensive documentation, see
        http://docs.mongodb.org/
Questions? Try the support group
        http://groups.google.com/group/mongodb-user
abc:SECONDARY>

Node3:

-bash-3.2$ mongo --port 27003
MongoDB shell version: 2.6.12
connecting to: 127.0.0.1:27003/test
Welcome to the MongoDB shell.
For interactive help, type "help".
For more comprehensive documentation, see
        http://docs.mongodb.org/
Questions? Try the support group
        http://groups.google.com/group/mongodb-user
abc:SECONDARY>

use rs.slaveOk() command for apply the replication on secodary servers
example:
abc:SECONDARY>rs.slaveOk()

6) Test replication is working

abc:PRIMARY> show dbs
admin  (empty)
local  0.094GB
abc:PRIMARY> db.products.insert({ "emp_name" : "shiv", "emp_id" : 320, "city" : "nashik", "salary" : 4000 })
WriteResult({ "nInserted" : 1 })
abc:PRIMARY> db.products.find()
{ "_id" : ObjectId("57c36b55d9bbb775d4557902"), "emp_name" : "shiv", "emp_id" : 320, "city" : "nashik", "salary" : 4000 }

Node2:

abc:SECONDARY> show dbs
admin  (empty)
local  0.094GB
abc:SECONDARY> db.products.find()
{ "_id" : ObjectId("57c36b55d9bbb775d4557902"), "emp_name" : "shiv", "emp_id" : 320, "city" : "nashik", "salary" : 4000 }
abc:SECONDARY>

Node3:

abc:SECONDARY> show dbs
admin  (empty)
local  0.094GB
abc:SECONDARY> db.products.find()
{ "_id" : ObjectId("57c36b55d9bbb775d4557902"), "emp_name" : "shiv", "emp_id" : 320, "city" : "nashik", "salary" : 4000 }



 Reference :-http://www.tutorialspoint.com

Upgrade mongoDB Enterprise 3.6.10 to 3.6.11 using mongo ops manager


 Check Current database Version:

[mongod@MySql ~]$ mongod –version
db version v3.6.10
git version: 3e3ab85bfb98875af3bc6e74eeb945b0719f69c8
OpenSSL version: OpenSSL 1.0.1e-fips 11 Feb 2013
allocator: tcmalloc
modules: enterprise
build environment:
    distmod: rhel70
    distarch: x86_64
    target_arch: x86_64












Login to Mongo ops manager:
Ø  Click on deployment



















gØ  Click on processes:












Ø  Click on hostname on which you want to upgrade mongoDB(click on MODIFY):
n  Select upgrade version:












Ø  Once deployment  done check the database version:

Saturday, 22 June 2019

how to configure AES cypher keys using wallet method in 12c GG


1] Login to oracle user.

2] connect golden gate prompt.

./ggsci

3] Open oracle wallet

GGSCI (source.example.com) 8> OPEN WALLET
Opened wallet at location 'dirwlt'.
GGSCI (source.example.com) 9> ADD MASTERKEY
Master key 'OGG_DEFAULT_MASTERKEY' added to wallet at location 'dirwlt'.

GGSCI (source.example.com) 10> INFO MASTERKEY
Masterkey Name:                 OGG_DEFAULT_MASTERKEY
Creation Date:                  Sat Jun 22 07:29:55 2019

Version:        Creation Date:                  Status:
1               Sat Jun 22 07:29:55 2019        Current

GGSCI (source.example.com) 11> INFO MASTERKEY VERSION 1
Masterkey Name:                 OGG_DEFAULT_MASTERKEY
Creation Date:                  Sat Jun 22 07:29:55 2019
Version:                        1
Renew Date:                     Sat Jun 22 07:29:55 2019
Status:                         Current
Key Hash (SHA1):                0xC683C5495E86196C25B316664BD91EFB1E15A200

GGSCI (source.example.com) 12> exit

4] Copy wallet file to remote server.

GGSCI (source.example.com) 12> exit
[oracle@source ggs]$ cd dirwlt
[oracle@source dirwlt]$ ls -ltr
total 4
-rw-r-----. 1 oracle oinstall 685 Jun 22 07:29 cwallet.sso
[oracle@source dirwlt]$ pwd
/u01/ggs/dirwlt
[oracle@source dirwlt]$ scp cwallet.sso oracle@target.example.com:/u01/ggs/dirwlt/.
The authenticity of host 'target.example.com (192.*.*.190)' can't be established.
ECDSA key fingerprint is SHA256:kUZS1JE7C6Oaseh72HegtiXt9z8NfG7DJsKlimwq0/Y.
ECDSA key fingerprint is MD5:08:1d:34:97:6c:6c:d6:de:7b:57:e1:02:ca:6b:6f:5f.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'target.example.com,192.*.*.190' (ECDSA) to the list of known hosts.
oracle@target.example.com's password:
cwallet.sso                                                  100%  685    38.4KB/s   00:00
[oracle@source dirwlt]$ cd ..

5] Add the ENCRYPT and KEYNAME parameters to RMTHOST in the data pump parameter file.

RMTHOST target.example.com, MGRPORT 7809, ENCRYPT AES192

6] Stop and restart the Extract process

12c golden gate one direction replication using integrated extract



OS Details:
[oracle@target ~]$ cat /etc/redhat-release
Red Hat Enterprise Linux Server release 7.6 (Maipo)
[oracle@target ~]$
Node Name:
target.example.com                 ----------Target database server host name
source.example.com                -------- Source database server host name

Database Name:
BANNER
--------------------------------------------------------------------------------
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
PL/SQL Release 11.2.0.4.0 - Production
CORE    11.2.0.4.0      Production
TNS for Linux: Version 11.2.0.4.0 - Production
NLSRTL Version 11.2.0.4.0 - Production

GG Details:
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 Dec 12 2015 00:54:38
Operating system character set identified as UTF-8.
Copyright (C) 1995, 2015, Oracle and/or its affiliates. All rights reserved.

Step: - Preparing the database for GG (Source database)

A] Database should be in archive Mode.

B] Enable supplemental logging

sql> alter database add supplemental log data;
sql> alter database force logging;
sql> select supplemental_log_data_min, force_logging from v$database;
sql> alter system switch logfile;

C] Create golden gate Admin user

sql> create tablespce GG_user datafile '/u01/app/oracle/oradata/DB11G/ggsample01.dbf' size 1GB;
sql> create user ggadmin identified by 'passwrod' default tablespace GG_user;
sql> grant connect,resource,DBA to ggadmin;
sql> exec dbms_goldengate_auth.grant_admin_privilege('ggadmin');
sql> grant flashback any table to ggadmin;

Step: - Add tns entry both database (target/source) in each tnsname.ora

Step: - create wallet and credentialstore (source and target database)

Connect GG prompt: (source database)

 GGSCI (source.example.com)> create wallet
 GGSCI (source.example.com)> add credentialstore
 GGSCI (source.example.com)> alter credentialstore add user ggadmin@srcdb alias srcdb domain admin
 (Enter your password) 
 GGSCI (source.example.com)> info credentailstore domain admin



Connect GG prompt: (target database)

 GGSCI (target.example.com)> create wallet
 GGSCI (target.example.com)> add credentialstore
 GGSCI (target.example.com)> alter credentialstore add user      ggadmin@trgdb alias trgdb domain admin
 (Enter your password) 
 GGSCI (target.example.com)> info credentailstore domain admin

Step:- enable supplemental logging to source database.

GGSCI (target.example.com) 10> dblogin userid ggadmin@trgdb password ******
Successfully logged into database.

GGSCI (target.example.com as ggadmin@DB11G) 11> add trandata hr.*

Logging of supplemental redo log data is already enabled for table HR.COUNTRIES.
TRANDATA for instantiation CSN has been added on table 'HR.COUNTRIES'.
Logging of supplemental redo log data is already enabled for table HR.DEPARTMENTS.
TRANDATA for instantiation CSN has been added on table 'HR.DEPARTMENTS'.
Logging of supplemental redo log data is already enabled for table HR.EMPLOYEES.
TRANDATA for instantiation CSN has been added on table 'HR.EMPLOYEES'.
Logging of supplemental redo log data is already enabled for table HR.JOBS.
TRANDATA for instantiation CSN has been added on table 'HR.JOBS'.
Logging of supplemental redo log data is already enabled for table HR.JOB_HISTORY.
TRANDATA for instantiation CSN has been added on table 'HR.JOB_HISTORY'.
Logging of supplemental redo log data is already enabled for table HR.LOCATIONS.
TRANDATA for instantiation CSN has been added on table 'HR.LOCATIONS'.
Logging of supplemental redo log data is already enabled for table HR.REGIONS.
TRANDATA for instantiation CSN has been added on table 'HR.REGIONS'.
GGSCI (source.example.com as ggadmin@DB11G) 12> redo data enabled for table hr.*
ERROR: Invalid command.
GGSCI (target.example.com as ggadmin@DB11G) 13> redo data enabled for table hr.*
ERROR: Invalid command.

Step: - Preparing the database for GG (target database)

A] Create goldengate Admin user:

sql> create tablespce GG_user  add datafile '/u01/app/oracle/oradata/DB11G/ggsample01.dbf' size 1GB;
sql> create user ggadmin identified by 'passwrod' default tablespace GG_user;
sql> grant connect,resource,DBA to ggadmin;
sql> exec dbms_goldengate_auth.grant_admin_privilege('ggadmin');
sql> grant flashback any table to ggadmin;
sql> alter system set enable_goldengate_replicate=true  scope=both;

Step:- configure manager process on both source and target server:

GGSCI (source.example.com) 1> edit param mgr
PORT 7809
PURGEOLDEXTRACTS ./dirdat/aa*, USECHECKPOINTS, MINKEEPHOURS 2

GGSCI (source.example.com) 2> start mgr


Step:- configure capture process

GGSCI (source.example.com) 3> edit param EXTRACT0
 (Add below parameter to extract par file)

-- Change Data Capture parameter file to extract
-- source table changes
EXTRACT extract0
SETENV (ORACLE_HOME = "/u01/app/oracle/product/11.2.0.4/db_1")
SETENV (ORACLE_SID="DB11G")
USERIDALIAS srcdb DOMAIN admin
TRANLOGOPTIONS NOUSENATIVEOBJSUPPORT
EXTTRAIL /u01/ggs/dirdat/rx
TABLE hr.departments;
DISCARDFILE /u01/ggs/dirrpt/hr.dsc, APPEND, Megabytes 100
DISCARDROLLOVER AT 04:30 ON friday

Step:- create capture process

GGSCI (source.example.com as ggadmin@DB11G) 7> add extract EXTRACT0, integrated tranlog, begin now
EXTRACT (Integrated) added.

GGSCI (source.example.com as ggadmin@DB11G) 8> info all

Program     Status      Group       Lag at Chkpt  Time Since Chkpt

MANAGER     RUNNING
EXTRACT     STOPPED     EXTRACT0    00:00:00      00:00:05

GGSCI (source.example.com as ggadmin@DB11G) 11> add exttrail /u01/ggs/dirdat/rx, extract EXTRACT0, megabytes 100
EXTTRAIL added.

Step:- register capture process to 11g database:

GGSCI (source.example.com) 10> dblogin userid ggadmin@srcdb password ******
Successfully logged into database.

GGSCI (source.example.com as ggadmin@DB11G) 13> register extract extract0 database;

Step:- configure Data pump process

GGSCI (source.example.com) 4> edit param DATAPMP0
(Add below paramter to datapump par file)

EXTRACT datapmp0
SETENV (ORACLE_HOME = "/u01/app/oracle/product/11.2.0.4/db_1")
SETENV (ORACLE_SID="DB11G")
USERIDALIAS srcdb DOMAIN admin
RMTHOST target.example.com, MGRPORT 7809
RMTTRAIL /u01/ggs/dirdat/tx
TABLE hr.departments;


Step:- create data pump process

GGSCI (source.example.com as ggadmin@DB11G) 15> add extract DATAPMP0, exttrailsource /u01/ggs/dirdat/rx begin now
EXTRACT added.

GGSCI (source.example.com as ggadmin@DB11G) 17> add rmttrail /u01/ggs/dirdat/tx extract DATAPMP0
RMTTRAIL added.

GGSCI (source.example.com as ggadmin@DB11G) 18> info all

Program     Status      Group       Lag at Chkpt  Time Since Chkpt

MANAGER     RUNNING
EXTRACT     STOPPED     DATAPMP0    00:00:00      00:01:33
EXTRACT     STOPPED     EXTRACT0    00:00:00      00:09:18

Step:- start extract and data pump process.

GGSCI (source.example.com) 2> start extract EXTRACT0

Sending START request to MANAGER ...
EXTRACT EXTRACT0 starting

GGSCI (source.example.com) 25> start extract DATAPMP0

Sending START request to MANAGER ...
EXTRACT DATAPMP0 starting

GGSCI (source.example.com) 26> info all

Program     Status      Group       Lag at Chkpt  Time Since Chkpt

MANAGER     RUNNING
EXTRACT     RUNNING     DATAPMP0    00:00:00      00:28:42
EXTRACT     RUNNING     EXTRACT0    00:00:09      00:00:05

Step:- configure replicat process(target Database)

GGSCI (target.example.com) 2> edit param REPLCAT0
(Add below paramter to replicat par file)

-- Replicator parameter file to apply changes
-- to tables
--
REPLICAT replcat0
SETENV (ORACLE_HOME = "/u01/app/oracle/product/11.2.0.4/db_1")
SETENV (ORACLE_SID="DB11G")
USERIDALIAS trgdb DOMAIN admin
DISCARDFILE /u01/ggs/dirdsc/replcat0.dsc, PURGE
ASSUMETARGETDEFS
MAP hr.departments TARGET hr.departments;

==> start replicate process:

GGSCI (target.example.com as ggadmin@DB11G) 16> add replicat replcat0 integrated exttrail /u01/ggs.12.2.0.2/dirdat/tx

GGSCI (target.example.com as ggadmin@DB11G) 16> start replicat REPLCAT0

Sending START request to MANAGER ...
REPLICAT REPLCAT0 starting


GGSCI (target.example.com as ggadmin@DB11G) 17> info all

Program     Status      Group       Lag at Chkpt  Time Since Chkpt

MANAGER     RUNNING
REPLICAT    RUNNING     REPLCAT0    00:00:00      00:01:35

===========check GG Replication setup====

==> Source Database

SQL> conn hr/hr   
Connected.
SQL> insert into departments values(277,'Marketing',null,1700);
1 row created.
SQL> commit;
Commit complete.

oracle@source ggs]$ ./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 Dec 12 2015 00:54:38
Operating system character set identified as UTF-8.

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



GGSCI (source.example.com) 1> info all

Program     Status      Group       Lag at Chkpt  Time Since Chkpt

MANAGER     RUNNING
EXTRACT     RUNNING     DATAPMP0    00:00:00      00:00:07
EXTRACT     RUNNING     EXTRACT0    00:00:04      00:00:05


GGSCI (source.example.com) 2> stats EXTRACT0

Sending STATS request to EXTRACT EXTRACT0 ...

Start of Statistics at 2019-06-22 02:36:24.

Output to /u01/ggs/dirdat/rx:

Extracting from HR.DEPARTMENTS to HR.DEPARTMENTS:

*** Total statistics since 2019-06-22 02:36:04 ***
        Total inserts                                      1.00
        Total updates                                      0.00
        Total deletes                                      0.00
        Total discards                                     0.00
        Total operations                                   1.00

*** Daily statistics since 2019-06-22 02:36:04 ***
        Total inserts                                      1.00
        Total updates                                      0.00
        Total deletes                                      0.00
        Total discards                                     0.00
        Total operations                                   1.00

*** Hourly statistics since 2019-06-22 02:36:04 ***
        Total inserts                                      1.00
        Total updates                                      0.00
        Total deletes                                      0.00
        Total discards                                     0.00
        Total operations                                   1.00

*** Latest statistics since 2019-06-22 02:36:04 ***
        Total inserts                                      1.00
        Total updates                                      0.00
        Total deletes                                      0.00
        Total discards                                     0.00
        Total operations                                   1.00

End of Statistics.

==> Target Database

GGSCI (target.example.com as ggadmin@DB11G) 19> stats REPLCAT0

Sending STATS request to REPLICAT REPLCAT0 ...

Start of Statistics at 2019-06-22 02:36:42.

Integrated Replicat Statistics:

        Total transactions                                 1.00
        Redirected                                         0.00
        DDL operations                                     0.00
        Stored procedures                                  0.00
        Datatype functionality                             0.00
        Event actions                                      0.00
        Direct transactions ratio                          0.00%

Replicating from HR.DEPARTMENTS to HR.DEPARTMENTS:

*** Total statistics since 2019-06-22 02:36:10 ***
        Total inserts                                      1.00
        Total updates                                      0.00
        Total deletes                                      0.00
        Total discards                                     0.00
        Total operations                                   1.00

*** Daily statistics since 2019-06-22 02:36:10 ***
        Total inserts                                      1.00
        Total updates                                      0.00
        Total deletes                                      0.00
        Total discards                                     0.00
        Total operations                                   1.00

*** Hourly statistics since 2019-06-22 02:36:10 ***
        Total inserts                                      1.00
        Total updates                                      0.00
        Total deletes                                      0.00
        Total discards                                     0.00
        Total operations                                   1.00

*** Latest statistics since 2019-06-22 02:36:10 ***
        Total inserts                                      1.00
        Total updates                                      0.00
        Total deletes                                      0.00
        Total discards                                     0.00
        Total operations                                   1.00

End of Statistics.

==> Validation from database (target database)

SQL> select * from departments;

DEPARTMENT_ID DEPARTMENT_NAME                MANAGER_ID LOCATION_ID
------------- ------------------------------ ---------- -----------
          230 IT Helpdesk                                      1700
          240 Government Sales                                 1700
          250 Retail Sales                                     1700
          260 Recruiting                                       1700
          270 Payroll                                          1700
          277 Marketing                                        1700






Saturday, 15 June 2019

replicate not started due to OGG-02091


GGSCI (target.example.com) 14> info all

Program     Status      Group       Lag at Chkpt  Time Since Chkpt

MANAGER     RUNNING
REPLICAT    ABENDED     REPLCAT1    00:00:00      00:11:15


Error: 

2019-06-15 07:38:24  ERROR   OGG-02091  Operation not supported because enable_goldengate_repli
cation is not set to true.

2019-06-15 07:38:24  ERROR   OGG-01668  PROCESS ABENDING.


Solution:

SQL> show parameter enable_goldengate_replication

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
enable_goldengate_replication        boolean     FALSE
SQL> alter system set enable_goldengate_replication=true scope=spfile;

System altered.

SQL> show parameter enable_goldengate_replication

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
enable_goldengate_replication        boolean     TRUE
SQL>

GSCI (target.example.com) 1> info all

Program     Status      Group       Lag at Chkpt  Time Since Chkpt

MANAGER     RUNNING
REPLICAT    RUNNING     REPLCAT1    00:00:00      00:00:00


WARNING OGG-02901 Replication of UDT and ANYDATA from redo logs



warning Details: 

WARNING OGG-02901  Replication of UDT and ANYDATA from redo logs is not su
pported with the Oracle compatible parameter setting. Using fetch instead.

Solution: 

Add below parameter to extract process

TRANLOGOPTIONS NOUSENATIVEOBJSUPPORT

==> stop and start extract process:

GGSCI (source.example.com) 23> view report EXTRACT1


***********************************************************************
                 Oracle GoldenGate Capture 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 Dec 12 2015 01:10:08

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


                    Starting at 2019-06-15 07:02:49
***********************************************************************

Operating System Version:
Linux
Version #2 SMP Mon Sep 24 14:45:01 PDT 2018, Release 4.14.35-1818.3.3.el7uek.x86_64
Node: source.example.com
Machine: x86_64
                         soft limit   hard limit
Address Space Size   :    unlimited    unlimited
Heap Size            :    unlimited    unlimited
File Size            :    unlimited    unlimited
CPU Time             :    unlimited    unlimited

Process id: 13653

Description:

***********************************************************************
**            Running with the following parameters                  **
***********************************************************************

2019-06-15 07:02:49  INFO    OGG-03059  Operating system character set identified as UTF-8.

2019-06-15 07:02:49  INFO    OGG-02695  ANSI SQL parameter syntax is used for parameter parsing
.
EXTRACT extract1
USERIDALIAS srcdb DOMAIN admin

2019-06-15 07:02:50  INFO    OGG-03522  Setting session time zone to source database time zone
'GMT'.
TRANLOGOPTIONS NOUSENATIVEOBJSUPPORT
EXTTRAIL ./dirdat/aa
TABLE hr.EMPLOYEES;
TABLE hr.DEPARTMENTS;

2019-06-15 07:02:50  INFO    OGG-01815  Virtual Memory Facilities for: BR
    anon alloc: mmap(MAP_ANON)  anon free: munmap
    file alloc: mmap(MAP_SHARED)  file free: munmap
    target directories:
    /u01/ggs/BR/EXTRACT1.

Bounded Recovery Parameter:
BRINTERVAL = 4HOURS
BRDIR      = /u01/ggs

2019-06-15 07:02:50  INFO    OGG-01851  filecaching started: thread ID: 139794004834048.

2019-06-15 07:02:50  INFO    OGG-01815  Virtual Memory Facilities for: COM
    anon alloc: mmap(MAP_ANON)  anon free: munmap
    file alloc: mmap(MAP_SHARED)  file free: munmap
    target directories:
    /u01/ggs/dirtmp.

CACHEMGR virtual memory values (may have been adjusted)
CACHEPAGEOUTSIZE (default):               8M
PROCESS VM AVAIL FROM OS (min):         128G
CACHESIZEMAX (strict force to disk):     96G

Database Version:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
PL/SQL Release 11.2.0.4.0 - Production
CORE    11.2.0.4.0      Production
TNS for Linux: Version 11.2.0.4.0 - Production
NLSRTL Version 11.2.0.4.0 - Production

Database Language and Character Set:
NLS_LANGUAGE     = "AMERICAN"
NLS_TERRITORY    = "AMERICA"
NLS_CHARACTERSET = "WE8MSWIN1252"

2019-06-15 07:02:51  INFO    OGG-02248  Logmining server DDL filtering enabled.

2019-06-15 07:02:53  INFO    OGG-02068  Integrated capture successfully attached to logmining s
erver OGG$CAP_EXTRACT1 using OGGCapture API.

2019-06-15 07:02:53  INFO    OGG-02089  Source redo compatibility version is: 11.2.0.4.0.

2019-06-15 07:02:53  INFO    OGG-02086  Integrated Dictionary will be used.

2019-06-15 07:02:53  INFO    OGG-01055  Recovery initialization completed for target file ./dir
dat/aa000000003, at RBA 1474.

2019-06-15 07:02:53  INFO    OGG-01478  Output file ./dirdat/aa is using format RELEASE 12.2.

2019-06-15 07:02:53  INFO    OGG-01026  Rolling over remote file ./dirdat/aa000000003.

2019-06-15 07:02:53  INFO    OGG-01053  Recovery completed for target file ./dirdat/aa000000004
, at RBA 1474.

2019-06-15 07:02:53  INFO    OGG-01057  Recovery completed for all targets.

***********************************************************************
**                     Run Time Messages                             **
***********************************************************************


WARNING OGG-02045 DB does not have streams_pool_size initialization parameter.


WARNING:

2019-06-15 06:40:03  WARNING OGG-02045  Database does not have streams_pool_size initialization
 parameter configured.

Solution :

set streams_pool_size:

SQL> show parameter streams_pool_size

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
streams_pool_size                    big integer 0

---set paramter as per the system: 

SQL> alter system set streams_pool_size=1G scope=spfile;   

System altered.


Login to the database as user C##GGUSER failed because of error Error while trying to retrieve text for error ORA-01804.

 Error :  2026-09-19 11:28:18  ERROR   OGG-00303  Unable to connect to database using user C##GGUSER@CDB. Ensure that the necessary privileg...