Replicat Abended with ORA-02290: check constraint (TABLE_NAME.CHK_JSON) violated - oracle

We see the below in my Discard file -
NOTE: I can see the record in my source db.
CI Error ORA-02002: error while writing to audit trail
ORA-22275: invalid LOB locator specified
ORA-02290: check constraint (SCHEMA_NAME.CHK_JSON) violated (status = 2002), SQL <INSERT /*+ RESTRICT_ALL_REF_CONS */ INTO "SCHEMA_NAME"."TABLE_NAME" ("INSTRUMENTID","INDEXDETAIL","CREATIONTIME","LASTUPDATEDTIME") VALUES (:a0,EMPTY_CLOB(),:a2,:a3) RETURNING "INDEXDETAIL" INTO :dl0>
Aborting transaction on /local/dbms/oracle/goldengate_dbfs/oggma/goldengate_trails/oggma_deployment/var/lib/data/tc beginning at seqno 22 rba 206,136,818
error at seqno 22 rba 206136818
Problem replicating CATALOG_NAME.SCHEMA_NAME.TABLE_NAME to SCHEMA_NAME.TABLE_NAME.
Mapping problem with insert record (target format) SCN:12.1.6904...
*
INSTRUMENTID = 11111111
000000: 42 32 37 41 42 37 42 31 |11111111 |
INDEXDETAIL = (LOB)
CREATIONTIME = 2022-05-30 06:20:15
000000: 32 30 32 32 2d 30 35 2d 33 30 20 30 36 3a 32 30 |2022-05-30 06:20|
000010: 3a 31 35 |:15 |
LASTUPDATEDTIME = NULL
*
Process Abending : 2022-06-01 07:32:44.534819

May I know what type of Replicat you are using? Whether Audit is enabled? Also, could you please share the full GG version.
You can also refer to this KM note which might help you.
ORA-2002 And ORA-22275 Encountered When SELECT Audit Is Turned On For A Table (Doc ID 2764792.1)

Related

Oracle PL/SQL Code will not compile, ORA-06550: line 96, column 3:PLS-00103: Encountered the symbol "end-of-file" when expecting one of the following:

