When a Index become invalid?

How can I force my index to become invalid?
Thanks.
Paulo.

Hi, thanks for your answer. But it is not yet clear for me.
Whats the difference between the status INVALID and UNUSABLE?
Can you help me?
Edited by: paulo on Mar 14, 2012 9:40 PM

Similar Messages

  • When do indexes become invalid?

    When do indexes become invalide?

    Indexes can become invalid or unusable whenever a DBA tasks shifts the ROWID values, thereby requiring an index rebuild. These DBA tasks that shift table ROWID's include:
    Table partition maintenance - Alter commands (move, split or truncate partition) will shift ROWID's, making the index invalid and unusable.
    CTAS maintenance - Table reorganization with "alter table move" or an online table reorganization (using the dbms_redefinition package) will shift ROWIDs, creating unusable indexes.
    Oracle imports - An Oracle import (imp utility) with the skip_unusable_indexes=y parameter
    SQL*Loader (sqlldr utility) - Using direct path loads (e.g. skip_index_maintenance) will cause invalid and unusable indexes.
    Cheers

  • Index becomes invalid

    Hi,
    11g on linux.
    I have a batch job run from the application end to refresh the table data. The data may be loaded through sql-loader/DML.
    After running of the batch job, some of the indexes becomes unusable state.
    I dont suspect the index becomes invalid due to duplicate records in primary key. Since I'm able to rebuild the index manually.
    I like to investigate from database end what the batch job does and make the indexes unsuable.
    I'm planning to 10046 trace session trace.
    Could you please share your comments, how to take this forward to find the Root Cause of what is actually happening on the objects and makes index unusable.
    Thanks
    KSG
    Edited by: KSG on May 30, 2013 8:03 PM

    KSG wrote:
    Hi,
    11g on linux.
    I have a batch job run from the application end to refresh the table data. The data may be loaded through sql-loader/DML.
    After running of the batch job, some of the indexes becomes unusable state.
    I dont suspect the index becomes invalid due to duplicate records in primary key. Since I'm able to rebuild the index manually.
    I like to investigate from database end what the batch job does and make the indexes unsuable.
    I'm planning to 10046 trace session trace.
    Could you please share your comments, how to take this forward to find what is actually happening on the objects and makes index unusable.
    Thanks
    KSGhttp://www.lmgtfy.com/?q=oracle+index+unusable
    Handle:     KSG
    Status Level:     Explorer (130)
    Registered:     Dec 23, 2008
    Total Posts:     766
    Total Questions:     212 (146 unresolved)
    I extend to you my condolences; since you rarely get your questions answered here.

  • Time when Oracle object become invalid

    We can find if there are invalid objects in the database.
    But is there a way to find when the object become invalid. I am interested in finding the time when object become invalid.
    Let me know if Oracle can tell this information.
    Thank you.
    --harvey                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

    Hi harvey;
    Please check below thread:
    Determine when objects become invalid
    Determine when objects become invalid
    http://stackoverflow.com/questions/1467604/determining-when-an-oracle-database-object-became-invalid
    Also see:
    http://download.oracle.com/docs/cd/B28359_01/server.111/b28310/general007.htm
    Regard
    Helios

  • R-Tree Index becomes invalid

    Hi,
    I've a index that becomes invalid almost every day. I get the error message
    ORA-29902: error in executing ODCIIndexStart() routine
    ORA-13203: failed to read USER_SDO_GEOM_METADATA view
    ORA-13203: failed to read USER_SDO_GEOM_METADATA view
    ORA-29400: data cartridge error
    ORA-01013: user requested cancel of current operation
    ORA-06512: at "MDSYS.SDO_INDEX_METHOD_10I", line 286
    after rebuilding the index everything works fine again.
    Does anybody know a solution on that problem?
    Peter

    Is there a nightly process that is causing things to change? I think we need more info to be able to help you.
    Is it possible that this index is in a different tablespace and backups aren't shutting them down/bringing them back up in the right order?
    Any manner of things could cause this, beyond the Oracle bug for spatial indexes in 10G, with large number of records. Ours handle this fine night after night, so something must be causing your data to change or affecting the index.
    What happens every night, or at the end of the day that could be affecting it?

  • When do VI and queue references become invalid?

    Hi all,
    I have a fairly complicated problem, so please bear with me.
    1)  I have a reentrant SubVI (let's call it VI "Assign") that has an input cluster of (VI ref, queue ref) (let's call the cluster type "Refs").  If the VI ref is invalid (first execution), the VI ref and queue ref are assigned values and are passed on as an output cluster of same type.  (The VI does other things too, but for simplicity only this is important.)
    2)  The VI that calls VI "Assign" (let's call it VI "Store") is not reentrant and has a local variable of type "Refs" that is wired to the input and output of VI "Assign".  This VI effectively stores the references.  The references returned by VI "Assign" are always valid right after the call, but after the problem condition described below, they are invalid at the start of all calls before they are passed to VI "Assign".
    3)  VI "Store" is called by multiple non-reentrant VIs, so the local variables of VI "Assign" retain their values (Has been tested and verified to retain their values).  The VI causing the problem in this case is a template VI of which multiple copies are launched (let's call it VI "Template").
    The problem is that the moment an instance of VI "Template" is closed, the queue reference becomes invalid, although the actual variant value of the reference remains the same.  The VI ref can become invalid or not, depending on small changes, but is always reproducible.  I assume there must be some similarity between VI and queue refs.  After spending some time researching, the Labview help states for the Open VI Ref component "If you do not close this reference, it closes automatically after the top-level VI associated with this function executes."  In this case I assumed it means that the moment the reentrant VI "Assign" finishes, the references will get cleared ??  So I made a non-reentrant VI (let's call it VI "NR Assign") that only assigns values to the references and VI "Assign" now calls this VI (It effectively does what I described VI "Assign" does).  I keep this VI alive by using it in a VI which never terminates and since it never terminates, the references should never become invalid.  Anyone still following?  This didn't solve the problem though.  If I reproduce the same scenario using only one instance of the template VI, it works just fine.  Furthermore, the VI and queue references are never closed, to aid analysis of the problem.  Can anyone shine some light on what happens when a template VI terminates?  Could this be the problem?
    Unfortunately I cannot include the code.
    Thank you whoever is able to make sense of this.
    Christie

    Christie wrote:
    Hi all,
    I have a fairly complicated problem, so please bear with me.
    1)  I have a reentrant SubVI (let's call it VI "Assign") that has an input cluster of (VI ref, queue ref) (let's call the cluster type "Refs").  If the VI ref is invalid (first execution), the VI ref and queue ref are assigned values and are passed on as an output cluster of same type.  (The VI does other things too, but for simplicity only this is important.)
    2)  The VI that calls VI "Assign" (let's call it VI "Store") is not reentrant and has a local variable of type "Refs" that is wired to the input and output of VI "Assign".  This VI effectively stores the references.  The references returned by VI "Assign" are always valid right after the call, but after the problem condition described below, they are invalid at the start of all calls before they are passed to VI "Assign".
    3)  VI "Store" is called by multiple non-reentrant VIs, so the local variables of VI "Assign" retain their values (Has been tested and verified to retain their values).  The VI causing the problem in this case is a template VI of which multiple copies are launched (let's call it VI "Template").
    The problem is that the moment an instance of VI "Template" is closed, the queue reference becomes invalid, although the actual variant value of the reference remains the same.  The VI ref can become invalid or not, depending on small changes, but is always reproducible.  I assume there must be some similarity between VI and queue refs.  After spending some time researching, the Labview help states for the Open VI Ref component "If you do not close this reference, it closes automatically after the top-level VI associated with this function executes."  In this case I assumed it means that the moment the reentrant VI "Assign" finishes, the references will get cleared ??  So I made a non-reentrant VI (let's call it VI "NR Assign") that only assigns values to the references and VI "Assign" now calls this VI (It effectively does what I described VI "Assign" does).  I keep this VI alive by using it in a VI which never terminates and since it never terminates, the references should never become invalid.  Anyone still following?  This didn't solve the problem though.  If I reproduce the same scenario using only one instance of the template VI, it works just fine.  Furthermore, the VI and queue references are never closed, to aid analysis of the problem.  Can anyone shine some light on what happens when a template VI terminates?  Could this be the problem?
    Unfortunately I cannot include the code.
    Thank you whoever is able to make sense of this.
    Christie
    All LabVIEW refnums do get deallocated automatically when the top-level VI in whose hierarchy the refnum was created goes idle (stops executing). You will have to make sure that the creation of a refnum is done inside a VI hierarchy that stays running for the entire time you want to use that refnum.
    Rolf Kalbermatter
    Message Edited by rolfk on 06-27-2007 11:52 AM
    Rolf Kalbermatter
    CIT Engineering Netherlands
    a division of Test & Measurement Solutions

  • Why Synonym becomes INVALID when changes are made on the related object ?

    Hi all,
    WHY SYNONYMS becomes invalid when changes are made on related OBJECTS ?
    Is there any specific reasons for this.?
    Is there any method or procedures to make the synonym VALID as soon as the we perform any alteration on the related object.
    Thanks
    Himabala

    Synonym will be validated when it is accessed, no need to take an action.

  • Object Fields Mysteriously Becoming Invalid

    I am not exactly sure what code to post with this considering the nature of what's going on, so I'll do my best to explain and then perhaps I can provide code based on your responses.
    When my application loads in the AppDelegate I create 3 objects of the "Item" type and then create an array out of those objects and add that array to an ItemListController which has a property for an NSMutableArray. The program then loads a UINavigationController with each of those objects in it being drawn with a subClass of UITableViewCell. As it stands now, if I click on any one of those objects more than 3 times, the object itself does not become nil, but all of the fields within it do.
    - (void)applicationDidFinishLaunching:(UIApplication *)application {
    Item *sword = [[Item alloc] initWithName:@"Sword" description:@"This is a sword"];
    //sword.itemPrice = (int *)524;
    Item *shield = [[Item alloc] initWithName:@"Shield" description:@"This is a shield"];
    //shield.itemPrice = (int *)322;
    Item *subligar = [[Item alloc] initWithName:@"Subligar" description:@"This is a subligar"];
    //subligar.itemPrice = (int *)1034;
    [subligar setImageWithPath:@"Hello.png"];
    if(self.itemListController == nil) {
    ItemListController *controller = [[ItemListController alloc] init];
    self.itemListController = controller;
    [controller release];
    NSMutableArray *itemArray = [[NSMutableArray alloc] initWithObjects:sword, shield, subligar, nil];
    self.itemListController.items = itemArray;
    [itemArray release];
    // Configure and show the window
    [window addSubview:[navigationController view]];
    [window makeKeyAndVisible];
    The click handler of my TableView right now simply calls the AppDelegate's instance of ItemListController and then gets the object back from the items array at the index at which the user clicked. From there, I set a few properties and load a view tailored to that Item.
    Presently, all of the logic that sets properties with the Item and loads the view for that object is commented out and so the only behavior occurring is the Item being retrieved from the AppDelegate's ItemListController.items and then being stored in a temporary object which is later released. But like I said above, *after 3 requests for my object all of its fields become invalid*. I have no idea what is causing it because the object itself is never being released within that time. Below is the code from the click event of the table cell:
    - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
    calls++;
    NSLog(@"Hit Count: %d", calls);
    iPhoneHelloWorldAppDelegate *appDelegate = (iPhoneHelloWorldAppDelegate *)[[UIApplication sharedApplication] delegate];
    Item *item = (Item *)[appDelegate.itemListController.items objectAtIndex:indexPath.row];
    //lastItem = item;
    if(self.itemView == nil) {
    ItemViewController *viewController = [[ItemViewController alloc] initWithNibName:@"ItemViewController" bundle:[NSBundle mainBundle]];
    self.itemView = viewController;
    [viewController release];
    if(calls > 3) {
    NSLog(@"item retainCount = %d", [item retainCount]);
    [item release];
    Here's a snapshot from the debugger after my Item object dies:
    http://img514.imageshack.us/img514/4567/picture2az5.png

    Hi,
    Item *item = (Item *)[appDelegate.itemListController.items objectAtIndex:indexPath.row];
    //lastItem = item;
    if(self.itemView == nil) {
    ItemViewController *viewController = [[ItemViewController alloc] initWithNibName:@"ItemViewController" bundle:[NSBundle mainBundle]];
    self.itemView = viewController;
    [viewController release];
    if(calls > 3) {
    NSLog(@"item retainCount = %d", [item retainCount]);
    // Why do you relase item? I don't see any retain or method wich increases the retain-count.
    [item release];

  • MATERIALIZED VIEW BECOMES INVALID AFTER REFRESH

    Hello All,
    I have wierd problem ,
    In my enviroinment we have a MATERIALIZED VIEW ,which is refreshed by a sheduled DBMS_SNAPSHOT.REFRESH Job post the refresh it becomes invalid and every time we have to compile it manually ,Could anybody help with a solution .Thanks a lot in Advance .
    DETAILS :
    ======
    VERSION:Oracle9i Enterprise Edition Release 9.2.0.6.0 - 64bit Production
    HOST: IBM AIX

    Is the MV part of a refresh group?
    Post the command and parameters used by the scheduled job to do the refresh as well as the parameters you use when you do it manually.

  • When should be package invalidated?

    Hello guys,
    I would need again some help...
    My question is: When exactly should be package invalidated?
    Consider following situation:
    We have two packages, one contains constants (in its specification), the other is reading these constants. Package is reading these constants in package body and package spec as well. Now, when I add a new constant to the first package and recompile it, should this invalidate the other package??? The new added constant is not used in the other package.
    In reality, we have a Constant package, containing all constants in its specification. One package (test_pkg) is reading some constant let say form line 100. Now we add new constant let say to line 50. When we recompile the constant package, planty of packages get invalidated because they are reading from it. We recompile all invalid packages. However test_pkg is not invalidated!!! Now if we run the code from test_pkg, it is still reading the constant from line 100, so it is reading it from wrong place and the constant has wrong value! The only thing what help is to recompile the test_pkg.
    So it looks like the reference to Constant package wasn't updated.
    Why isn't test_pkg invalidated???
    Oracle version:
    SELECT * FROM V$VERSION;
    Oracle Database 11g Release 11.2.0.1.0 - 64bit Production
    PL/SQL Release 11.2.0.1.0 - Production
    "CORE     11.2.0.1.0     Production"
    TNS for Linux: Version 11.2.0.1.0 - Production
    NLSRTL Version 11.2.0.1.0 - Production

    From my standard library of responses...
    Packages tend to fail because of their "package state". A package has a "state" when it contains package level variables/constants etc. and the package is called. Upon first calling the package, the "state" is created in memory to hold the values of those variables etc. If an object that the package depends upon e.g. a table is altered in some way e.g. dropped and recreated, then because of the database dependencies, the package takes on an INVALID status. When you next make a call to the package, Oracle looks at the status and sees that it is invalid, then determines that the package has a "state". Because something has altered that the package depended upon, the state is taken as being out of date and is discarded, thus causing the "Package state has been discarded" error message.
    If a package does not have package level variables etc. i.e. the "state" then, taking the same example above, the package takes on an INVALID status, but when you next make a call to the package, Oracle sees it as Invalid, but knows that there is no "state" attached to it, and so is able to recompile the package automatically and then carry on execution without causing any error messages. The only exception here is if the thing that the package was dependant on has changes in such a way that the package cannot compile, in which case you'll get an Invalid package type of error.
    And if you want to know how to prevent discarded package states....
    Move all constants and variables into a stand-alone package spec and reference those from your initial package. Thus when the status of your original package is invlidated for whatever reason, it has no package state and can be recompiled automatically, however the package containing the vars/const will not become invalidated as it has no dependencies, so the state that is in memory for that package will remain and can continue to be used.
    As for having package level cursors, you'll need to make these local to the procedures/functions using them as you won't be able to reference cursors across packages like that (not sure about using REF CURSORS though.... there's one for me to investigate!)
    This first example shows the package state being invalided by the addition of a new column on the table, and causing it to give a "Package state discarded" error...
    SQL> set serveroutput on
    SQL>
    SQL> create table dependonme (x number)
      2  /
    Table created.
    SQL>
    SQL> insert into dependonme values (5)
      2  /
    1 row created.
    SQL>
    SQL> create or replace package mypkg is
      2    procedure myproc;
      3  end mypkg;
      4  /
    Package created.
    SQL>
    SQL> create or replace package body mypkg is
      2    v_statevar number := 5; -- this means my package has a state
      3
      4    procedure myproc is
      5      myval number;
      6    begin
      7      select x
      8      into myval
      9      from dependonme;
    10
    11      myval := myval * v_statevar;
    12      DBMS_OUTPUT.PUT_LINE('My Result is: '||myval);
    13    end;
    14  end mypkg;
    15  /
    Package body created.
    SQL>
    SQL> exec mypkg.myproc
    My Result is: 25
    PL/SQL procedure successfully completed.
    SQL>
    SQL> select object_name, object_type, status from user_objects where object_name = 'MYPKG'
      2  /
    OBJECT_NAME
    OBJECT_TYPE         STATUS
    MYPKG
    PACKAGE             VALID
    MYPKG
    PACKAGE BODY        VALID
    SQL>
    SQL>
    SQL> alter table dependonme add (y number)
      2  /
    Table altered.
    SQL>
    SQL> select object_name, object_type, status from user_objects where object_name = 'MYPKG'
      2  /
    OBJECT_NAME
    OBJECT_TYPE         STATUS
    MYPKG
    PACKAGE             VALID
    MYPKG
    PACKAGE BODY        INVALID
    SQL>
    SQL> exec mypkg.myproc
    BEGIN mypkg.myproc; END;
    ERROR at line 1:
    ORA-04068: existing state of packages has been discarded
    ORA-04061: existing state of package body "SCOTT.MYPKG" has been invalidated
    ORA-06508: PL/SQL: could not find program unit being called: "SCOTT.MYPKG"
    ORA-06512: at line 1
    SQL>
    SQL> select object_name, object_type, status from user_objects where object_name = 'MYPKG'
      2  /
    OBJECT_NAME
    OBJECT_TYPE         STATUS
    MYPKG
    PACKAGE             VALID
    MYPKG
    PACKAGE BODY        INVALID
    SQL>
    SQL> exec mypkg.myproc
    PL/SQL procedure successfully completed.
    SQL>
    SQL> select object_name, object_type, status from user_objects where object_name = 'MYPKG'
      2  /
    OBJECT_NAME
    OBJECT_TYPE         STATUS
    MYPKG
    PACKAGE             VALID
    MYPKG
    PACKAGE BODY        VALIDAnd this next example shows how having the package variables in their own package spec, allows the package to automatically recompile when it is called even though it became invalidated by the action of adding a column to the table.
    SQL> drop table dependonme
      2  /
    Table dropped.
    SQL>
    SQL> drop package mypkg
      2  /
    Package dropped.
    SQL>
    SQL> set serveroutput on
    SQL>
    SQL> create table dependonme (x number)
      2  /
    Table created.
    SQL>
    SQL> insert into dependonme values (5)
      2  /
    1 row created.
    SQL>
    SQL> create or replace package mypkg is
      2    procedure myproc;
      3  end mypkg;
      4  /
    Package created.
    SQL>
    SQL> create or replace package mypkg_state is
      2    v_statevar number := 5; -- package state in seperate package spec
      3  end mypkg_state;
      4  /
    Package created.
    SQL>
    SQL> create or replace package body mypkg is
      2    -- this package has no state area
      3
      4    procedure myproc is
      5      myval number;
      6    begin
      7      select x
      8      into myval
      9      from dependonme;
    10
    11      myval := myval * mypkg_state.v_statevar;  -- note: references the mypkg_state package
    12      DBMS_OUTPUT.PUT_LINE('My Result is: '||myval);
    13    end;
    14  end mypkg;
    15  /
    Package body created.
    SQL>
    SQL> exec mypkg.myproc
    My Result is: 25
    PL/SQL procedure successfully completed.
    SQL>
    SQL> select object_name, object_type, status from user_objects where object_name = 'MYPKG'
      2  /
    OBJECT_NAME
    OBJECT_TYPE         STATUS
    MYPKG
    PACKAGE             VALID
    MYPKG
    PACKAGE BODY        VALID
    SQL>
    SQL> alter table dependonme add (y number)
      2  /
    Table altered.
    SQL>
    SQL> select object_name, object_type, status from user_objects where object_name = 'MYPKG'
      2  /
    OBJECT_NAME
    OBJECT_TYPE         STATUS
    MYPKG
    PACKAGE             VALID
    MYPKG
    PACKAGE BODY        INVALID
    SQL>
    SQL> exec mypkg.myproc
    My Result is: 25
    PL/SQL procedure successfully completed.

  • Variable becomes invalid during loop (CS6 based)

    First off I know that CC fixed this, but unfortunately my hands are tied and I have to use CS6 for this process. The script below is built to allow user to select precomp layers within a master comp. It then strips each precomp down to just itself and then the project is reduced to just the master comp and associated assets. It's actually inspired by Jeff Almasol's script he made for me years ago. I've just customized my own variation due to an issue in CS6 with the Reduce Project function. The issue arrising is that the loop goes off and processes the first selected precomp properly, but the master comp variable becomes invalid upon the second precomp processed. The script involves saving the project file and reopening the main source project during the loop process. Any thoughts as to why the variable is becoming invalid? The lines marked BOLD and ITALIC are the trouble spots.
         function compToProjectsScript(thisObj){
              try{
                   var masterComp, curItem, selLayerIndices, selLayerIndicesLength, curLayer, curLayerName, saveFolder, newFileInfo, curLayerIndex, folderString, allItems;
                   ///FUNCTIONS
                   //retrieveSelectedLayersIndex
                   function retrieveSelectedLayersIndex(compObj){
                        var selLayers, selLayersLength, layerIndex;
                        layerIndex = new Array();
                        selLayers = compObj.selectedLayers;
                        selLayersLength = selLayers.length;
                        for(var l=0; l<selLayersLength; l++){
                             if(selLayers[l].source instanceof CompItem){
                                  layerIndex.push(selLayers[l].index);
                        return layerIndex;
                   //reduceCompToLayer
                   function reduceCompToLayer(layerObj, compObj){
                        var layerCount = compObj.numLayers;
                        var lastLayer = compObj.layer(layerCount);
                        layerObj.moveBefore(lastLayer);
                        for(var i=1; i<=layerCount-2; i++){
                             firstLayerLocked = compObj.layer(1).locked;
                             if(firstLayerLocked == true){
                                  firstLayerLocked = false;
                                  compObj.layer(1).remove();
                             }else{
                                  compObj.layer(1).remove();
                   //retrieveParentCompIndexNum
                   function retrieveParentCompIndexNum(){
                        var proj, openedComp, parentComp, itemcount;
                        proj = app.project;
                        openedComp = proj.activeItem;
                        itemcount = proj.numItems;
                        if(openedComp instanceof CompItem){
                             parentComp = {'name': openedComp.name, 'id': openedComp.id};
                             for(var i=1; i<=itemcount; i++){
                                  if(proj.item(i).name == parentComp.name && proj.item(i).id == parentComp.id){
                                       return i;
                  masterComp = app.project.item(retrieveParentCompIndexNum());     //VARIABLE SET
                   selLayerIndices = retrieveSelectedLayersIndex(masterComp);
                   selLayerIndicesLength = selLayerIndices.length;
                   var curProjFile = app.project.file;
                   if(curProjFile != null){
                        saveFolder = Folder.selectDialog("Choose a \"save to\" folder.");
                        if(saveFolder != null){
                             folderString = Folder.decode(saveFolder).toString();
                             app.project.save(new File(folderString + "/_Duplicate_" + curProjFile.name));
                             var dupFile = app.project.file;
                             app.beginUndoGroup("compToProject");
                                  for(var i=0; i<selLayerIndicesLength; i++){
                                            app.beginSuppressDialogs();
                                                 curLayerIndex = selLayerIndices[i];
                                                 curLayer = masterComp.layer(curLayerIndex);     //BECOMES INVALID ON SECOND PASS
                                                 curLayerName = curLayer.name;
                                                 reduceCompToLayer(curLayer, masterComp);
                                                 app.project.reduceProject(masterComp);
                                                 newFileInfo = folderString + "/" + curLayerName + ".aep";
                                                 app.project.save(new File(newFileInfo));
                                            app.endSuppressDialogs(true);
                                       app.open(curProjFile);
                             app.endUndoGroup();
                             writeLn("All done.");
                   }else{
                        alert("Save project first, then try again.");
              }catch(err){alert("Error at line #" + err.line.toString() + "\r" + err.toString());}
         compToProjectsScript(this);

    Here's that final setup I went with:
    //START
         function compToProjectsScript(thisObj){
              try{
                   var masterComp, curItem, selLayerIndices, selLayerIndicesLength, curLayer, curLayerName, saveFolder, newFileInfo, curLayerIndex, folderString, allItems;
                   ///FUNCTIONS
                   //retrieveSelectedLayersIndex
                   function retrieveSelectedLayersIndex(compObj){
                        var selLayers, selLayersLength, layerIndex;
                        layerIndex = new Array();
                        selLayers = compObj.selectedLayers;
                        selLayersLength = selLayers.length;
                        for(var l=0; l<selLayersLength; l++){
                             if(selLayers[l].source instanceof CompItem){
                                  layerIndex.push(selLayers[l].index);
                        return layerIndex;
                   //reduceCompToLayer
                   function reduceCompToLayer(layerObj, compObj){
                        var layerCount = compObj.numLayers;
                        var lastLayer = compObj.layer(layerCount);
                        layerObj.moveBefore(lastLayer);
                        for(var i=1; i<=layerCount-2; i++){
                             firstLayerLocked = compObj.layer(1).locked;
                             if(firstLayerLocked == true){
                                  compObj.layer(1).locked = false;
                                  compObj.layer(1).remove();
                             }else{
                                  compObj.layer(1).remove();
                   //retrieveParentCompIndexNum
                   function retrieveParentCompIndexNum(){
                        var proj, openedComp, parentComp, itemcount;
                        proj = app.project;
                        openedComp = proj.activeItem;
                        itemcount = proj.numItems;
                        if(openedComp instanceof CompItem){
                             parentComp = {'name': openedComp.name, 'id': openedComp.id};
                             for(var i=1; i<=itemcount; i++){
                                  if(proj.item(i).name == parentComp.name && proj.item(i).id == parentComp.id){
                                       return i;
                   compIndex = retrieveParentCompIndexNum();
                   masterComp = app.project.item(compIndex);
                   selLayerIndices = retrieveSelectedLayersIndex(masterComp);
                   selLayerIndicesLength = selLayerIndices.length;
                   var curProjFile = app.project.file;
                   if(curProjFile != null){
                        saveFolder = Folder.selectDialog("Choose a \"save to\" folder.");
                        if(saveFolder != null){
                             folderString = Folder.decode(saveFolder).toString();
                             app.project.save(new File(folderString + "/_Duplicate_" + curProjFile.name));
                             var dupFile = app.project.file;
                             app.beginUndoGroup("compToProject");
                                  for(var i=0; i<selLayerIndicesLength; i++){
                                            app.beginSuppressDialogs();
                                                 sourceComp = app.project.activeItem;
                                                 curLayerIndex = selLayerIndices[i];
                                                 curLayer = sourceComp.layer(curLayerIndex);
                                                 curLayerName = curLayer.name;
                                                 reduceCompToLayer(curLayer, sourceComp);
                                                 app.project.reduceProject(sourceComp);
                                                 newFileInfo = folderString + "/" + curLayerName + ".aep";
                                                 app.project.save(new File(newFileInfo));
                                            app.endSuppressDialogs(true);
                                       app.open(dupFile);
                             app.endUndoGroup();
                             writeLn("All done.");
                   }else{
                        alert("Save project first, then try again.");
              }catch(err){alert("Error at line #" + err.line.toString() + "\r" + err.toString());}
         compToProjectsScript(this);
    //END

  • Problem: Objects become invalid so easily

    Hi All,
    We are running Oracle 9i Standard Edition, which was downgraded from the Enterprise Edition, because they want to save $50K/year.
    I have noticed even in the enterprise edition that some objects (sprocs, functions, triggers, packages) could become invalid for no reason (no schema changes and no changes in some sprocs/functions called by some others). I have googled this problem and found a few tips on the the internet and at least one seasoned DBA said Oracle objects can become invalid for no obvious reasons. After the downgrade, things got worse. The DBA runs a script to compile all packages, sprocs, functions, triggers once every hour. Then things got even worse. But I think the DBA script did not run more than once in a row to resolve some dependency issues. So now the DBA runs his script every two minutes. The problem is gone, but is there any better way to do this? Or should it happen in the first place? I figure that if Oracle runs like this, it should be out of business soon, because the MS SQL guys say they never have to explicitly re-compile invalid obejcts. At first the DBA thought that when PowerBuilder calls the sprocs, the sprocs do not re-compile because Sybase does not know how to program against Oracle. Then one day I was using SQL*Plus to run the sprocs and got the explicit error message for invalid objects and then the DBA was convinced otherwise.
    Thanks.
    Ben

    Thanks a lot. Yes you are right. The re-complie did cause other objects to be invalid. that's why I asked to dba to run his script more than once in a row. Now the problem seems to be gone. But here is what I found at http://www.dbazine.com/oracle/or-articles/hordila2. It is true when a package or sproc becomes invalid, they often times do not auto re-compile. See his comments on that.
    Application Malfunctions and Data InconsistenciesPart of maintaining quick response times for the database is making sure that as many objects as possible have a valid status. At least frequently used objects should not be invalid. Some objects (views, triggers, procedures, functions, packages, package bodies) can become invalid under certain circumstances: after massive data loads, imports, batches, even without explicit schema changes, after schema restructuring (drop, re-name, alter of objects). Very often, developers leave behind on purpose lots of invalid objects, to serve as a library of source code for future needs, or as a source code backup for the production objects. Some of these events are thought of as normal, or maybe bad style, while others are treated as bugs.
    Anyway, if this happens, applications may stop working at all or may start working slower, incorrectly or incompletely. Mal-functioning triggers calling invalid procedures, etc., for example, can lead to data inconsistencies, missed data propagation, etc. In a complex system, this is a serious situation and may go undetected for some length of time.
    Failed RecompilingFor some objects (views, triggers), the Oracle system may attempt automatically to recompile and validate them at the first run. This will slow the first runs of the application, but the system will function correctly, and be faster on the next runs. For stored programs, most of the time, this auto-recompile does not happen. The DBA needs to detect and recompile them as soon as possible.
    Some objects need to be re-developed/edited for references to be successfully recompiled and to become valid again. And other objects may
    Ben

  • Combination of packages repeteiively becoming invalid

    Hello all,
    We are using Oracle 9.2.0.7.0 on Toad and SQL Developer on a database with a vast number of packages. At the moment for no clear reason 7 packages repetitively become invalid for no transparent reason. When we recompile using dbms_utility.compile_schema all object will reinstate themselves, and become valid. The next moment you look and want to use the packages they will be invalid again.
    We have tried to compare the packages with a comparable database, where the same revisions of the packages exist. On the test database these are correct and valid, on the acceptance database they (the 7 mentioned before) fall over.
    Can anybody give us any indications on where to find the problem? We have tried recompiling the forms that are part of the applications, but these are all valid. We are out of ideas now.
    Any help is greatly appreciated.
    Thanks,
    -victorbax-

    http://download.oracle.com/docs/cd/B28359_01/server.111/b28310/general007.htm#
    This link might give you a clue on what might have happend inside
    http://it.toolbox.com/blogs/database-solutions/keep-track-of-oracle-object-dependences-2521
    Edited by: Maran Viswarayar on Sep 24, 2008 4:28 PM

  • Objects using dblinks become invalid

    I am using numerous functions / procedures / synonyms which point to other databases via dblinks. All was well when the dbLinks / synonyms were public. Last week I was asked to put up a test schema on the same database so I duly made all the public dblinks & synonyms private. All seemed well, everything compiled so I made it live.
    Now we get intermittent problems whereby the procedures using the synonyms & dblinks suddenly become invalid. They refuse to automatically compile, causing errors in the applications using the database. SOmetimes they automatically recompile after a time, sometimes they refuse to compile until I do them manually in SQL developer.
    anybody have any idea why this should be happening?
    Main database is Oracle Enterprise 11.1.0.7 64 bit, connecting to one of same version, one of 10.2.0.4 64 bit. All running on AIX 6.1.

    Hi,
    Same thing is happening here.
    DB A with PROC_SP (Strore procedure)
    DB B with 2 users; user TEST1 referencing PROC_SP@A and user TEST2 referencing also PROC_SP@A.
    When compiling code on user TEST1 that uses PROC_SP@A, the code on TEST2 becames invalid, and vice-versa.
    Did you solve your problem ?
    My Database version is 11.2.0.2.0, both DB (A and B) use the same version (Exadata with 11R2)
    Thanks in advance.

  • When an Object got invalid?

    Hi All,
    Is there any way to findout when(date / time) an object got invalid, as the LAST_DDL_TIME and TIMESTAMP columns of the DBA_OBJECTS do not change if the parent object gets affected and child become invalid right?

    Enfact I want to know at what time an object became INVALID,
    there are 2 n more DBA's applying the Script for the Database, One is working on an assignment to remove the unwanted Objected from DB and the other is working on normal development , now both executed their script which invalidated around 200 Objects, I want to know Invalid objects by each action (Cleanup or Development action) As I am aware of the time the statements were executed, one way to get the list, is to revert the changes and work pro-activly, but it would be very easy for me if I group the list of objects invalidated by the time.otherwise I would have to get the list of all objects before and after every action activity, which is frequent
    Thanks

Maybe you are looking for

  • Problem with Preview and PSD files - random gray square

    Hi guys, hope you can help... I've got a problem with Preview and PSD files. If I open in Preview both an original jpg straight from my reflex and the photoshop version of the same picture, the psd file presents a gray square (of what it seems unrend

  • Apple ID for Screen/File Sharing Home Network

    I have several Macs connected mostly by ethernet as part of my home network. I am trying to simplify the act of logging into one device from another. One method is to setup a username and password for each Mac, and then use these credentials to log i

  • Error during activation a message mapping

    Hi, I get this error during activation a message mapping: source code has an syntax error: D:/usr/sap/XI3/DVEBMGS00/j2ee/cluster/server0/./temp/classpath_resolver/Mapf1f9db20a78a11dac004000f1ff80130/source/com/sap/xi/tf/_Source2Target_.java:2: packag

  • ITunes freezes when I connect my iPad2

    I recently bought an iPad2 but have not been able to sync it with iTunes yet, because every time I connect the iPad, iTunes freezes and becomes unresponsive. I use a Sony Vaio laptop with Windows 7 64-bit Professional, and the latest version of iTune

  • Loud hiss during video chat

    Hi, I've been trying to chat with a Windows user running AIM. We are able to connect and get good quality video and sound... for about 15 seconds. Afterward the audio turns into a very loud hiss. Disconnecting and reconnecting restores the audio temp