ORA-38500: Unsupported operation: Oracle XML DB not present

While trying to import using impdp got the below error

Table "ANAND"."TEST" exists and has been truncated. Data will be loaded but all dependent metadata will be skipped due to table_exists_action of truncate
Processing object type TABLE_EXPORT/TABLE/TABLE_DATA
ORA-31693: Table data object "ANAND"."TEST":"Y2012_Q2_M06" failed to load/unload and is being skipped due to error:
ORA-38500: Unsupported operation: Oracle XML DB not present
..............

As it said XML db nor present, check for XDB status in dba_registry


COMP_NAME                            VERSION      STATUS
------------------------------------ ------------ --------
Oracle XML Database                  11.2.0.3.0   VALID

03:15:37 SYS > select owner, object_name, object_type, status from dba_objects where status = 'INVALID' and owner = 'XDB';

no rows selected

As per DOC ID 1424643.1, the error can be generated when tables metadata of the exported table in the dumpfile and the existing table at the target DB are different.On checking the table structure there wasn’t any difference.

After spending some more time on it, finally decided to deinstall/install XDB.

Deinstall -- @?/rdbms/admin/catnoqm.sql
Install --@?/rdbms/admin/catqm.sql {XDB pwd} {XDB default tbs} {XDB temporary tbs} {SecureFiles = YES/NO}

For more details one can refer to Doc id 1292089.1

After this, impdp completed successfully. :)

DBCA failing with “Diskgroup XXX is not compatible for database usage”

Today a friend of mine pinged me an error while he was trying to create database using DBCA from 11.2.0.3 RDBMS home on an exadata box.Screenshot of the error is below

dbca_error

The error was easy to understand as compatible parameter set in the database initialization parameter was lower than the compatible.rdbms set for the diskgroup in ASM. The db compatible parameter was set to 11.2.0.0.0 whereas for the diskgroup compatible.rdbms was set to 11.2.0.2.0.

So checking the ASM instance showed

SYS@+ASM7 > col COMPATIBILITY form a10
SYS@+ASM7 > col DATABASE_COMPATIBILITY form a10
SYS@+ASM7 > col NAME form a20
SYS@+ASM7 > select group_number, name, compatibility, database_compatibility from v$asm_diskgroup;

GROUP_NUMBER NAME               COMPATIBIL DATABASE_C
------------ ------------------ ---------- ----------
           1 DATA_O1            11.2.0.2.0 11.2.0.2.0
           2 RECO_O1            11.2.0.2.0 11.2.0.2.0

The compatible.asm diskgroup attribute controls the format of the ASM diskgroup metadata. Only ASM instances with a software version equal to or greater than compatible.asm can mount the diskgroup.

The compatible.rdbms diskgroup attribute determines the format of ASM files themselves. The diskgroup can be accessed by any database instance with a compatible init.ora parameter set equal to or higher than the compatible.rdbms attribute.

DBCA (choose General Purpose) doesn’t provide any screen wherein we can change the parameter value. But as we want to create the database using dbca, we need to change the parameter value in the template stored in ORACLE_HOME/assistants/dbca/templates