I have written the following PL/SQL code block and it uses a long array of 4 digit strings in the array.
The program block will loop over the array using the array(i) position as a query variable to return the the r_LDR_IORG record which is then printed with i, array(i), and r_LRD_IORG.PS_ORG_ID.
1 DECLARE
2 type array_t is varray(692) of varchar2(6);
3 array array_t := array_t('0118','0118','01R1','01R1','01R2','01R2','01R4','01R4',
4 '01R5','01R5','01R7','01R7','03BB','03BB','03BB','03BB',
5 '03R3','03R4','03R8','0684','0684','0684','0685','0685',
6 '0685','06CN','06CN','06CN','06GG','06GG','0799','0799',
7 '079T','079T','079T','079T','07R1','07R1','07R1','07R1',
8 '07R3','07R3','07R3','07R3','07R5','07R5','07R5','07R5',
9 '07R6','07R6','07R6','07R6','07R7','07R7','07R7','07R7',
10 '0954','0954','0954','0956','0956','0956','0959','0959',
11 '0959','09ZZ','09ZZ','09ZZ','14R1','14R1','14R1','14R2',
12 '14R2','14R2','16C4','16C4','16C4','16R3','16R3','16R5',
13 '16R5','16R5','16R5','16R7','16R7','16R7','16U4','16U4',
14 '16U4','16U4','1850','1850','1851','1852','1899','20R1',
15 '20R1','20R2','20R2','2181','2181','2181','2181','2182',
16 '2182','2182','2182','2184','2184','2184','2184','2186',
17 '2186','2186','2186','23C1','23C1','23C1','23C1','23C1',
18 '23C1','23C2','23C2','23C2','23C2','23C2','23C2','23FF',
19 '23FF','23FF','23FF','23R1','23R1','23R1','23R1','23R1',
20 '23R1','23R1','23R1','23R2','23R2','23R2','23R2','23R2',
21 '23R2','23R2','23R2','23R3','23R3','23R3','23R3','23R3',
22 '23R3','23R3','23R3','23R5','23R5','23R5','23R5','23R5',
23 '23R5','23R5','23R5','23R6','23R6','23R6','23R6','23R6',
24 '23R6','23R6','23R6','23R7','23R7','23R7','23R7','23R8',
25 '23R8','23R8','23R8','23R8','23R8','23R8','23VP','23VP',
26 '23VP','23VP','23X1','23X1','23X1','23X1','23X2','23X2',
27 '23X2','23X2','23X3','23X3','23X3','23X3','23X4','23X4',
28 '23X4','23X4','23XX','23XX','23XX','23XX','24MA','24MA',
29 '24MA','24MB','24MB','24MB','24MG','24MG','24MQ','24MQ',
30 '24MQ','24MR','24MR','24MR','26R2','26R2','26R4','26R4',
31 '299T','299T','299T','29R1','29R1','29R1','29R2','29R2',
32 '29R2','29R3','29R3','29R4','29R4','29R4','3071','3071',
33 '3071','3071','3072','3072','3072','3072','3075','3075',
34 '3075','3075','3083','3083','3083','3083','3084','3084',
35 '3084','3084','30XB','30XB','30XB','30XB','32M2','32M2',
36 '32M2','32M2','32M2','32M3','32M3','32M3','32M3','32M3',
37 '32M4','32M4','32M4','32M4','32M4','32M5','32M5','32M5',
38 '32M5','32M5','32M6','32M6','32M6','32M6','32M6','32M7',
39 '32M7','32M7','32M7','32M7','32M8','32M8','32M8','32M8',
40 '32M8','32MB','32MB','32MB','32MB','32MB','32MD','32MD',
41 '32MD','32MD','32MD','32ME','32ME','32ME','32ME','32ME',
42 '32MF','32MF','32MF','32MF','32MF','32MG','32MG','32MG',
43 '32MG','32MG','32MH','32MH','32MH','32MH','32MH','32MJ',
44 '32MJ','32MJ','32MJ','32MJ','32MK','32MK','32MK','32MK',
45 '32MK','32ML','32ML','32ML','32ML','32ML','32MM','32MM',
46 '32MM','32MM','32MM','32MN','32MN','32MN','32MN','32MN',
47 '32MP','32MP','32MP','32MP','32MP','32MV','32MV','32MV',
48 '32MV','32MV','32MW','32MW','32MW','32MW','32MW','32R2',
49 '32R2','32R2','32R2','32R2','32R3','32R3','32R3','32R3',
50 '32R3','32R4','32R4','32R4','32R4','32R4','32R5','32R5',
51 '32R5','32R5','32R5','32R6','32R6','32R6','32R6','32R6',
52 '32R7','32R7','32R7','32R7','32R7','32R8','32R8','32R8',
53 '32R8','32R8','32RA','32RA','32RA','32RA','32RA','32RB',
54 '32RB','32RB','32RB','32RB','32RC','32RC','32RC','32RC',
55 '32RC','32RD','32RD','32RD','32RD','32RD','32RE','32RE',
56 '32RE','32RE','32RE','32RF','32RF','32RF','32RF','32RF',
57 '32RG','32RG','32RG','32RG','32RG','32RH','32RH','32RH',
58 '32RH','32RH','32RJ','32RJ','32RJ','32RJ','32RJ','32RK',
59 '32RK','32RK','32RK','32RK','32RL','32RL','32RL','32RL',
60 '32RL','32RM','32RM','32RM','32RM','32RM','32RN','32RN',
61 '32RN','32RN','32RN','32RP','32RP','32RP','32RP','32RP',
62 '32RQ','32RQ','32RQ','32RQ','32RQ','32RW','32RW','32RW',
63 '32RW','32RW','341R','341R','341R','35R1','35R1','35R1',
64 '35R1','35R2','35R2','35R2','35R3','35R3','35R3','35R3',
65 '39Z1','4175','4175','4175','4175','4176','4176','4176',
66 '4176','4177','4177','4177','4177','4179','4179','4179',
67 '4179','41U1','41U1','41U1','41U1','41U2','41U2','41U2',
68 '41U2','41U3','41U3','41U3','41U3','41U4','41U4','41U4',
69 '41U4','41Z1','41Z1','41Z1','41Z1','4290','4290','4290',
70 '4290','4293','4293','4293','4293','42B7','42B7','42B7',
71 '42N7','42N7','42N7','42N7','4350','4350','4350','4351',
72 '4351','4351','4390','4390','4390','4390','4391','4391',
73 '4391','4391','43C9','43C9','43C9','43C9','44R1','44R1',
74 '44R1','44R1','46MM','46MM','46MM','46R1','46R1','46R1',
75 '46R2','46R2','46R2','46R2','489B','489B','48R1','48R1',
76 '48R3','48R3','5185','5185','5279','5279','5279','5297',
77 '5297','5297','521U','521U','521U','52R1','52R1','52R1',
78 '53R1','53R1','53R1','53R1','53R2','53R2','53R2','53R2',
79 '53R4','53R4','53R4','53R4','53R6','53R6','53R6','53R6',
80 '53R7','53R7','53R7','53R7','5480','5480','5481','5481',
81 '5482','5482','5501','5501','5501','5501','5501','5501',
82 '5501','5501','5501','5502','5502','5502','5502','5502',
83 '5502','5502','5502','5502','5502','5503','5503','5503',
84 '5503','5503','5503','5503','5503','5503','5503','55X6',
85 '55X6','55X6','55X6','560X','560X','560X','560X','561X',
86 '561X','561X','561X','56PP','56PP','56PP','56PP','62R2',
87 '62R2','65BT','65BT','65Z1','65Z1','65Z1','2R88','2R88',
88 '2S50','2S50','2S99','2S99','3E99','3E99','3E99','3E99',
89 '3EL1','3EL1','3EL1','3EL1'); -- Initialise it
90 BEGIN
91 for i in 1..array.count loop
92 for r_LRD_IORG IN (select * from LRDLicnse.LRD_IORG where IORG_TYP_DSC = 'BRANCH' and Record_status = 'A' and LGCY_IORG_ID = array(i)) loop
93 dbms_output.put_line(i, array(i), r_LRD_IORG.PS_ORG_ID);
94 end loop;
95 end loop;
96 END
97 /
After trying to compile the code block and run it I get the following error messages.
Error starting at line : 1 in command -
DECLARE
type array_t is varray(692) of varchar2(6);
array array_t := array_t('0118','0118','01R1','01R1','01R2','01R2','01R4','01R4',
'01R5','01R5','01R7','01R7','03BB','03BB','03BB','03BB',
'03R3','03R4','03R8','0684','0684','0684','0685','0685',
'0685','06CN','06CN','06CN','06GG','06GG','0799','0799',
'079T','079T','079T','079T','07R1','07R1','07R1','07R1',
'07R3','07R3','07R3','07R3','07R5','07R5','07R5','07R5',
'07R6','07R6','07R6','07R6','07R7','07R7','07R7','07R7',
'0954','0954','0954','0956','0956','0956','0959','0959',
'0959','09ZZ','09ZZ','09ZZ','14R1','14R1','14R1','14R2',
'14R2','14R2','16C4','16C4','16C4','16R3','16R3','16R5',
'16R5','16R5','16R5','16R7','16R7','16R7','16U4','16U4',
'16U4','16U4','1850','1850','1851','1852','1899','20R1',
'20R1','20R2','20R2','2181','2181','2181','2181','2182',
'2182','2182','2182','2184','2184','2184','2184','2186',
'2186','2186','2186','23C1','23C1','23C1','23C1','23C1',
'23C1','23C2','23C2','23C2','23C2','23C2','23C2','23FF',
'23FF','23FF','23FF','23R1','23R1','23R1','23R1','23R1',
'23R1','23R1','23R1','23R2','23R2','23R2','23R2','23R2',
'23R2','23R2','23R2','23R3','23R3','23R3','23R3','23R3',
'23R3','23R3','23R3','23R5','23R5','23R5','23R5','23R5',
'23R5','23R5','23R5','23R6','23R6','23R6','23R6','23R6',
'23R6','23R6','23R6','23R7','23R7','23R7','23R7','23R8',
'23R8','23R8','23R8','23R8','23R8','23R8','23VP','23VP',
'23VP','23VP','23X1','23X1','23X1','23X1','23X2','23X2',
'23X2','23X2','23X3','23X3','23X3','23X3','23X4','23X4',
'23X4','23X4','23XX','23XX','23XX','23XX','24MA','24MA',
'24MA','24MB','24MB','24MB','24MG','24MG','24MQ','24MQ',
'24MQ','24MR','24MR','24MR','26R2','26R2','26R4','26R4',
'299T','299T','299T','29R1','29R1','29R1','29R2','29R2',
'29R2','29R3','29R3','29R4','29R4','29R4','3071','3071',
'3071','3071','3072','3072','3072','3072','3075','3075',
'3075','3075','3083','3083','3083','3083','3084','3084',
'3084','3084','30XB','30XB','30XB','30XB','32M2','32M2',
'32M2','32M2','32M2','32M3','32M3','32M3','32M3','32M3',
'32M4','32M4','32M4','32M4','32M4','32M5','32M5','32M5',
'32M5','32M5','32M6','32M6','32M6','32M6','32M6','32M7',
'32M7','32M7','32M7','32M7','32M8','32M8','32M8','32M8',
'32M8','32MB','32MB','32MB','32MB','32MB','32MD','32MD',
'32MD','32MD','32MD','32ME','32ME','32ME','32ME','32ME',
'32MF','32MF','32MF','32MF','32MF','32MG','32MG','32MG',
'32MG','32MG','32MH','32MH','32MH','32MH','32MH','32MJ',
'32MJ','32MJ','32MJ','32MJ','32MK','32MK','32MK','32MK',
'32MK','32ML','32ML','32ML','32ML','32ML','32MM','32MM',
'32MM','32MM','32MM','32MN','32MN','32MN','32MN','32MN',
'32MP','32MP','32MP','32MP','32MP','32MV','32MV','32MV',
'32MV','32MV','32MW','32MW','32MW','32MW','32MW','32R2',
'32R2','32R2','32R2','32R2','32R3','32R3','32R3','32R3',
'32R3','32R4','32R4','32R4','32R4','32R4','32R5','32R5',
'32R5','32R5','32R5','32R6','32R6','32R6','32R6','32R6',
'32R7','32R7','32R7','32R7','32R7','32R8','32R8','32R8',
'32R8','32R8','32RA','32RA','32RA','32RA','32RA','32RB',
'32RB','32RB','32RB','32RB','32RC','32RC','32RC','32RC',
'32RC','32RD','32RD','32RD','32RD','32RD','32RE','32RE',
'32RE','32RE','32RE','32RF','32RF','32RF','32RF','32RF',
'32RG','32RG','32RG','32RG','32RG','32RH','32RH','32RH',
'32RH','32RH','32RJ','32RJ','32RJ','32RJ','32RJ','32RK',
'32RK','32RK','32RK','32RK','32RL','32RL','32RL','32RL',
'32RL','32RM','32RM','32RM','32RM','32RM','32RN','32RN',
'32RN','32RN','32RN','32RP','32RP','32RP','32RP','32RP',
'32RQ','32RQ','32RQ','32RQ','32RQ','32RW','32RW','32RW',
'32RW','32RW','341R','341R','341R','35R1','35R1','35R1',
'35R1','35R2','35R2','35R2','35R3','35R3','35R3','35R3',
'39Z1','4175','4175','4175','4175','4176','4176','4176',
'4176','4177','4177','4177','4177','4179','4179','4179',
'4179','41U1','41U1','41U1','41U1','41U2','41U2','41U2',
'41U2','41U3','41U3','41U3','41U3','41U4','41U4','41U4',
'41U4','41Z1','41Z1','41Z1','41Z1','4290','4290','4290',
'4290','4293','4293','4293','4293','42B7','42B7','42B7',
'42N7','42N7','42N7','42N7','4350','4350','4350','4351',
'4351','4351','4390','4390','4390','4390','4391','4391',
'4391','4391','43C9','43C9','43C9','43C9','44R1','44R1',
'44R1','44R1','46MM','46MM','46MM','46R1','46R1','46R1',
'46R2','46R2','46R2','46R2','489B','489B','48R1','48R1',
'48R3','48R3','5185','5185','5279','5279','5279','5297',
'5297','5297','521U','521U','521U','52R1','52R1','52R1',
'53R1','53R1','53R1','53R1','53R2','53R2','53R2','53R2',
'53R4','53R4','53R4','53R4','53R6','53R6','53R6','53R6',
'53R7','53R7','53R7','53R7','5480','5480','5481','5481',
'5482','5482','5501','5501','5501','5501','5501','5501',
'5501','5501','5501','5502','5502','5502','5502','5502',
'5502','5502','5502','5502','5502','5503','5503','5503',
'5503','5503','5503','5503','5503','5503','5503','55X6',
'55X6','55X6','55X6','560X','560X','560X','560X','561X',
'561X','561X','561X','56PP','56PP','56PP','56PP','62R2',
'62R2','65BT','65BT','65Z1','65Z1','65Z1','2R88','2R88',
'2S50','2S50','2S99','2S99','3E99','3E99','3E99','3E99',
'3EL1','3EL1','3EL1','3EL1'); -- Initialise it
BEGIN
for i in 1..array.count loop
for r_LRD_IORG IN (select * from LRDLicnse.LRD_IORG where IORG_TYP_DSC = 'BRANCH' and Record_status = 'A' and LGCY_IORG_ID = array(i)) loop
dbms_output.put_line(i, array(i), r_LRD_IORG.PS_ORG_ID);
end loop;
end loop;
END
Error report -
ORA-06550: line 97, column 0:
PLS-00103: Encountered the symbol "end-of-file" when expecting one of the following:
; <an identifier> <a double-quoted delimited-identifier>
The symbol ";" was substituted for "end-of-file" to continue.
06550. 00000 - "line %s, column %s:\n%s"
*Cause: Usually a PL/SQL compilation error.
*Action:
If you could help getting this pl/sql block up and running I would be much appreciative about it.
Thank you,
Steve Brooks
Obvious error, which causes this exception to be thrown: The END command, before the slash on a line by itself, must be ended in semicolon. Like this:
........
end loop;
END; -- notice the semicolon
/
After you fix this, you will run into another error. put_line takes only one argument, not three. If you want a string including those bits of data, and commas and spaces, you will have to build it using single-quotes for the parts that are hard-coded (comma, space) and the concatenation operator. The more common way would be something like this:
........
dbms_output.put_line('i = ' || i || ', array(i) = ' || array(i) ||
', PS_ORG_ID = ' || r.LRD_IORG.PS_ORG_ID);

