IOT tablespace

Hi All,
Is it recommneded to put IOT (index organized tables in index tablespace or data tablespace?
Is it possible to move just the index of the IOT in different tablespace?
I am using Oralce 11g.
Many Thanks.

Hi,
spur230 wrote:
Hi All,
Is it recommneded to put IOT (index organized tables in index tablespace or data tablespace?
Is it possible to move just the index of the IOT in different tablespace?In an index-organized table, all the data is stored in the primary index (that is, the index on the primary key). You can't separate them.
If you're using separate tablespaces for data and indexes, then I suggest putting the table iteslf (and therefore, the primary index) in the data tabelspace. If you have any additional indexes, put them in the index tablespace.
Note that, depending on how your disks are configured, there may not be any advantage to having separate tablespaces for data and indexes.
For example, one of my databases has data files on the G, H and I drives, but those 3 drives are really just logical partitions of the same Raid array, and I/O on the G drive is just as likely to contend with I/O on the the H and I drives as it is to contend with other I/O on the G drive.

Similar Messages

  • IOTs and overflow tablespace

    Hi everyone,
    I created an IOT without an overflow tablespace. What does Oracle do if it cannot fit a row into the index block? Do it give an error or will it use multiple index blocks to store the row of data?
    Thanks,
    Paul

    <quote>I created an IOT without an overflow tablespace.
    What does Oracle do if it cannot fit a row into the index block?</quote>
    It will never happen.
    An IOT defined with or without an overflow will get a default PCTTHRESHOLD of 50 ...
    the allowed values are between 1 and 50.
    PCTTHRESHOLD represents the percentage in an index block which could be occupied by one IOT row.
    flip@FLOP>  show parameter db_block_size
    NAME                                 TYPE        VALUE
    db_block_size                        integer     8192
    flip@FLOP>  create table tt
      2  ( x   number     not null
      3   ,c1  char(2000) not null
      4   ,c2  char(2000) not null
      5   ,constraint ttpk primary key (x)
      6  )
      7  organization index
      8  ;
    create table tt
    ERROR at line 1:
    ORA-01429: Index-Organized Table: no data segment to store overflow row-pieces
    So, Oracle sees we didn’t define an overflow and does some upfront checking on the declared size of the row
    (BTW, it will be the same if the CHAR columns were defined as VARCHAR2).
    It figures up it cannot store a row in 50% of my 8K block (there is some overhead in the block too).
    flip@FLOP> create table tt
      2  ( x   number     not null
      3   ,c1  char(2000) not null
      4   ,constraint ttpk primary key (x)
      5  )
      6  organization index
      7  ;
    Table created.
    Not it can. And just to show, PCTHRESHOLD is defaulted to 50 …
    flip@FLOP>  select dbms_metadata.get_ddl( 'TABLE', 'TT') from dual;
    DBMS_METADATA.GET_DDL('TABLE','TT')
      CREATE TABLE "FLIP"."TT"
       (    "X" NUMBER NOT NULL ENABLE,
            "C1" CHAR(2000) NOT NULL ENABLE,
             CONSTRAINT "TTPK" PRIMARY KEY ("X") ENABLE
       ) ORGANIZATION INDEX NOCOMPRESS PCTFREE 10 INITRANS 2 MAXTRANS 255 LOGGING
      STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
      PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
      TABLESPACE "USERS"
    PCTTHRESHOLD 50
    So, if you have wide rows you better have an overflow … well, you have to.

  • One user for multiple tablespaces

    Hello.
    Oracle 11g enterprise.
    Whenever I setup a new tablespace on my server, I create a user for each tablespace on the server.
    Is is possible to create only one user for all tablespaces on a server?
    What is the easiest way to create this one user to have all roles and privileges across all tablespaces?
    Any suggestions are greatly appreciated.

    I would seriously question a design with 'N' databases (whether they are on 1 or more or 'N' servers is not the issue) and DBLink from each of the databases to every other database.
    Not only is it going to be hell to manage (how and when can you decide to shutdown a database for maintenance / patching / server/hardware maintenance when you have N-1 others connecting to it online), but it indicates a possibly high level of data duplication.
    So we still revert to why you think you need that many databases and that many users and that many database links.
    As has been pointed out, there is no relation between tablespaces and DBLinks. NONE whatsoever.
    As for tablespaces and users, I can have
    a. One Tablespace and 10 database accounts with any 1 to 10 of the accounts storing data objects in the tablespace
    b. Ten Tablespaces and 1 database account storing data objects across all 10 tablespaces
    c. 100 database accounts but only 1 to N of them having any data objects, the others only doing SELECT/INSERT/UPDATE/DELETE on objects owned by 1 to N schemas. (This one schemas all being in 1 tablespace or M tablespaces).
    There is no one-to-one correspondence between users and tablespaces necessary. Tablespaces are for logical grouping of data objects.
    I keep referring to data objects as these (Tables, Indexes, LOBs, IOTs, Clusters etc) require storage. Objects like Sequences do not require separate tablepaces although they have persistent values. Objects like DBLinks and Views are only definitions and require no storage (other than in the data dictionary !). Objects like Procedures and Packages and Triggers are code objects and require no storage (other than in the data dictionary).
    So :
    1. Such a design needs to be questioned.
    2. Even if you need such a design, do not tie DBLinks to Tablespaces.
    3. Even if you need DBLinks, do not tie Users to Tablespaces.

  • TEMP tablespace getting full while inserting a CLOB in Trigger

    We have a Oracle 10g (10.2.0.4.0) DB on a Solaris 9 box which also runs our J2EE web-service application on Weblogic 8sp6 server.
    We get around 220K web-service requests from upstream callers daily to insert data in the main table, say TABLE1, which has daily partitions on a date column. This table has around 21 columns out of which 1 is a CLOB column.
    Now this table has an AFTER INSERT trigger which calls a package procedure to insert the same record into another table, say TABLE2.
    From Java application insert statement in executed in below format using a weblogic jdbc connection pool :
    INSERT INTO TABLE1(COLUMN1, COLUMN2, ........., CLOB_COLUMN,........, COLUMN21) VALUES (:1, :2, :3, :4, :5, :6, :7, :8, :9, :10, :11, :12, :13, :14, :15, :16, :17, :18, :19, :20);
    Clob object is prepared in application using ojdbc14.jar.
    We are observing a strange issue here. The TEMP tablespace utilization keeps on growing as more and more inserts are executed by application and after ~125K inserts the TEMP tablespace gets full and we start getting ORA-01652 error.
    On further analysis we could see that there are only 7-10 session being maintained but as more and more inserts happen TEMP tablespace utilization goes on increasing for each of these sessions.
    When we tried with inserting just few records and then watching the session details in v$session_wait then we could see that it is in INACTIVE state and waiting for the event ‘SQL*Net message from client’. This does not seem correct as the session has successfully inserted the data and committed the transaction and we can see the data in the tables as well.
    The confusing thing here is when we modify the trigger to pass blank string('' ) instead of the CLOB column to TABLE2 then this issue does not occur. All 200K records are inserted properly and TEMP tablespace utilization also keep always below 1%.
    Can you please help us in solving this issue. Is this related to any oracle issue?
    Inside the package we have tried using DBMS_COPY statement to copy the CLOB column after insert but still same result.
    Code for reference:
    Trigger:
    =====================================
    CREATE OR REPLACE TRIGGER trg
    AFTER INSERT OR UPDATE
    ON TABLE1
    REFERENCING NEW AS NEW OLD AS OLD
    FOR EACH ROW
    BEGIN
    IF (:NEW.date_col > SYSDATE - 2)
    THEN
    IF (:NEW.cat IN (1001, 1002))
    THEN
    pkg.process_change
         (:NEW.COLUMN1,
              :NEW.COLUMN2,
              :NEW.CLOB_COLUMN,
    FLAG
    END IF;
    END IF;
    END;
    =====================================
    Package:
    =====================================
    procedure PKG.Process_change(
    p_COLUMN1 number,
    p_COLUMN2 varchar2,
    p_CLOB_COLUMN clob,
    flag boolean
    ) is
    v_watermark pls_integer;
    v_type varchar2(1);
    begin
    if (flag) then
    v_type := 'U';
    else
    v_type := 'I';
    end if;
    select t_seq.nextval into v_watermark from dual;
    insert into TABLE2(
    COLUMN1 number,
    COLUMN2 varchar2,
    CLOB_COLUMN clob,
    watermark,
    dml_type
    )values (
    p_COLUMN1 number,
    p_COLUMN2 varchar2,
    p_CLOB_COLUMN clob,
    v_watermark,
    v_dml_type
    end;
    =====================================

    My first thought on reading your post is that not only are you using a database version that is now so old it is in extended support and even then not even the most recent patchset for it.
    The first thing I would do is move to 11gR2 and if you can't do that at least get to 10.2.0.5 and apply CLOB relevant patches as well.
    Same goes for your operating system. Solaris 9 is ancient: So move to 10 which has vastly improved memory management.
    To help you further it would be really valuable to know the table layout. For example is this a heap table or an IOT? Is it partitioned? Is this RAC? What size are the CLOBs? Are they stored in-line? Chunk size? etc.
    This page should start you down the right road:
    http://docs.oracle.com/cd/B19306_01/appdev.102/b14249/adlob_tables.htm#sthref204
    But I am also wondering why you would use a trigger to, as you say, "insert the same record into another table." This description is a poster child for "bad design."

  • Partitioned IOT of Object Type - mapping table not allowed for bitmap index

    Hi,
    looks like a feature available for standard Partitioned IOTs is not supported for object based tables, namely the MAPPING TABLE construct to support secondary local bitmap indexes.
    Can you confirm behaviour is as expected/documented?
    If so, is a fix/enhancement to support mapping table for object-based Partitioned IOTs in the pipeline?
    Results for partition-wise load using pipelined table function are very good, look-ups across tens of millions of rows are excellent.
    Environment = Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
    OS = Oracle Enterprise Linux Server release 5.2 (Carthage) 2.6.18 92.el5 (32-bit)
    Here's the potted test-case...
    1) First the non object based Partitioned IOT - data is range-partitioned across the alphabet
    CREATE TABLE IOT_Table (
    textData VARCHAR2(10),
    numberData NUMBER(10,0),
    CONSTRAINT IOT_Table_PK PRIMARY KEY(textData))
    ORGANIZATION INDEX MAPPING TABLE PCTFREE 0 TABLESPACE Firewire
    PARTITION BY RANGE (textData)
    (PARTITION Text_Part_A VALUES LESS THAN ('B') PCTFREE 0 TABLESPACE Firewire Storage (Initial 10M Next 1M PCTIncrease 0),
    PARTITION Text_Part_B VALUES LESS THAN ('C') PCTFREE 0 TABLESPACE Firewire Storage (Initial 10M Next 1M PCTIncrease 0),
    PARTITION Text_Part_C VALUES LESS THAN ('D') PCTFREE 0 TABLESPACE Firewire Storage (Initial 10M Next 1M PCTIncrease 0),
    PARTITION Text_Part_D VALUES LESS THAN ('E') PCTFREE 0 TABLESPACE Firewire Storage (Initial 10M Next 1M PCTIncrease 0),
    PARTITION Text_Part_E VALUES LESS THAN ('F') PCTFREE 0 TABLESPACE Firewire Storage (Initial 10M Next 1M PCTIncrease 0),
    PARTITION Text_Part_F VALUES LESS THAN ('G') PCTFREE 0 TABLESPACE Firewire Storage (Initial 10M Next 1M PCTIncrease 0),
    PARTITION Text_Part_G VALUES LESS THAN ('H') PCTFREE 0 TABLESPACE Firewire Storage (Initial 10M Next 1M PCTIncrease 0),
    PARTITION Text_Part_H VALUES LESS THAN ('I') PCTFREE 0 TABLESPACE Firewire Storage (Initial 10M Next 1M PCTIncrease 0),
    PARTITION Text_Part_I VALUES LESS THAN ('J') PCTFREE 0 TABLESPACE Firewire Storage (Initial 10M Next 1M PCTIncrease 0),
    PARTITION Text_Part_J VALUES LESS THAN ('K') PCTFREE 0 TABLESPACE Firewire Storage (Initial 10M Next 1M PCTIncrease 0),
    PARTITION Text_Part_K VALUES LESS THAN ('L') PCTFREE 0 TABLESPACE Firewire Storage (Initial 10M Next 1M PCTIncrease 0),
    PARTITION Text_Part_L VALUES LESS THAN ('M') PCTFREE 0 TABLESPACE Firewire Storage (Initial 10M Next 1M PCTIncrease 0),
    PARTITION Text_Part_M VALUES LESS THAN ('N') PCTFREE 0 TABLESPACE Firewire Storage (Initial 10M Next 1M PCTIncrease 0),
    PARTITION Text_Part_N VALUES LESS THAN ('O') PCTFREE 0 TABLESPACE Firewire Storage (Initial 10M Next 1M PCTIncrease 0),
    PARTITION Text_Part_O VALUES LESS THAN ('P') PCTFREE 0 TABLESPACE Firewire Storage (Initial 10M Next 1M PCTIncrease 0),
    PARTITION Text_Part_P VALUES LESS THAN ('Q') PCTFREE 0 TABLESPACE Firewire Storage (Initial 10M Next 1M PCTIncrease 0),
    PARTITION Text_Part_Q VALUES LESS THAN ('R') PCTFREE 0 TABLESPACE Firewire Storage (Initial 10M Next 1M PCTIncrease 0),
    PARTITION Text_Part_R VALUES LESS THAN ('S') PCTFREE 0 TABLESPACE Firewire Storage (Initial 10M Next 1M PCTIncrease 0),
    PARTITION Text_Part_S VALUES LESS THAN ('T') PCTFREE 0 TABLESPACE Firewire Storage (Initial 10M Next 1M PCTIncrease 0),
    PARTITION Text_Part_T VALUES LESS THAN ('U') PCTFREE 0 TABLESPACE Firewire Storage (Initial 10M Next 1M PCTIncrease 0),
    PARTITION Text_Part_U VALUES LESS THAN ('V') PCTFREE 0 TABLESPACE Firewire Storage (Initial 10M Next 1M PCTIncrease 0),
    PARTITION Text_Part_V VALUES LESS THAN ('W') PCTFREE 0 TABLESPACE Firewire Storage (Initial 10M Next 1M PCTIncrease 0),
    PARTITION Text_Part_W VALUES LESS THAN ('X') PCTFREE 0 TABLESPACE Firewire Storage (Initial 10M Next 1M PCTIncrease 0),
    PARTITION Text_Part_X VALUES LESS THAN ('Y') PCTFREE 0 TABLESPACE Firewire Storage (Initial 10M Next 1M PCTIncrease 0),
    PARTITION Text_Part_Y VALUES LESS THAN ('Z') PCTFREE 0 TABLESPACE Firewire Storage (Initial 10M Next 1M PCTIncrease 0),
    PARTITION Text_Part_Z VALUES LESS THAN (MAXVALUE) PCTFREE 0 TABLESPACE Firewire Storage (Initial 10M Next 1M PCTIncrease 0))
    NOLOGGING PARALLEL -- FLASHBACK ARCHIVE IOT_Flashback_Data
    SQL> table IOT_TABLE created.
    2) Create the local secondary bitmap index utilising the underlying mapping table
    CREATE BITMAP INDEX IOT_Table_BMI1 ON IOT_Table (numberData)
    LOCAL STORAGE (INITIAL 1M PCTINCREASE 0 NEXT 512K) NOLOGGING PARALLEL;
    SQL> bitmap index IOT_TABLE_BMI1 created.
    3) Quick test to confirm all ok
    SQL> INSERT INTO IOT_Table VALUES ('ABC123',100);
    SQL> 1 rows inserted.
    SQL> SELECT * FROM IOT_Table;
    TEXTDATA NUMBERDATA
    ABC123     100
    4) Now create a minimal object type to use as the template for object table
    CREATE TYPE IOT_type AS OBJECT
    textData VARCHAR2(10 CHAR),
    numberData NUMBER(10,0)
    ) FINAL
    SQL> TYPE IOT_type compiled
    5) Attempt to create an object-based range partitioned IOT, including MAPPING TABLE clause as per step (1)
    CREATE TABLE IOTObj_Table OF IOT_type (textData PRIMARY KEY)
    OBJECT IDENTIFIER IS PRIMARY KEY ORGANIZATION INDEX
    MAPPING TABLE -- we'd like to use this feature to enable use of Bitmap Indexes...
    PCTFREE 0 TABLESPACE Firewire
    PARTITION BY RANGE (textData)
    (PARTITION Text_Part_A VALUES LESS THAN ('B') PCTFREE 0 TABLESPACE Firewire Storage (Initial 10M Next 1M PCTIncrease 0),
    PARTITION Text_Part_B VALUES LESS THAN ('C') PCTFREE 0 TABLESPACE Firewire Storage (Initial 10M Next 1M PCTIncrease 0),
    PARTITION Text_Part_C VALUES LESS THAN ('D') PCTFREE 0 TABLESPACE Firewire Storage (Initial 10M Next 1M PCTIncrease 0),
    PARTITION Text_Part_D VALUES LESS THAN ('E') PCTFREE 0 TABLESPACE Firewire Storage (Initial 10M Next 1M PCTIncrease 0),
    PARTITION Text_Part_E VALUES LESS THAN ('F') PCTFREE 0 TABLESPACE Firewire Storage (Initial 10M Next 1M PCTIncrease 0),
    PARTITION Text_Part_F VALUES LESS THAN ('G') PCTFREE 0 TABLESPACE Firewire Storage (Initial 10M Next 1M PCTIncrease 0),
    PARTITION Text_Part_G VALUES LESS THAN ('H') PCTFREE 0 TABLESPACE Firewire Storage (Initial 10M Next 1M PCTIncrease 0),
    PARTITION Text_Part_H VALUES LESS THAN ('I') PCTFREE 0 TABLESPACE Firewire Storage (Initial 10M Next 1M PCTIncrease 0),
    PARTITION Text_Part_I VALUES LESS THAN ('J') PCTFREE 0 TABLESPACE Firewire Storage (Initial 10M Next 1M PCTIncrease 0),
    PARTITION Text_Part_J VALUES LESS THAN ('K') PCTFREE 0 TABLESPACE Firewire Storage (Initial 10M Next 1M PCTIncrease 0),
    PARTITION Text_Part_K VALUES LESS THAN ('L') PCTFREE 0 TABLESPACE Firewire Storage (Initial 10M Next 1M PCTIncrease 0),
    PARTITION Text_Part_L VALUES LESS THAN ('M') PCTFREE 0 TABLESPACE Firewire Storage (Initial 10M Next 1M PCTIncrease 0),
    PARTITION Text_Part_M VALUES LESS THAN ('N') PCTFREE 0 TABLESPACE Firewire Storage (Initial 10M Next 1M PCTIncrease 0),
    PARTITION Text_Part_N VALUES LESS THAN ('O') PCTFREE 0 TABLESPACE Firewire Storage (Initial 10M Next 1M PCTIncrease 0),
    PARTITION Text_Part_O VALUES LESS THAN ('P') PCTFREE 0 TABLESPACE Firewire Storage (Initial 10M Next 1M PCTIncrease 0),
    PARTITION Text_Part_P VALUES LESS THAN ('Q') PCTFREE 0 TABLESPACE Firewire Storage (Initial 10M Next 1M PCTIncrease 0),
    PARTITION Text_Part_Q VALUES LESS THAN ('R') PCTFREE 0 TABLESPACE Firewire Storage (Initial 10M Next 1M PCTIncrease 0),
    PARTITION Text_Part_R VALUES LESS THAN ('S') PCTFREE 0 TABLESPACE Firewire Storage (Initial 10M Next 1M PCTIncrease 0),
    PARTITION Text_Part_S VALUES LESS THAN ('T') PCTFREE 0 TABLESPACE Firewire Storage (Initial 10M Next 1M PCTIncrease 0),
    PARTITION Text_Part_T VALUES LESS THAN ('U') PCTFREE 0 TABLESPACE Firewire Storage (Initial 10M Next 1M PCTIncrease 0),
    PARTITION Text_Part_U VALUES LESS THAN ('V') PCTFREE 0 TABLESPACE Firewire Storage (Initial 10M Next 1M PCTIncrease 0),
    PARTITION Text_Part_V VALUES LESS THAN ('W') PCTFREE 0 TABLESPACE Firewire Storage (Initial 10M Next 1M PCTIncrease 0),
    PARTITION Text_Part_W VALUES LESS THAN ('X') PCTFREE 0 TABLESPACE Firewire Storage (Initial 10M Next 1M PCTIncrease 0),
    PARTITION Text_Part_X VALUES LESS THAN ('Y') PCTFREE 0 TABLESPACE Firewire Storage (Initial 10M Next 1M PCTIncrease 0),
    PARTITION Text_Part_Y VALUES LESS THAN ('Z') PCTFREE 0 TABLESPACE Firewire Storage (Initial 10M Next 1M PCTIncrease 0),
    PARTITION Text_Part_Z VALUES LESS THAN (MAXVALUE) PCTFREE 0 TABLESPACE Firewire Storage (Initial 10M Next 1M PCTIncrease 0))
    NOLOGGING PARALLEL -- FLASHBACK ARCHIVE IOT_Flashback_Data
    This errors out with the following...
    SQL Error: ORA-25182: feature not currently available for index-organized tables
    25182. 00000 - "feature not currently available for index-organized tables"
    *Cause:    An attempt was made to use one or more of the following feature(s) not
    currently supported for index-organized tables:
    CREATE TABLE with LOB/BFILE/VARRAY columns,
    partitioning/PARALLEL/CREATE TABLE AS SELECT options,
    ALTER TABLE with ADD/MODIFY column options, CREATE INDEX
    *Action:   Do not use the disallowed feature(s) in this release.
    6) Re-running the create table statement in step 5 without the MAPPING TABLE clause works fine. Not surprisingly an attempt to create a secondary local bitmap index on this table fails as there's no mapping table, like so...
    CREATE BITMAP INDEX IOTObj_Table_BMI1 ON IOTObj_Table (numberData)
    LOCAL STORAGE (INITIAL 1M PCTINCREASE 0 NEXT 512K) NOLOGGING PARALLEL;
    CREATE TABLE with LOB/BFILE/VARRAY columns,
    partitioning/PARALLEL/CREATE TABLE AS SELECT options,
    ALTER TABLE with ADD/MODIFY column options, CREATE INDEX
    *Action:   Do not use the disallowed feature(s) in this release.
    CREATE BITMAP INDEX IOTObj_Table_BMI1 ON IOTObj_Table (numberData)
    LOCAL STORAGE (INITIAL 1M PCTINCREASE 0 NEXT 512K) NOLOGGING PARALLEL
    Error at Command Line:99 Column:13
    Error report:
    SQL Error: ORA-00903: invalid table name
    00903. 00000 - "invalid table name"
    7) Creating a secondary local b-tree index is fine, like so...
    SQL> CREATE INDEX IOTObj_Table_I1 ON IOTObj_Table (numberData)
    LOCAL STORAGE (INITIAL 1M PCTINCREASE 0 NEXT 512K) NOLOGGING PARALLEL;
    index IOTOBJ_TABLE_I1 created.
    8) A quick test to ensure object table ok...
    SQL> INSERT INTO IOTObj_Table VALUES (IOT_Type('DEF456',500));
    SQL> 1 rows inserted.
    SQL> SELECT * FROM IOTObj_Table;
    TEXTDATA NUMBERDATA
    DEF456     500

    Thanks Dan,
    the intention is to range partition based on the initial character, so A* -> Text_Part_A, B* -> Text_Part_B, and so on.
    Here's an example, using an empty IOTObj_Table as created previously.
    1) Set up & confirm some test data (two 'D's, one 'N', and two 'Z's)
    SQL> INSERT INTO IOTObj_Table VALUES (IOT_Type('DEF456',500));
    SQL> INSERT INTO IOTObj_Table VALUES (IOT_Type('DDD111',510));
    SQL> INSERT INTO IOTObj_Table VALUES (IOT_Type('N3000',515));
    SQL> INSERT INTO IOTObj_Table VALUES (IOT_Type('ZZ1212',520));
    SQL> INSERT INTO IOTObj_Table VALUES (IOT_Type('Z111X',530));
    SQL> COMMIT;
    SQL> SELECT * FROM IOTObj_Table;
    TEXTDATA NUMBERDATA
    DDD111     510
    DEF456     500
    N3000     515
    Z111X     530
    ZZ1212     520
    2) Just to prove our IOT is enforcing the Primary Key based on the TextData attribute, try to insert a duplicate
    SQL> INSERT INTO IOTObj_Table VALUES (IOT_Type('Z111X',530));
    Error starting at line 141 in command:
    INSERT INTO IOTObj_Table VALUES (IOT_Type('Z111X',530))
    Error report:
    SQL Error: ORA-00001: unique constraint (OCDataSystems.SYS_IOT_TOP_84235) violated
    00001. 00000 - "unique constraint (%s.%s) violated"
    *Cause:    An UPDATE or INSERT statement attempted to insert a duplicate key.
    For Trusted Oracle configured in DBMS MAC mode, you may see
    this message if a duplicate entry exists at a different level.
    *Action:   Either remove the unique restriction or do not insert the key.
    3) Now confirm that our data has been slotted into the range-based partition we expect using the PARTITION clause of SELECT...
    - The two 'D's...
    SQL> SELECT * FROM IOTObj_Table PARTITION (Text_Part_D);
    TEXTDATA NUMBERDATA
    DDD111     510
    DEF456     500
    - The single 'N'...
    SQL> SELECT * FROM IOTObj_Table PARTITION (Text_Part_N);
    TEXTDATA NUMBERDATA
    N3000     515
    - The two 'Z's...
    SQL> SELECT * FROM IOTObj_Table PARTITION (Text_Part_Z);
    TEXTDATA NUMBERDATA
    Z111X     530
    ZZ1212     520
    4) And to wrap up confirm an empty partition
    SELECT * FROM IOTObj_Table PARTITION (Text_Part_W);

  • Error ORA-39125 and ORA-04063 during export for transportable tablespace

    I'm using the Oracle Enterprise Manager (browser is IE) to create a tablespace transport file. Maintenance...Transport Tablespaces uses the wizard to walk me through each step. The job gets created and submitted.
    The 'Prepare' and 'Convert Datafile(s)' job steps complete successfully. The Export step fails with the following error. Can anyone shed some light on this for me?
    Thank you in advance!
    =======================================================
    Output Log
    Export: Release 10.2.0.2.0 - Production on Sunday, 03 September, 2006 19:31:34
    Copyright (c) 2003, 2005, Oracle. All rights reserved.
    Username:
    Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.2.0 - Production
    With the Partitioning, OLAP and Data Mining options
    Starting "SYS"."GENERATETTS000024": SYS/******** AS SYSDBA dumpfile=EXPDAT_GENERATETTS000024.DMP directory=EM_TTS_DIR_OBJECT transport_tablespaces=SIEBEL job_name=GENERATETTS000024 logfile=EXPDAT.LOG
    Processing object type TRANSPORTABLE_EXPORT/PLUGTS_BLK
    Processing object type TRANSPORTABLE_EXPORT/TABLE
    Processing object type TRANSPORTABLE_EXPORT/TABLE_STATISTICS
    ORA-39125: Worker unexpected fatal error in KUPW$WORKER.UNLOAD_METADATA while calling DBMS_METADATA.FETCH_XML_CLOB [TABLE_STATISTICS]
    ORA-04063: view "SYS.KU$_IOTABLE_VIEW" has errors
    ORA-06512: at "SYS.DBMS_SYS_ERROR", line 105
    ORA-06512: at "SYS.KUPW$WORKER", line 6241
    ----- PL/SQL Call Stack -----
    object line object
    handle number name
    2CF48130 14916 package body SYS.KUPW$WORKER
    2CF48130 6300 package body SYS.KUPW$WORKER
    2CF48130 2340 package body SYS.KUPW$WORKER
    2CF48130 6861 package body SYS.KUPW$WORKER
    2CF48130 1262 package body SYS.KUPW$WORKER
    2CF0850C 2 anonymous block
    Job "SYS"."GENERATETTS000024" stopped due to fatal error at 19:31:44

    More information:
    Using SQL Developer, I checked the view SYS.KU$_IOTABLE_VIEW referred to in the error message, and it does indeed report a problem with that view. The following code is the definition of that view. I have no idea what it's supposed to be doing, because it was part of the default installation. I certainly didn't write it. I did, however, execute the 'Test Syntax' button (on the Edit View screen), and the result was this error message:
    =======================================================
    The SQL syntax is valid, however the query is invalid or uses functionality that is not supported.
    Unknown error(s) parsing SQL: oracle.javatools.parser.plsql.syntax.ParserException: Unexpected token
    =======================================================
    The SQL for the view looks like this:
    REM SYS KU$_IOTABLE_VIEW
    CREATE OR REPLACE FORCE VIEW "SYS"."KU$_IOTABLE_VIEW" OF "SYS"."KU$_IOTABLE_T"
    WITH OBJECT IDENTIFIER (obj_num) AS
    select '2','3',
    t.obj#,
    value(o),
    -- if this is a secondary table, get base obj and ancestor obj
    decode(bitand(o.flags, 16), 16,
    (select value(oo) from ku$_schemaobj_view oo, secobj$ s
    where o.obj_num=s.secobj#
    and oo.obj_num=s.obj#),
    null),
    decode(bitand(o.flags, 16), 16,
    (select value(oo) from ku$_schemaobj_view oo, ind$ i, secobj$ s
    where o.obj_num=s.secobj#
    and i.obj#=s.obj#
    and oo.obj_num=i.bo#),
    null),
    (select value(s) from ku$_storage_view s
    where i.file# = s.file_num
    and i.block# = s.block_num
    and i.ts# = s.ts_num),
    ts.name, ts.blocksize,
    i.dataobj#, t.bobj#, t.tab#, t.cols,
    t.clucols, i.pctfree$, i.initrans, i.maxtrans,
    mod(i.pctthres$,256), i.spare2, t.flags,
    t.audit$, t.rowcnt, t.blkcnt, t.empcnt, t.avgspc, t.chncnt, t.avgrln,
    t.avgspc_flb, t.flbcnt, t.analyzetime, t.samplesize, t.degree,
    t.instances, t.intcols, t.kernelcols, t.property, 'N', t.trigflag,
    t.spare1, t.spare2, t.spare3, t.spare4, t.spare5, t.spare6,
    decode(bitand(t.trigflag, 65536), 65536,
    (select e.encalg from sys.enc$ e where e.obj#=t.obj#),
    null),
    decode(bitand(t.trigflag, 65536), 65536,
    (select e.intalg from sys.enc$ e where e.obj#=t.obj#),
    null),
    (select c.name from col$ c
    where c.obj# = t.obj#
    and c.col# = i.trunccnt and i.trunccnt != 0
    and bitand(c.property,1)=0),
    cast( multiset(select * from ku$_column_view c
    where c.obj_num = t.obj#
    order by c.col_num, c.intcol_num
    ) as ku$_column_list_t
    (select value(nt) from ku$_nt_parent_view nt
    where nt.obj_num = t.obj#),
    cast( multiset(select * from ku$_constraint0_view con
    where con.obj_num = t.obj#
    and con.contype not in (7,11)
    ) as ku$_constraint0_list_t
    cast( multiset(select * from ku$_constraint1_view con
    where con.obj_num = t.obj#
    ) as ku$_constraint1_list_t
    cast( multiset(select * from ku$_constraint2_view con
    where con.obj_num = t.obj#
    ) as ku$_constraint2_list_t
    cast( multiset(select * from ku$_pkref_constraint_view con
    where con.obj_num = t.obj#
    ) as ku$_pkref_constraint_list_t
    (select value(ov) from ku$_ov_table_view ov
    where ov.bobj_num = t.obj#
    and bitand(t.property, 128) = 128), -- IOT has overflow
    (select value(etv) from ku$_exttab_view etv
    where etv.obj_num = o.obj_num)
    from ku$_schemaobj_view o, tab$ t, ind$ i, ts$ ts
    where t.obj# = o.obj_num
    and t.pctused$ = i.obj# -- For IOTs, pctused has index obj#
    and bitand(t.property, 32+64+512) = 64 -- IOT but not overflow
    -- or partitioned (32)
    and i.ts# = ts.ts#
    AND (SYS_CONTEXT('USERENV','CURRENT_USERID') IN (o.owner_num, 0) OR
    EXISTS ( SELECT * FROM session_roles
    WHERE role='SELECT_CATALOG_ROLE' ));
    GRANT SELECT ON "SYS"."KU$_IOTABLE_VIEW" TO PUBLIC;

  • Tablespace Reorganisation in Oracle 10g Database

    Dear All,
    I'm planning of doing a carrying out a Tablespace Reorganisation of the schema tablespace on the production server. I need your views regarding the process to be taken and tuning that is required before carrying out such an activity. For your information, the size of the tablespace is around 3TB. Also, since it is the production server, we can't have an outage for more than 24hrs. Hence, I would like some help from all of you in order to carry out this activity successfully in the time frame.
    Regarding the process :
    I have some ideas about how to do the tablespace reorganisation in oracle 10g. But, if I carry out the activity my way, its going it to take atleast 3-4 days to complete (which won't be acceptable).
    Areas of concern :
    1) Steps to perform the tablespace reorganisation in Oracle 10g DB.
    2) Size of the temporary tablespace before starting the Reorg.
    3) Any further suggestions / recomendations regarding tuning up of Oracle Parameters for enhancement of speed and acuracy of the activity.
    System Specifications :
    SAP - BI 7.0 (SAP NetWeaver 2004s)
    DB - Oracle 10.2.0.2.0, DBSL Patch Level - 158
    OS - AIX 5.3
    Looking forward to some good and prompt suggestions from all of you !!
    Please provide your valuable inputs.
    NOTE :: We have successfully performed the reorganization in the rest of the landscape on the same schema tablespace without any issues.
    Thanks and Regards,
    Deoraj Alok.

    It is quite an old thread, but let me put in my view points, which could help others.
    1. The Size of PSAPTEMP and PSAPUNDO tablespace should be 1.5*largest Table Size.
    2. Another Important thing is , if the time is in an issue, what you can do is to reorg. only top 50 largest tables where maximum space is being wasted. Folowing is the query to determine the TOP 50 tables which has the highest WASTED size.
    SELECT * FROM
    (SELECT
    SUBSTR(TABLE_NAME, 1, 21) TABLE_NAME,
    NUM_ROWS,
    AVG_ROW_LEN ROWLEN,
    BLOCKS,
    +ROUND((AVG_ROW_LEN + 1) * NUM_ROWS / 1000000, 0) NET_MB,+
    +ROUND(BLOCKS * (8000 - 23 * INI_TRANS) *+
    (1 - PCT_FREE / 100) / 1000000, 0) GROSS_MB,
    ROUND((BLOCKS * (8000 - 23 * INI_TRANS) * (1 - PCT_FREE / 100) -
    +(AVG_ROW_LEN + 1) * NUM_ROWS) / 1000000) "WASTED_MB",+
    Tablespace_Name
    FROM DBA_TABLES
    WHERE
    NUM_ROWS IS NOT NULL AND
    OWNER LIKE 'SAP%' AND
    PARTITIONED = 'NO' AND
    (IOT_TYPE != 'IOT' OR IOT_TYPE IS NULL)
    ORDER BY 7 DESC)
    WHERE ROWNUM <=50;
    I am sure that, only these 50 tables will reduce the maximum space and you can ignore rest of the tables.
    3. Even you can find out all the Tables which are having LONG and LONG RAW fields by using this query
    Select Distinct TABLE_NAME From dba_tab_cols Where Owner='SAPYSP' and (DATA_TYPE='LONG' OR DATA_TYPE='LONG RAW');
    Now, from the results of this query you can see how many Tables are present in the Top 50 Tables. There will be a few only and you can export/import these few tables in offline mode.
    4. After reorg, fi you want to claim the free disk space also, it would not be that easy because of the high water mark present in datafiles but you can try with
    Alter datafile <datafile id> resize <Size>M
    5. If free disk space is the first priority the you need to create another Table space (which should have size as big as it can have all the tables) and you re-organize in this new tablespace. After Reorg, drop the old tablespace and rename the new Table space with the old one (Rename Tablespace Command will work only in Oracle 10g).
    I hope this information helps all those who are going to do reorg in their respective projects. However, You can further put your question if in doubt and I will try to answer them.

  • Segment organization within tablespace

    Hi There,
    I was trying to organize objects within the tablespaces and moving things around when I got up to this:
    I needed to get rid of the PROD_T3 tablespace so I moved everything out of it apart from the below
    SQL> select owner,segment_name,segment_type, TABLESPACE_NAME,bytes/1024/1204 from dba_Segments where tablespace_name='PROD_T3' order by 3;
    OWNER                SEGMENT_NAME                   SEGMENT_TYPE       TABLESPACE_NAME                BYTES/1024/1204
    PROD                 PK_VOTER_REG_DOC               INDEX              PROD_T3                          122.471761
    PROD                 SYS_IL0000186869C00026$$       LOBINDEX           PROD_T3                          .053156146
    PROD                 SYS_LOB0000186869C00026$$      LOBSEGMENT         PROD_T3                          .053156146
    PROD                 PLAN_TABLE                     TABLE              PROD_T3                          .106312292
    PROD                 BIN$IEDOLJmsSj6isKTb5Z2cOQ==$0 TABLE              PROD_T3                          .053156146and so I started investigating each segment in the tablespace:
    SQL> select owner, index_name, table_name, tablespace_name, status from dba_indexes where index_name='PK_VOTER_REG_DOC';
    OWNER                INDEX_NAME                     TABLE_NAME                     TABLESPACE_NAME        STATUS
    PROD                 PK_VOTER_REG_DOC               VOTER_REG_DOC                  PROD_T3                VALID
    SQL> select owner, table_name, tablespace_name, status from dba_tables where table_name='VOTER_REG_DOC';
    OWNER                TABLE_NAME                     TABLESPACE_NAME                STATUS
    PROD                 VOTER_REG_DOC                                                 VALIDI'm a bit surprised form the above that there isn't a tablespace?!! I can describe the table and get a count for the number of rows in there:
    SQL> desc prod.VOTER_REG_DOC
    Name                                                                     Null?    Type
    VOTER_ID                                                           NOT NULL NUMBER(10)
    CARD_NO                                                              NOT NULL CHAR(9)
    SQL> select count(*) from prod.VOTER_REG_DOC;
      COUNT(*)
       3656468But when I look at dba_segments, I can't see it:
    SQL> select owner,segment_name, segment_type , tablespace_name from dba_segments where owner='PROD' and segment_name='VOTER_REG_DOC' order by 1,2
    no rows selected
    SQL>
    SQL> select owner,segment_name, segment_type , tablespace_name from dba_segments where owner='PROD' and segment_name like '%VOTER_REG%' order by 2,3;
    OWNER                SEGMENT_NAME                   SEGMENT_TYPE       TABLESPACE_NAME
    PROD                 PK_VOTER_REG_DOC               INDEX              PROD_T3
    SQL>Where am I going wrong with this? Also, I was surprised to see an object or a segment called "BIN$IEDOLJmsSj6isKTb5Z2cOQ==$0" ? I thought any BIN* would be sitting in DBA_RECYCLEBIN as the object(s) been deleted or am I wrong?
    Appreciate the help.
    Cheers

    >
    I believe you will find that you are looking at the definition entry for an index organized table.
    select IOT_TYPE from dba_tables where table_name = 'VOTER_REG_DOC'
    if it returns 'IOT' then that is what you have.
    >
    Bingo..
    SQL> select owner, IOT_TYPE from dba_tables where table_name = 'VOTER_REG_DOC';
    OWNER                IOT_TYPE
    PROD                 IOTNow that's that sorted; how about the BIN$ item? can I drop this item? How can go on about investigating it?
    SQL> r
      1* select owner,segment_name,segment_type, TABLESPACE_NAME,bytes/1024/1204 from dba_Segments where tablespace_name='PROD_T3' order
    by segment_type
    OWNER                SEGMENT_NAME                   SEGMENT_TYPE       TABLESPACE_NAME                BYTES/1024/1204
    PROD                 SYS_IL0000186869C00026$$       LOBINDEX           PROD_T3                          .053156146
    PROD                 SYS_LOB0000186869C00026$$      LOBSEGMENT         PROD_T3                          .053156146
    PROD                 PLAN_TABLE                     TABLE              PROD_T3                          .106312292
    PROD                 BIN$IEDOLJmsSj6isKTb5Z2cOQ==$0 TABLE              PROD_T3                          .053156146Edited by: rsar001 on Mar 19, 2010 1:37 PM

  • Regarding Overflow segments in IOT

    can any one please tell me what will be contents of the overflow segments in an IOT.
    documentation says
    An OVERFLOW clause, which preserves dense clustering of the B-tree index by storing the row column values exceeding a specified threshold in a separate overflow data segment. This data segment can be in another tablespace also.
    An OVERFLOW clause, which preserves dense clustering of the B-tree index by enabling the storage of some of the nonkey columns in a separate overflow data segment.
    during the insert operations if the data extent threshold limit is reached it alloates a overflow segment right..
    in the documentation it also says that non key columns in the table are also stored in the overflow segments.
    CAN ANY ONE TELL ME WHAT WILL BE THE CONTENTS OF INDEX SEGMENTS AND OVERFLOW SEGMENTS FOR THE FOLLOWING TABLE.
    CREATE TABLE admin_docindex2(
    token CHAR(20),
    doc_id NUMBER,
    token_frequency NUMBER,
    token_offsets VARCHAR2(512),
    CONSTRAINT pk_admin_docindex2 PRIMARY KEY (token, doc_id))
    ORGANIZATION INDEX
    TABLESPACE admin_tbs
    PCTTHRESHOLD 20
    INCLUDING token_frequency
    OVERFLOW TABLESPACE admin_tbs2;

    The contents of the oveflow segment will be all columns defined after the including token_frequency column, in your case the token_offsets column.
    As definitions for all the remaining columns within the index structure are relatively small, the pctthreashold value of 20% is not likely to come into play.
    Cheers
    Richard Foote
    http://richardfoote.wordpress.com/

  • Move large tables and indexes into own tablespace

    I currently manage a 100Gb 10.2.0.4 SE database on Windows.
    There is one data tablespace and one indexes.
    I have one table xxxHistory that is periodically cleared out, however, six months of data must be retained.
    The table is currently 17Gb and has 95 million rows, the corresponding nine or so indexes take another 47Gb.
    I am having a small problem with I/O waits on this table so, I want to move this table and the indexes to their own tablespaces, which I will create (xxxHistory_D and xxxHistory_I).
    I know the two methods, exp/imp (difficult due to foreign keys) and the prefered method of :
    alter table tbl move tablespace tblsp and
    alter index ind rebuild tablespace tblsp.
    I have no problems with the syntax etc, having used this method many times.
    My question is, does anyone have a better idea of how to approach this to minimise downtime?
    The system cannot be used if this table is not available.
    I am also going to migrate to 11.2x when available but can't find anything in the new features to help.
    Note, this is SE, so partitioning is not an option and once I have sorted this table out, I will unchain the rows of any other and reorganise the space.
    Disk space is not an issue.
    Thanks,

    BigPhil wrote:
    Note, this is SE, so partitioning is not an option and once I have sorted this table out, I will unchain the rows of any other and reorganise the space.
    Disk space is not an issue.
    Strategically this sounds as if you really do need partitioning; since you're on SE, you could consider the v7 "partition view" concept.
    Create one table per month, and index each table separately.
    Add a constraint to each table of the form: "movement date between to_date('...') and to_date('...')"
    Create a union all view of the tables.
    Getting rid of a single month means redefining the view.
    In theory any queries you do should be able to filter predicate pushdown and thus eliminate redundant partitions, and also handle pushing joins down into the union all view. But that's something you would have to test carefully.
    You could even create the tables as index organized tables - which may be the solution to your I/O wait problems - if your queries are about stock movement then all the movements for a given stock will be thinly scattered across the table, leading to one block I/O per row required. IOTs would give you an overhead on inserts, but eliminate waits on queries.
    Regards
    Jonathan Lewis
    http://jonathanlewis.wordpress.com
    http://www.jlcomp.demon.co.uk
    To post code, statspack/AWR report, execution plans or trace files, start and end the section with the tag {noformat}{noformat} (lowercase, curly brackets, no spaces) so that the text appears in fixed format.
    "Science is more than a body of knowledge; it is a way of thinking"
    Carl Sagan                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • How to specify overflow clause for IOT

    Hi,
    I’m using OSDM v3.0.0.665
    How do I specify ‘overflow’ clause for index organized table (IOT)?
    I need to generate DDL something similar to this “ create table T1(…….) organization index..overflow".
    In OSDM, when I open physical model and table properties ‘IOT properties’ tab, I can see dropbox for overflow segment but no values in drop box, it is blank.
    I do have tablespace created in my physical model.
    I’m able to generate DDL for IOT but does not have ‘overflow’ clause.
    Thanks,
    Vikas

    David,
    Thanks for your response.
    After creating segment template, I’m able to generate overflow clause.
    However I’m still not able to specify tablespace for both – IOT table and overflow segment.
    If I specify tablespace for IOT (say T1) under ‘General’ tab and if I also specify overflow segment (with tablespace T2) under ‘IOT properties’ tab, I’d expect it to generate DDL with tablespace T1 for IOT and tablespace T2 for overflow.
    However it generates DDL with overflow tablespace T1 and does not generate any tablespace clause for IOT. So, IOT is created in default tablespace for user.
    I need DDL with tablespace clause for both – IOT as well as overflow segment.
    Can you please help?
    Also, how do I get rid of other storage clauses like PCTFREE, PCTUSED, MINEXTENTS, MAXEXTENTS etc..
    Thanks,
    Vikas

  • IOT move

    Hi,
    Db : 10.2.0.4
    How to move the IOT table?
    If it's partition/ partition index,how to move?
    ALTER TABLE gei.I_S_RL MOVE TABLESPACE GE3 STORAGE
    (INITIAL 131072 NEXT 131072 PCTINCREASE 0);
    ERROR at line 1:
    ORA-28660: Partitioned Index-Organized table may not be MOVEd as a whole
    Thanks & Regards,
    VN

    You have to move/rebuild a partitioned IOT one partition at a time.
    Issue a separate ALTER statement for each partition.

  • Insufficient privileges - Split Partitioned IOT

    Hi,
    Can someone help me figuring this out. I'm trying to do a SPLIT PARTITION in a stored procedure.
    SQL> select * from v$version where rownum = 1;
    BANNER                                                         
    Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bi
    1 row selected.This is my sample table:
    SQL> CREATE TABLE tab (
             period                NUMBER(13)         NOT NULL,
             check_id              VARCHAR2(4)        NOT NULL,
             opkr_number           NUMBER(7)          NOT NULL
          ,CONSTRAINT tab_pk PRIMARY KEY (period, check_id, opkr_number)
        ORGANIZATION INDEX COMPRESS 2
        PARTITION BY LIST (period)
           PARTITION tab_p72  VALUES(72),
           PARTITION tab_p73  VALUES(73),
           PARTITION tab_rest VALUES(DEFAULT));
    Table created.And I want to do this in my procedure:
    SQL> ALTER TABLE tab SPLIT PARTITION tab_rest VALUES(74) INTO (PARTITION tab_p74, PARTITION tab_rest);
    Table altered.
    SQL> ALTER TABLE tab DROP PARTITION tab_p74;
    Table altered.This attempt won't work:
    SQL> CREATE OR REPLACE PROCEDURE myproc
    AS
    BEGIN
       EXECUTE IMMEDIATE 'ALTER TABLE tab SPLIT PARTITION tab_rest VALUES(74) INTO (PARTITION tab_p74, PARTITION tab_rest)';
    END;
    Procedure created.
    SQL> exec myproc
    ORA-01031: insufficient privileges
    ORA-06512: at "XQL_STIK.MYPROC", line 4
    ORA-06512: at line 1Only if I put in AUTHID CURRENT_USER, it will. And this what I just cannot figure out.
    SQL> CREATE OR REPLACE PROCEDURE myproc2
    AUTHID CURRENT_USER
    AS
    BEGIN
       EXECUTE IMMEDIATE 'ALTER TABLE tab SPLIT PARTITION tab_rest VALUES(74) INTO (PARTITION tab_p74, PARTITION tab_rest)';
    END;
    Procedure created.
    SQL> exec myproc2
    PL/SQL procedure successfully completed.
    SQL> ALTER TABLE tab DROP PARTITION tab_p74;
    Table altered.It cannot be the ALTER TABLE privilege.
    SQL> create or replace procedure myproc3
    as
    begin
       execute immediate 'ALTER TABLE tab ADD x NUMBER';
    end;
    Procedure created.
    SQL> exec myproc3
    PL/SQL procedure successfully completed.
    SQL> DROP TABLE tab PURGE;
    Table dropped.Can anyone see what I'm missing?
    Edit: I can even do this, so it must have to do with the SPLIT (And this being an IOT)
    SQL> CREATE OR REPLACE PROCEDURE myproc4
    AS
    BEGIN
       EXECUTE IMMEDIATE 'ALTER TABLE tab DROP PARTITION tab_rest';
       EXECUTE IMMEDIATE 'ALTER TABLE tab ADD  PARTITION tab_p74 VALUES(74)';
    END;
    Procedure created.
    SQL> exec myproc4
    PL/SQL procedure successfully completed.Best regards
    Peter
    Edited by: Peter Gjelstrup on Feb 3, 2010 4:34 AM
    - Added DROP/ADD example

    Hi Herald,
    and Centinul.
    Thanks for that metalink. Looked promising, but I'm not sure. It seems that I can use ALTER SESSION, even in a SP.
    SQL> CREATE OR REPLACE PROCEDURE myproc5
    AS
    BEGIN
       EXECUTE IMMEDIATE 'ALTER SESSION SET NLS_LANGUAGE = american';
    END;
    Procedure created.
    SQL> select value
      from nls_session_parameters
    where parameter = 'NLS_LANGUAGE';
    VALUE                                  
    DANISH                                 
    1 row selected.
    SQL> set role none;
    Set role complete.
    SQL> exec myproc5
    PL/SQL procedure successfully completed.
    SQL> select value
      from nls_session_parameters
    where parameter = 'NLS_LANGUAGE';
    VALUE                                  
    AMERICAN                               
    1 row selected.
    SQL> select * from session_privs
    order by 1;
    PRIVILEGE                              
    CREATE MATERIALIZED VIEW               
    UNLIMITED TABLESPACE                   
    2 rows selected.
    SQL> set role all;
    Set role complete.
    SQL> select * from session_privs
    order by 1;
    PRIVILEGE                              
    ALTER SESSION                          
    CREATE CLUSTER                         
    CREATE INDEXTYPE                       
    CREATE MATERIALIZED VIEW               
    CREATE OPERATOR                        
    CREATE PROCEDURE                       
    CREATE SEQUENCE                        
    CREATE SESSION                         
    CREATE SYNONYM                         
    CREATE TABLE                           
    CREATE TRIGGER                         
    CREATE TYPE                            
    CREATE VIEW                            
    UNLIMITED TABLESPACE                   
    14 rows selected.Hmm..
    Edit:
    [Bug:1548539|https://support.oracle.com/CSP/main/article?cmd=show&type=BUG&id=1548539]
    Seems to indicate that CREATE TABLE is the thing I'm looking for.
    This seems to be consistent with what Bartek has.
    Can anyone confirm, by running some of my original test case with and without CREATE TABLE privilege?
    I'm sorry for asking for this final confirmation, unfortunately it would be quite painful for me to have some privileged user do that for me.
    Regards
    Peter
    Edited by: Peter on Feb 3, 2010 8:50 AM
    - Maybe CREATE TABLE?

  • Nologging to Logging & Moving IOT

    Hello,
    Oracle ver. 8.1.6 on Linux.
    Problem 1:
    When converting an IOT from "nologging" to "logging"
    Oracle didn't gave any error. But when i queried the dba_tables it still shows 'NOLOGGING'. However when i tried with ordinary( non-IOT) it works fine. How to go about it ?
    Problem 2:
    Will indexes ( including secondary indexes ) created on an IOT will reside along with the table ( like primary index )? When i tried moving the IOT from one tablespace to another only the primary indexes moved to the new tablepace. I am forced to rebuild the secondary indexes in the new tablespaces. Is there any method to take both ( primary & secondary ) to move to new tablespace in one command.
    Thanks in advance.
    Saji

    I see following objects in USER_SEGMENTS. All of them are related to IOT indexes. Around 512 entries.
    OBJECT_NAME
    SYS_IOT_TRNS_1082943
    SYS_IOT_TRNS_162982
    SYS_IOT_TRNS_1083001
    SYS_IOT_TRNS_163358
    SYS_IOT_TRNS_1083035
    SYS_IOT_TRNS_163546
    SYS_IOT_TRNS_1083065
    SYS_IOT_TRNS_163734
    SYS_IOT_TRNS_1083095
    SYS_IOT_TRNS_163922
    SYS_IOT_TRNS_1083125
    SYS_IOT_TRNS_164110
    SYS_IOT_TRNS_1083163
    SYS_IOT_TRNS_164298
    SYS_IOT_TRNS_1083193
    SYS_IOT_TRNS_164486
    If I issue -
    ALTER TABLE SYS_IOT_TRNS_1082943 MOVE TABLESPACE "DPIPE_SUMMARY_SEG_2"
    getting -
    ORA-28674: cannot reference transient index-organized table
    Please help. Thanks.

  • Create index without using temp tablespace

    Hello,
    i have a great table with over 2.000.000.000 rows. Therefor i want to create an index on column1:
    CREATE INDEX "SCHEMA"."INDEX_TABLE1" ON "SCHEMA"."TABLE1" ("STR1")
    PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS NOCOMPRESS LOGGING
    STORAGE( INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
    PCTINCREASE 0 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
    TABLESPACE "USERS" ;
    If i execute this my temp tablespace will be used and if its full (max 20gb) the creation will be aborted.
    Where is my fault to create the index?
    With best

    bladepit wrote:
    The table description:
    CREATE TABLE "SCHEMA"."TABLE1"
    (     "STR1" VARCHAR2(20 BYTE),
         "STR2" VARCHAR2(20 BYTE),
         "VAL" NUMBER
    ) SEGMENT CREATION IMMEDIATE
    PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
    STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
    PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
    TABLESPACE "USERS" ;
    And i want to get the values like this:
    select str1,str2,val from SCHEMA.TABLE1 where str1 = 'TEST1' or str2 = 'TEST1'
    If this is the complete definition of the table, and if (str1, str2) are unique, and this really is the only way you use the table, then it looks as if your STRATEGIC move would be to rebuild the table as a hash partitioned IOT with something like 128 partitions. Since you probably can't do that in the short-term you could create a hash partitioned index on the table (assuming you have paid the partitioning licence) with enough partitions that you can create each one separately. Something like:
    SQL> create index t1_i1 on t1(n1, n2, n3) unusable global partition by hash (n1, n2) partitions 4;
    Index created.
    SQL> select index_name, partition_name from user_ind_partitions;
    INDEX_NAME           PARTITION_NAME
    T1_I1                SYS_P8713
    T1_I1                SYS_P8712
    T1_I1                SYS_P8711
    T1_I1                SYS_P8710
    4 rows selected.
    SQL> alter index t1_i1 rebuild partition sys_p8713 online;
    Index altered.
    -- repeat for each partition in turnRegards
    Jonathan Lewis

Maybe you are looking for

  • Email of the Purchase Order to the User

    Hi, Currently, I am able to send the email of the purchase order to the vendor mail address, which is mentioned on general data tab of the vendor master. In addition, the requirement is that the purchase order also to be emailed to the User, who has

  • How to avoid pop-up dialog? "Read From Spreadshee​t File.vi"

    I am using LV2010 and VBAI2011. I am using LV to write vi for my VBAI user interface. VBAI will send the inspection results to vi by "Update Inspection UI". I am calling a "Run LabVIEW VI" from within the VBAI. This vi contains a sub-vi "Read From Sp

  • Return Sales - Header - System Status Blocked.

    Hi Gurus, We are implementing for a cable industry, and doing the Make to Order scenario.when i am running out the scenario for Return sales system is showing the status blocked in Header. But i am able to save the Document. After creation of sales o

  • HP C6280 all-in-one - help

    My printer has been working great, but all of a sudden it prints backwards, in other words I would have to turn the paper over and read it through the back.  I've tried everything to get it back to normal.  I finally did click on "mirror image", and

  • Can't write to HD, must reboot, error -50

    It's happened four times in three months. Suddenly the Mac can't write to the hard disk (error -50) and I have to reboot. I have to close all open programs with errors because they can't write their configuration files. Recent email mail be lost. I c