xxxxxx: (test1) /u01/oraadmin/test/admin> cd $ORACLE_HOME
xxxxxx: (test1) /u01/app/oracle/product/11.2.0.3/dbhome_1> cd assistants/dbca/templates/
xxxxxx: (test1) /u01/app/oracle/product/11.2.0.3/dbhome_1/assistants/dbca/templates> ls -lrt
total 292272
-rwxrw-r-- 1 oracle oinstall        83 Oct  4 07:25 create_bct.sql
-rwxrw-r-- 1 oracle oinstall       718 Oct  4 07:25 crt_cluster_interconnect.sql
-rwxrw-r-- 1 oracle oinstall      5104 Oct  4 07:25 Data_Warehouse.dbc
-rwxrw-r-- 1 oracle oinstall       122 Oct  4 07:25 drop_cluster_interconnect.sql
-rwxrw-r-- 1 oracle oinstall     13756 Oct  4 07:25 dw_x2_2.dbt
-rwxrw-r-- 1 oracle oinstall       178 Oct  4 07:25 exadata_miscellaneous.sql
-rwxrw-r-- 1 oracle oinstall   1507328 Oct  4 07:25 example.dmp
-rwxrw-r-- 1 oracle oinstall  21889024 Oct  4 07:25 example01.dfb
-rwxrw-r-- 1 oracle oinstall      4984 Oct  4 07:25 General_Purpose.dbc
-rwxrw-r-- 1 oracle oinstall       803 Oct  4 07:25 logs.sql
-rwxrw-r-- 1 oracle oinstall      4104 Oct  4 07:25 logs.wk1
-rwxrw-r-- 1 oracle oinstall       320 Oct  4 07:25 logs_to_add.lst
-rwxrw-r-- 1 oracle oinstall       311 Oct  4 07:25 logs_to_add.sql
-rwxrw-r-- 1 oracle oinstall      8208 Oct  4 07:25 logs_to_add.wk1
-rwxrw-r-- 1 oracle oinstall     11489 Oct  4 07:25 New_Database.dbt
-rwxrw-r-- 1 oracle oinstall     13558 Oct  4 07:25 oltp_x2_2.dbt
-rwxrw-r-- 1 oracle oinstall       369 Oct  4 07:25 recreate_temp.sql
-rwxrw-r-- 1 oracle oinstall   9748480 Oct  4 07:26 Seed_Database.ctl
-rwxrw-r-- 1 oracle oinstall 265691136 Oct  4 07:26 Seed_Database.dfb
-rwxrw-r-- 1 oracle oinstall       761 Oct  4 07:26 set_cluster_interconnect.sql
-rwxrw-r-- 1 oracle oinstall        18 Oct  4 07:26 set_fra_size.lst
-rwxrw-r-- 1 oracle oinstall       806 Oct  4 07:26 set_fra_size.sql
-rwxrw-r-- 1 oracle oinstall       513 Oct  4 07:26 set_fra_size.wk1
-rwxrw-r-- 1 oracle oinstall       199 Oct  4 07:26 set_use_large_pages_false.sql
xxxxxx: (test1) /u01/app/oracle/product/11.2.0.3/dbhome_1/assistants/dbca/templates>

As we choose the General Purpose template, we need to edit the value in General_Purpose.dbc and search of compatible parameter and you would see

..............
  initParam name="compatible" value="11.2.0.0.0"/
..............
..............

Edit the value to either equal to compatible.rdbms of diskgroup or higher. In our case, we set it “11.2.0.3” and dbca didn’t threw error the next time :)

To know more on ASM diskgroup compatibility read

http://www.pythian.com/news/1078/oracle-11g-asm-diskgroup-compatibility/

UPGRADE CHECKPOINTTABLE – Goldengate

We have a goldengate setup wherein 3 different GoldenGate clients connects and replicat to one target database.Below are the versions being currently used 11.1.1.1, 11.2.1.0.0 and 11.2.1.0.3.

The version 11.2.1.0.3 was recently added, and below are the steps performed

GGSCI (myhost) 2> obey ./dirprm/add_rep.oby

GGSCI (myhost) 3>

GGSCI (myhost) 3> DBLOGIN USERID ggate@test PASSWORD 'xxxxxxxx'

ERROR: Unable to connect to database using user ggate@test. Please check privileges.
ORA-12170: TNS:Connect timeout occurred.

GGSCI (myhost) 4>

GGSCI (myhost) 4> ADD REPLICAT rep, extTrail /app/trail/rep/rp, checkpointTable ggate.OGG_CHECKPOINT

REPLICAT added.

dblogin failed but then the replicat got added. Now what happens if we try to delete it

GGSCI (myhost) 5> delete replicat rep
ERROR: Could not delete DB checkpoint for REPLICAT rep (Database login required to delete database checkpoint).

GGSCI (host) 6> info all

Program     Status      Group   Lag at Chkpt  Time Since Chkpt