expression to Calculate percentage in ssrs

What is the expression if I want to find the percentage of 50 of the total of
524?
Valid Consent
50
35
42
18
15
16
22
48
64
18
30
28
37
41
22
38
Assumeing that your data is in a table's field named CONSENT and using Dataset1, your table's detail expression could be
=Fields!CONSENT.Value / SUM(Fields!CONSENT.Value, "Dataset1")
This will take a single value from the CONSENT field in a table and divide it by the total of all CONSENT fields in Dataset1.

What is the exact NULL value for a field in Oracle?

Title says it all pretty much. What is the exact value that is assigned to a(n) a)Arithmetic b)String c)Logical field to represent NULL, in Oracle DBMS?
Thank you for your time!
Null is the absence of meaning, the absence of value. What gets assigned is null. Not even an ASCII null (ascii value 0) but nothing.
That's why there's a special operation to test for null . This will return false:
...
where col1 = null
We need to test for:
where col1 is null
"we were asked by a professor at uni to find what exactly that value is in these 3 respective cases"
Okay, let's investigate that. Here is a table with two rows:
SQL> create table t42 (
2 type varchar2(10)
3 , colv varchar2(10)
4 , coln number
5 , cold date
6 )
7 /
Table created.
SQL> insert into t42 values ('not null', 'X', 1, sysdate);
1 row created.
SQL> insert into t42 values ('all null', null, null, null);
1 row created.
SQL>Exp
Oracle has a function dump() which shows us the datatype and content of the passed value. Find out more.
What does dump() tell us about our two rows?
SQL> select type
2 , dump(colv) as colv
3 , dump(coln) as coln
4 , dump(cold) as cold
5 from t42;
TYPE COLV COLN COLD
---------- -------------------- -------------------- ----------------------------------
not null Typ=1 Len=1: 88 Typ=2 Len=2: 193,2 Typ=12 Len=7: 120,117,4,29,6,60,44
all null NULL NULL NULL
SQL>
So: the null columns have no data type, no value.
"I don't think dump is suitable for supporting any argument over what "exactly" gets stored to represent a null - because if the expression is null, it simply returns null by definition "
#JeffreyKemp makes a fair point. So let's dip a toe into the internals. The first step is to dump the data block(s);l the dump is written to a trace file:
SQL> conn / as sysdba
Connected.
USER is "SYS"
SQL> select dbms_rowid.rowid_relative_fno(t42.rowid) as fno
2 , dbms_rowid.rowid_block_number(t42.rowid) as blk
3 from a.t42
4 /
FNO BLK
-------- --------
11 132
11 132
SQL> alter system dump datafile 11 block 132;
System altered.
SQL> select value from v$diag_info where name = 'Default Trace File';
VALUE
--------------------------------------------------------------------------------
/home/oracle/app/oracle/diag/rdbms/orcl/orcl/trace/orcl_ora_3275.trc
SQL>
Because T42 is small it fits into only one block. Here is the interesting bit of the dump:
data_block_dump,data header at 0x805664
===============
tsiz: 0x1f98
hsiz: 0x16
pbl: 0x00805664
76543210
flag=--------
ntab=1
nrow=2
frre=-1
fsbo=0x16
fseo=0x1f73
avsp=0x1f5d
tosp=0x1f5d
0xe:pti[0] nrow=2 offs=0
0x12:pri[0] offs=0x1f7f
0x14:pri[1] offs=0x1f73
block_row_dump:
tab 0, row 0, #0x1f7f
tl: 25 fb: --H-FL-- lb: 0x1 cc: 4
col 0: [ 8] 6e 6f 74 20 6e 75 6c 6c
col 1: [ 1] 58
col 2: [ 2] c1 02
col 3: [ 7] 78 75 05 01 02 08 08
tab 0, row 1, #0x1f73
tl: 12 fb: --H-FL-- lb: 0x1 cc: 1
col 0: [ 8] 61 6c 6c 20 6e 75 6c 6c
end_of_block_dump
End dump data blocks tsn: 33 file#: 11 minblk 132 maxblk 132
We can see there are two rows in the table. The first row has entries for four columns; this is the 'not null' row. The second row has only one column: this is the 'all null' row. So, Jeffrey is quite right. All the trailing fields are null so Oracle stores nothing for them.
Answer from APC is fully right, let's give some information on "what does it mean":
Arithmetic: NULL basically means "not defined". Every math operation with NULL (i.e. "not defined") also returns NULL
String: NULL is an empty string, i.e. '' IS NULL returns TRUE - this behavior of Oracle is different to many others RDBMS.
Logical: I assume you mean what happens to BOOLEAN data types. Unlike almost any other programming language in PL/SQL a BOOLEAN variable can have three different states: TRUE, FALSE and NULL. Be aware of this special behavior when you work with BOOLEAN in PL/SQL.
In addition to #APC, in DB there is a something like 'ternary logic' in comparison operations, when we can say that value are equal, not equal and the third is "we don't know", cause of it value absence NULL, and even comparison of to NULL values gives the NULL, meaning that we have no information about operands

Adding new column and inserting values to an exisitng excelsheet using SSIS/SSRS

I have an existing excel template as like below :
DATE 7/28/2016 7/29/2016 July MTD YTD
Call Activity
IB_Calls_Offered 22 29 52 52 52
IB_Calls_Answered 22 29 52 52 52
Sale 6 3 9 9 9
Everyday when my SP get executed , I need to add a extra column (as Current Date) and fill the corresponding data.
Kindly Suggest me how to do it by using SSIS/SSRS

update from temp table to original table

I have two tables one is original table and second one is temp table. Temp table having the correct record. Unique column is cust_id. My table structure is
Customer table
cust_id amount
12 100
13 120
14 130
15 250
20 70
25 110
28 900
temp table
cust_id amount
12 300
13 190
14 110
15 240
20 30
25 210
28 500
I want to update the record from temp table to customer orignal table using customer id.
It can be done using merge statement.
merge into original_table ot
using temp_table tp
on (ot.cust_id = tp.cust_id)
when matched
then update set ot.amount = tp. amount

Resources