PL/SQL :: Client Identifier In Web App For Use In Audit Trigger?
Feb 1, 2013
in my java web app running on Weblogic which uses connection pooling, I am calling an Oracle Stored Proc that sets client identifier to userid using dbms_session.set_identifier
I then retrieve it in triggers attached to db tables to capture before-after image
I must have missed a step because this is what I find (testing locally):
1. I login to my app as USER1 and update some data
2. I check the audit tables and sure enough last_updated_by is set to USER1
3. Without logging out, I start a different browser (Firefox, in step 1 I used Chrome) and login as USER2
4. I now switch to USER1 session in Chrome browser (still logged in as USER1) and update some data
5. This time I see that the audit tables show last_updated_by as USER2 (instead of USER1)
I'm trying to create a trigger that will come into play after the user has inserted a 0 for the booking evaluation, i need the booking id sent to the audit table. This is what I have tried so far:
CREATE OR REPLACE TRIGGER zero_evaluation AFTER INSERT OR UPDATE ON booking FOR EACH ROW WHEN (NEW.Evaluation=0) BEGIN INSERT INTO audit (audit_id, booking_id, Reason) VALUES (audit_id_seq.NEXTVAL,:NEW.booking_id, 'Contact customer for 0 evaluation'); END;
I get the following: Line 2 PL/SQL: SQL Statement ignored Line 3 PL/SQL: ORA-02289: sequence does not exist
This is my SQL statement: CREATE TABLE audit (audit_id numeric(5) not null, booking_id numeric(5) not null,
I'm not able to login to PL/SQL Developer 7.0.3.1123.I'm receiving "ORA-12154: TNS: could not resolve the connect identifier specified" error. Although it lists all TNS entries in Database drop down.It was working fine last week but now I'm not able to login.
it seems to me that the file tnsnames.ora is not read when i execute sqlplus.whit the command: sqlplus username / password @ servicename i receive the error ORA-12154, while if i pass the whole connection string i can connect without problems
AVDF current version 12.1 not support External/SAN storage. my question is, if customer get a huge number of Audit log and DBFW event records, then how max size can Audi Vault server support for online data (not archive data)? and can I use a Hardware server with multiple HDDs for AV Server?
why my logon trigger always creates 2 records with different timestamp. Also is this the proper way of excepting records to insert?
Script.
CREATE OR REPLACE TRIGGER TR_LOGON_AUDIT AFTER LOGON ON DATABASE BEGIN If user<> 'DBSNMP' then -- don't want to insert this if user <> 'SYS' then -- don't want to insert this
[code]....
Result when select.
OS_USERNAME LOGON_TIMESTAMP ----------- ---------------- GAN 2010-08-05 14:27:52 GAN 2010-08-05 14:27:55
We can audit a particular table alone, I would like to audit one table, to find all different kinds of queries fired (Including select, insert and update) over a period of 2 months.
I am trying to do an update with an anonymous PL/SQL block because it has been absolutely impossible to get by the infamous "Single-row subquery returns multiple rows" Whatever.So this code below work... Obviously, I am updating it to a constant.. OK, duh.. Of course it works, it's easy.... Now, I really need to update it to a value in another table that is in my cursor. I believe that I probably need to declare a secondary cursor.
I'm just getting back in the DBA saddle, so I'm a little rusty..
set serveroutput on; DECLARE numrows NUMBER := 0; total NUMBER := 0; CURSOR upd_record_cur IS SELECT m.rowid, m.swcm_cycle, t.newcycle, p.aprem_no from toad.fswcmas m,
[code]...
Not so good here
ORA-06550: line 20, column 53: PL/SQL: ORA-00904: "TOAD"."TTP43425_LOAD"."NEWCYCLE": invalid identifier ORA-06550: line 20, column 10: PL/SQL: SQL Statement ignored
Doesn't work... BEGIN FOR upd_rec IN upd_record_cur LOOP update toad.fswcmas sw set sw.swcm_cycle = toad.ttp43425_load.newcycle WHERE rowid = upd_rec.rowid; total := total + 1;
I have to create a audit/history table on a master table so that I can store the old/current state of data in my audit table. I am planning to write following program.
1. Created the audit table with similar number of records. 2. Everyday at a particular time I will compare the audit/main table and push the records in audit table which are either updated or not present in the audit table so that the audit table = main table + old state of data.
I am unable to figure out the proper way to implement the point 2 above in oracle database.
I facing the below issue while enable the audit on table.
SQL> audit delete on test; audit delete on test * ERROR at line 1: ORA-00604: error occurred at recursive SQL level 1 ORA-01400: cannot insert NULL into ("SYS"."AUDIT_DDL"."DICT_OBJ_TYPE") ORA-06512: at line 2
=== Related Information === SQL> select version from v$instance;
VERSION ----------------- 11.2.0.2.0
SQL> show parameter audit;
NAME TYPE VALUE ------------------------------------ ----------- ------------------------------ audit_file_dest string /orasw/product/11.2.0 /rdbms/audit audit_sys_operations boolean FALSE audit_syslog_level string audit_trail string DB
SQL> SELECT TABLESPACE_NAME,owner from dba_tables where table_name='AUD$';
We got an apps that queries an EMP table , using select * from EMP where fname like '%SCOTT%' and Lname like '%TIGER%';
How do I list all the hits being encountered by the query within the day? Is it available in the flashback query or archived logs or anywhere in the database?
We need to audit what data has changed from Vendor_B table when compared to Vendor_A table.
There is two tables:
a) VENDOR_A b) VENDOR_B
VENDOR_A and VENDOR_B table does not share the same structure but have 1 column in common - the ID and may or may not having changed Coordinates.
We need to audit what coordinates has changed from Vendor_B data when compared to Vendor A and get the report back in the format of:
<pre> VENDOR_A VENDOR_B ID Change_date LONGITUDE LATITUDE LONGITUDE LATITUDE 873 1/02/2013 -33.46711315 151.3195056 -33.46211316 151.3245057 694 3/02/2013 -33.46721315 151.3198056 -33.46214312 151.3265053
</pre> --------------------------------------------------------------------------------------------------------------------------------------------------- --Found a sample query from Ask Tom but I am not sure how I can apply them to get the structure above. --------------------------------------------------------------------------------------------------------------------------------------------------- <pre> create table base_tab (pk number, column1 number, column2 varchar2(30), column3 date); Create table refresh_tab (pk number, column1 number, column2 varchar2(30), column3 date); Create table diff (pk number, column1 number, column2 varchar2(30), column3 date, base_tab number, refresh_tab number, action varchar2(30));
[Code] .....
--clean out the differences table truncate table diff;
-------------------------------- -- build the difference data ------------------------------------ insert into diff select pk,column1,column2, column3, count(src1) base_tab, count(src2) refresh_tab, null action from ( select a.*,
I am attempting to run a query to pull some data to fill a data request. However I keep getting the following error, "ERROR at line 1:ORA-00972: identifier is too long."
select FS_CORRESPONDENCE_CODE||';'||CM_FILER_SEQ||';'||CM_ORGNAME||';'||CM_FILER_CODE||';'|| CM_PARTY_CODE||';'||RC_LNAME||';'||RC_FNAME||';'||RC_ORGNAME||';'||RC_MAILADDR1||';'|| RC_MAILADDR2||';'||RC_CITY||';'||RC_STATE||";'||RC_ZIP||';'||RC_OCCUPATION||';'|| RC_EMPLOYER||';'||RC_AMT||';'|| from TREFCM, trefrc, treffs WHERE CM_FILER_SEQ = RC_FILER_SEQ
I am trying to execute the below and getting the error:
PLS-00201: identifier 'DBMS.REFRESH' must be declared
The mv is in my schema.. so I am owner. I thought I once read that a dbms.refresh had to be in a block.. so I added the begin and end.. but that didn't resolve it.
I have tried two ways, both resulting in the above error:
execute dbms.refresh('mv_bb_basket'); begin dbms.refresh('mv_bb_basket'); end;
SQL> alter system "_allow_level_without_connect_by"=true scope=spfile; alter system "_allow_level_without_connect_by"=true scope=spfile * ERROR at line 1: ORA-00972: identifier is too long