Insert to Audit Enabled Tables Failes on Iseries

Gov

Guest
Hi All,

Hope everyone is doing good. I need your help on the following scenario.

I am receiving an error when I try to write a record to the file which is audit enabled on DB2. Reason is the file with the name is no more a physical file and changed as a logical file when Auditing is enabled. I need to figure out changing the API for insert might help.

Exact Scenario - I am trying to Copy data from Source environment to Destination environment for the table F4101 using custom C program. I have used the API - JDB_InsertTable. When I try to create a insert statement using NER it ends up with JDB_InsertTableCols in the .c file. I guess (not sure) might be changing API might help in this scenario

Appreciate any Ideas or Thoughts
 
Gov,

The fact it's a logical or view should not make a difference. What is the exact error you are seeing in the log?

Craig
 
Hi Craig,

Log shows Journal errors

Feb 6 16:17:55.902088 dbdrv_log.c196 - 3673/5 WRK:Starting jdeCallObject OS400CC004 - StartJournalFile:Command STRJRNPF FILE(PRODDTA/F4101 ) JRN(OWJRNL/OW_JRNL ) IMAGES(*BOTH) OMTJRNE(*OPNCLO). Failed with exception CPF7002
Feb 6 16:17:55.902256 dbdrv_log.c220 - 3673/5 WRK:Starting jdeCallObject OS400CC004 - StartJournalFile:
 
The auto-journaling process should be starting it on the F4101_ADT physical file, not the logical F4101. SAR 6182482 refers to this issue (which is really old). Seems like the system doesn't "know" auditing is enabled.

Does this happen only locally? on server? both? J environments?
 
Currently the program run on server and J Environment.

May be this could be issue the source environment does not have the Auditing enabled and the Destination environment has it on.
 
OK. Can you run the program in the destination environment and override your source data source?
 
Not Really. I do not have specs of the program in the destination environment currently.

Do you know something like - An audit enabled file will not allow table operations from/ To a different data source. Oracle says this is not allowed as per article - ID 645204.1
 
Just so I understand:

The C function is copying F4101 from Env-A to Env-B.
- Env-B does have Auditing?
- You are copying F4101, not F4101_ADT

The logical (or SQL View) looks like any other table on the system, to E1.

I the C isn't functioning as you desire - have you considered a Table Conversion?

(db)
 
From the thread so far it seems to me that the Journaling on table is failing on your table (source) which results into failure of Insert.

Chan
 
Yes Env -B has Auditing On. Never thought of using TC. Oracle mentions like even for TC programs or R98403, the auditing should be disabled before we do copy. Right now working on what are the other problems will come across if we turn off audit and turn on back.
 
After working with Oracle, realized that not completely talk about Audit On. Could be some thing else as some of Audit Enabled files are doing fine with inserts.
 
It has been a long time since I played with JDE's Auditing....

For those tables that the table copies fail - confirm that auditing IS ON for the destination tables. If memory serves me(IFF - that's another topic), There are triggers that occur as a record is being written. Those triggers update the table (not the logical) with the audit information. I don't recall if the audit fields are unique (primary) keys. I don't recall if the primary keys have to be non-null...

Just a thought...

(db)
 
[ QUOTE ]
For those tables that the table copies fail - confirm that auditing IS ON for the destination tables. If memory serves me(IFF - that's another topic), There are triggers that occur as a record is being written. Those triggers update the table (not the logical) with the audit information. I don't recall if the audit fields are unique (primary) keys. I don't recall if the primary keys have to be non-null...

Just a thought...

[/ QUOTE ]

Yes Audit is turned on and to confirm the Audit fields of _ADT file not part of primary key.
 
Oracle come back and says Turning on Audit is the reason behind. They wanted me to run the program turning of Audit which may not help me all the time (As per my CNC, its a pain turning of Audit and turning on)

I am just thinking about writing record directly to _ADT file and see how it goes.

One Question to CNC experts- Have anyone enabled Audit in 2 different environments at one time? Right now as per the design it should be at one environment at any time.

Thanks,
 
Back
Top