Which is better database audit or database trigger ?

Hello ,
Hope everyone is doing well.............
I have a doubt , which i have mentioned below ........ Plz help me on this ....
Suppose I want to track all the actions that is going to be performed on a table (example -UPDATE), like
1-> which user has modified the table .
2-> At which time the data has been modified .
3 -> before image of data and after image of the data
In order to track all the above information , we can user oracle database audit or we can create a trigger that wiill fire for that
perticular event and track all the informations in to a table .
But my questions are
-> On which scenario should i use trigger
-> On which scenario should i use database audit
-> In between trigger and database audit , which one sholud be used keeping in mind about the performance .
Thanks

user9085814 wrote:
Hello ,
Hope everyone is doing well.............
I have a doubt , which i have mentioned below ........ Plz help me on this ....
Suppose I want to track all the actions that is going to be performed on a table (example -UPDATE), like
1-> which user has modified the table .
2-> At which time the data has been modified .
3 -> before image of data and after image of the data
In order to track all the above information , we can user oracle database audit or we can create a trigger that wiill fire for that
perticular event and track all the informations in to a table .
But my questions are
-> On which scenario should i use trigger
-> On which scenario should i use database audit
-> In between trigger and database audit , which one sholud be used keeping in mind about the performance .
ThanksUse database auditing whenever possible, FGA is also available on DML from 10g onwards.Use trigger when you've to capture before and after value.
http://dbpedias.com/wiki/Oracle:Fine_Grained_Auditing_vs_Triggers
http://www.oracle.com/technetwork/articles/sql/week10-10gdba-097438.html

