Sunday, November 11, 2012

ERROR OGG-00446 SQL operation failed: Inserting into checkpoint table


ERROR   OGG-00446  SQL operation failed: Inserting into checkpoint table,

When we are creating the Replicate  we need to create the checkpoint table which stores  metadata of the  replicates transaction details in it for the specified time..
The checkpoint table store the information from the last trail files records  which is inserted int to  the database.. If the replicated goes to improper shutdown or normal stop of the replicate then when we start the replicate... It refers to the checkpoint table for the last transactions in database and and according to it Replicate will write the records in the database
A checkpoint table can be created as common for more than one replicate's to store the metadata of the replicate 
Checkpoint table can be create in any schema as per your wish .. but it is recommend to create   in the gg schema 
we can use the GLOBALS parameter to create the default checkpoint for all the Replicates .. if we use the GLOBALS we no need to specify the checkpoint table at that time of add the replicate .. it will pick the default Checkpoint table from the GLOBALS parameter

To Create the check point table

Step 1

Log-in with the ggsci prompt and proceed with the edit parameter GLOBALS for creating the default checkpoint table

[oratest@fah gg]$ ./ggsci

GGSCI (fah) 2> edit params ./GLOBALS

Edit the GLOBALS parameter and add the checkpoint table in it format to add the checkpoint table is checkpoint table <table_name>
checkpointtable <table_name>
Now a file will be create as GLOBALS on the gg_home with the inserted recorded of table_name
Step 2

we need to login into the database for adding the checkpoint table

If you have set the Env variables like ORACLE_SID,ORACLE_HOME in replicate then you can issue the command

GGSCI (fah) 4> dblogin userid <username>,password <password>
Successfully logged into database.

If the env variables are not set then we have to issue 

GGSCI (fah) 8> DBLOGIN USERID  <username>@<hostname>:<database_port>/<database service name>,PASSWORD < password 
>
Successfully logged into database.

Step 3

Add the checkpoint table in  the database

GGSCI (fah) 17> add checkpointtable <table_name>

Successfully created checkpoint table <table_name>.

 A new table will be created in the default gg schema with the table_name which is specified 

Step 4

Add the replicate with the checkpoint table 

GGSCI (fah) 19> add replicat <replicte_name> exttrail ./dirdat/22 checkpointtable <table_name>
REPLICAT added.

GGSCI (fah) 20> start <replicate_name>

Sending START request to MANAGER ...
REPLICAT <replicate_name> starting

Step 5

Check the stats of the particular replicate

GGSCI (fah) 30> stats <replicte_name>

Sending STATS request to REPLICAT <replicate_name> ...

Start of Statistics at 2012-11-10 13:09:55. 

*** Total statistics since 2012-11-10 13:08:37 ***
        Total inserts                            14666.00
        Total updates                                0.00
        Total deletes                                0.00
        Total discards                            2249.00
        Total operations                         14666.00

Step 6

Check the checkpoint table which holds the checkpoint for the last transaction 


SQL> select * from GGSCHKPT;

GROUP_NA  GROUP_KEY      SEQNO        RBA AUDIT_TS                      CREATE_TS LAST_UPDA CURRENT_DIR
-------- ---------- ---------- ---------- ----------------------------- --------- --------- ------------------------------------------------------------
TRANR1      5870815         29    6411875 2012-11-11 00:05:29.758380    10-NOV-12 11-NOV-12 /u06/app/oracle/product/gg

It stores the sequence number and last RBA and time stamp in it

and undet the 
Note : if you are not specifying  the the checkpoint table a the time of creation of replicate then you will get the below error message

ERROR   OGG-00446  SQL operation failed: Inserting into checkpoint table GGSCHKPT, group TRANR1, SQL <INSERT INTO "GGSCHKPT" (group_name, group_key, current_dir, create_ts, last_update_ts,  seqno, rba, audit_ts) VALUES (:group_name, :group_key, :current_dir, :create_ts, sysdate, :seqno, :rba, :audit_t> SQL Error 942: ORA-00942: table or view does not exist

For Solving this error we need to create the checkpoint table 






No comments:

Post a Comment