MANAGER     RUNNING
EXTRACT     RUNNING     ext     00:00:00      00:00:05
REPLICAT    STOPPED     rep     00:00:00      00:00:38

So, now what can be done to delete it. Its simple,

In GG_HOME/dirchk

TEST:/u01/app/oracle/product/ggate/dirchk->ls -lrt
total 20
-rw-rw-r-- 1 ggate dba 4096 Nov 17 01:51 EXT.cpb
-rw-rw-r-- 1 ggate dba 2048 Nov 17 03:39 REP.cpr
-rw-rw-r-- 1 ggate dba   52 Nov 17 03:59 EXT.cps
-rw-rw-r-- 1 ggate dba 8192 Nov 17 03:59 EXT.cpe

Remove "REP.cpr" file.

TEST:/u01/app/oracle/product/ggate/dirchk->rm REP.cpr


TEST:/u01/app/oracle/product/ggate->ggsci

Oracle GoldenGate Command Interpreter for Oracle
Version 11.2.1.0.3 14400833 OGGCORE_11.2.1.0.3_PLATFORMS_120823.1258_FBO
Linux, x64, 64bit (optimized), Oracle 11g on Aug 23 2012 20:20:21

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



GGSCI (host) 1> info all

Program     Status      Group  Lag at Chkpt  Time Since Chkpt

MANAGER     RUNNING
EXTRACT     RUNNING     EXT     00:00:01      00:00:07

Once the port issue was resolved, added the replicat “rep” again successfully.

GGSCI (myhost) 2>  DBLOGIN USERID ggate@test PASSWORD "xxxxxxxx"
Successfully logged into database.

GGSCI (myhost) 3> ADD REPLICAT REP, extTrail /app/trail/rep/rp, checkpointTable ggate.OGG_CHECKPOINT
REPLICAT added.


GGSCI (myhost) 4> info all

Program     Status      Group   Lag at Chkpt  Time Since Chkpt

MANAGER     RUNNING
EXTRACT     RUNNING     EXT     00:00:01      00:00:02
REPLICAT    STOPPED     REP     00:00:00      00:00:20


GGSCI (myhost) 2> start REP

Sending START request to MANAGER ...
REPLICAT REP starting


GGSCI (myhost) 3> info all

Program     Status      Group  Lag at Chkpt  Time Since Chkpt

MANAGER     RUNNING
EXTRACT     RUNNING     EXT     00:00:00      00:00:06
REPLICAT    STOPPED     REP     00:00:00      00:04:15

Why is the status ‘STOPPED’? ggserr.log shows

2012-11-17 04:04:46  ERROR   OGG-00446  Oracle GoldenGate Delivery for Oracle, rep.prm:  Supplemental Checkpoint table does not exist.  Create a supplemental checkpoint table with the UPGRADE CHECKPOINTTABLE command in GGSCI if you have upgraded from release 11.2.1.0.0 or earlier.
2012-11-17 04:04:46  ERROR   OGG-01668  Oracle GoldenGate Delivery for Oracle, rep.prm:  PROCESS ABENDING.

The target db is on 11.2.0.2.0 version. Checking the checkpoint table

SYS@test > desc ggate.ogg_checkpoint
 Name                                                                       Null?    Type
 -------------------------------------------------------------------------- -------- --------------------------------------------------
 GROUP_NAME                                                                 NOT NULL VARCHAR2(8)
 GROUP_KEY                                                                  NOT NULL NUMBER(19)
 SEQNO                                                                               NUMBER(10)
 RBA                                                                        NOT NULL NUMBER(19)
 AUDIT_TS                                                                            VARCHAR2(29)
 CREATE_TS                                                                  NOT NULL DATE
 LAST_UPDATE_TS                                                             NOT NULL DATE
 CURRENT_DIR                                                                NOT NULL VARCHAR2(255)

04:00:55 SYS@test1 > /

