Wednesday, 30 September 2015

Errors in Goldengate Scenario 3

Scenario 3

Error Message :- ERROR   OGG-01044  The trail '/u01/app/oracle/product/ogg_trg/dirdat/rg' is not assigned to extract 'EXT1'. Assign the trail to the extract with the command "ADD EXTTRAIL/RMTTRAIL /u01/app/oracle/product/ogg_trg/dirdat/rg, EXTRACT EXT1".

2015-09-26 17:34:57  ERROR   OGG-01668  PROCESS ABENDING.


GGSCI (node4.example.com as ogguser@amer) 49> info all

Program     Status      Group       Lag at Chkpt  Time Since Chkpt

MANAGER     RUNNING                                        
EXTRACT     ABENDED     EXT1        00:00:00      00:07:30

## After checking we found that remote trail file name was not correct so we fixed it solve it as per below details :-

## Let check what exact remote should the extract send to, so its the rt file not rg which was observed in the error log

GGSCI (node4.example.com as ogguser@amer) 51> info extract ext1, detail

EXTRACT    EXT1      Last Started 2015-09-26 17:34   Status ABENDED
Checkpoint Lag       00:00:00 (updated 00:09:14 ago)
Log Read Checkpoint  Oracle Redo Logs
                     2015-09-26 17:30:07  Seqno 20, RBA 25548800
                     SCN 0.2082218 (2082218)

  Target Extract Trails:

  Trail Name                                       Seqno        RBA     Max MB Trail Type

  /u01/app/oracle/product/ogg_trg/dirdat/rt            0       1964        100 RMTTRAIL


## We can also check from below command :-


GGSCI (node4.example.com as ogguser@amer) 52> info rmttrail *

       Extract Trail: /u01/app/oracle/product/ogg_trg/dirdat/rt
             Extract: EXT1
               Seqno: 0
                 RBA: 1964
           File Size: 100M

## Below are details of how we have fixed it :-

GGSCI (node4.example.com as ogguser@amer) 54> edit params ext1



GGSCI (node4.example.com as ogguser@amer) 55> view params ext1

EXTRACT ext1
userid ogguser, password o
RMTHOST node4.example.com , mgrport 7909
rmttrail /u01/app/oracle/product/ogg_trg/dirdat/rt
TABLE SCOTT.EMP4;



GGSCI (node4.example.com as ogguser@amer) 56> start extract ext1

Sending START request to MANAGER ...
EXTRACT EXT1 starting


GGSCI (node4.example.com as ogguser@amer) 57> info all    

Program     Status      Group       Lag at Chkpt  Time Since Chkpt

MANAGER     RUNNING                                        
EXTRACT     RUNNING     EXT1        00:10:54      00:00:05

Errors in Goldengate Scenario 2

# Scenario 2

WARNING OGG-01223  TCP/IP error 111 (Connection refused), endpoint: node4.example.com:7907.

INFO    OGG-01971  The previous message, 'WARNING OGG-01223', repeated 2 times.


Whenever there is problem with extract always check whether it is able to capture the records or not, this will be done by stats extract command from GGSCI prompt

GGSCI (node4.example.com as ogguser@amer) 42> stats extract ext1

Sending STATS request to EXTRACT EXT1 ...

No active extraction maps.

## this means that extract is not able to capture the records as of now

We check the extract report file in location

/u01/app/oracle/product/ogg_src/dirrpt

and the report file name is EXT1.rpt

Below is the error details :-

2015-09-26 17:31:20  WARNING OGG-01223  TCP/IP error 111 (Connection refused), endpoint: node4.example.com:7907.

2015-09-26 17:31:50  INFO    OGG-01971  The previous message, 'WARNING OGG-01223', repeated 2 times.

## After reading the above error message, we came to know that the MGR port number was not correct in extract parameter file, so after correcting it we are able to solve it, lets check how

GGSCI (node4.example.com as ogguser@amer) 37> view params ext1


EXTRACT ext1
userid ogguser, password o
RMTHOST node4.example.com , mgrport 7907
rmttrail /u01/app/oracle/product/ogg_trg/dirdat/rt
TABLE SCOTT.EMP4;

## After correcting the port number to 7909


GGSCI (node4.example.com as ogguser@amer) 47> start extract ext1

Sending START request to MANAGER ...
EXTRACT EXT1 starting



GGSCI (node4.example.com as ogguser@amer) 44> info all

Program     Status      Group       Lag at Chkpt  Time Since Chkpt

MANAGER     RUNNING                                        
EXTRACT     RUNNING     EXT1        00:00:00      00:02:10

Errors in Goldengate Scenario 1

 Scenario 1

ERROR   OGG-00446  Missing filename opening checkpoint file.

ERROR   OGG-01668  PROCESS ABENDING.

___

Checking the replicat status

GGSCI (node4.example.com as ogguser@euro) 45> info all

Program     Status      Group       Lag at Chkpt  Time Since Chkpt

MANAGER     RUNNING                                        
REPLICAT    STOPPED     REP1        00:00:00      00:00:06


Below is the error :-

2015-09-26 17:26:03  ERROR   OGG-00446  Missing filename opening checkpoint file.

2015-09-26 17:26:03  ERROR   OGG-01668  PROCESS ABENDING.


## this means that in replicat file keyword REPLICAT rep_group name is not written, lets fix this :-

edit params rep1

