Relaxation for the audit data.
Hi all
I would like to rrre to write a trigger that maintains the auditing information.
We have two tables. 1 2 EMP. EMP_AUDIT.
If I do all DML operations or any other predefined on EMP table that verify information must INSERT into table EMP_AUDIT.
Can you please let me know how to write a trigger for this.
Thank you.
This is called re - invent the wheel. Why opt for it?
Have you considered maintenance efforts while suggesting the solution? How is it easy to replicate when given the need for another table of audit?
You already have audit functionality provided by Oracle to take care of the check. Why not reuse the functionality rather that rebuild?
This link here gives a demonstration step by step to enable the feature.
In addition, the example does not ask for OP. Could there be updated or insert operations that may be interested in OP. With your path, he would need to create three different triggers.
Here is an example to do only once:
drop table test_table;
drop table test_table_hist;create table test_Table (pk_col number primary key, col1 number, col2 varchar2(5));
create table test_table_hist (pk_col number, old_col1 number, new_col1 number, old_col2 varchar2(5), new_col2 varchar2(5), operation varchar2(10), mod_time timestamp);
create or replace trigger trg_test_table_history
before insert or delete or update of col1, col2
on test_table
for each row
begin
if inserting then
insert into test_table_hist (pk_col, new_col1, new_col2, operation, mod_time)
values (:new.pk_col, :new.col1, :new.col2, 'Insert', systimestamp);
elsif updating then
insert into test_table_hist (pk_col, old_col1, new_col1, old_col2, new_col2, operation, mod_time)
values (:new.pk_col, :old.col1, :new.col1, :old.col2, :new.col2, 'Update', systimestamp);
else
insert into test_table_hist (pk_col, old_col1, old_col2, operation, mod_time)
values (:old.pk_col, :old.col1, :old.col2, 'Delete', systimestamp);
end if;
end;insert into test_table values (1, 1001, 'ABCD');
update test_table set col2 = 'ABCDZ' where pk_col = 1;
insert into test_table values (2, 1002, 'PQRS');
delete from test_table where pk_col = 2;commit;
select *
from test_table_hist;PK_COL OLD_COL1 NEW_COL1 OLD_COL2 NEW_COL2 OPERATION MOD_TIME
---------------------- ---------------------- ---------------------- -------- -------- ---------- -------------------------
1 1001 ABCD Insert 04-FEB-13 06.50.58.926695000 AM
1 1001 1001 ABCD ABCDZ Update 04-FEB-13 06.50.59.099346000 AM
2 1002 PQRS Insert 04-FEB-13 06.50.59.264155000 AM
2 1002 PQRS Delete 04-FEB-13 06.50.59.427643000 AM
Post edited by: PurveshK added Audit trigger for example
Tags: Database
Similar Questions
-
How to connect as a user of a real basis for the audit account?
Hi apex experts...
For the audit, I need to insert the user, among other things, in different tables.
The thing is, I have an application with authentication of account of DB, so a real user database is connected, during the audit, field inserted user is "ANONYMOUS".
I need to audit the user real, is - it possible?
Thank you!
Apex 4.2
EPG
Oracle Enterprise Linux 5.5
11.2 EE databasePlease give complete error messages, so we don't have to find it first:
ORA-04044: procedure, function, package or type is not allowed hereThis is a clear message for me. You must use a trigger, not a default.
Oracle documentation:
A DEFAULT expression cannot contain references to the functions PL/SQL or other columns, the nickname CURRVAL, NEXTVAL, LEVEL, PRIOR and ROWNUM, or date constants that are not completely specified.Published by: InoL on May 15, 2013 13:36
-
Need to create a structure for the target data store?
Hi Experts,
If I create a structure for the target data store, and then load the data from source to target works fine. If I make mistakes.
Is necessary to create a structure for target?
Please help me...
Thanks in advance.
A.Kavya.
I found the answer. No need to create the structure for target temporary data store. and we need to create the structure for the permanent target data store.
-
Need to retrieve the data for the current date.
Hello
I have a table which then retrieves information when using this command.
Select ta_acct, shift, created_on track_alerts;
Technicolor A 24 March 14
Technicolor A 24 March 14
Technicolor A 24 March 14
Technicolor A 24 March 14
Manitoba telecom a 24 March 14 system
Technicolor A 24 March 14
I used this statement to retrieve the data for the given date.
Select ta_acct, shift, created_on track_alerts where created_on = 24 March 14 ';
Its not data recovery.
Need help.
Kind regards
Prasad K T,.
984002170
Prasad K T wrote:
Yes the created data type is date.
CREATED_ON DATE Partha thanks it works now.
Select ta_acct, shift, created_on in track_alerts where to move is: Shift and TRUNC (created_on) = TO_DATE('24-MAR-2014','DD-MON-YYYY');
Still, I made a small change to my querry.
Select ta_acct, shift, created_on track_alerts where to move is: shft and TRUNC (created_on) = TO_DATE (select double sysdate,'MON-DD-YYYY "");
For this statement, it does not work.
of course not...
first: sysdate returns a date so no need of conversion here
and
second SYSDATE includes time, so your application should look like this:
Select ta_acct, shift, created_on in track_alerts where to move is: Shift and TRUNC (created_on) = trunc (sysdate)
or
Select ta_acct, shift, created_on in track_alerts where to move is: shft and created_on > = trunc (sysdate) and created_on<>
HTH
-
I bought Adobe Creative cloud. for the audit, he sent an email that is not mine. How can I fix this problem as I triend to go to my profile and until now I can't download my phtotshop and I got the approval of my payment
Hi Christophe,
Please refer to the threads below where the issue has been addressed:
CC has a fake email, can not change
confirm/verify e-mail addresses for CC subscriptions
Kind regards
Sheena
-
Hello
I have trouble creating my DRS cluster + storage of DRS, I have 3 hosts esxi 5.1 for the task
First, I created the cluster, no problem with that, so the DRS storage was created and now I can see in the Summary tab
"The number of heartbeat for the host data warehouses is 0, which is less than required: 2".
I search the Web and there are similar problems when people has only a single data store (the one that came with ESXi) and need to add another but in my case... vcenter detects any...
In the views of storage I see the store of data (VMFS) but for some strange reason the cluster not
In order to achieve data warehouses minimum (2) can I create an NFS and map it in THE 3 esxi hosts? Vcenter which consider a play config?
Thank you
You probably only have local data warehouses, which are not that HA would require for this feature (pulsations datastore) to work properly.
You will need either 2 iSCSI, FC 2 or 2 NFS volumes... Or a combination of the any of them, for this feature to work. If you don't want to use this feature, you can also turn it off:
-
Difference in the number of records for the same date - 11 GR 2
Guy - 11 GR on Windows2005 2, 64-bit.
BILLING_RECORD_KPN_ESP - is a monthly partitioned table.
BILLING_RECORD_IDX #DATE - is a local index on "charge_date" in the table above.
SQL > select / * + index (BILLING_RECORD_KPN_ESP BILLING_RECORD_IDX #DATE) * /.
2 (trunc (CHARGE_DATE)) CHARGE_DATE;
3 count (1) Record_count
4. IN "RATOR_CDR". "" BILLING_RECORD_KPN_ESP ".
where the 5 CHARGE_DATE = January 20, 2013.
Group 6 by trunc (CHARGE_DATE)
5 m
CHARGE_DATE RECORD_COUNT
------------------ ------------
2401 20 January 13-> > some records here.
-> > Here I can see only '2041' records for Jan/20. But in the query below, it shows "192610" for the same date.
Why is this difference in the number of records?
SQL > select / * + index (BILLING_RECORD_KPN_ESP BILLING_RECORD_IDX #DATE) * /.
(trunc (CHARGE_DATE)) CHARGE_DATE,
2 count (1) Record_count
3. FOR "RATOR_CDR." "" BILLING_RECORD_KPN_ESP ".
"4 where CHARGE_DATE > 20 January 2013."
Group of 5 by trunc (CHARGE_DATE)
6 order by trunc (CHARGE_DATE)
5 m
CHARGE_DATE RECORD_COUNT
------------------ ------------
192610 20 January 13-> > more records here
JANUARY 21, 13 463067
JANUARY 22, 13 520041
23 JANUARY 13 451212
JANUARY 24, 13 463273
JANUARY 25, 13 403276
JANUARY 26, 13 112077
27 JANUARY 13 10478
28 JANUARY 13 39158
Thank you!Because in the second example you also select rows that have a nonzero component.
The first example selects only rows that are 00:00:00
(by the way, you should ask questions like this in the forum SQL)
-
ESXi is unable to install 'his place on the disk for the dump data' no ideas?
It is an older server.
Data sheet:
GOING Linux 2200 series
Intel P3 700 MHz x 2
768 MB OF RAM
9.1 GB SCSI x 3 (configured in RAID 5 now)
I have attached a picture of the error message that is received and typed most of the message below.
NOT_IMPLEMENTED /build/mts/release/bora-123629/bora/vmkernel/sched/sched.c:5075
Frame 0x1402ce0 ip = 0x62b084 cr2 = cr3 = 0 x 0 = ox3000 cr4 = 0 x 20
are is 0xffffffff ds is 0xffffffff fs = 0xffffffff gs = 0xffffffff
EAX = 0xffffffff = 0xffffffff = 0xffffffff edx ecx ebx = 0xffffffff
= 0x1402e3c = 0xffffffff edi esi EBP = 0xffffffff err =-1 eflags = 0xffffffff
* 0:0 / & lt; NULL & gt; 1:0 / & lt; NULL & gt;
0x1402e3c: battery: 0x830c3f, 0x1402e58, 0x1402e78
VMK availability: 0:00:00:00.026 TSC: 222483259709
No space on disk for the dump data
Waiting for debugger... (World 0)
Debugger is listening on the serial port...
Press ESC to enter the local debugger
This could be a simple problem or not, I'm not sure. I spent several hours already trying to reconfigure the readers to try to get the installation to recognize.
Any help is greatly appreciated.
I agree with Matt, the material can be simply too old-
If you find this or any other answer useful please consider awarding points marking the answer correct or useful
-
Recommended value for the BAM data expiration time
Hello
Can someone tell me what is the recommended value for the BAM data expiration time?
Enterprise Server default is 24 hours, but I would like to be able to raise the average runtime instance after several months. Is it reasonable to the value of the time-out value a high value? Or it will have an impact on the performance of BPM/BAM?
Thanks in advance.
Best regards
CANormally, we keep the BAM data expiration time at halfway with 24 to 72 hours. For historical reports that you are looking for the Data Mart / Data Warehouse DB are more logical. This database stores the data forever and takes pictures at longer intervals, normally 24 hours. These data are not in time real normally then because a capture instant is only taken once per day but will give you historical reports that you are looking for. The data from this database structure is almost identical to the BAM DB.
-
Not able to start agent cache for the requested data store
Hello
This is my first attempt in TimesTen. I am running TimesTen on the same host Linux (RHES 5.2) running Oracle 11 g R2. TimesTen version is:
TimesTen Release 11.2.1.4.0
Trying to create a simple cache.
The DSN entry section for ttdemo1 to. odbc.ini is as follows:
+ [ttdemo1] +.
Driver=/home/Oracle/TimesTen/TimesTen/lib/libtten.so
Data store = / work/oracle/TimesTen_store/ttdemo1
PermSize = 128
TempSize = 128
UID = hr
OracleId = MYDB
DatabaseCharacterSet = WE8MSWIN1252
ConnectionCharacterSet = WE8MSWIN1252
With the help of ttisql I connect
Command > Connect "dsn = ttdemo1; pwd = oracle; oraclepwd = oracle;
Successful login: DSN = ttdemo1; UID = hr; DataStore = / work/oracle/TimesTen_store/ttdemo1; DatabaseCharacterSet = WE8MSWIN1252; ConnectionCharacterSet=WE8MSWIN1252;DRIVER=/home/oracle/TimesTen/timesten/lib/libtten.so;OracleId=MYDB; PermSize = 128; TempSize = 128; TypeMode = 0; OracleNetServiceName = MYDB;
(Default AutoCommit = 1).
Command > call ttcacheuidpwdset ('ttsys', 'oracle');
Command > call ttcachestart;
* 10024: could not start agent cache for the requested data store. Could not initialize Handle.* Oracle environment
The command failed.
The following text appears in the tterrors.log:
15:41:21.82 Err: ORA: 9143: ora-9143 - 1252549744-xxagent03356: database: TTDEMO1 OCIEnvCreate failed. Return - 1 code
15:41:21.82 Err: 7140: oraagent says it failed to start: could not initialize manage Oracle environment.
15:41:22.36 Err: 7140: TT14004: failed to create the demon TimesTen: couldn't reproduce oraagent for "/ work/oracle/TimesTen_store/ttdemo1 ': has not been initialized Handl Oracle environment
What are the reasons that the demon cannot happen again to another agent? FYI, the environment variables are defined as:
ORA_NLS33=/U01/app/Oracle/product/11.2.0/Db_1/ocommon/NLS/Admin/data
ANT_HOME = / home/oracle/TimesTen/ttdemo1/3rdparty/ant
CLASSPATH=/home/oracle/TimesTen/ttdemo1/lib/ttjdbc5.jar:/home/oracle/TimesTen/ttdemo1/lib/orai18n.jar:/home/oracle/TimesTen/ttdemo1/lib/timestenjmsxla.jar:/home/oracle/TimesTen/ttdemo1/3rdparty/jms1.1/lib/jms.jar:.
Oracle@rhes5:/Home/Oracle/TimesTen/ttdemo1/info% echo $LD_LIBRARY_PATH
/home/oracle/TimesTen/ttdemo1/lib:/home/oracle/TimesTen/ttdemo1/ttoracle_home/instantclient_11_1:/u01/app/oracle/product/11.2.0/db_1/lib:/u01/app/oracle/product/11.2.0/db_1/network/lib:/lib:/usr/lib:/usr/ucblib:/usr/local/lib
See you soonI see no problem here. The ENOENTs are superfluous because it locates libtten here:
23302 open ("/ home/oracle/TimesTen/11.2.1.4.0/TimesTen/ttimdb1/lib/libtten.so", O_RDONLY) = 3
without doubt, it does the same thing trying to find the libttco.so?
23302 open ("/ home/oracle/TimesTen/11.2.1.4.0/TimesTen/ttimdb1/ttoracle_home/instantclient_11_1/libttco.so", O_RDONLY) =-1 ENOENT (no such file or directory)
Thank you for taking the trace. I really want to have a look at the complete file if you can send it to me?
-
With the help of AfterInsertTrigger for the audit table
Hi all
I use after Insert trigger to re - write the record goes to the base table in the corresponding table. The statement from the two tables are the same, except that the table has a column more - audit_time. Here is how I defined the trigger:
Create or replace trigger dup_rec after insert on table_A for each line
begin PK_comm.create_audit_rec (table_A, table_b,: new.) ROWID); end;
In the PK_comm package, I defined the procedure as 'PRAGMA AUTONOMOUS_TRANSACTION' create_audit_rec as follows:
Procedure create_audit_rec (baseTable IN VARCHAR2, auditTable IN VARCHAR2, cRowId IN VARCHAR2)
IS
PRAGME AUTONOMOUS_TRANSACTION;
Insert into auditTable (audit_time, col1, col2, col3)
Select systimestamp, col1, col2, col3
from baseTable
where ROWID = chartorowid ('v_rowID');
It seems that registration is NOT added to the audit table when I tried to insert a record in the database table. Is it possible that integration into baseTable have not completed when the trigger is activated? If Yes, what is the work around?
Thanks for your help,
MikePackages have session scope. Thus, each session will have a different instance of the collection.
If you have multiple tables, you must in general, several collections. If you can guarantee that a single table would never change during the scope of a single statement, you could get away with a single collection. But as soon as a trigger on table A changes data in table B, you would need different collections. For most applications, it is much easier to simply create separate collections. I guess you can also create a collection of objects and folders that have a table name and a ROWID as well and add the logic to process only the associated with the table ROWID that you are interested in.
Justin
-
Use the 2nd column for the label data
This should be easy. Online help for the numbers shows an example under Add graphics > adjust figure brands and labels. My table is a simple 2-d column chart. In a single column, I have the weight in pounds, and in the second column, I have a date. When I have only the weight column selected in the form of data, I get a graph that is almost perfect, but there is no date label. When I try to include date data, I have a reverse relationship X and Y. Once I selected a cell as reference data, it doesn't have any way to deselect. What I want to do is chart weight against date and have the date appear as a label.
Any advice is welcome.
Hi innerserenity,
I swapped the order of the columns. Column A is a column header.
Kind regards
Ian.
-
Hello
I used the Labview FPGA module to develop test equipment. Now, I need to write a driver that is to be a Dll with compatible interface to C/C++ for this equipment. So that my client who is familiar with C/C++ can call the driver without any study on labview. But I had a few problem on how to convert labview for C/C++ data complex data type. To clearly explain to my question, I have attached a simple example. (see attachment) I try to generate a Dll for the attached example VI and get the the function prototype at the head of the files as below:
' void OpenFpgaReference (LStrHandle * RIODevice, TD1 * errorIn, LVRefNum * FPGAVIReferenceOut, TD1 * errorOut).
As you have known, the type of data "LStrHandle * RIODevice" and "LVRefNum * FPGAVIReferenceOut" Labview data format are. C/C++ do not have this kind of data type and can not reconige it. As a result, I can't call the Dll of C/C++ programming language. How to convert these two data type of labview for the C/C++ compatible data format, and then build the Dll? Anyone know about this?
The answer is really apprecaited! Thank you in advanced.
Ivan.Chen wrote:
As I found in the following article:
http://digital.NI.com/public.nsf/WebSearch/FB001AA027C8998386256AAD006C142D?OpenDocument
LVRefNum is the name of resource of LabVIEW VISA or refnum, and "it is impossible to convert LabVIEW VISA name of resource or refnum VISession valid ID."
This means that external code modules can not access & control the session VISA which is open by labview. But for my purposes, I will not attempt to access this VISA extenal code(C/C++) session. I just hope that save this session VISA in the external code once I opened it in Labview dll; and pass it to the labview dll when needed. While I have not need to login again when I need to control the device. Is it possible to do?A LVRefNum is really just a single int32 value. Its meaning is useless for other environments than those who created it so that you Michael not any what in C/C++ caller but pass it back to other functions in your DLL, but this often isn't a problem at all.
You can take the following statement of the LabVIEW extcode.h headers and add them to your delabviewed header files to make it work in such a way.
#define Private (T) typedef struct T # _t {void * p ;} * T}
Private (LVRefNum);
The LStrHandle you must set a standard C string instead in your export DLL and document what is the size of the string buffer should have if it is an output parameter.
TD1 error clusters should also be divided into their parameters (C compatible) separate for all items or just to the left of suite entirely.
Rolf Kalbermatter
-
Filter KeywordFilterField customized for the tabular data model
I am currently looking for the rows in the table that is filtered through the KeywordFilterField. The underlying data are in table form:
Contact {name, phone, etc etc}
The KeywordFilterField shows only what I pass to it (Contact.Name) by calling setSourceList() and filters that the channels in the list. So if I get the numbers, which will return a list empty, because none of the Contacts have numbers in their names.
However, what I want to do is query the table, like a SQL query, retrieve lines that correspond to a part of Contact.Name or Contact.Phone. (Remember this application don't use SQLite.) I'm using RMS to persistent storage and I created my database and queries of base by hand.)
Is there a way I could customize/override the filter query so that the KeywordFilterField calls my query functions rather than it's default filter String? It is a base with search CRUD application. I use KeywordFilterField because it's everything I need.
Any help would be useful.
It is possible with a text field and a list field, this way you can make your own personalized search for the keyword filter field does not search your data the way you want. In addition, I know that the keyword filter field is broken and that it was returning always completely incorrect search result for me.
Here's an overview of what to do. Some things I can't tell you how for example to what is happening in the function "searchContacts" since it is up to you to write the code to do whatever custom search you want.
class CustomKeywordFilterScreen extends MainScreen implements FieldChangeListener, ListFieldCallback { //just a slightly modified edit field for use in entering keywords private CustomKeywordField _filterEdit; //a standard list field private ListField _countryList; //temp variable to hold the last keyword searched so we don't search for it again //you'll see this used later on private String _previousFilterValue; //any other private vars you need to hold search results go here //we'll use an a Contact[] for illustration private Contact[] _contactResults; CustomKeywordFilterScreen() { super(Manager.VERTICAL_SCROLL | Manager.VERTICAL_SCROLLBAR); //initiaize to empty string _previousFilterValue = ""; //searchContacts is whatever function you write to do the customized search you want, //in this example passing an empty string returns all contacts _contactResults = searchContacts(_previousFilterValue); //create the edit field and set it as the title of the screen so it's always visible, //even when you scroll the list _filterEdit = new CustomKeywordField(); _filterEdit.setLabel("Search: "); _filterEdit.setChangeListener(this); setTitle(_filterEdit); //create the list for showing results _contactList = new ListField(); _countryList.setRowHeight(-2); _contactList.setSize(_contactResults.length); _contactList.setCallback(this); add(_contactList); } protected boolean keyChar(char c, int status, int time) { if (c == Characters.ESCAPE) { //user pressed escape key, if there's something in the edit field clear it //otherwise handle it as closing the screen or whatever else you want if (_filterEdit.getTextLength() > 0) { _filterEdit.setText(""); } else { //close the screen or do something else, it's your call //maybe even do nothing, whatever you want } return (true); } else { //all other keystrokes set focus on the edit field _filterEdit.setFocus(); } return (super.keyChar(c, status, time)); } public void fieldChanged(Field field, int context) { if (field == _filterEdit) { //test the edit field's value against the previously searched value //if NOT the same then do a search and refresh results if (!_filterEdit.getText().equals(_previousFilterValue)) { //cache the newest search keyword string _previousFilterValue = _filterEdit.getText(); //search your data _contactResults = searchContacts(_previousFilterValue); //update the list size to cause it to redraw _contactList.setSize(_contactResults.length); } } } public void drawListRow(ListField listField, Graphics graphics, int index, int y, int width) { if (listField == _contactList && index > -1 && index < _contactResults.length) { //draw your list field row as you want it to appear } } public Object get(ListField listField, int index) { if (listField == _contactList && index > -1 && index < _contactResults.length) { return (_contactResults[index]); } return (null); } public int getPreferredWidth(ListField listField) { return (Display.getWidth()); } public int indexOfList(ListField listField, String prefix, int start) { return (-1); } }
class CustomKeywordField extends EditField { CustomKeywordField() { super(USE_ALL_WIDTH | NO_LEARNING | NO_NEWLINE); } protected void paint(Graphics graphics) { super.paint(graphics); //Draw caret so the edit field always shows a cursor giving the user an indication they can type at anytime, //even when the focus is on the list field that is used in conjunction with this edit field to create a //keyword filter field replacement getFocusRect(new XYRect()); drawFocus(graphics, true); } }
-
Extraction of the metadata for the audit of an electronically signed document report
I'm contract review and manually extract data from PDF files that have been signed electronically. Is there a way to extract metadata from the report of audit and entry into an excel spreadsheet?
Hi 55aalexa,
Sign in with your Adobe sign account, go to the page manage-> them and click on "Little black icon" who will say 'has the form data to the signature section. It will automatically download the excel file with all the data of the signed document.
Feel free to contact us if you have queries or concern.
Kind regards
Nicos
Maybe you are looking for
-
How can I remove tab scrolling?
I would like to see all my tabs in the tab bar without having to scroll. I know that this "reduces" the tab, sometimes to where they are not readable, but that's what I want. I opened about 20 pages of stock and I can easily read the stock symbol whe
-
Photosmart 3310: photosmart 3310 windows 10 - printer not found
I bought a new computer (Lenovo: 30) and immediately updated for Windows 8.1 to 10. I ran the Print and Scan doctor who has downloaded the latest version of the software, HP Photosmart and Officejet full feature software and drivers - Full_Webpack -
-
Running command-line Windows (path problem)
Hello It's kind of weird, but I can't run the command line in windows 7 due to the long way and spaces... I want to run the command:
-
Receive the error"the printer is offline
Original title: slow down the response of the printer My printer has recently begun to respond very slowly and displays error messages such as 'the printer is offline' or 'the printer is unresponsive. Print job seems to stand in line print, but subse
-
Migration planning in 11.1.2.1 application
Hi allI did not go to a total migration through LCM 11.1.2.1 of an application to another. After a little research I found a few steps to export the application, but I have not found how to import it. Perhaps I have missed. Steps I did: 1 > I have cr