truncate table another user via trigger?

Oracle 10.2.0.4

A user USER1 should be able to truncate a table of another user, user 2.

I will not give drop any table, there are a lot of patterns in this PB. It must be transparent, because it happens from an application, so I can't substitute a procedure:

exec ('table_name') drop_user2_table;

but USER1 executes: truncate table table_name;


Is there an any place of relaxation for this command?.

You thought you found the solution. If so, please indicate the post as answer and correct.

Tags: Database

Similar Questions

  • How to lock the table rows selected adf for another user

    Hi all

    In my case, I created a vo based on eo. where I create an attribute (marked) transitional type boolean.

    I have created two jsf pages

    1 - summary.jsf
    2 - claimed.jsf

    in the two page, I slipped even vo as the adf table.

    in the page summary, all vo lines is display. and I created a button on the summary.jsf page.

    When I have selected a few record table adf (using the check box marked attribute) and click the cliam then

    apply filter adf table see criteria and open claimed.jsf page. claimed. JSF page only display selected fine line.

    but I want that these selected lines (which is displayed on the claimed.jsf page) don't display another user in the summary.jsf page.

    I want to say that these specific lines will be locked so the other user does not work on these lines.

    Concerning

    Manish

    You would have to:

    (1) add a column in the underlying table of the DB to track lines are claimed
    (2) change your VO to include a where clause clause that excludes claimed elements
    (3) add something in your UI to release the goods in question (if necessary) so that you can release an item if someone closes their browser.

    John

  • transfer tables belonged to a user to another user schema

    Hello
    in 10 G R2
    in DB control how to transfer the tables belonged to a user to another user scheme?

    Thank you.

    It isn't a way that I know of.

    You can study using EXPDP/IMPDP or EXP/IMP.

  • How to rename a table in the schema of another user

    Hello! How can I rename a table to another user? I'm sysdba. I can't recreate just, because it is very huge and it will take a lot of time to move data to the left and to the right.

    ALTER table make.orders rename make.orderhistory.

    My bad, how it works

    SQL>
    SQL> alter table maran.test1 rename to test2;
    alter table maran.test1 rename to test2
                                      *
    ERROR at line 1:
    ORA-00955: name is already used by an existing object
    
    SQL> alter table maran.test1 rename to test3;
    
    Table altered.
    

    To apologize

  • Another user has modified the line containing oracle.jbo.Key primary key

    Hello

    In jdev 12 c

    I have a jsf page in a BTF, and there is a display of master(A:readonly table)-detail(B1:readonly table)-detail(B2:editable form) this page

    The (readonly table) B1 and B2 (editable form) are created on the same data control. There is no other layout compicated or functions on this page.

    The B2 (editable form) was based on a VO whose id is a type of DBSequence, and the new value has been created by a database trigger.

    I put

    All the columns that are updated by a database trigger or a PL/SQL call, are enabled for "Refersh on Insert" (for the case of the insertion) or "Refresh update" (for the case of update) or both in the entity object xml file.

    But when I submit/validate the page (form B2), the error msg 'another user has changed the line containing oracle.jbo.Key primary key' was always held randonly.

    And after the error msg, I can commit the data successfully by press the button validate again.

    How can I solve this problem?

    Thank you.

    The problem is that you use the pl/sql code. It is run out of the box. When a change is made in a row in this way, the framework removes upward, neither knowing that the change was done rightly and throws an error message.

    The code (which I copied from the other thread for reference) intercepts the error and re executs the lock in the case of the specific error.

    /*** customizing locking management:

    * Because attribute values can change 'outside' ADF standard life cycle,

    * when optimistic locking executes, the exception "Another User Changed the Row" is thrown.

    * In this case, we execute locking again, ignoring the exception

    */

    public void lock()

    {

    try

    {

      super.lock();

    } catch (oracle.jbo.RowInconsistentException e)

    {

      if (e.getErrorCode().equals("25014"))

      {

      super.lock();

      }

      else throw e;

    }

    }


    Timo

  • FRM - 40654 Record has been updated by another user. Refresh the file

    Hello

    Scenario of

    ------------
    Header block - H1
    Multi disc child block - C1
    ----------------
    Update of a field - rate of change in the header block - should change two fields - "price and quantity" in the block of records child multi - C1.
    There is no trigger database on all the tables.
    We have treated the logic above in the update of H1 post-declencheur.

    Updated explicit statemetns still appear in the subsequent update trigger, whose purpose is to update the table of the child of the block - price and quantity columns.

    -------------------
    Question
    Is it correct to use an update statement in the post update trigger oto updated the table of the child block. Otherwise, the wheat is the right way?
    We are also updating a column of synthesis called 'sum_amount' which belongs to H1.
    -----------------------
    We get the error:
    -------------
    FRM - 40654 Record has been updated by another user. Refresh the folder to display the change.
    -----------------

    Updates on this would be useful. We stayed by the suggestions in this forum... and were not able to solve this problem...
    Concerning
    SR

    If it is not updated in later day, what's the alternative outside using post - update trigger so that the prices of columns and the amount are updated as soon as the exchange rate is updated.

    Have you commented the trigger for update again?

    In general, I tend to use the over - or before fires (suite-update / Pre - Update). However, I think that you'll get the same error using these triggers. More importantly, I need to know the answer to my previous question:

    We are also updating a summary column called "sum_amount" that belongs to H1.
    

    How are you on this column of table of contents? The SUM_AMOUNT column is a calculated field or you have written the code that updates this article? The column SUM_AMOUNT is a field of database? >
    My first reaction is that this process is the most likely cause of your error FRM-40654, but that's just a guess.

    Craig...

  • FRM-40654 updated record by another user

    Hello friends... :)

    I want to join tables plug the motion
    I use this application, and my result is ok...
    But when I try to use this query at the form level
    then I get this error...

    FRM-40654: updated by another user record

    Please tell me how to solve this problem...

    Declare
    long mSQL;
    Begin

    / * msql: = ' (select * from time_attm one)
    where emp_ID = (select ID from personnel.personnel
    where id = a.emp_id
    Connect prior Id = mgr
    Start with id = ' | : global.id | '))';*/
    set_block_property ('time_attm', query_data_source_name, msql);
    execute_query;
    exception
    While others then
    Message(Error_Code ||) ' : ' || Texte_erreur);
    End;

    Al-Salamu Asalam we Rahmatu Allah we Barakatu...

    Adeel pls check if you have any rating triggers server working on tables in your form. Most likely, the same elements that are updated in your forms are also managed in a trigger server side.

    1-one way to solve this problem is to define the update and insert properties of these elements NOT in your block if they are handled in the trigger.

    2 - pls check the DML property for the block.

    3. you can also check your form and triggers after you after insertion, POST-update, AFTER validation and see what happens

    4 - or you have the number of columns in your block with a precision higher than in the database.

    5 - you can write your own SQL insert, update or DELETE statement in the form, editing a column value TO the same table that you update using a block of base table of standard forms.

    6 or forms block on the basis of the opinions and property button Mode = auto, pls Mode Set = Unique key.

    I hope this helps...

    Kind regards

    Amatu Allah.

  • Error - file has been updated by another user. Ask to see change

    Hello

    If I save a record in forms (Custom) after this attempt to change or add content in the fields, I get the error below.
    FRM-40654: record has been updated by another user. Re-query to see change.

    Please provide the inputs.
    (Form 10g Version, using this form in Oracle Application R12)

    Thank you
    Prasanna

    Prasanna,
    Some of the typical causes of this error are:
    1 database column is of type CHAR (?) and forms is of type VARCHAR2 (?). As CHAR() pads type, the length of the Forms data will be cut padded spaces of the value of data when the column is queried in the form. The solution is to update the VARCHAR2 database column so that the data are not completed.
    2 database trigger on the table changes the data in the INS, the UPD treatment or if you have a Post-Ins/Upd trigger that changes the data in the table. The solution is to clear the block and update or change your processing logic to prevent editing the table.
    3. after query trigger on the data block changes something in the base table. The solution is to eliminate the process after query that updates your block element.

    Here are some of the most common causes of this error.

    Hope this helps,
    Craig B-)

    If someone useful or appropriate, please mark accordingly.

  • Grant to truncate table

    I truncate tables 4 to another user.

    I grant kind of what I need to to my user to perform this specific task in the table in another schema?

    Thank you
    Luciana

    The only way to be able to issue a command TRUNCATED on a table, you aren't owner would be to give the DROP ANY TABLE privilege. No worthy of their name DBA would allow that to happen.

    Another solution would be to create a stored procedure, owned by the owner of the tables (or a DBA account) who performs the dynamic SQL statements to truncate the tables in question. The owner of this procedure would then grant you EXECUTE access to the procedure.

    Justin

  • When a second (another) user tries to connect using the connection to distance that a message "select a user to disconnect so you can connect.

    Original title: Remote Desktop

    We have Windows Server 2012 essentials (evaluation version) installed and working.  When connecting to even via the remote desktop connection it works fine, but when a second (another) user tries to connect using the connection to remote, a message "select a user to disconnect so you can connect.  The names of the 2 users are displayed the first is the name of the administrator of the local server and the second is the remote desktop user who was first.  We need at least 3 to 4 remote desktop both users to be connected.  Please advice

    Hi BHARATISRANI,

    Thanks for posting in the Microsoft Community.

    Since you are using Windows Server 2012 Essentials, the question you posted would be better suited for COMPUTING public Pro on TechNet. I would recommend posting your query in the TechNet Forums to get help:

    Windows Server 2012 Essentials General TechNet Forums

  • I have vista and how to record a program to a usb port to another user who has xp to use the program

    I have a samsung program for my phone, I installed and I have vista, I want to know how to record the program on a USB for another user may install and use the program, because they have a netbook with no cd it must be saved to the usb, but the other user has xp so please can you me how to record the program on usb

    Hello

    You cannot save a program that is installed on a USB key or any other

    Once installed a program spreads during the operating system at various locations

    You must download it again and save it on a USB flash drive, then transfer it to their netbook via a USB flash drive

    or get them to download it themselves directly to their netbook so they are available on the net

    For more information on the program, contact samsung

    http://www.Samsung.com/us/support/contact

  • Another user changed the row with a primary key oracle.jbo.Key]

    I see many discussions about this error, but still cannot understand the difficulty that I need in my scenario.

    I am an Oracle Developer and completely new to ADF, please bear with me.

    I use JDeveloper 11.1.1.9.0

    My scenario:

    Creates an object editable view (UVO) with sub selects in the query, which is from several db tables.

    Creating a table using the UVO

    When I try to update a field in the table, and then click the validate, I get the error message:

    Another user changed the row with a primary key oracle.jbo.Key]

    Can someone explain in what scenarios I see this error and how do I solve this problem?

    Try the viewObject execution after validation and reQueryOnCommit set to true

    For details see - binary: a reason more for "Houston-25014: another user has modified the line containing oracle.jbo.Key primary key '

    Ashish

  • doc files locked by another user. Occurs when the laptop computer on the new Word documents opening.

    Just acquired a computer laptop and everything seemed to sync with SkyDrive and my desktop PC, except that the Word doc files will not open. Error message _ .doc is locked by another user. By selecting 'Open read-only' displays a different error message.

    All other types of files and doc files produced local seem to work well. I can access and open files on SkyDrive.com with both computers. docx files do not seem to be affected.

    The problem occurs only on my laptop. To access the files established by clicking on it in the local SkyDrive open Word (2010) with the error message (the file is locked by another user).

    Files open very well during the passage of SkyDrive.com (from mobile) and in all desktop scenarios. And can access the files on the desktop to the laptop via the network. The two computers configured in the same way of C:, D: (SkyDrive on this partition) and E:

    I can copy files over the network to the laptop E: partition and they access very well. Copy them to D:\SkyDrive (once the original has been removed and SkyDrive left) same problem occurs. Network's WiFi in the House.

    Does not occur with the new files created on laptop, the files in the root directory of the laptop (only subdir) skydrive and .docx files.

    I have updated the advanced settings of sharing and security on the two computers without success.

    All other types of files seem fine.

    Help appreciated.

    Stephen

    Greetings from the happy camper,

    Long process, simple solution. Thanks to Madeni K N for suggestions that lead to the solution.

    The drive letter has changed

    The temporary internet folder to E: and changed environment variables

    Moved temporary internet files to E:

    Without success

    The drive letter has changed back to D:

    Deleted from the temporary internet folder.

    Success!

    Checked E: temp internet files and notice a file called Content.Word

    Empty file 0 bytes

    Copied to the temporary internet folder in D: less Content.Word file

    Reset environment variables and temp internet folder to D:

    No problem! Yes team!

    Comments and suggestions appreciated.

    Thank you all

    Stephen

  • Truncate Table generates cancel?

    What I understand, TRUNCATE TABLE resets the high water and after some discussions and information on the web creates a small amount of cancellation. For example, http://www.orafaq.com. However, documentation of Oracle 11 g 2 to truncating Tables and Clusters makes clear that it does not generate just undo.

    Quote: A TRUNCATE statement does not generate the cancellation information and committed immediately. It is a DDL statement and cannot be cancelled.

    TRUNCATE is apparently done a COMMIT before and after he runs, which would explain why there is no ROLLBACK. And if I'm not mistaken, any DML or DDL statement must create an entry in the log again first, before you run.

    Which is correct? Does TRUNCATE really create no CANCELLATION and implicit VALIDATION is perhaps only a protection measure, or what is the real story here? I tried a few tests, playing with the employee_demo table, but I have not been able so far to know what has changed in the UNDO tablespace. Unfortunately, I'm not a great expert on PL/SQL and do not use it much. Is there a way to simply to query or compare the cancellation of table before and after a truncate table operation to see the difference? By comparing the size is not.

    Thank you!

    Summary/Conclusion:

    The answer, in other words, is that TRUNCATE TABLE Undo. This cancellation information cannot be used by the user to RESTORE a TRUNCATE TABLE, which also applies to the other DDL statements, but may be required by the body to perform the database crash recovery.

    Because TRUNCATE TABLE changes the metadata in the data dictionary and resets the high tide of the object, it produces much less that cancel the DML statements as DELETE. However, it would probably not be the Oracle database if everything were that easy.

    If you happen to find this interesting question and wish to know more on it again and cancel the process regarding the DDL statements, some of the responses I received the case very resourceful and provided information you many not know or will not find in the usual documentation.

    I can mark only one answer is right and just caught the first response that provided an answer to my original question. The answers that I've marked as useful are those replies which I think has provided good explanations or added interesting new aspects or information thereon.

    Thank you all for your time and your contributions!

    To check the generation of cancellation (example):

    SQL > select count (*) from t1;

    COUNT (*)

    ----------

    1000000

    1 selected line.

    SQL > select name, value of V$ mystat ms, v$ statname sn where sn.statistic # ms.statistic # and sn.name like '% cancellation' and ms.value =! = 0 ;

    NAME                                                                  VALUE

    ---------------------------------------------------------------- ----------

    cancel changes vector size 192

    1 selected line.

    SQL > truncate table t1;

    Table truncated.

    SQL > select name, value of V$ mystat ms, v$ statname sn where sn.statistic # ms.statistic # and sn.name like '% cancellation' and ms.value =! = 0 ;

    NAME                                                                  VALUE

    ---------------------------------------------------------------- ----------

    cancel the change in size of vector 31272

    1 selected line.

    The cancellation that would have been generated by a deletion would have been of the order of one hundred twenty megabytes - but you'll have to take my word for it.

    This small amount of cancellation would have been associated a few blocks management cleared space, the day and possibly put segment header some updating of the data dictionary (your changes of $ tab_stats).

    To prove that some cancel the blocks of space for the table (and its indexes) management, you would probably have to spend just before truncation, then truncation of log files, then empty the current log file to get a picture of minimum log that you could review to see which blocks had been affected by again them and the bits from the redo had correspondent (or on the contrary (, reversing) entries created in cancel it. You would then be able to see exactly what had happened to the table (and index) blocks and how this action had been protected by the cancellation.

    Bottom line - people often say that "truncate" generates no cancellation, what they really mean is that it generates no cancellation for data, although it always generates a relatively small amount of cancellation for the meta-data.

    Concerning

    Jonathan Lewis

    P.S. before everybody does point out that there are always special cases - truncation of a table in a cluster is implemented as a deletion.

  • AlreadyLockedException: Cannot lock the file, another user holds the lock

    I created the client application to web service using Jdeveloper 11.1.1.7 and deployed on weblogic 10.3.6 on cluster consists of 3 servers. The task of the application is to extract the data from the DB and push application external server permanently. Everything seems fine and works applications. The problem is with some message logs on all three servers.

    I see the following stack of servers:

    oracle.jbo.AlreadyLockedException: Houston-26030: unable to lock the file, another user owns the lock. [[

    at oracle.jbo.server.OracleSQLBuilderImpl.doEntitySelectForAltKey(OracleSQLBuilderImpl.java:1105)

    at oracle.jbo.server.BaseSQLBuilderImpl.doEntitySelect(BaseSQLBuilderImpl.java:567)

    at oracle.jbo.server.EntityImpl.doSelect(EntityImpl.java:8589)

    at oracle.jbo.server.EntityImpl.lock(EntityImpl.java:6237)

    at oracle.jbo.server.EntityImpl.beforePost(EntityImpl.java:6756)

    at oracle.jbo.server.EntityImpl.postChanges(EntityImpl.java:6943)

    at oracle.jbo.server.DBTransactionImpl.doPostTransactionListeners(DBTransactionImpl.java:3301)

    at oracle.jbo.server.DBTransactionImpl.postChanges(DBTransactionImpl.java:3106)

    at oracle.jbo.server.DBTransactionImpl.commitInternal(DBTransactionImpl.java:2108)

    at oracle.jbo.server.DBTransactionImpl.commit(DBTransactionImpl.java:2389)

    ........

    It is clearly stated that another process locks the record while the current process tries to lock the record even. Yet once obvious to say that the same application is deployed on three different servers (i.e. on the cluster) and each application tries to do the same task at the same time in each of the three servers with cluster.

    Question: It is healthy to ignore this error? or I have to solve out?

    I also checked this blog (Andrejus Baranovskis Blog: optimistic and pessimistic locking in Oracle ADF BC) he explains the difference between locking type available in the application model (optimistic and pessimistic). Will I change the lock mode in the request form for the client application that is mentioned to be optimistic rather than pessimistic? This will solve the problem? Is it OK to do with the behavior of the application who explained.

    I thought about this a bit more and would not use temporary tables. Because the ADF does not guarantee that a session database is still used by the same am it will be difficult to control.

    You can use a column in the table itself to write, for example, the name server that will manage the data before doing the real work.

    Our you will find further information in the table that allows you to balance the work using this in a query. Sample would be a column id that allows you to select only the tires where the modulo 3 id is equal to 0, 1, or 2. In this way, it would be pointless to write something on the table before proposing the line as each server would see only the lines it is supposed to work.

    Timo

Maybe you are looking for

  • Apple Watch wrist pain

    I bought my Apple Watch mid July 2016 and thereafter wear a few weeks noticed that my wrist was really painful. Now, I have so I assigned to whom, but have not had my wrist hurt like this over the years. I went to my other wrist and had the same prob

  • Restore the Session bug - fails after erasing history

    This happens sometimes in the past, but after the latest update of Firefox, it happens almost everytime. When I close the browser, I want to clear the history first. Also, before you remove history, I open a new empty tab and close tab old, just to m

  • How to remove fxkeyboard 2.4.1 my computer

    I installed fxkeyboard 2.4.1 on my computer and I want to remove it. How can I remove this program on my computer? It is not on my list of computer program.

  • Impossible to update the setting of DVD region on Equium A100-147

    Hi I have an Equium A100-147 with a CARPET * a DVD-RAM UJ - 841S and I am returning the dvd region 2 region.Tried to go through Win DVD, media player and the Manager of devices but not successful on all occasions. Whenever I thought I left a change o

  • Problem adding a hard disk for Pavilion Elite HPE - 380 t

    Hello I am trying to replace my existing drive with a new WD 1 TB hard drive. So I intend to install the new WD drive as the 2nd drive, and then run the utility WD Acronis to clone the original to the new drive. However, when I install the new disk,