Drop and re-create the index on the current table

Hello

I just have a few questions about the removal and creating indexes on a table that activates a lot.

Let me explain first:

The table is used by the application with the DML statements every 3 seconds and I want to do is to drop the indexes and re-create them.
But Im worried about the consequences - what happens when I try to recreate the indexes and the table has an option rowlock/used by the application?

P.S
It's production environment - so I can't stop the application.


BR / Ander

A reconstructed index either Online or Offline.

Online index rebuild features:

ALTER INDEX REBUILD ONLINE;

LMD is allowed on the base table
It's relatively slow
Base table is targeted for the new index
Base table is locked in shared mode and DOF is not possible
Intermediate table stores changes to data in the base table, during the rebuilding of indexes to update the new index later

Offline index rebuild features:

ALTER INDEX REBUILD. (Default)
Does not refer to the base of the table and the base table is exclusively locked
New index is created from the old index
Not possible DML and DDL on the base table
Relatively faster

Tags: Database

Similar Questions

  • drop and re-create the table

    Hello

    I am very new to the Apex. Very basic SQL and pl sql.

    Two questions: -.

    First of all, I want to delete a table and then recreate the same table in a script (strange I know but it is purely a LOV table).

    Then, run the combined script when a user presses a button on a form in the published application.

    REPORTED

    Hi reported.

    The delay I was referring to that is that when you go on a database connection, it takes much longer for a long time as if it were local. Rather than create a local table, why don't you just make the LOV created through data binding? for example the LOV queries:

    SELECT DISTINCT surname display_value, surname return_value
    FROM CUSTOMER_TBL@DBLINK
    

    Mike

  • drop and re-create the table using dynamic sql

    The following procedure should drop the table and re-create it. Currently, I get the dbms_output of the query. If I run the query only, it works well. but through the procedure, it does not work. Please help me

    PROCEdure emp_backup is
    sql_txt varchar2(10000);
    begin
         begin
         EXECUTE IMMEDIATE 'drop table emp_backup ' ;
         exception
         when others then
         null;
    
         sql_txt:= 'CREATE TABLE emp_backup as ' ||
                     'select * from emp  '||
                     'where dep_no=10 ' ;
         dbms_output.put_line(sql_txt);
         EXECUTE IMMEDIATE sql_txt;
    Exception
    when others then
    Null;
    
    End;

    Daniel wrote:
    I'm getting following error ORA-01031: insufficient privileges

    What is the command to grant privileges to this

    GRANT CREATE TABLE TO <>
    

    Detaching Frank, however, and echoing my previous comment, let them down and to re-create the tables makes no sense. It is logical to truncate a table if you test a load. If you build a data warehouse, it makes sense to delete and re-create a partition if you rerun a load for a particular date and that you have daily partitions. Deletion and recreation of a table in a stored procedure is not a reasonable way to test a system (nor is there a reasonable way to approach change control issues that will inevitably produce when you need to change the structure of a table).

    Justin

  • DROP AND RE-CREATE ALL INDEXES

    Hi all

    I have a database with all the struture of tables and their indexes, but no data on the tables.

    I have scripts to import that will insert millions of rows in tables.

    What I want to do is:

    (1) built a sript which creates all indexes
    (2) remove all indexes
    (3) load all the data in the tables
    (4) create all indexes the sript running 1)

    My problem is on point 1). I don't know how to build this script.

    Thanks in advance for any help,

    RS

    Yes, I see that I go wrong here... once again ;-)

    I have also addressed this issue in the past and now, remember that there are also some Metalink Notes on this topic, where people complain about the same problem.
    Especially Note 394143.1 manages your problem
    I'm sorry for the mistake. Maybe this note helps.

    I went to the #3 option.

    Edit:
    In fact, it is the script to generate the DDL and put them in a CLOB table. In this case for Materialized views:

    Set serveroutput on;
    declare
    CLOB ddl_out;
    objname varchar2 (30): = ";
    tablechk varchar2 (100): = ";
    number of sqlorder: = 1;
    cursor c1 is select a.mview_name, a.owner from dba_mviews; -where owner = 'EHDA ";

    Start
    -Due to formatting problems dbms_metadata, the output is saved in a table that contains a clob column
    run immediately "drop table ddl_output;
    immediate ' create table ddl_output (objname varchar2 (30), ddl_query clob, number sqlorder);

    for r1 in c1
    loop
    dbms_output. Enable (10000);
    If objname = r1.mview_name
    then
    dbms_output.put_line (' treatment: ' |) R1.mview_name);
    on the other
    objname: = r1.mview_name;
    sqlorder: = 1;
    end if;
    insert into ddl_output values (r1.mview_name, 'drop the materialized view' |) R1.mview_name | ';', sqlorder);
    sqlorder: = sqlorder + 1;
    Select dbms_metadata.get_ddl ('MATERIALIZED_VIEW', "|) R1.mview_name: ",". R1.owner | ") in the double ddl_out;
    insert into ddl_output values (r1.mview_name, ddl_out |) ';', sqlorder);
    sqlorder: = sqlorder + 1; Select dbms_metadata.get_dependent_ddl ('INDEX', "|) R1.mview_name: ",". R1.owner | ") in the double ddl_out;
    insert into ddl_output values (r1.mview_name, ddl_out |) ';', sqlorder);
    sqlorder: = sqlorder + 1;
    commit;
    end loop;
    end;
    /

    After that which has finished, use the script below to recreate the object with the table DDL

    declare
    query varchar2 (2000);
    cursor c1 is select ddl_query from ddl_output by objname, sqlorder;

    BEGIN
    for r1 in c1
    loop
    dbms_output. Enable (999999);
    query: = r1.ddl_query;
    dbms_output.new_line ();
    dbms_output.put_line (Query);
    If length (query) > 5
    then
    immediate execution of the query;
    end if;

    end loop;
    end;
    /

    Published by: fjfranken on March 24, 2009 05:14

  • drop and re-create the tablespace

    version 9208
    the requirement must deletes and recreates same tablespace with different data file location, could it cause any problem?

    Published by: DBA2008 on February 18, 2010 15:24

    The problem is that you lose data, which is currently this tablespace (unless export you it before).

    Werner

  • How to monitor connections dropped and rejected on the PIX Firewall / ASA?

    I need to monitor the SNMP OID of the connections dropped and rejected on the PIX and ASA firewalls. Is this possible?

    If this is the case, what SNMP OID should I monitor?

    Syslogs and Netflow (introduced in version 8.2) are your options.

    No MIB can give you the numbers of conn.

    PK

  • By program (step by step) read data XFDF and dynamically create the form

    Hej,

    I have a form created dynamically with JavaScript in Adobe Acrobat 9. I exported the variable amount of data in an XFDF file.

    Now, I want to import the XFDF file into a second PDF file. But while the data is variable, I need to read the data imported manually

    and to create the new PDF dynamically. This is required, while the new PDF must contain a chart made in Flash and will be

    filled with data from the XFDF file.

    My problem is, that "doc.importAnXFDF ()" does not return the data that is imported as an object. I was looking for solutions

    but I have always found solutions to automatically populate an existing form. The API guide is not useful. Where can I read the imported data

    to iterate on and in the process.

    Thank you very much.

    Christian

    As I discovered (https://acrobatusers.com/tutorials/extracting-pages-pdf-acrobat-javascript) it is possible to save a range of

    pages programmatically. In fact, this has many advantages for my use case, including to prevent the many errors made by users.

    So I decided to use this solution and close this issue.

  • steps to create the new table using existing metadata

    Hi all


    That's what I want to achieve,

    I want to create a procedure that will take an input parameter as a table name lets say 'EMP ',.
    This procedure checks if this table exists or not?
    If they don't exist
    It will create a new table with the name _dummy join the existing table name (ex: new table will be EMP_DUMMY).
    and new table should have the same structure of the table, indexes, and constraints on the EMP table.


    NB: It should not be created using select as create table EMP_DUMMY select * from EMP where = condition false;



    Can someone help me please how to achieve this?

    Please, don't post duplicate discussions.

    Check your thread previous stored procedure to create a new table with the existing table structure to further discussions

  • How to create the logical tables &amp; how to give joints according to obiee 11g?

    Hello

    I have again to obiee 11g. I want to create the logical tables in MDB layer.

    After that I want to give joins according to MDB.

    I don't know, how to create the logical tables and how to give joints according to obiee 11g?

    Please help me.

    Thanks in advance,

    A.Kavya

    Hello

    The new logical table is right click on the MDB itself, for the join you generally in the business model diagram (again right click on objects).

    Maybe it's better if you start from a kind of tutorial to at least have an overview of what is happening where (layer business and physical layer etc.).

    Take a look at what Oracle has available: Oracle BI EE 11 g

    And no doubt, it can be a good start: https://apexapps.oracle.com/pls/apex/f?p=44785:24:0:NO:P24_CONTENT_ID, P24_PREV_PAGE:9787, 2

  • How to get textframe parent of the current Table?

    Hi all

    I have ITableModel and had ITextModel through ITableTextContainer; through textmodel, I get iframelist. But my question is how can he get the exact relative of the current table textframe?

    Pls suggest on that.

    I got it!

    ITableTextContainer GetAnchorTextIndex().

  • Can I create an index on a partitioned table bitmap?

    Can I create an index on a partitioned table bitmap?

    Yes, you can. But an index on a partitioned table bitmap must be a local index.
    Image bitmap index on non partitioned tables cannot be partitioned.

  • Can someone create a program for me to tension and calclate to the current aid concert. I need a graphic Visual and some nuts for aesthetic purposes. PLS HELP

    Hey someone create a labview program that uses the current and voltage to find the resistance. I also need a chart and buttons for aesthetic purposes. PLS HELP A GAL!

    COME ON GUYS.  HELP A GAL JAVA!

    HERE YA GO, GAL.

  • Create the work around plan group, unless there is a clipping path, and then create the work around clipping path plan

    Hello again everyone.

    I was able to work on a lot of this code to other people's questions, but I hit a snag in my if/else clause structure... I need to make a plan to work around each groupItem of high-level layer [0]. This part is cake... unless there is a clipping mask. Visible limits do not work when there is a clipping mask. So, I built some of the loops that browse the pathItems search the clipping mask and return the visibleBounds said mask. However, I can't find how to structure the if clause in a way that will create the plan of work around the clipping mask when one exists.

    I am successful to find the visibleBounds of the mask and the creation of the appropriate graphic board, but it is ALSO to create a work plan around the visible boundaries of the entire group. How framing an if clause to determine if a work plan has been done around the clip path already and therefore not create a second work plan around the visible boundaries of the groupItem together? I guess I would need some sort of function to determine if createdArtboardAroundClip = true and if so, skip this group...

    Thank you all.

    Here is the code:

    var aB = docRef.artboards;
    var docLayers = docRef.layers;
    var layer1 = docLayers[0];
    var groupLevel1 = layer1.groupItems;
    
    for (a = 0; a < groupLevel1.length; a++){
        var groupLevel2 = groupLevel1[a].groupItems;
        var vB = groupLevel1[a].visibleBounds
        
        for (b = 0; b < groupLevel2.length; b++){
            var paths = groupLevel2[b].pathItems;
            
            for (c = 0; c < paths.length; c++){
                if (paths[c].clipping == true){
                    var clipBounds = paths[c].visibleBounds;
                    aB.add(clipBounds);
                    break;
                    }
                }
            }
        aB.add(vB);
        }
    

    Oh sorry, I forgot that one.  I was able to view the image basically to see what is happening.  Okay, so I saw a problem, you have one of your straps closure irrelevant.   Your first nested for loop does not close where you want.

  • CFLOOP and cfoutput creates the transport back to RSS Feed

    I have problems with the validation of an RSS feed that I create using CFXML. I tried both cfoutput and cfloop and creates the following:

    < item >
    < title > events: Panel of career on the career opportunities with a library technician certificate < /title >
    < link > http://events.LBCC.edu/detail.cfm?EventID=1286 < / link >
    < description > The Library Department & amp; LAKE career & amp; Employment Services Center will host a panel of career on career opportunities with a library technician certificate. 11:00 to 13:00 in the E - the Student Center building. < / description >
    < / point >
    <-cfloop and cfoutput is adding to create an RSS feed not valid carriage return.
    < item >
    < title > events: EOPS applications will be available as of May 3, < /title >
    < link > http://events.LBCC.edu/detail.cfm?EventID=1273 < / link >
    < description > due to the FAFSA application volume increased financial aid, EOPS applications will be available beginning May 3. for other questions, please call 562-938-4772 (IBC) or 562-938-3097 (PCC). < / description >
    < / point >

    If I use the xml cffeed works correctly as follows and creates a valid stream:

    < item >
    < title > events: Panel of career on the career opportunities with a library technician certificate < /title >
    < link > http://events.LBCC.edu/detail.cfm?EventID=1286 < / link >
    < description > The Library Department & amp; LAKE career & amp; Employment Services Center will host a panel of career on career opportunities with a library technician certificate. 11:00 to 13:00 in the E - the Student Center building. < / description >
    < / point >
    < item >
    < title > events: EOPS applications will be available as of May 3, < /title >
    < link > http://events.LBCC.edu/detail.cfm?EventID=1273 < / link >
    < description > due to the FAFSA application volume increased financial aid, EOPS applications will be available beginning May 3. for other questions, please call 562-938-4772 (IBC) or 562-938-3097 (PCC). < / description >
    < / point >

    Here is my code:

    < cfproperty output = "false" >
    < name cffunction = "UpdateRSSFeed" access = "remote" returntype = 'Cancel' >
    < cfset RSSXMLPath = "e:\websites\www\RSSFeed\" >

    <!--create all the news and events Feed-->
    < component cfinvoke = method "eventsystem" = "listAllNewsEvents" returnvariable = "listAllNewsEventsRET" >

    < cfoutput >
    < cfxml variable = "AllNewsEventsFeed" >
    "" "" < xmlns:rdf rss = "http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:itunes = "http://www.itunes.com/dtds/podcast-1.0.dtd" xmlns ="http://purl.org/dc/elements/1.1/" xmlns:taxo = "http://purl.org/rss/1.0/modules/taxonomy/" version = "2.0" > "
    < String >
    < title > news and events RSS Feed < /title >
    < link > http://www.LBCC.edu/ < / link >
    < cfloop query = "listAllNewsEventsRET" >
    < item >
    < title > < cfif listAllNewsEventsRET.event_typeID eq 2 > News: cfelse > events: < / cfif > #XMLFormat (listAllNewsEventsRET.Event_Title) # < /title >
    #listAllNewsEventsRET.FullLink # < link > < / link >
    < description > #XMLFormat (listAllNewsEventsRET.summary) # < / description >
    < / point >
    < / cfloop >
    < / channel >
    < / rss >
    < / cfxml >
    < / cfoutput >
    <!--> write to file
    < cffile
    action = "write".
    addnewline = "" charset = "us-ascii".
    file = ' #RSSXMLPath #NewsEvents2.xml.
    output = "#ToString (AllNewsEventsFeed)" # "fixnewline ="no">"
    < / cffunction >
    < / cfproperty >

    Any suggestion would be appreciated.

    Thank you.

    Ron

    And there is a newline at the end of the line is not there!

     <-- this is a carriage return!
    
    

    won't do much if you use just one big around all the code you want to copy, AND all the white space you do not.  Effectiviely to use it, you need to do something like that.

    
    News and Events RSS Feed
    http://www.lbcc.edu/
    
    
    <cfif listAllNewsEventsRET.event_typeID eq 2>News:<cfelse>Events:</cfif>#XMLFormat(listAllNewsEventsRET.Event_Title)#
    #listAllNewsEventsRET.FullLink#
    #XMLFormat(listAllNewsEventsRET.summary)#
    
    
    
    
    
    
  • Wireless connection drops and reconnects to the games only?

    I have an Asus ea - No. 66, WIndows 7 64 bit, whenever I connect to a game, being especially csGO. I lose the connection and gain back almost instantly.  I'm not connected to the game or anything else. Then everything comes back online. I was wondering, which could materialize this project?

    Hi boozal,.

    Thanks for posting that query you in Microsoft Communities. Provide the following information:

    ·         Did you do changes on the computer before the show?

    ·         You get the error message?

    Follow these methods.

    Method 1: Temporarily disable the security software .

    Note: Antivirus software can help protect your computer against viruses and other security threats. In most cases, you should not disable your antivirus software. If you do not disable temporarily to install other software, you must reactivate as soon as you are finished. If you are connected to the Internet or a network during the time that your antivirus software is disabled, your computer is vulnerable to attacks.

    Method 2: Follow these steps:

    Step 1: Start the computer in safe mode with network and check if the problem persists.

    Step 2: If the problem does not persist in safe mode with networking, perform a clean boot to see if there is a software conflict as the clean boot helps eliminate software conflicts.

    Note: After completing the steps in the clean boot troubleshooting, follow step 3 from the link to start the computer to a Normal startupmode.

    Method 3: Follow the steps in the article.

    Windows wireless and wired network connection problems

    I hope this helps. Let us know if you need more assistance.

    Thank you.

Maybe you are looking for