Similar Messages

  • Which is better for performance Azure SQL Database or SQL Server in Azure VM?

    Hi,
    We are building an ASP.NET app that will be running on Microsoft Cloud which I think is the new name for Windows Azure. We're expecting this app to have many simultaneous users and want to make sure that we provide excellent performance to end users.
    Here are our main concerns/desires:
    Performance is paramount. Fast response times are very very important
    We want to have as little to do with platform maintenance as possible e.g. managing OS or SQL Server updates, etc.
    We are trying to use "out-of-the-box" standard features.
    With that said, which option would give us the best possible database performance: a SQL Server instance running in a VM on Azure or SQL Server Database as a fully managed service?
    Thanks, Sam

    hello,
    SQL Database using shared resources on the Microsft data centre. Microsoft balance the resource usage of SQL Database so that no one application continuously dominates any resource.You can try the 
    Premium Preview
    for Windows Azure SQL Database which offers better performance by guaranteeing a fixed amount of dedicated resources for a database.
    If you using SQL Server instance running in a VM, you control the operating system and database configuration. And the
    performance of the database depends on many factors such as the size of a virtual machine, and the configuration of the data disks.
    Reference:
    Choosing between SQL Server in Windows Azure VM & Windows Azure SQL Database
    Regards,
    Fanny Liu
    If you have any feedback on our support, please click here. 
    Fanny Liu
    TechNet Community Support

  • Is there an AUDIT option like AFTER SERVERERROR database trigger?

    I want to log any and every error-exception in a test database for a period.
    I have seen DBMS_UTILITY.FORMAT_ERROR_BACKTRACE article published on Oracle Magazine;
    http://www.oracle.com/technology/oramag/oracle/05-mar/o25plsql.html
    But before trying to build a custom application like this one;
    http://apex.oracle.com/pls/otn/f?p=2853:4:1160653345033883::NO::P4_QA_ID:5922
    1- I wanted to be sure if there is a specific WHENEVER NOT SUCCESSFUL Audit option for this need?
    2- Also is there a way to capture NO_DATA_FOUND exception with AFTER SERVERERROR database trigger?
    Thank you,
    Best regards.

    some stuff like following;
    1)
    -- the right one is conn hr/hr
    conn hr/eychar
    2)
    -- the right one is grant select on employees to public;
    grant select onnnn employees to public;
    3)
    create or replace procedure p1 as
    begin
    raise_Application_error(-20001, 'catch me if you can');
    end;
    exec p1;
    again thank you for your interest Michaels.

  • Which is better? Extracting images from directories or from database?

    Good day,
    I would like to start a discussion on extracting image (binary data) from a relational database. Although some might say that extracting image from directories is a better approach, I m still sceptic on that implementation.
    My argument towards this is based on the reasonings below:
    1. Easier maintainence. - System Administrator can do backup from one place which is the database.
    2. High level of security - can anyone tell me how easy it is to hack into a database server?
    3. image is not dependent on file structure - no more worries about broken links because some one might mistakenly change the directory structure. If there needs to be a change, it will be handle efficiently by the database server.
    The intention of my question is to find out :
    1. Why is taking image from a directory folder which resides on the web server is better than using the same approach from the database?
    2. How is this approach (taking image from directory) scalable if there is thousands of images and text that needs to be served?
    If anybody would be kind enough to reply, I would be most grateful.
    Thank You.
    Regards
    hatta

    Databases are typically more oriented towards text and number content than binary content, I believe. If you carry images in the database you will need to run them through your code and through your java server before they are displayed. If they are held in a directory they will be called from hrefs in the produced page, which means that they are served by your static server. This is quicker because no processing of the image is required. It also means the Database has to handle massively less data. Depending on the database this should be far quicker to query.
    It is worth noting that it is also quite difficult to actually change mime-types on a page to display a picture in the midst of HTML- the number of enquiries on these pages about this topic should be enough to illustrate this.
    If you give over controls of all the image file handling to your java system (which I do when I write sites like the one you describe) then the actual program knows where to put the images and automatically adds them to the database. The system administrator never needs to touch them. If they want a backup they save the database and the website directory. The second of those should be a standard administrative task anyway, so there is not a huge difference there. The danger of someone accidentally changing the directory structure is no greater than the danger of someone accidentally dropping a database table- it can be minimised by making sure your administrators are competent. Directory structures can be changed back, dropped tables are gone.
    The security claim is slightly negated because you still have to run a webserver. Every program you run on your server is vulnerable to attack but if you are serving web pages you will have a server program that is faster than a database for image handling. You are far more at risk from running FTP or Telnet on your server or (worst of all) trying to maintain IIS.
    The images in directory structure is more scalable because very large databases are more likely to become unstable and carrying a 50k image in every image field rather than 2 bytes of text will make the database roughly 25000 times larger. I have already mentioned the difference in serving methods which stands in favour of recycling images. A static site will be faster than a dynamic site of equivalent size, so where you can, take advantage of that.

  • Which is better? store files in the database or directly on the O.S.?

    Hi,
    i´m developing an application to manager files. which is better? store files in the database or directly on the O.S.? If i decide to store on database, i will use the BLOB data type but i have a doubt...the BLOB data type occupies the same space on database regardless of file size? there is another data type better?
    Tks,
    Fernando.

    http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:1011065100346196442
    Ask Tom has a bit of info to share on the topic. Have a read of this. :)

  • Which is better External View OR Database procedure Proxy ?

    Hi Jasmin and Kilian,
    Creation of External View in HANA and consume in ABAP.
    Which is better External View OR Database procedure Proxy.
    Regards,
    Pravin
    Message was edited by: Jens Weiler
    Branched from http://scn.sap.com/thread/3498161

    Hi Pravin,
    that depends on your application logic and use case. There is no general recommendation for one or the other.
    If, for instance, you have input parameters, you would go for a DB procedure proxy, since the external view does not allow to pass input parameters from the ABAP to the HANA column view.
    On the other hand, if you would like to consume the result in an ALV with integrated data access (the "next generation ALV"), you would rather go for an external view... so - like the answer to so many other questions - it depends... .
    Cheers,
      Jasmin

  • Which is better to install Oracle 11g database based on ASM or Filesystem

    We will install 2 sets of Oracle 11.2.0.3 on Redhat Linix 5.6 and configure Data Guard for them further -- one will be a primary DB server, the other will be a physical standby DB server. The Oracle DB stoage is based on SAN Array Disk with 6TB size. Now there are two options to manage the DB datafiles:
    1. Install Oracle ASM
    2. Create the tranditional OS filesystem
    Which is better? in the past, our 10g data guard environment is not based on Oracle ASM.
    Someone think if we adopt the oracle ASM, the shortcomings are :
    1. as there is one more instance that will consume more memory and resource.
    2. as the ASM file system cannot be shown out on the OS level directly such as "df" command, the disk utilization monitor job will be more difficult. at least it cannot be supervised at OS level.
    3. as the DB bshoule be done the daily incremental backup (Mon-Sat) to Local Backup Drive. the bakup job must be done by RMAN rather than user-managed script.
    Who can provide some advices? Thanks very much in advance.

    user5969983 wrote:
    We will install 2 sets of Oracle 11.2.0.3 on Redhat Linix 5.6 and configure Data Guard for them further -- one will be a primary DB server, the other will be a physical standby DB server. The Oracle DB stoage is based on SAN Array Disk with 6TB size. Now there are two options to manage the DB datafiles:
    1. Install Oracle ASM
    2. Create the tranditional OS filesystem
    Which is better? in the past, our 10g data guard environment is not based on Oracle ASM. ASM provides a host of new features ito data management, and performance - to the extent that you can rip out the entire existing storage system, replace it with a brand new storage system, without a single second of database downtime.
    Someone think if we adopt the oracle ASM, the shortcomings are :
    1. as there is one more instance that will consume more memory and resource.Not really relevant on 64bit h/w architecture that removes limitations such a 4GB of addressable memory. On the CPU side... heck, my game PC at home has a 8 core 64bit CPU. Single die and dual core CPUs belong to the distant past.
    Arguing that an ASM instance has overheads would be silly. And totally ignores the wide range of real and tangible benefits that ASM provides.
    2. as the ASM file system cannot be shown out on the OS level directly such as "df" command, the disk utilization monitor job will be more difficult. at least it cannot be supervised at OS level.That is a A Very Good Thing (tm). Managing database storage from o/s level is flawed in many ways.
    3. as the DB bshoule be done the daily incremental backup (Mon-Sat) to Local Backup Drive. the bakup job must be done by RMAN rather than user-managed script.
    rman supports ASM fully.
    I have stopped using cooked file systems for Oracle - I prefer ASM first and foremost. The only exceptions are tiny servers with a single root disk that needs to be used for kernel, database s/w, and database datafiles. (currently these are mostly Oracle XE systems in my case, and configured that way as XE does not support ASM and is used as a pure cost decision).

  • Multiple Rows Update / Refresh Toplink Query when database trigger involved

    Hi everybody!
    I have two easy troubles for you; the platform is the same as the SRDemo Toplink version.
    1.     Multiple Rows Update: I want to update with mergeEntity method, multiple rows for an isolated table; that method receives a parameter that I try to bind with the iterator "dataProvider" but it only merges the first row, not all, any other combination returns an error.
    What I want to do is to have a form (like tabular forms in Apex) that lets me update multiple rows in a single page. ¿May anyone tell me how to do it?
    2.     Refresh Toplink Named Query: I have a list on a page with two columns. From another page, a button does an action that fires a database trigger that updates one of the columns on the list´s page. When I go back to the list, it is not updated; however, the CacheResults´s property is set to false on the iterator.
    Thanks in advance,
    Alejandro T

    I didn't use it (yet), but - you might take a look. You'll find a [url http://www.oracle.com/technetwork/developer-tools/apex/application-express/apex-plug-ins-182042.html]Timer plug-in on this page. It is a dynamic action which allows you to periodically fire other dynamic actions in the browser. For example use the timer to refresh a region every five minutes. You can perform any dynamic action you want using this infrastructure.So I was thinking: you might use it to run a dynamic action which would check whether something changed in that table (I suppose you'll know the way) (for example, a database trigger might set a flag in some table, timestamp or similar), and - if you find that something really changed - refresh the page.
    As I said, I never used it so that's pure theory. Someone else might know better, though.

  • Could the Database Trigger get a forms variable value

    Hi All
    We have an ERP which connect all users of the system with a single schema (Database user name), We create a record for each user in the ERP itself to specify the privillages for each user
    I would like to make a database trigger to Audit a table , by storing the user name, action (Insert,delete,update) on an audit table.
    The problem is the user name i want to store is not the schema name, but it's stored in a database table and read in a global variable.
    Can i get the user name (which stored in the global variable) in the database trigger ???
    Thanks
    Mostafa Abolaynain

    If this global variable lives inside Forms (which the title of your post seems to indicate), then no.
    A database trigger can only reference "stuff" that lives inside the database session at the database server, not "stuff" that lives inside the proces at the client device.
    You should ask your ERP vendor: there might very well be something (eg. a variable inside a database package) that you can use.

  • Workflow Vs Database Trigger

    Hi
    I am new to workflow..i am in the learning process.. just a simple query on workflow...
    What is the advantage of Workflow over the database trigger in the context of sending a mail...
    i will be helpful if u send me some features of workflow...
    Regards
    Yram

    Hi,
    If all you want is to send an email, then there are better ways of doing it than to use Workflow.
    Comparing Oracle Workflow to a database trigger is kind of like comparing a car and a unicycle - they do completely different things, but can do the same thing as each other if you really want to.
    Oracle Workflow provides a complete workflow process management solution - a database trigger is a piece of PL/SQL which fires on an insert, update or delete operation on a table. They are completely different.
    It might be worth looking in somewhere like Wikipedia to see what a workflow product can do, or the Workflow pages on OTN to see what Oracle Workflow in particular can offer.
    HTH,
    Matt
    WorkflowFAQ.com - the ONLY independent resource for Oracle Workflow development
    Alpha review chapters from my book "Developing With Oracle Workflow" are available via my website http://www.workflowfaq.com
    Have you read the blog at http://thoughts.workflowfaq.com ?
    WorkflowFAQ support forum: http://forum.workflowfaq.com

  • Can I execute a mapping from a database trigger ????

    Can anyone tell me if I can execute a mapping from a database trigger ? How ???
    Thanks in advance.----
    JEMD

    Hello,
    We are using the approach of scheduling predefined job heavily in our projects. It works fine.
    There are several points to mention:
    - scheduling / rescheduling algorithm must not lead to simultaneous session of the mapping run. Depending of content of the mappings/PF this could bring the real pain.
    - If there are several user sessions intensively interacting the table on which the scheduling trigger is created, scheduling / rescheduling algorithm must be written with care – users could lock or wait each other while updating job record.
    - Depending on intensity of such mapping runs additional care must be taken of OWB audit trail which will tend to grow.
    Depending on requirements trigger could call ordinal procedure for scheduling (if mapping run must be performed only if user commit change to the table), or procedure with autonomous_transaction pragma (if any touch of the table should fire the execution – don’t think this is a case)
    Sergey

  • Create text file in Database Trigger

    Hello,
    How to create text file in the database trigger. I am working on Row level trigger which has select statement if statement fails I have to create text file and insert record in text file. I tried to use file1 TEXT_IO.FILE_TYPE package it does not works.
    Thanks,
    Atif

    TEXT_IO is not available on the database. It is only available if you are doing client-side PL/SQL development in Oracle Forms. On the database side, you can use the UTL_FILE package.
    Since writing to a file is not transactional, however, and because Oracle may have to call a trigger multiple times to ensure write consistency:
    http://tkyte.blogspot.com/2005/09/part-iii-why-is-restart-important-to.html
    http://tkyte.blogspot.com/2005/08/part-ii-seeing-restart.html
    http://tkyte.blogspot.com/2005/08/something-different-part-i-of-iii.html
    you aregenerally better off not writing to a file in a trigger. The better answer is generally to use Oracle Asynchronous Queues to send a message to another process that actually writes the file. That way, if the transaction rolls back, nothing gets written to the file.
    Justin
    Distributed Database Consulting, Inc.
    http://www.ddbcinc.com/askDDBC

  • How to Get  the SSO Logged user information in database trigger

    I need to track which SSO user is inserting data into a table , so how can i get the information of that user in a database trigger on that table
    thanks

    Try using portal30.wwctx_api.get_user returns a varchar2 (PUBLIC) or the Username that is logged in
    I need to track which SSO user is inserting data into a table , so how can i get the information of that user in a database trigger on that table
    thanks

  • How to get SSO logged user information in a database trigger

    my database is 9i
    my application server is 9i too
    I need to track which SSO user is inserting data into a table , so how can i get the information of that user in a database trigger on that table
    thanks

    Hi,
    The only way I could figure out how to get it was to import the com.sap.security.api.
    1. From Window>Preferences>Java-->Classpath Variables, set up a variable called WEBAS_HOME pointing to:
    <drive>/usr/sap/<SID>/jc00/j2ee/cluster/server0/
    2. Right click on properties of your Dynpro Project->Properties->Java Build Path->Libraries and click "Add Variable." 
    3. Select WEBAS_HOME and click "Extend"
    4. Select /bin/ext/com.sap.api.sda/com.sap.security.api.jar and click OK.
    If you don't have access to a portal directory, you will have to get this jar file and copy it to your workspace to add to your build path instead of the above steps.
    Then in your code:
    import com.sap.security.api.IUser;
    import com.sap.security.api.IUserAccount;
      public void GetLogonID( )
         String LogonID;
         try {
              /*     create an user object from the current user */
              IWDClientUser wdUser = WDClientUser.getCurrentUser();
              IUser user = wdUser.getSAPUser();
              if (user != null) {
                   IUserAccount acct = user.getUserAccounts()[0];
                   if (acct != null) {
                        LogonID = acct.getLogonUid();
                   } else
                        LogonID = "acct null";
              } else {
                   LogonID = "user null";
              wdContext.currentContextElement().setDisplayName(user.getFirstName() + " " + user.getLastName());
              wdContext.currentContextElement().setLogonID(LogonID.toUpperCase());
         } catch (Exception e) {
              e.printStackTrace();
    Hope this helps...  I had to search several places before I found all the necessary stuff.  Maybe I can get my first points!
    Thanks,
    Andrew

  • How can I obtain an specific message raised by a database trigger

    Dear friends,
    if I have a database trigger and I want to show an error message which was raised from a database trigger to a form, I can do it by raising an application error inside database trigger, and by showing DBMS_ERROR_TEXT inside ON-ERROR trigger. This is ok for me.
    But how can I do if I want to show a specific message? Let's say I have a BEFORE INSERT table trigger, and I want to verify whether data was correctly informed (for example, "user name must be entered"). If I raise an application error, I see a very big error message which includes both my personal error message and database message.
    Surely I can do a SUBSTR in this message, but can't I do something easier? Let's say I put all error messages in a variable:
    (Let's suppose it's a BEFORE INSERT trigger code, which is related to my table)
    if :NEW.user_name is null then
    p_error_message := 'User name must be entered.';
    end if;
    if p_error_message is not null then
    raise_application_error (-20000, p_error_message);
    end if;
    ... with this p_error_message being shown to final user, with no need to edit it via PL/SQL instructions like SUBSTR. Is this possible? If not, I'll be quite satisfied with SUBSTR because it fits my needs somehow.
    Best regards,

    raise_application_error will be used for raise errors on form.here i'm providing u the example
    CREATE TRIGGER at AFTER UPDATE OR DELETE OR INSERT ON emp
    for each row
    declare
    v_1 number
    begin
    select empno into v_1 from emp where empno=7369 ;
    exception when no_data_found then
    RAISE_APPLICATION_ERROR(-20001,'No data found'||sqlerrm);
    END;
    now when you insert data on emp table through form. if value does not found of selected empno then No data found will be shown on form
    Edited by: SKYNIAZI on Mar 20, 2009 12:19 PM
    Edited by: SKYNIAZI on Mar 20, 2009 12:56 PM

Maybe you are looking for

  • External hard drive is unmounted

    I cant find info on how to mount it back in. I dont know how it happened. I have plugged and unplugged power and FW cable but it doesnt show.... thanks for ur help

  • When Matching Users Via Email, Changing Email Address Does Not Change Login

    Well, the subject pretty much says it all, but here're some examples of what's going on: Initial Data - Create 2 Business Partners in SAP, C1 and C2. - Create 2 Contact Employees in SAP, Adam with email adam at eden.org in C1 and Eve with no email in

  • KSII activity prices not calculation (actual)

    Hi During Actual Price calculation KSII following is error message : All activity prices are manually entered Message no. KP211 Diagnosis All activity prices in controlling area HGC, fiscal year 2011, and version 0 were determined and set as manually

  • How do I change margin units between inches and millimetres?

    Firefox 23.0.1 on Windows 8. Using Print-Preview -> Page-Setup -> Margins & Header/Footer

  • BDT custom fields value transferring

    Hi all, I want to add some new fields for the real estate screen of CMS workbench. I have already done the screen part by creating a Z* function group. Moreover, I also append a Z* structure(e.g. ZCMS_RE_EXTRA, having all the new fields inside) to CM