GROUP_NA  GROUP_KEY      SEQNO        RBA AUDIT_TS                      CREATE_TS                   LAST_UPDATE_TS
-------- ---------- ---------- ---------- ----------------------------- --------------------------- ---------------------------
CURRENT_DIR
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
RABC     2253238980          0  230112172 2012-11-17 00:18:32.000000    16-NOV-12-13:56:33          17-NOV-12-04:08:45
/u01/app/oracle/product/ggate

RDEF     451369050        174   13320072 2012-11-17 04:08:48.000000    08-OCT-12-22:02:16          17-NOV-12-04:08:51
/app/ggate

RGBAA    3979228817         85   30933007 2012-11-17 03:03:33.000000    26-OCT-12-10:06:50          17-NOV-12-04:04:09
/app/ggate

RDONE    3150503361        365  276978037 2012-11-17 04:05:33.000000    14-OCT-12-10:34:54          17-NOV-12-04:05:40
/app/ggate

Though we have added and started REP, we don’t see any row for it in checkpoint table. Lets try to run upgrade checkpointtable command

GGSCI (myhost) 2> DBLOGIN USERID ggate@test PASSWORD "xxxxxxx"
Successfully logged into database.

GGSCI (myhost) 3> UPGRADE CHECKPOINTTABLE ggate.OGG_CHECKPOINT

Successfully upgraded checkpoint table ggate.OGG_CHECKPOINT.

GGSCI (myhost) 4> start rep

Sending START request to MANAGER ...
REPLICAT REP starting


GGSCI (myhost) 5> info all

Program     Status      Group  Lag at Chkpt  Time Since Chkpt

MANAGER     RUNNING
EXTRACT     RUNNING     EXT     00:00:02      00:00:26
REPLICAT    RUNNING     REP     02:35:52      00:00:16

From db

SYS@test1 > desc ggate.ogg_checkpoint
 Name                                                                       Null?    Type
 -------------------------------------------------------------------------- -------- --------------------------------------------------
 GROUP_NAME                                                                 NOT NULL VARCHAR2(8)
 GROUP_KEY                                                                  NOT NULL NUMBER(19)
 SEQNO                                                                               NUMBER(10)
 RBA                                                                        NOT NULL NUMBER(19)
 AUDIT_TS                                                                            VARCHAR2(29)
 CREATE_TS                                                                  NOT NULL DATE
 LAST_UPDATE_TS                                                             NOT NULL DATE
 CURRENT_DIR                                                                NOT NULL VARCHAR2(255)
 LOG_CSN                                                                             VARCHAR2(129)
 LOG_XID                                                                             VARCHAR2(129)
 LOG_CMPLT_CSN                                                                       VARCHAR2(129)
 LOG_CMPLT_XIDS                                                                      VARCHAR2(2000)
 VERSION                                                                             NUMBER(3)

04:12:24 SYS@test1 > select * from ggate.ogg_checkpoint;

GROUP_NA  GROUP_KEY      SEQNO        RBA AUDIT_TS                      CREATE_TS                   LAST_UPDATE_TS
-------- ---------- ---------- ---------- ----------------------------- --------------------------- ---------------------------
CURRENT_DIR
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
LOG_CSN
---------------------------------------------------------------------------------------------------------------------------------
LOG_XID
---------------------------------------------------------------------------------------------------------------------------------
LOG_CMPLT_CSN
---------------------------------------------------------------------------------------------------------------------------------
LOG_CMPLT_XIDS
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
   VERSION
----------
RABC     2253238980          3  119752892 2012-11-20 02:12:30.000000    16-NOV-12-13:56:33          20-NOV-12-04:12:35
/u01/app/oracle/product/ggate






RDEF   451369050        183  229511885 2012-11-20 04:12:22.000000    08-OCT-12-22:02:16          20-NOV-12-04:12:24
/app/ggate






RGBAA   3979228817         97   80060759 2012-11-20 10:07:02.000000    26-OCT-12-10:06:50          20-NOV-12-04:10:09
/app/ggate






