TIMESTAMP on FGA_AUDIT [message #469177] |
Tue, 03 August 2010 11:34 |
GAN2009
Messages: 25 Registered: January 2009 Location: Phils
|
Junior Member |
|
|
Hi Oracle Experts,
We have the fga enabled in our database & our plan is to transfer the
log data into a local table which I can call FGA_LOCAL_TBL. The process
on transferring the data is via procedure with job for execution schedule.
Problem: Viewing the dba_fga_audit_trail on TIMESTAMP everything seems fine
but once inserted into the local table it change into wrong time.
Please help to figure out the solution.
Select TIMESTAMP, EXTENDED_TIMESTAMP from
dba_fga_audit_trail where username='GAN';
TIMESTAMP EXTENDED_TIMESTAMP
8/3/2010 9:51:55 AM 8/3/2010 9:51:55.054340 AM -06:00
This is how it look like in local table:
FGA_LOCAL_TBL
TIMESTAMP
2010-08-03 03:51:55
This is the select line on the procedure:
SELECT
TO_CHAR(DBA_FGA_AUDIT_TRAIL.TIMESTAMP,'YYYY-MM-DD HH12:MI:SS'),
Thank you,
GAN
|
|
|
|
|
Re: TIMESTAMP on FGA_AUDIT [message #469181 is a reply to message #469178] |
Tue, 03 August 2010 11:53 |
GAN2009
Messages: 25 Registered: January 2009 Location: Phils
|
Junior Member |
|
|
Hi BlackSwan,
Yes Timestamp in DBA_FGA_AUDIT_TRAIL is date datatype but in my local table I set it to varchar2 so I need to_char to convert it. Actually I set it that way to investigate the problem coz even my local table set to date datatype still the time is wrong. Do you think it something to do with timezone as you can see in the extended_timestamp it has -06:00 at the end part?
Thank you,
GAN
|
|
|
|
Re: TIMESTAMP on FGA_AUDIT [message #469184 is a reply to message #469182] |
Tue, 03 August 2010 12:08 |
GAN2009
Messages: 25 Registered: January 2009 Location: Phils
|
Junior Member |
|
|
I'm sorry for misleading you BlackSwan but I intent to do it HH24:mi:ss. I'm trying to do different combination but I guess focusing in the wrong area.
I ran this & I got:
select dbtimezone from dual;
-06:00
Not to much familiar with timezone but I'm thingking that it should be 00:00 so it's current?
|
|
|
|
Re: TIMESTAMP on FGA_AUDIT [message #469187 is a reply to message #469186] |
Tue, 03 August 2010 12:57 |
GAN2009
Messages: 25 Registered: January 2009 Location: Phils
|
Junior Member |
|
|
Hi Michel,
That's just a guess. My database is in Canada and with timezone MDT. As I query the timestamp from dba_fga_audit_trail everything seems fine but as I inserted the log data into local table I'm getting 6 hours over.
I'm trying another solution, to add 6 hours before insert but that won't clear the real problem though.
Thank you,
-GAN-
|
|
|
|
|
Re: TIMESTAMP on FGA_AUDIT [message #469195 is a reply to message #469177] |
Tue, 03 August 2010 14:37 |
GAN2009
Messages: 25 Registered: January 2009 Location: Phils
|
Junior Member |
|
|
I'm getting the right time now by applying below select statement from dba_fga_audit_trail. It's not the best solution but good enough to move forward in our project.
TO_CHAR(TIMESTAMP - INTERVAL '6' HOUR,'YYYY-MM-DD HH24:MI:SS')
Thank you all!
-GAN-
|
|
|