During the ETG Table lock

Hello

I want to clone a table in our database. Version: 11.2.0.4


Test case:

CREATE TABLE test_1

(IDENTIFICATION NUMBER)

/

INSERT INTO test_1 (id) values (5);

COMMIT;

Now-> I want to start cloning from the table. BUT! After cloning, I must write off line-counts of the original and cloned table. (simple audit)

To avoid any DML operation during cloning I lock the table in exclusive mode.

Test_1 in MODE EXCLUSIVE TABLE LOCK.

-> Now I start the operation of the ETG

-> DDL's implicit VALIDATION here

CREATE TABLE test_clone

AS

SELECT * from test_1

/

-> DDL's implicit VALIDATION here too

-> Here would be County-parts to start... (The Original County and County of Clone)

Problem: My DDL statement makes two implicit commits-> first before the DDL and second after the DDL.

So, in this case the lock on the original table will be released before cloning could begin. --> During a long race THAT DEC can other data manipulations arrive on the original of another session table.

And in this case if I count the original and the clone table lines I can get a different result.

Do you know a solution for this?

-> I can't start a procedure or a second session-> This cloning is done in a DB-Patch which we deliver to DBA.

-> I can only run an anonymous pl/sql block

-> In fact, I don't want to use the INSERT INTO (append)... because an ETG is faster and I want to know if there could be a solution for this problem with the DDL.

I thought to create a trigger on the original table that fires if a DML arrived-> but what happens if a DBA ends the script... then this trigger there. So, I would avoid this change in structure.

How I could lock the original table so that I can run a DDL in the same session after it without to release the lock on the original table? -> I don't think that would work, but you may know...

Thanks in advance!

In fact, I wanted to know if if it was very important how it could be solved. -> In my case, it would have been good to get to know a solution said that maybe I don't know yet.

A better solution IMHO and the most common way to do it is just put the table in READ ONLY mode.

ALTER TABLE myTable READ ONLY

... do the ETG

In general, there are many more controls to perform AFTER the operation than just the count of lines. These controls can should be performed by multiple sessions/users for an autonomous transaction will not help you here.

Reading using only keep data available without him to be changed. You can then rename the original table to keep data online for a period of time or to allow time for it to be saved.

Tags: Database