REP   2249640216         12  211547890 2012-11-20 04:12:32.000000    17-NOV-12-04:00:48          20-NOV-12-04:12:34
/u01/app/oracle/product/ggate
12957879573832
780.26.260408
12957879573832
780.26.260408
         1

RDONE    3150503361        404  290793846 2012-11-20 04:12:19.000000    14-OCT-12-10:34:54          20-NOV-12-04:12:23
/app/ggate


ORA-26723: user “XXXXX” requires the role “DV_GOLDENGATE_REDO_ACCESS”

While starting the extract on UAT DB env which had been recently moved to exadata we got the below error.As we had redo and archive logfiles on ASM, we used “TRANLOGOPTIONS DBLOGREADER” in extract parameter file.

2012-10-24 22:35:48  ERROR   OGG-00446  Oracle GoldenGate Capture for Oracle, emos_cc.prm:  Opening ASM file +RECO_UMO1/archivelog/2012_10_24/thread_1_seq_224.955.797517005 in DBLOGREADER mode: (26723) ORA-26723: user "GGATE" requires the role "DV_GOLDENGATE_REDO_ACCESS"

The first thing which we did is checked whether the role exists or not.


22:41:53 SYS@xxxxx1 > select role from dba_roles where role like 'DV_%';

no rows selected

Ahh, No roles starting with DV_ exists in the db. Then why is GOldenGate asking for this role.Doing some search on tahiti.oracle.com pointed to a document which mentioned

Grant the DV_GOLDENGATE_REDO_ACCESS role to any user who is responsible for using the Oracle GoldenGate TRANLOGOPTIONS DBLOGREADER method to access redo logs in an Oracle Database Vault environment. This enables the management of Oracle GoldenGate processes to be tightly controlled by Database Vault, but does not change or restrict the way an administrator would normally configure Oracle GoldenGate.

So, now we have a clue. Its something to do with Database Vault.The UAT env had recently been moved to exadata box, prior to which it on a normal server where the extract was running fine.

22:42:05 SYS@xxxxx1 > SELECT * FROM V$OPTION WHERE PARAMETER = 'Oracle Database Vault';

PARAMETER                                                        VALUE
---------------------------------------------------------------- ----------------------------------------------------------------
Oracle Database Vault                                            TRUE

Above, shows Database Vault option enabled, but as the database was restored from the backup of the db on normal server, we didn’t had any DVSYS and DVF schemas.

Oracle Database Vault has the following schemas:

DVSYS Schema: Owns the Oracle Database Vault schema and related objects

DVF Schema: Owns the Oracle Database Vault functions that are created to retrieve factor identities

As, vault wasn’t required, we used CHOPT utility available from 11.2 for enabling/disabling database features.


After shutting down the db, ran chopt on all the nodes --

abcde0025: (abncu1) /u01/abncu/admin> chopt disable dv

Writing to /u01/app/oracle/product/11.2.0.3/dbhome_1/install/disable_dv.log...
/usr/bin/make -f /u01/app/oracle/product/11.2.0.3/dbhome_1/rdbms/lib/ins_rdbms.mk dv_off ORACLE_HOME=/u01/app/oracle/product/11.2.0.3/dbhome_1
/usr/bin/make -f /u01/app/oracle/product/11.2.0.3/dbhome_1/rdbms/lib/ins_rdbms.mk ioracle ORACLE_HOME=/u01/app/oracle/product/11.2.0.3/dbhome_1

abcde0025: (abncu1) /u01/abncu/admin>

Started the db and checked for the value which was disabled (FALSE) and GoldenGate extract started working.

SYS@xxxxx1 > SELECT * FROM V$OPTION WHERE PARAMETER = 'Oracle Database Vault';

PARAMETER VALUE
----------------------------------------------------------------
----------------------------------------------------------------
Oracle Database Vault   FALSE

References
http://docs.oracle.com/cd/E11882_01/server.112/e23090/db_objects.htm#DVADM71151

http://docs.oracle.com/cd/E11882_01/install.112/e17214/postinst.htm#CHDBDCGE