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

Thread: Local index ???

  1. #1
    Join Date
    Jan 2001
    Posts
    16
    Hi !
    I've created this partitioned table. Now, I need to create local index for this. Could someone please post the syntax as to how to do it ?


    CREATE TABLE TRACK_COUNT (
    ID NUMBER (38) NOT NULL,
    TIMESTAMP DATE NOT NULL,
    VISITID NUMBER (38) NOT NULL,
    HTTPRESOURCEID NUMBER (8) NOT NULL,
    LQUERYINFOID NUMBER (38) DEFAULT 0 NOT NULL,
    HTTPSTATUSCODE NUMBER (38) NOT NULL,
    BYTES NUMBER (38) NOT NULL,
    SERVERID NUMBER (38) NOT NULL,
    TRANSTIME NUMBER (38),
    PARSEID NUMBER (38) NOT NULL )
    PARTITION BY RANGE (TIMESTAMP)
    ( PARTITION P_MAR VALUES LESS THAN (TO_DATE('01042000','DDMMYYYY')) tablespace tbs_track,
    PARTITION P_APR VALUES LESS THAN (TO_DATE('01052000','DDMMYYYY')) tablespace tbs_track,
    PARTITION P_MAY VALUES LESS THAN (TO_DATE('01062000','DDMMYYYY')) tablespace tbs_track,
    PARTITION P_JUN VALUES LESS THAN (TO_DATE('01072000','DDMMYYYY')) tablespace tbs_track,
    PARTITION P_JUL VALUES LESS THAN (TO_DATE('01082000','DDMMYYYY')) tablespace tbs_track,
    PARTITION P_AUG VALUES LESS THAN (TO_DATE('01092000','DDMMYYYY')) tablespace tbs_track,
    PARTITION P_SEP VALUES LESS THAN (TO_DATE('01102000','DDMMYYYY')) tablespace tbs_track2,
    PARTITION P_OCT VALUES LESS THAN (TO_DATE('01112000','DDMMYYYY')) tablespace tbs_track2,
    PARTITION P_NOV VALUES LESS THAN (TO_DATE('01122000','DDMMYYYY')) tablespace tbs_track2,
    PARTITION P_DEC VALUES LESS THAN (TO_DATE('01012001','DDMMYYYY')) tablespace tbs_track2,
    PARTITION P_JAN VALUES LESS THAN (TO_DATE('01022001','DDMMYYYY')) tablespace tbs_track2,
    PARTITION P_FEB VALUES LESS THAN (TO_DATE('01032001','DDMMYYYY'))
    tablespace tbs_track2);


    thanks a lot

  2. #2
    Join Date
    Nov 2000
    Location
    greenwich.ct.us
    Posts
    9,092
    CREATE INDEX TRACK_COUNT_IX1 ON TRACK_COUNT (TIMESTAMP) LOCAL;
    Jeff Hunter

  3. #3
    Join Date
    Jun 2000
    Posts
    417
    If you go to Technet and the documentation for your server version, there is a sql reference available which you can use to find out the syntax for any command you need to use, in addition to why you're using the arguments you're using instead of just doing what one of us told you.

  4. #4
    Join Date
    Jan 2001
    Posts
    16
    Thanks , both of you. But What I need to know it that do I have to create indexes for each partition ?

    Thanks

  5. #5
    Join Date
    Nov 2000
    Location
    greenwich.ct.us
    Posts
    9,092
    You really need to read about partitioning. There are several types of partitioned indexes and only the application can dictate which one is best. Try ( [url]http://technet.oracle.com/docs/products/oracle8i/doc_library/817_doc/server.817/a76965/c09parti.htm#429785[/url] ) for a start.

    The previous example creates and maintains the same number of partitions as the base table.
    Jeff Hunter

  6. #6
    Join Date
    Jan 2001
    Posts
    61

    Thumbs up

    You don't need to cretae INDEX for each partition.

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