Similar Questions

  • Control ring during the cell table, but cell entry shows through

    Hello world!

    I have a control panel with a control of the ring which is placed above the active cell on MouseUp.

    Unfortunately the input query (or the old value) of the cell is shown through the ring-control,.

    that's not pretty.

    screenshot:

    I tried different ring-controls, but they all have the same behavior.

    Try to find answers, but the guides to build the configuration of the table-ring that I found it.

    does not mention a solution.

    I hope that some of you have seen the same problem

    and could point me in the right direction.

    : cheers: thx for your time and

    jwscs

    PS. : If the sample code is required I'll gladly provide

    OK, shortly after the display of my question, I had another idea

    I disabled the front table and that did not work, because the rows and columns of the selected cell

    cannot be determined,

    But turning off right after the selection and then later reactivation, resolved at present.

    I would be happy to know that any other method that you guys came.

    : cheers:

  • BlackBerry Smartphones during the update, phone locked itself.

    I have a BB 8310 for my girlfriend. While trying to update to simply sync my music on the phone, I decided to update the phone software that turned into a disaster. Updating, during the screen where it says "DO NOT DISCONNECT", the defective USB cable went out leaving the unfinished phone. Now all phones will Flash with a red light. It does NOT at all. The screen remains black. When its plugged into the computer now, it does not read it's a BlackBerry. He said: "USB device not recognized".

    Now, I know that when installing the phone system files where probably deleted. And not replaced. So what now? Is there something I can do to get the phone recognized by my computer? It has been saved until the new facilities took place, but does not help because the computer does not recognize the phone. HELP PLEASE! I would not lose my new BlackBerry before getting really enjoy.

    Well, the good news is that I was right. It's "mode of software program. A red light flashes twice every 3 seconds. But I had once the usb stick to the right. I got the phone to download the new software I'm trying to do in the first place. It pays to read everything in Device Manager!

  • Computer locked up during the last step of the upgrade from windows xp to windows vista

    During the last stage of upgrade from xp to vista, "complete upgrade" my computer locked up: monitor frozen, unable to move the cursor, cannot close the window of upgrade. Green progress bar shows the upgrade about 3/4 full. How to unlock the computer without losing the progress of upgrading?

    Hello

    I doubt if you can

    have you checked the requirenents system before the upgrade?

    http://Windows.Microsoft.com/en-us/Windows-Vista/products/system-requirements

  • Oracle DB 11.2.0.4: Impossible to activate the table lock after having stopped it

    Hello

    I use Oracle Database 11.2.0.4.

    After reading the documentation on how to prevent unwanted table DDL statement.

    I found a way to do this in by issuing 'edit the table < table_name > disable table lock'.

    Turn it off doesn't work, however I can not re - activate.

    The error message is:

    ORA-00054: resource busy and acquire with NOWAIT specified or timeout expired

    I want to activate the lock, because I need to add new columns to this table.

    I was digging on several threads that have the same problem as mine. But none of them gives any acceptable solution.

    Impossible to activate the table lock after disablng it

    ALTER table enable table lock blocking

    However, a poster responds by quoting the documentation that says: (Note: I can't find what doc says)

    'Specify the TABLE LOCK ACTIVATE to activate the table locking, allowing operations on the table DDL. All currently process transactions must commit or roll before Oracle database allows table locking. »


    By the way:

    1. the table is mine and nobody knows there are (therefore, it would be just me which undoubtedly make any DML at it, and I did not).

    2. I've disabled the lock table months ago and tried to turn it back on because I want to add the new column to the table.


    It means that I have to wait for that "ALL transactions running" happening on the current scheme being validated or cancelled?

    The table itself is located on the stops and never schema of production on which transactions take place continuously.


    Is it true that Oracle expects all execute transactions? Is it known bug?

    Why would Oracle wait as all transactions which has nothing to do with the underlying table?

    Is there no workaround solution to solve this?


    Note:

    I tried to deactivate - activate the table locking on the development database (which has less transaction) and it works fine.


    Kind regards


    Buntoro

    Your best option might be suspended from the database. If it is an application of type OTP, it must suspend in some secinds, do your DOF, then get out. Your users should not notice. I have described the mechanism here,

    Quiesce

    --

    John Watson

    Oracle Certified Master s/n

  • Error during the update of a newly inserted in a table line

    Dear all,

    I use jDeveloper 12.1.3.0.0. Below is a narrative of the question, I am doing face and any help on this will be a great help...

    To generate the primary key of the table SBUSINESUNITID, I use a sequence at the OS level and "Update on insert" = TRUE as below.

    When I create a new record in a table view. I did a typo highlighted below and recorded data.

    The data is saved to the database table, as expected.

    If I need to update the typographical error and save it again, I get the below error and changes are not saved.

    If I ignore this message and click on save again the changes are saved.

    Please suggest if there is a specific setting, I need to change.

    Hi Yeddu,

    Try one of the options described in this post.

    ADF & JAVA: oracle.jbo.RowInconsistentException (Houston-25014)

    option 3 worked for me.

    Override the lock() in class ViewObejctImpl as method

    @override
    public void lock() {
    try {
    super.lock();
    } catch (RowInconsistentException e) {
        refresh(REFRESH_WITH_DB_ONLY_IF_UNCHANGED | REFRESH_CONTAINEES);
        super.lock();
    }
    }
    
  • Locking during the generation and the online option to avoid problems

    Hi Experts,

    In our suite of applications, schemas are shared among several applications, and even when there is a deployment of an application, the other application remains upward. In this process, we are facing problems of locking. For example, when creating indexes, I get the error "resource busy and acquired with no expectations. This post is specific to this point on error when creating index (change the design of the app etc is out of reach for me currently).

    I was checking the "online" option of create index and I was wondering if that helps. It looks promising for me. When we have large tables (50 million more and creating indexes on them takes about 5 minutes and at the same time we have another app doing short transactions - who commit in 5 seconds, then creating index 'with the option' can help - is what I was asking.)

    Here is an example of what I've tried:

    -- first create a table with a few million rows:
    
    SET SERVEROUTPUT ON
    
    DECLARE
      v_sql VARCHAR2 (200);
    BEGIN
      v_sql := 'create table test as select * from dba_objects';
    
      EXECUTE IMMEDIATE v_sql;
    
      FOR i IN 1 .. 5
      LOOP
      v_sql := 'insert into test select * from test';
    
      EXECUTE IMMEDIATE v_sql;
    
      COMMIT;
      END LOOP;
    END;
    /
    
    --Now in session 1:
    ---------
    
    
    create index ti1 on test(OWNER,OBJECT_NAME,SUBOBJECT_NAME,OBJECT_ID,DATA_OBJECT_ID,OBJECT_TYPE,CREATED,LAST_DDL_TIME,TIMESTAMP,STATUS,TEMPORARY,GENERATED,SECONDARY,NAMESPACE)
    online;
    
    session 2:
    ------------
    DELETE FROM TEST WHERE ROWNUM<1000;
    
    commit;
    
    DELETE FROM TEST WHERE ROWNUM<40200;
    rollback;
    
    --etc.
    

    I find that deletions, etc. in the second session is done (they follow by commit and they take a few seconds) with this option 'create an index online '. The option 'create index' is also no error with the error ORA-«resource busy...» ». So what a better way to create indexes to avoid locking issues? Note that is is very good for us to have the creation of index take more time for what's important is that they are not lacking in critical production deployments.

    Are there other possible implications (-except that it takes more time to create the index with the option 'online'), that one should be aware of? Any known issues or is there any other glitches with the creation of online index?

    I will be grateful for any views on that.

    What is your version of DB full?

    In our suite of applications, schemas are shared among several applications, and even when there is a deployment of an application, the other application remains upward. In this process, we are facing problems of locking. For example, when creating indexes, I get the error "resource busy and acquired with no expectations.

    OK-, this exception is not surprising. To create or rebuild an index, Oracle has a lock on the base table. He can't do that if other users perform DML on the table - it must wait.

    And before 11 g ANY other session that then tries to perform DML on the base table that oracle wait will also block.

    I was checking the "online" option of create index and I was wondering if that helps.

    Well, if you do not use the clause of 'ONLINE' you must do that maintenance CONNECTION or you now cause other sessions cling while creating/reconstruction is made;

    It looks promising for me. When we have large tables (50 million more and creating indexes on them takes about 5 minutes and at the same time we have another app doing short transactions - who commit in 5 seconds, then creating index 'with the option' can help - is what I was asking.)

    Yes - it should help. But he cannot eliminate the problem entirely.

    See this article by the Index indicated Richard expert Foote (there are many other related articles index also):

    https://richardfoote.WordPress.com/2008/02/11/index-create-and-rebuild-locking-improvements-in-11g-ch-ch-ch-changes/

  • How to use several adf 12 shape and insert the form data in to table during the click on "submit" button

    How to use several adf 12 shape and insert the form data in to table during the click on "submit" button. Can we use several form from adf or not?

    Make sure that you dragged the VO based EO.

    Also make sure that the VO attributes based EO Updatable property.

    The query according to VO is used only to add LOV to the column of the original VO ModelId.

    See you soon

    AJ

  • MISP track changes made to a digitized table used during the conversion?

    I need to convert several databases in AL32UTF8, which is 2 TB or so of size.  I want to reduce the outage window.  Most of the data is ASCII, but the character set is WE8ISO8859P15, so it is possible to get the non-ascii character in there.  My plan was to analyze the database while it is live, then run MISP during the blackout without a full re-analysis.  But I fear that a non-ascii character could go in there from scanning the failure.  The MISP track changes since the last scan, so just check the lines that have been added or changed since the scan?  In my tests limited until now, so it seems that complete analysis would take longer than the window of failure, a progressive solution would be wonderful.  However, I don't see how to make this happen.


    Thank you

    Mike has

    No, the CDS is not currently able to track incremental changes. However, you could try to categorize paintings like those who can get new non-ASCII characters and those who cannot. The fact that a given table has at least one non-ASCII character is a pretty good approximation of this classification. In this way, you could just rescan the tables which are likely to get new non-ASCII characters. Depending on the size of the problem tables this may shorten the time to restart the analysis considerably.

    Note that all need conversion CLOB columns, even if they contain ASCII only.

    To minimize the window of downtime, we recommend a solution with GoldenGate. GoldenGate is, however, not a free product.

    Thank you

    Sergiusz

  • ADF Table retrieves all lines during the loading of the page

    Hello

    We have a requirement where we need run the query programmatically by giving the query column and its value.

    I used the code below in the AMimpl.java and calling this method during the click on the button Search my Search Page.

    I am able to get the features you want on the search page by clicking the search button.

    The question now is when the page initially loads, the table fetches all rows of the VO by default.

    Can you please let me know where I need to change so that the table will get no line on the initial load of the page?

    ' public void setVoParams (String columnName, String columnValue) {}

    ViewObject mapVO = this.getFusionSapMapping1 ();

    String whereClause = "MappingEO." + columnName + "" as: colValue ";"

    mapVO.setWhereClause (whereClause);

    mapVO.defineNamedWhereClauseParam ("colValue", null, null);

    mapVO.setNamedWhereClauseParam ("colValue", columnValue);

    mapVO.executeQuery ();

    }

    Hello

    You don't tell us your version of JDeveloper.

    An easier approach to implement your condition is to use the property refreshCondition of your iterator. Here is an example of how do: https://blogs.oracle.com/shay/entry/delay_method_execution_when_us

    Antonis

  • How to hide the ADF table during execution

    Hi all

    I use Jdeveloper - 11.1.2.4.39.64.36.1 version

    Is it possible to show only the tables with associated in the same lines and hide tables with no record.

    For ex: Let's say that at the time of the design, there are three related data tables with the diagram below.

    Table 1
    Table 2
    Table 3

    However, during execution, there is no record for 'Table 2', but the table 1 and table 3 have records associated with them.

    Is it possible to hide the table 2 and get the following provision -

    Table 1
    Table 3

    According to the schema, table 2 should hide, and table 3 should get reordered under table 1 directly.

    Best regards

    Ankit Gupta

    Hello

    You can set the property visible from the table to something like #{bindings.. estimatedRowCount gt 0}

    Arun-

  • How to lock "Write to file measure VI" during the execution of the request for this file cannot be opened during execution.

    Hello

    I have an application where I am external hardware data acquisition and save it in a file using "Write to measure file VI.

    During the application run on time; When the user opens ".» LVM text file "; abendons-saving application of the data obtained in the prescribed file but continues to demand on external hardware data acquisition. When I stop the application; an error message is poped indicating that an error has occurred due to open running.

    My question is: How can I block this file in which the data is saved, so that the user cannot open it during the execution of the application?

    Looking forward for your kind suggestions in this regard.

    Kind regards

    Jamal

    Hi Jamal,.

    It has been said many times before: use simple simple file features!

    Opening a file with a default access "read/write" will disable access to this file to other programs!

  • Installation of Windows XP Pro on a new configuration of the motherboard. Installation locks a blue screen during the installation of devices. Assistance from ms said why, but not healing. Anyone know an answer?

    My old motherboard gave the soul, and I have now installed a Gigabyte GA-880GM-UD2H with an AMD Phenom 6 processor and 4 GB of RAM.  The 2 HD is a Maxtor Sata 1 300 GB ones. One is divided into 2 equal partitions, the other has a single partition. During installation, it hangs at a blue screen during the "installing devices" and towards the end of the indicator. Removing everything except the essential, makes no difference.
    With 0x0000000A IRQL_NOT_LESS_OR_EQUAL error message States. This rising on the MS, it indicates:-stop this message indicates that a kernel-mode process or driver tried to access a memory address in which he was not allowed to access. The most common cause of this error is a bad or corrupted pointer that refers to an incorrect location in the memory. A pointer is a variable used by a program to designate a block of memory. If the variable has an incorrect value, the program tries to access memory that it shouldn't. When this occurs in a user mode application, it generates an access violation. When it occurs in kernel mode, it generates a STOP 0x0000000A messages. If you encounter this error during the upgrade to a newer version of Windows, it could be caused by a device driver, system service, a virus scanner, or backup tool which is not compatible with the new version.

    I start with new parts, except the DVD & HDs drive and with a start-up Virgin & installation process. I'm not upgraded to the BONE, that's the one I was using before the reconstruction. The supplier of components, suspected of defective parts and cooperated in the provision of a set of replacement of parts, but there is no change in the problem.

    Can someone explain what I can do to start?   Thank you!

    Hello

    See the article below which might help you.

    You receive an error message "Stop 0x0000000A" in Windows XP
    http://support.Microsoft.com/kb/314063

  • Do not have NAVIGATOR_WINDOW_INACTIVE if you lock the screen during the startup screen

    Title describes the problem, is this a bug or what type of event should I listen to?

    Solved the problem in NAVIGATOR_DEVICE_LOCK_STATE of handling then check if the screen is locked. I guess that's the solution?

  • [ADF, JDev12.1.3] How to display a gif of loading during the loading of the af: table (through the ExecuteWithParams method call)?

    Hallo,

    in the fragment of my page, I created an af:table you drag an instance of VO for the data control; I also have a search button by dragging the operation ExecuteWithParams of the same instance of VO.

    I double clicked on the serach button to create the searchButton_action method in the bean calling the ExecuteWithParams operation after you have made a few operations.

    Next to the button, I put a table whose source is a gif of "load".

    I would like to make visible the gif while research is underway and make it invisible when the search is complete.


    In the beginning, I followed this approach.

    In the searchButton_action, I wrote the code to set the visible of the image property.

    But it did not work because the gif never appears. I also tried to set the property PartialTriggers of the image with the ID of the button table and search.

      public String searchButton_action() {
        RichActiveImage imgSearch = (RichActiveImage) FacesUtils.findComponent("ImgSearch");
        imgSearch.setVisible(true);
        AdfFacesContext.getCurrentInstance().addPartialTarget(imgSearch);
        // ...
        OperationBinding operationBinding = BindingsUtils.getBindings().getOperationBinding("MyVOInstanceExecuteWithParams");
        // ...
        imgSearch.setVisible(false);
        AdfFacesContext.getCurrentInstance().addPartialTarget(imgSearch);
        // ...
      }
    

    Then I tried with another approach which is to set the Visible property using the value off of the search button which is #{! links.} MyVOInstanceExecuteWithParams.enabled}

    But also, this approach has not worked.

    I also tried to set the property PartialTriggers of the image with the ID of the button table and search.

    What's not in my efforts? You could you kindly help me to solve the problem?

    Thank you

    Federico

    PS

    FacesUtils.findComponent is a method that retrieves the item passed as param. It works well since I used it several more times in my application.

    Your approach may not work add there is only a single thread of UI work. Your trigger reached the component when the execute with Péan has finished its work.

    For your use case there are a few solutions combining JavaScript and client-server events showing a window as long as the operation is running. Read https://blogs.oracle.com/groundside/entry/notification_during_long_running_transactions for all the info.

    Timo

Maybe you are looking for