DBAsupport.com Forums - Powered by vBulletin
Results 1 to 4 of 4

Thread: Need view in valid state

  1. #1
    Join Date
    Apr 2003
    Posts
    353

    Need view in valid state

    SQL> SELECT STATUS FROM USER_OBJECTS WHERE OBJECT_NAME='V_TEST_DISABLE';

    STATUS
    -------
    VALID

    SQL> ALTER TABLE TEST_DISABLE DISABLE PRIMARY KEY;

    Table altered.

    SQL> SELECT STATUS FROM USER_OBJECTS WHERE OBJECT_NAME='V_TEST_DISABLE';

    STATUS
    -------
    INVALID

    SQL> ALTER TABLE TEST_DISABLE ENABLE NOVALIDATE PRIMARY KEY;

    Table altered.

    SQL> SELECT STATUS FROM USER_OBJECTS WHERE OBJECT_NAME='V_TEST_DISABLE';

    STATUS
    -------
    INVALID

    SQL> ALTER VIEW V_TEST_DISABLE COMPILE;

    View altered.

    Any idea to keep this view in valid state( but the design logic requires the primary key also to be disabled or dropped)

  2. #2
    Join Date
    Dec 2000
    Location
    Ljubljana, Slovenia
    Posts
    4,439
    And why is the state of the view so important for you? It will be automaticaly recompiled the moment the first query hits it after it became invalid.
    Jurij Modic
    ASCII a stupid question, get a stupid ANSI
    24 hours in a day .... 24 beer in a case .... coincidence?

  3. #3
    Join Date
    Apr 2003
    Posts
    353
    Thanks.
    We are taking the object_status list everyday for reporting purpose.

    We will add a dummy select statement after the disable script
    which will enable the view.

  4. #4
    Join Date
    Jun 2000
    Location
    Madrid, Spain
    Posts
    7,447
    reinventing the wheel

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width