Delete operation handling in Destination database

I have a requirement NOT to DELETE records on the destination database, instead MARK that record as DELETED (Setting a flag as "Y" in a column). Is there a method in Streams that I can use to get this done easily?
This is one-way Streams replication and no DML actitivity will occur on the destination database.
Thanks,
Shri.

BEGIN
DBMS_STREAMS_ADM.ADD_SCHEMA_RULES(
queue_name => 'STREAMS_CAPTURE_Q',
streams_type => 'CAPTURE',
streams_name => 'STREAMS_CAPTURE',
schema_name => 'test',
include_dml => TRUE,
include_ddl => FALSE,
include_tagged_lcr => FALSE,
inclusion_rule => TRUE,
and_condition => ':lcr.get_command_type() = ''UPDATE''') ;
END;

Similar Messages

  • Database Auditing to record DELETE operation on a schema for all tables.

    Hi,
    I am using ORACLE DATABASE 11g. I want to apply the AUDIT feature to record all the DELETE operations happening on the schema tables.
    I did the following steps but dint got the proper output :-
    I logged into the SYS as sysdba user and set
    alter system set audit_trail=DB,EXTENDED scope=spfile;then i executed this command to record the sql which will use the DELETE privileges
    AUDIT DELETE ANY TABLE;Then i bounced back my DB and for testing purpose i created a table in SCOTT schema and inserted 10 rows in it and then DELETE all the rows from it.
    As per expectation i check the view
    select * from aud$
    where spare1 like '%MACHINE1%'
    and USERID='SCOTT'
    order by ntimestamp#;The output i got is :-
    34     168368     1     1          SCOTT     I-DOMAIN\MACHINE1     MACHINE1     100     0                                                                      Authenticated by: DATABASE; Client address: (ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=2565))          MACHINE1                    5          21-DEC-11 07.02.58.621000 AM               0     928:5024     0000000000000000               983697018     <CLOB>     <CLOB>     But here i don't see the SQL generated in the last column.
    What i was expecting is that if i fire a DELETE statement in the schema it will get logged here and with the help of this view i will be able to see that which user from which machine executed a DELETE statement and what that statement was?
    Please let me know what step i have missed here.
    PS:- The ACTION# column shows 100 , is it the code for DELETE action. I also accessed the DBA_AUDIT_TRAIL view but din't found any usefull info their.
    Thanks in advance.

    Try instead:
    audit delete table;AUDIT DELETE ANY TABLE is auditing use of DELETE ANY TABLE privilege.

  • On performing continuous delete operation database hangs

    Dear All,
    On performing continuous delete operation , the instance on which delete operation is performed database hangs i.e it does not allows to make new connection and some times on alert log we get ORA-3136 error
    Database version 10.2.0.3 , OS : HP-UXvi3
    Regards

    Refer this thread
    ORA-3136 while performing bulk delete

  • Need help in Delete operation using blazeDS

    Please find the flex client code and servlet code given below
    Trying to call a DELETE methods on the servlet using BlazeDS.Configuration is perfect in the proxy-config.xml and services-config.xml
    when DELETE is called with paramter user="krishna it is being printed as
    received DELETE operation with parameternull   
    My Question is why the servlet printing null value for the user where it should print "someuser"?Can some one help me on this?
    FLEX CLIENT
    <?xml version="1.0" encoding="utf-8"?><mx:Application  xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical">
    <mx:Script><![CDATA[
     import mx.controls.Alert; 
    import mx.rpc.http.HTTPService; 
    import mx.rpc.events.ResultEvent; 
    import mx.rpc.events.FaultEvent; 
    public function callServletDELETE():void { 
    var service:HTTPService = new HTTPService();  
    //service.url= "http://localhost:8080/examples/blazeDS";service.destination=
    "BlazeDSHTTP"; //this is configured in proxy-config.xml fileservice.useProxy =
    true; service.method =
    "DELETE"; service.resultFormat=
    "e4x"; service.addEventListener(
    "result", billingCarrierResult);service.addEventListener(
    "fault", httpFault); service.send({user:
    'someuser'});}
    protected function billingCarrierResult(event:ResultEvent):void{
    serviceResultsTextArea.text =
    "Success with BlazeDS!\n"+event.result; 
    protected function httpFault(event:FaultEvent):void{
    serviceResultsTextArea.text =
    "Failure trying to access service.\n"+ event.fault.faultString + "\n" + event.fault.faultDetail;}
    ]]>
    </mx:Script> <mx:TextArea  id="serviceResultsTextArea" width="50%" height="50%" />
    <mx:Button  label="DELETE" click="callServletDELETE()"/>
    </mx:Application>
    servlet
    import java.io.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    * Simple example intended to demonstrate BlazeDS with HttpService.
    public class BlazeHttpExample extends HttpServlet
       //excluded other methods GET,POST as they are working fine
        * Handles the HTTP <code>DELETE</code> method.
        * @param request servlet request
        * @param response servlet response
       @Override
       protected void doDelete(HttpServletRequest request, HttpServletResponse response)
          throws ServletException, IOException
          System.out.println("received DELETE operation with parameter"+request.getParameter("user"));
       @Override
       public String getServletInfo()
          return "Simple intended to illustrate BlazeDS HttpService support.";

    in your java code you are considering user as the parameter.. but that is not a parameter..
    When making a http call in flex try something like this
    var obj:Object = new Object();
    obj["user"] = 'someuser';
    service.send(obj);
    this should work hopefully.

  • Update/insert/delete data from xcelsius to Database via web service

    Hi,
    I need to create dashboard that go function can <b>update/insert/delete</b> data send to <u>Database</u> thru <u>web services</u>, as i know got 2 xcelsius add-on software which support those of function <b>InfoBurst</b> and <b>flynet </b>
    <b>InfoBurst</b>
    http://www.infosol.com/azbocug/minutes/4-Writeback%20to%20a%20Database%20with%20Xcelsius.pdf
    <b>flynet </b>
    http://www.flynetviewer.com/public/community/Blogs/FlynetXcelsiusServerUser/default.aspx
    Except this 2 purchase add-on xcelsius, any other solution ?  
    Maybe need to write some in MSSQL or C# programming which enable insert, update, delete ...etc  ?
    *note: i not use Xcelsius Engage Server , i use Xcelsius Engage only
    thanks,
    regards
    s1
    Edited by: Leong Pui Kee on Mar 1, 2011 6:06 AM

    Hi,
    As of now in Xcelsius/Dashboard Design there is no feature or functionality to insert/update/delete data from database.
    Solution:
    Create a Web service in let’s say C# or Java, which will perform insert/update/delete operation.
    In Xcelsius add Web Service connection and user above web service.
    Xcelsius Web Service connection provides option to pass input values to a Web Service (Input Pane) and get the result (Output values pane).
    We can pass values to be written to the database as a input to Web Service via Web Service connection from Xcelsius and write data to the database.
    Note:
    Performing delete operation from Xcelsius Dashboard could be risky and may delete important data from database. I would not prefer giving delete option/functionality in Xcelsius dashboard.
    Hope this helps!
    Thank you.
    Regards,
    Vinay Mhaske

  • Anybody else finding that the iPod classic cannot handle their iTunes database?

    I have a very complex database that heavily uses the smart playlists. I have playlists referencing playlists, etc. and the last 2 operating systems can't handle it. I've got way too many hours behind my iTunes database and I'm unwilling to throw it out to use the iPod. It works great on my machine, allowing me to create well balanced and interesting playlists that are broad and diverse. My database used to work on the iPod. The problem arose with the instalation of a new iPod operating system back over a year ago. The installation killed my iPod and Apple refused to consider that the upgrade was responsible and called it coincidence. Since then an iPod will only work until I make some small mistake, like trying to use the Genius or plugging it into my computer and making some change in my iTunes database. Then it's back to disk mode, erase, reboot, reload and eventually replace.
    Apple dismisses the idea that there is some software or hardware flaw causing the trouble. They claim that the iPod software will handle any iTunes database that is functional and fits on the iPod with a little extra room. They have replaced my iPod 4 times in the last 6+ months under the now impossible idea that I am receiving a series of flawed machines. These iPods sits in my glove compartment of my car and suffer no abuse. Since the last OS update, I can only load an iPod by importing my music in smaller chunks, a day long process at best. A full load of the database kills a new iPod immediately. My last time through tech support we came up with this technique as a way to isolate a potential bad song or album. Everything loaded fine in chunks and the iPod handled everything until a made a change to one of the songs and it went into eternal Apple mode and was replaced at the store. I am pretty convinced that Apple is wrong on this one and that the iPod software or hardware is not robust enough to handle what you can do in iTunes. Anyone else have a similar problem? Anyone at Apple care to look a little more carefully at the problem as a learning tool?
    Dan, Tired of Riding the Bull

    Hi huskerpapa!
    The issue you are seeing could be related to several things, but luckily, we have an article that can help you troubleshoot this issue and find the source of the problem. That article can be found right here:
    iTunes for Windows Vista or Windows 7: Troubleshooting unexpected quits, freezes, or launch issues
    http://support.apple.com/kb/ts1717
    Thanks for coming to the Apple Support Communities!
    Regards,
    Braden

  • Need to Set Current Row when Using Built-in Data Control Delete Operation?

    I have an af:table bound to a ViewObject (VO) collection (no Entity Object) - within each row, I include a column that contains a 'Remove' command button so the user can remove the row. I add the command button by dragging/dropping the built-in delete operation from the VO on the Data Control Palette. When I use this as is (no changes), the Remove button always deletes the first row in the collection, not the selected row. Do I need to add code to set the current row, and if so can someone please provide an example and specify where I need to add? thanks.
    ------ .jspx af:table with command button to remove each row ------
    <af:table value="#{bindings.ListView1.collectionModel}" var="row"
    rows="#{bindings.ListView1.rangeSize}"
    first="#{bindings.ListView1.rangeStart}"
    // note: I don't have any code added for selectedRow or makeCurrent - assuming this is built-in?
    selectionState="#{bindings.ListView1.collectionModel.selectedRow}"
    selectionListener="#{bindings.ListView1.collectionModel.makeCurrent}">
    <af:column>
    <af:commandButton actionListener="#{bindings.Delete.execute}"
    text="Remove"
    disabled="#{!bindings.Delete.enabled}"/>
    </af:column>
    ---------- corresponding pagedef file ------------
    <bindings>.....
    <action id="Delete" IterBinding="ListView1Iterator"
    InstanceName="SrchDataControl.ListView1"
    DataControl="SrchDataControl" RequiresUpdateModel="false"
    Action="30"/>
    </bindings>
    Note: I also tried solution posted on following thread, but again, only first row is deleted, not the selected row?: Delete and Commit
    Message was edited by:
    javaX

    I just want to delete (or remove) it from the VO. Data for this VO is not on the database.
    The function is doing what I want it to do (delete from the VO), its just always deleting the first row, versus the selected row. I select the command button next on a column next to an item further down in the list and it deletes the first row. The problem is setting the selected row to be removed - I thought setting the current row would be taken care of by the SelectListener?
    selectionState="#{bindings.MyIspListView1.collectionModel.selectedRow}"
    selectionListener="#{bindings.MyIspListView1.collectionModel.makeCurrent}"

  • ADF delete from more than one table with single delete operation

    Hi all,
    I have a scenario in which I am trying to delete record(s) from 3 tables.
    My jspx page looks like this:
    Column1:drop down from 1st table
    Column2:drop down from 2nd table
    Column3:drop down from 3rd table
    Delete Commit
    I have created a view object which has these three tables as entities. I drag dropped the view object and displayed these three columns.
    Now when i select any one or all three or any two out of these and click delete, only the "column 1" gets deleted from 1st table. The remaining two tables remain unaffected.
    Y is this so?
    Can't I use one delete operation for all three tables' DML operation in single go?
    Thanks.

    If you have a business case that requires deleting from 3 tables at once when removing a single row in a view object then you may look for the problem in you data model...
    Until then I'd suggest to create a database view providing the information you need (plus the PKs fron the individual tables) and creating entity and view objects based on this view. An "instead of dele" trigger attached to the view can do the actual delete operation on the 3 tables.
    bye
    TPD

  • Delete Operation in JDBC Sender Adapter not works

    Hi,
        I have one student table which contains the fields ID,Name,BirthMonth,BirthYear,ReadFlag fields. ReadFlag is a character field or lenght 1 which contains only values either 'Y' or ' '. 
         I want to execute delete operation in this table ie to delete the records which contains the readflag = 'Y'. So, I set the below values for the following parameters.
    DELETE FROM student WHERE READFLAG = ' Y '
    Query SQL Statement : SELECT * FROM student WHERE readflag = 'Y'
    Update SQL Statement : DELETE FROM student WHERE READFLAG = 'Y'
    Poll Interval : 60 Seconds.
        There are more records in this table which contains readflag = 'Y'. But, the Adapter does not delete those records from the table i.e delete operation is not executed. At the same time, in Comm. Channel monitoring it does not show any error, but the delete operation is not carried out in the table.
         I tried after 'COMMIT' the table also. But it does not work. What could be the reason ? or How to use Delete Operation effectively on the table ?
         Kindly help me friends to solve this problem.
    Thanking you.
    Kind Regards,
    Jeg.

    http://help.sap.com/saphelp_nw04/helpdata/en/7e/5df96381ec72468a00815dd80f8b63/content.htm >>>
    <i>Adapter Work Method
    You must add an indicator that specifies the processing status of each data record in the adapter (data record processed/data record not processed) to the database table.
    The UPDATE statement must alter exactly those data records that have been selected by the SELECT statement. You can ensure this is the case by using an identical WHERE clause. (See Processing Parameters, SQL Statement for Query, and SQL Statement for Update below).
    <b>Processing can only be performed correctly when the isolation level for transaction is set to repeatable_read or serializable.
    Example
    SQL statement for query: SELECT * FROM table WHERE processed = 0;
    SQL statement for update: UPDATE table SET processed = 1 WHERE processed = 0;
    processed is the indicator in the database.</b></i>
    try with repeatable_read or serializable !!!
    Also go thru this thread - DELETE Querey in JDBC SENDER

  • Simply delete all entries in a database.

    Hello,
    how do I simply delete all entries in a database (which must be thread safe, and most probably is)? For instance it is needed, as I'm developing a versioned open source XML/JSON database system, whereas I'm using a BerkeleyDB environment/database as a transaction log per revision (resource/log/version_number/...) for dirty blocks/pages and now want to introduce checkpointing (with currently only a single write-transaction per resource). That is another reading transaction (possibly another thread might read a transaction log, a BerkeleyDB environment/database while another thread, the checkpointer (most probably a deamon thread) commits, that is writes the log periodically or during less workload into the real resource. After the data is commited, the transaction-log must be emptied, but probably a reading transaction still reads from the log and falls back to reading from the real resource if the page is not in the log. That is I can't remove the database, but probably simply have to delete all entries and a simple .commit-file flag which indicates if the data has been written back to the real resource or the checkpointer must be writing it back sometime in the future (if the .commit-file still exists). Do I have to iterate through the database with a cursor (and .getNext())? Or does a dedicated method exist?
    kind regards
    Johannes

    Hi Johannes,
    As I think you've already discovered, there is no built-in method for deleting all records of a database that is open. The only similar built-in methods are those for removing or truncating an entire database (removeDatabase and truncateDatabase), and the database must be closed.
    If you can't find a way to use removeDatabase or truncateDatabase, then you'll have to iterate through the records and delete them individually. If this is done for a large numbers of records in a single transaction, it will be expensive on a number of fronts, including memory usage for the locks: each record is individually locked.
    If you don't need to delete all records in a single transaction (I couldn't completely understand your use case), then you can iterate with a cursor using READ_UNCOMMITTED and delete the records in individual transactions using Database.delete. This avoids using lots of memory for the locks, since only one record is locked at a time.
    In either case the cost can be reduced by using DatabaseEntry.setPartial(0, 0, true) for the DatabaseEntry that is passed as the data parameter. You only need the key to delete the record, not the data, and avoiding a fetch of the data is a big cost savings (if the record data is not in cache). This optimization is only in JE 5.0 and above --in JE 4.1 and earlier, this has no advantage because the data is always fetched internally, as part of the deletion operation.
    --mark                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Destination database instance is 'started' not 'mounted' in standby alert.l

    11.2.0.2 Physcial standby db is taking long time to startup approximately about 20 to 30 minutes. In Alert.log i am seeing continous message "destination database instance is 'started' not 'mounted'" at time of startup. Its solaris 64bit platform. Any idea whats wrong?

    user530956 wrote:
    11.2.0.2 Physcial standby db is taking long time to startup approximately about 20 to 30 minutes. In Alert.log i am seeing continous message "destination database instance is 'started' not 'mounted'" at time of startup. Its solaris 64bit platform. Any idea whats wrong?what parameters you been set for LOG_ARCHIVE_DEST_2 in standby instance? Disable those parameters.
    Next time paste your PFILE of standby.
    >
    user530956      
         Newbie
    Handle:      user530956
    Status Level:      Newbie
    Registered:      Sep 15, 2006
    Total Posts:      113
    Total Questions:      63 (63 unresolved)
    >
    WOW.... Not even one question was not resolved, Sad to see that no one is helpful in OTN, then work with Support.
    CLOSE THE THREADS AS ANSWERED Keep the forum clean.
    Read Announcement: Forums Etiquette / Reward Points
    https://forums.oracle.com/forums/ann.jspa?annID=718

  • Select Statement Blocking Delete Operation

    Hi Experts,
    In a Single table am trying to do delete operation but it has been blocked by simple select query.
    Database setting : Read Committed Snapshot already set to ON for that database.
    Any Idea why SELECT blocking DELETE.
    FYI : Before Select statement I could noticed the following setting "set transaction isolation level  read committed".
    Kindly Advise
    Regards,
    Nandhu

    FYI : Before Select statement I could noticed the following setting "set transaction isolation level  read committed".
    Hi NandhuJana,
    1. Did you read
    Uri Dimant's response?
    Please try to remove this statement and check again
    2. When we ask you for DDL+DML , the idea is to let us the option to (1) reproduce the issue in some cases, (2) get the best information which is the real database structure, queries, etc'. In this case for example I do not see the isolation level statement
    in your code and we need it to understand what is happening :-) The order and structure (nested transactions for example) of statements is what important here.
    3. you can check your isolet level using one of those options to make sure what is going in your script:
    SELECT TRANSACTION_ISOLATION_LEVEL = CASE transaction_isolation_level
    WHEN 0 THEN 'Unspecified'
    WHEN 1 THEN 'ReadUncommitted'
    WHEN 2 THEN 'ReadCommitted'
    WHEN 3 THEN 'Repeatable'
    WHEN 4 THEN 'Serializable'
    WHEN 5 THEN 'Snapshot'
    END
    FROM sys.dm_exec_sessions
    where session_id = @@SPID
    GO
    DBCC USEROPTIONS WITH NO_INFOMSGS
    GO
    I hope this is helpful :-)
      Ronen Ariely
     [Personal Site]    [Blog]    [Facebook]

  • How to override the default delete operation

    Hi,
    I am new to Jheadstart, java coding for that matter.
    Here's my situation,
    I have a view which is based on a function (function returns a collection).
    I have created instead of triggers on this view to perform insert/update/delete operations.
    All these DML operations work as expected in Oracle database.
    Now, I created an Entity object and a view object on this view in my jheadstart project.
    When I run this Jheadstart application my insert and search operations run fine but update and delete operations fail with JBO-26080 error.
    The underlying oracle error is "ORA-02014: cannot select FOR UPDATE from view with DISTINCT, GROUP BY, etc."
    I know that delete and update operations work fine in Oracle and hence I would like to override the default Jheadstart operations. Can any body tell me how can I do it or point me in right direction?

    Hi,
    From the JHeadstart Developer's Guide, chapter TroubleShooting - Problem Assessment:
    If you are getting a JBO error (Business Components for Java error), try to perform the same data retrieval or data manipulation action using the BC4J Tester. You can
    invoke the tester through a right-mouse-click on the BC4J application module. If you get the same error using the BC4J tester, the problem is in the BC4J object definitions. If you added business rules, or other custom code to your BC4J objects that executes during your data retrieval or data manipulation action, you can debug this code line-by-line by running the tester in debug mode. You can also look up the JBO error in the JDeveloper online help, for each error possible causes and how to solve them are described.
    It sounds to me like you will also get this error in the BC4J Tester. This means that the problem is not related to JHeadstart. You can go to the JDeveloper discussion forum http://otn.oracle.com/discussionforums/jdev.html and ask your question there without mentioning JHeadstart. Maybe there is some switch you can set in the BC4J object to let BC4J not use SELECT FOR UPDATE.
    Hope this helps,
    Sandra Muller
    JHeadstart Team

  • Destination database instance is 'started' not 'mounted'

    When i tried to startup the standby database, it is taking a long time. (Still it is not started)
    The error in alert log is
    destination database instance is 'started' not 'mounted'
    Could some one help me ?
    Thanks in advance..
    regards,
    Jibu

    No version information.
    No hardware or operating system.
    No indication of whether physical, logical, or snapshot.
    No indication of what commands you issued.
    No error message (your impression of the message is not the message)
    No indication as to whether it used to work or is a new install
    No help is possible at this time.

  • Help in Delete operation

    I have a problem when deleting rows from a table. When I created the database the following delete statement worked fine, but now it takes a lot to complete. To delete 600 rows it takes more than 10 minutes. Maybe the transaction log is full, but i don't know how to check the space assigned to it or where is it.
    The delete operation is the following one.
    DELETE FROM event_TTT WHERE event_TTT.event_id IN
    (SELECT event.event_id FROM event WHERE event_TTT.event_id=event.event_id and event.MM_id=1328)

    Thank you for your information about statistics. After reading some papers and after checking that automatic statistics are being gathered in my system, I think that my tables do not fulfill the requirements to gather statistics manually ("statistics on tables which are significantly modified during the day"). Maybe I'm wrong. I'll continue reading about this.
    Anyway, I've new data about my delete operation. I think it is very slow, but I'll give you the details:
    DELETE FROM event_track e
    WHERE EXISTS
    SELECT
    NULL
    FROM event e1
    WHERE e1.event_id = e.event_id
    AND e1.pdep_mission_id = 1328
    AND ROWNUM = 1
    The is an index on e1.pdep_mission_id.
    e1.event_id and e.event_id are primary keys.
    Number of rows on e = 117000.
    Number of rows on e1 = 120000
    Number or rows to delete = 3500
    This is the execution plan (with autotrace):
    Plan hash value: 660928614
    | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
    | 0 | DELETE STATEMENT | | 1 | 254 | 217K (1)| 00:31:20 |
    | 1 | DELETE | EVENT_TRACK | | | | |
    |* 2 | FILTER | | | | | |
    | 3 | TABLE ACCESS FULL | EVENT_TRACK | 119K| 28M| 667 (3)| 00:00:06 |
    |* 4 | COUNT STOPKEY | | | | | |
    |* 5 | TABLE ACCESS BY INDEX ROWID| EVENT | 1 | 9 | 2 (0)| 00:00:01 |
    |* 6 | INDEX UNIQUE SCAN | PK_EVENT271 | 1 | | 1 (0)| 00:00:01 |
    Predicate Information (identified by operation id):
    2 - filter( EXISTS (SELECT 0 FROM "PDEP"."EVENT" "E1" WHERE ROWNUM=1 AND
    "E1"."EVENT_ID"=:B1 AND "E1"."PDEP_MISSION_ID"=1305))
    4 - filter(ROWNUM=1)
    5 - filter("E1"."PDEP_MISSION_ID"=1305)
    6 - access("E1"."EVENT_ID"=:B1)
    Estadísticas
    11207 recursive calls
    26273 db block gets
    24517966 consistent gets
    23721872 physical reads
    4316076 redo size
    932 bytes sent via SQL*Net to client
    1105 bytes received via SQL*Net from client
    6 SQL*Net roundtrips to/from client
    12 sorts (memory)
    0 sorts (disk)
    3518 rows processed
    This operation took 2 hours and 5 minutes to complete the deletion of 3500 rows. Do I have to assume that this is correct or maybe I'm doing something wrong ??
    Thank you in advance.

Maybe you are looking for