GGSCI (node4.example.com as ogguser@euro) 49> view params rep1

REPLICAT REP1
ASSUMETARGETDEFS
USERID ogguser, PASSWORD o
MAP scott.emp4, TARGET scott.emp4;


# Now we have updated REPLICAT REP1


GGSCI (node4.example.com as ogguser@euro) 52> start replicat rep1

Sending START request to MANAGER ...
REPLICAT REP1 starting


GGSCI (node4.example.com as ogguser@euro) 53> info replicat rep1

REPLICAT   REP1      Last Started 2015-09-26 17:28   Status RUNNING
Checkpoint Lag       00:00:00 (updated 00:00:08 ago)
Process ID           9086
Log Read Checkpoint  File /u01/app/oracle/product/ogg_trg/dirdat/rt000000
                     2015-09-26 16:49:45.000288  RBA 1964

Monday, 31 August 2015

Important points related to Multitenant Architecture Oracle 12C

Important points related to Multitenant Architecture Oracle 12C

# Undo tablespace is common for all containers.

# A common temporary tablespace is required for all containers however each PDB can have its own temporay tablespace for its application users

# Redo log files is common for all containers.

# Each Datafile is specific to a single container represented by a con_id

# Control files are common for all containers.

# Regarding archivelog mode or non archivemode, all the PDBs in a CDB share the archivelog mode of the CDB.

# Now each container has its own dictionary that means each container has its own system tablespace now and a sysaux tablespace also.

# There is a limit of 253 PDBs in a CDB including the seed

# Limit of 512 services in a CDB

Storing application data in Pluggable databases.

Storing application data in Pluggable databases.

First we will connect to pluggable database pdb1

SQL> alter session set container = pdb1;

Session altered.

SQL> show con_name

CON_NAME
------------------------------
PDB1

Now we will create tablespace pdb1_tbs1 in pluggable database pdb1

SQL> create tablespace pdb1_tbs1 datafile '/u01/app/oracle/oradata/cdb1/pdb1/pdb1_tbs1a.dbf' size 100m;

Tablespace created.

Creating the table in above tablespace in pdb1 pluggable database

SQL> create table sales (id number) tablespace pdb1_tbs1;

Table created.

## Connecting to root now

SQL> alter session set container = cdb$root ;

Session altered.

SQL> create table sales (id number) ;                  

Table created.

## Confirming the table_name, tablespace_name, con_id and owner

SQL> select table_name,CON_ID,owner from cdb_Tables where table_name='SALES'

SQL> select table_name,CON_ID,tablespacE_name,owner from cdb_Tables where table_name='SALES';

TABLE_NAME     CON_ID TABLESPACE_NAME                OWNER
---------- ---------- ------------------------------ ------------------------------
SALES               3 PDB1_TBS1                      SYS
SALES               1 SYSTEM                         SYS










Querying about CDB or a NON CDB

To determine whether a database is a CDB or a non CDB, execute the below query :-

SQL> SELECT CDB FROM V$DATABASE;

CDB
---
YES

## Let us check about each Container in a CDB

We will query the V$CONTAINERS view.

SQL> COLUMN NAME FORMAT A8

SQL> SELECT NAME, CON_ID, DBID, CON_UID, GUID FROM V$CONTAINERS ORDER BY CON_ID;

NAME         CON_ID       DBID    CON_UID GUID
-------- ---------- ---------- ---------- --------------------------------
CDB$ROOT          1  862823670          1 FD9AC20F64D344D7E043B6A9E80A2F2F
PDB$SEED          2 3526827491 3526827491 1E8418ECE0501751E05372C909C0C35E
PDB1              3 1620003564 1620003564 1E84263113671CB0E05372C909C0893F
PDB2              4 2018651655 2018651655 1E84287383001DBEE05372C909C012F3
PDB2_11           5  938823506  938823506 1E851D182997251BE05372C909C034B6
PDB_22            6 2820822967 2820822967 1E85456E7EFC246EE05372C909C08EA3

6 rows selected.

Lets check container ID, Name, and Status of Each PDB

SQL> COLUMN PDB_NAME FORMAT A15

SQL> SELECT PDB_ID, PDB_NAME, STATUS FROM DBA_PDBS ORDER BY PDB_ID;

    PDB_ID PDB_NAME        STATUS
---------- --------------- ---------
         2 PDB$SEED        NORMAL
         3 PDB1            NORMAL
         4 PDB2            NORMAL
         5 PDB2_11         NORMAL
         6 PDB_22          NEW



Seed PDB in Oracle 12C


A Seed PDB is actually the PDB$SEED which is an oracle supplied template that the CDB can use to create new PDBs. We are not allowed to add or modify objects in seed PDB.

You can use the CREATE PLUGGABLE DATABASE statement to create a PDB by copying the files from PDB$SEED, which is a template for creating PDBs.

The following SQL statement creates a PDB named crmpdb from the seed using Oracle Managed Files:

CREATE PLUGGABLE DATABASE crmpdb
 ADMIN USER karan IDENTIFIED BY mypassword

We can see below that PDB seed may not be dropped or altered

SQL> alter pluggable database PDB$SEED open;
alter pluggable database PDB$SEED open
                         *
ERROR at line 1:
ORA-65017: seed pluggable database may not be dropped or altered

However any other pdb definately can be dropped or altered.

SQL> alter pluggable database PDB1 open ;

Pluggable database altered.