How to store an index in a specific table space?

Hello everyone..
I am using Oracle 10.2.0.
Is it possible to store an index in a table space, in the same create index syntax?
I have tried the following syntax:
create index index_name on table_name (column_name) tablespace index_tablespace;and I am getting the following error:
ERROR at line 1:
ORA-02216: tablespace name expected
Any help would be appreciated.

Latvian83 wrote:
create index index_name on table_name (column_name) tablespace index_tablespace;
Is index_tablespace EXACT name of tablespace you are trying to create index in? I bet - it is not. If so, then most likely tablespace name you are using is a keyword/reserved name. For example:
SQL> create table table_name(column_name number);
Table created.
SQL> create index index_name on table_name (column_name) tablespace as;
create index index_name on table_name (column_name) tablespace as
ERROR at line 1:
ORA-02216: tablespace name expected
SQL> create index index_name on table_name (column_name) tablespace date;
create index index_name on table_name (column_name) tablespace date
ERROR at line 1:
ORA-02216: tablespace name expected
SQL> SY.
P.S. Next time post exact code.

Similar Messages

  • How to store output of SQ01 into internal table.

    Hello Experts
    How to store output of SQ01 into internal table.
    Thanks,
    Umesh

    You can't store the sq01 output into internal table.
    Once you create the query it will generate the abap program, in that program you can see the contents.
    Regards
    Sasi

  • How to store the zip file in oracle table?

    hi,
    How to store the zip file in oracle table ?
    is it possible to unzip and read the file ?
    Thanks
    Rangan S

    SQL> DESC BLOB_TABLE;
    Name Type Nullable Default Comments
    A INTEGER Y
    B BLOB Y
    SQL> INSERT INTO BLOB_TABLE VALUES(5,BLOB('MWDIR_TST','TEST.ZIP'));
    INSERT INTO BLOB_TABLE VALUES(5,BLOB('MWDIR_TST','TEST.ZIP'))
    ORA-00904: "BLOB": invalid identifier
    SQL> INSERT INTO BLOB_TABLE VALUES(5,('MWDIR_TST','TEST.ZIP'));
    INSERT INTO BLOB_TABLE VALUES(5,('MWDIR_TST','TEST.ZIP'))
    ORA-00907: missing right parenthesis
    SQL> INSERT INTO BLOB_TABLE VALUES(5,('\\MWDIR_TST\TEST.ZIP'));
    INSERT INTO BLOB_TABLE VALUES(5,('\\MWDIR_TST\TEST.ZIP'))
    ORA-01465: invalid hex number
    SQL> INSERT INTO BLOB_TABLE VALUES(5,('\\MWDIR_TST\TEST.ZIP'));

  • How to create User and Database in different Table spaces

    How to create User and Database in different Table spaces using oracle 10g
    Regards
    daya

    I am sorry but your question does not seem to make much sense.
    Can you please rephrase your question?

  • How to store photo images in a database table?

    Hello Y'all,
    How do I store about 695 signs inventory photo images from a PDF file to an Oracle database table? We are using Oracle 10.2.0.2. What data type should I use for these images? How about the table space? What table space should I allocate to ensure there is no space issue?
    Thanks in advance for any/all the help.

    Here you go..
    Assuming you have a table
    test_blob (col1 BLOB);
    Create an oracle directory or use an existing one to place the image on the oracle server.
    create or replace directory tmp_blob as '/tmp';This tmp location should exist on your server where oracle is installed.
    also ftp the image file (say image1.bmp) to this location
    declare
    l_blob BLOB;
    l_bfle BFILE;
    l_re BOOLEAN := FALSE;
    Begin
    DBMS_LOB.createtemporary(l_blob, TRUE);
    insert into test_blob(col1) values (EMPTY_BLOB())
    returning col1 into l_blob;
    --return image into l_blob;
    l_bfile := BFILENAME('TMP_BLOB','image1.bmp');
    --check if file exists
    l_ret := DBMS_LOB.fileexists (l_bfile) = 1;
    if (l_ret)
    then
    DBMS_LOB.fileopen(l_bfile);
    DBMS_LOB.loadfromfile(l_blob, l_bfile, DBMS_LOB.getlength(l_bfile));
    commit;
    else
    DBMS_OUTPUT.put_line('File not present');
    end if;
    end;
    / not tested this exact one.. check for the syntax errors if any.. this should work

  • How 2 select a constrains on a specific table...?

    Hello
    i want 2 know how 2 ...
    select a constrains on a specific table...?
    Regards,
    Abdetu...

    Thanks Kanchana Devasurendra
    it optimized my Query criteria..
    SQL> select table_name,constraint_name from user_constraints
      2  where table_name = 'WH_S_ITEMS';
    TABLE_NAME                     CONSTRAINT_NAME
    WH_S_ITEMS                     SYS_C009689
    WH_S_ITEMS                     SYS_C009690
    WH_S_ITEMS                     WS1_PKBetter Performance... :)
    Regards,
    Abdetu...

  • How to store a bitmap file in the table

    i am using oracle 8i. i dont know how to save the bitmap file in the table, is long raw datatype should be used.
    thanks

    try to use the datatype of that feild as longraw...
    if u need more help then ask..
    tariq.

  • How to store a pdf file in a table

    Hi
    In my project i have to store a pdf
    file in the table column.
    can anyone tell what wil be the column type
    while creating the table in oracle 7.3.4
    Thanks
    Alok

    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Alok Hota ([email protected]):
    Hi
    In my project i have to store a pdf
    file in the table column.
    can anyone tell what wil be the column type
    while creating the table in oracle 7.3.4
    Thanks
    Alok<HR></BLOCKQUOTE>
    Since you have to store a binary file you
    can use LONG RAW.
    Thorsten

  • How can I identify reports that use specific tables

    Hi, is there a way that I can identify the reports that select from specific tables?  We have 3,000 reports in business object enterprise XI R2 SP5. and we're trying to identify all the reports that use a specific table.

    Or if you have a developer in Java or .NET available you can write one. Fairly simple to get the info.
    In .NET you would open each report, write the name of the report to a log file with the output of the SQL Statement:
    Using RAS as the report engine.
                GroupPath gp = new GroupPath();
                string tmp = String.Empty;
                rptClientDoc.RowsetController.GetSQLStatement(gp, out tmp);
                MessageBox.Show(tmp, "Data Source Set and SQL Statement", MessageBoxButtons.OK, MessageBoxIcon.Information);
    If you want more details is is available with a few more lines of code. The above would only show you what is used in the report.
    I don't believe there is a BOE tool that can do this but they may have one.
    Here's a link to the BOE Admin forum: BI Platform
    Thank you
    Don

  • How to store a pdf file  in a table field.

    Hi,
    I need to store the file in a table field..How we can do this.The file format is pdf..I stored this in application server also..

    during my tries to adapt this code to my needs, following error occured during compilation of the procedure:
    PLS-00201: identifier 'IMAGES.MIME_TYPE' must be declared
    here is my procedure:
    CREATE OR REPLACE PROCEDURE load_file( file_name VARCHAR2 )
    AS file_lob BFILE;
    binary_lob BLOB;
    mime_type images.mime_type%TYPE;
    extension_pos NUMBER;
    BEGIN
    --Use the extension of the file name to determing the MIME-type 
    --The MIME-type for a .pdf file will be application/pdf
    extension_pos := INSTR( file_name, '.' );
    mime_type := 'application/' || SUBSTR( file_name,extension_pos + 1,LENGTH( file_name ) );
    -- Insert a new row into the images table. Get the LOB locator
    -- for the newly inserted row
    -- we will be using that to insert
    -- the content from the file.
    INSERT INTO TESTBLOB( blobid, filename, mime_type, content )
    VALUES( 1, file_name, mime_type, EMPTY_BLOB() )
    RETURNING content INTO binary_lob;
    -- Open up the file in the IMAGES directory named file_name,
    -- load that file into the newly created LOB locator, and
    -- close the file
    file_lob := BFILENAME( 'TESTDIRECTORY', file_name );
    dbms_lob.fileOpen ( file_lob, dbms_lob.file_readOnly );
    dbms_lob.loadFromFile( binary_lob,file_lob,dbms_lob.getLength( file_lob ) );
    dbms_lob.fileClose ( file_lob );
    END;
    how do I have to adjust the declaration of the mime_type variable respectively what does images.mime_type%TYPE mean?
    katharina

  • How to maintain bitmap index on a large table in DW?

    Hi all,
    We have many tables which are constantly doing either FULL or INCREMENTAL loading.
    And we have created many BITMAP indexes and several B*Tree index (caused by PRIMARY KEY or UNIQUE key constraints) on those tables.
    So, what I want to know is, how to maintain those BITMAP (and B*Tree) indexes for different loading mode?
    like, should I drop the index before the full load and re-create it after that?
    and do nothing in INCREMENTAL loading? I am aware that it will take more time to load with indexes.
    any links, books, articles or opinions would be highly appreciated.
    Thanks

    Just to reiterate, add to what Adam said. From Oracle Doc
    http://download.oracle.com/docs/cd/E11882_01/server.112/e17120/indexes002.htm#CIHJIDJG
    Unusable indexes
    An unusable index is ignored by the optimizer and is not maintained by DML. One reason to make an index unusable is to improve bulk load performance. (Bulk loads go more quickly if the database does not need to maintain indexes when inserting rows.) Instead of dropping the index and later re-creating it, which requires you to recall the exact parameters of the CREATE INDEX statement, you can make the index unusable, and then rebuild it.
    You can create an index in the unusable state, or you can mark an existing index or index partition unusable. In some cases the database may mark an index unusable, such as when a failure occurs while building the index. When one partition of a partitioned index is marked unusable, the other partitions of the index remain valid.
    An unusable index or index partition must be rebuilt, or dropped and re-created, before it can be used. Truncating a table makes an unusable index valid.
    Beginning with Oracle Database 11g Release 2, when you make an existing index unusable, its index segment is dropped.
    The functionality of unusable indexes depends on the setting of the SKIP_UNUSABLE_INDEXES initialization parameter. When SKIP_UNUSABLE_INDEXES is TRUE (the default), then:
    •DML statements against the table proceed, but unusable indexes are not maintained.
    •DML statements terminate with an error if there are any unusable indexes that are used to enforce the UNIQUE constraint.
    •For nonpartitioned indexes, the optimizer does not consider any unusable indexes when creating an access plan for SELECT statements. The only exception is when an index is explicitly specified with the INDEX() hint.
    •For a partitioned index where one or more of the partitions are unusable, the optimizer does not consider the index if it cannot determine at query compilation time if any of the index partitions can be pruned. This is true for both partitioned and nonpartitioned tables. The only exception is when an index is explicitly specified with the INDEX() hint.
    When SKIP_UNUSABLE_INDEXES is FALSE, then:
    •If any unusable indexes or index partitions are present, any DML statements that would cause those indexes or index partitions to be updated are terminated with an error.
    •For SELECT statements, if an unusable index or unusable index partition is present but the optimizer does not choose to use it for the access plan, the statement proceeds. However, if the optimizer does choose to use the unusable index or unusable index partition, the statement terminates with an error.
    Incremental load really matters the volume and whether for new dats you just add new partitions or subpartitions . If my incremntal go all over place and/or if I am touching few thousand rows. Yes might want to keep the indexes valid and let Oracle maintain it. IF millions added or incremental data just added to new part/subpart . Keeping indexes unsable for those partitions/subpartitions and the rebuilding it later may yield better results.

  • How to get row index in dynamically populated table?

    Hi,
    I am following example given in http://balusc.xs4all.nl/srv/dev-jep-dat.html to Dynamically populate datatable. How can I get row index while populating table in populateDynamicDataTable() method
    private List myList;
    private String[] headers; // Optional.
    private HtmlDataTable dynamicDataTable;
    // Actions ----------------------------------------------------------
    public void loadMyList() {
    // Set headers (optional).
    headers = new String[] {"header1", "header2", "header3"};
    // Set rows. This is a stub example, just do your dynamic thing.
    String[] row1 = {"ID1", "Name1", "Value1"};
    String[] row2 = {"ID2", "Name2", "Value2"};
    String[] row3 = {"ID3", "Name3", "Value3"};
    // Convert rows to List and set the List.
    myList = new ArrayList();
    myList.add(Arrays.asList(row1));
    myList.add(Arrays.asList(row2));
    myList.add(Arrays.asList(row3));
    public void populateDynamicDataTable() {
    //*********************** I want current row in this method *************//
    // Any columns?
    if (myList != null && myList.size() > 0) {
    dynamicDataTable = new HtmlDataTable();
    // Get amount of columns.
    int columns = ((List) myList.get(0)).size();
    // Set columns.
    for (int i = 0; i < columns; i++) {
    // Set header (optional).
    UIOutput header = new UIOutput();
    header.setValue(headers);
    // Set output.
    UIOutput output = new UIOutput();
    ValueBinding myItem =
    FacesContext
    .getCurrentInstance()
    .getApplication()
    .createValueBinding("#{myItem[" + i + "]}");
    output.setValueBinding("value", myItem);
    // Set column.
    UIColumn column = new UIColumn();
    column.setHeader(header);
    column.getChildren().add(output);
    // Add column.
    dynamicDataTable.getChildren().add(column);
    // Getters ----------------------------------------------------------
    public List getMyList() {
    return myList;
    public HtmlDataTable getDynamicDataTable() {
    if (dynamicDataTable == null) {
    loadMyList(); // Reload to get most recent data.
    populateDynamicDataTable();
    return dynamicDataTable;
    // Setters ----------------------------------------------------------
    public void setMyList(List myList) {
    this.myList = myList;
    public void setDynamicDataTable(HtmlDataTable dynamicDataTable) {
    this.dynamicDataTable = dynamicDataTable;
    I have tried dynamicDataTable.getRowIndex, but it returns -1
    Is there any other way?
    Thanks ,
    Chitra.

    When you dynamically populate a datatable, you're populating the columns, not the actual rows.
    Just add EL to the styleClass attribute, like:styleClass="#{myBean.myTable.rowIndex == 1 ? 'highlightedClass' : 'defaultClass'}"where 'myTable' refers to a HtmlDataTable property in the backing bean.

  • How to Drop an index from a used table. online

    I need to drop an index from a table that is constantly used , read and write.
    The DML's are locking the table and preventing the index drop (ORA-00054: resource busy and acquire with NOWAIT specified )
    I tried to lock the table first - using 'lock table TAB1 in exclusive mode'
    but when i ran the 'drop index' command , the drop (as all DDL's) first commits and this frees the lock which cause again the ORA-00054: resource busy and acquire with NOWAIT specified error.
    I would appriciate any help .I can't take the DB or table or Application writing to the table offline. I need something like 'create index IND1 online' for DROP but there is none as far as I know...
    Thanks in advanve.
    Amit Zor

    "It is requsted for the removal of an ORDER BY clause from a CPU consuming query.
    The extra field enables me to remove it as the result set comes back ordered by the index"
    It might do that today, but it is not guaranteed to do it tomorrow. Oracle may be able to retrieve the records ordered using that index, but I would leave it in your query if you are depending on the rows being ordered. The CBO is smart enough to not actually sort the rows (i.e. act on the ORDER BY clause) if it can get them sorted using the index, but if it decides to use another access path for one of many reasons your results will not be sorted without the ORDER BY.
    Since the CBO seems to think that your existing index is useful (which is why you cannot get the lock on it), your only option is to wait for a period of really low activity on the database and try it then.
    John

  • How to store context data into a database table?

    Hi All,
      I am very new to Web Dynpro ABAP.
    I am trying to store context data into database table. For this i need to write some code.
    I have created one context attribute to store data and i have one database table.
    Know i want to store that context attribute's data into database table.
    Can anyone provide me necessary code to do this.
    Thanks in Advance!
    Regards,
    Sreelakshmi.

    Hello Sreelakshmi,
    i think there would be some button and when u click that, the data of the context need to get saved into the database.
    For the button,create an action.
    in the action handler write the following code.
    DATA lo_nd_kna1 TYPE REF TO if_wd_context_node.
    DATA lo_el_kna1 TYPE REF TO if_wd_context_element,
    DATA lt_kna1 TYPE wd_this->elements_znode.
    DATA ls_kna1 TYPE wd_this->element_znode.
    lo_nd_kna1 = wd_context->get_child_node( name = wd_this->wdctx_znode ).
    lo_el_kna1 = lo_nd_kna1->get_element(  ).
      lo_el_kna1->get_static_attributes( IMPORTING static_attributes = ls_kna1 ).
    modify kna1 from ls_kna1.
    Regards
    Sajid

  • HOW TO CREATE LOCAL INDEX ON BIG PARTITION TABLE

    Dear All,
    I have one big table 450GB stored on 9 partitions and same partitions I have created for the index. Now the problem is when i am trying to create local index it took one and half day and is still going on...
    is there any shortest way to create local index on this table easily.
    Database version is 11.2.0.1.0
    INDEX SCRIPT IS
    CREATE INDEX INDEX_SPACE0_IX_LOCAL ON FINANCE (END_TIME)
    INITRANS 2 MAXTRANS
    255
    LOCAL ( PARTITION INDEX_SPACE01
    LOGGING
    NOCOMPRESS
    TABLESPACE INDEX_SPACE01
    PCTFREE 5 INITRANS 2 MAXTRANS 255 STORAGE (INITIAL 1M MINEXTENTS 1 MAXEXTENTS
    2147483645 BUFFER_POOL
    DEFAULT), PARTITION INDEX_SPACE02
    LOGGING
    NOCOMPRESS
    TABLESPACE INDEX_SPACE02 PCTFREE
    5 INITRANS 2 MAXTRANS 255 STORAGE (INITIAL 1M MINEXTENTS 1 MAXEXTENTS
    2147483645 BUFFER_POOL DEFAULT),
    PARTITION INDEX_SPACE03
    LOGGING
    NOCOMPRESS
    TABLESPACE
    INDEX_SPACE03
    PCTFREE 5 INITRANS 2 MAXTRANS 255 STORAGE (INITIAL 1M MINEXTENTS 1 MAXEXTENTS
    2147483645 BUFFER_POOL DEFAULT),
    PARTITION INDEX_SPACE04
    LOGGING
    NOCOMPRESS
    TABLESPACE
    INDEX_SPACE04 PCTFREE 5 INITRANS 2 MAXTRANS 255 STORAGE (INITIAL 1M MINEXTENTS
    1 MAXEXTENTS
    2147483645 BUFFER_POOL DEFAULT),
    PARTITION INDEX_SPACE05
    LOGGING
    NOCOMPRESS
    TABLESPACE
    INDEX_SPACE05 PCTFREE 5 INITRANS 2 MAXTRANS 255 STORAGE (INITIAL 1M MINEXTENTS
    1 MAXEXTENTS 2147483645 BUFFER_POOL DEFAULT),
    PARTITION INDEX_SPACE06
    LOGGING
    NOCOMPRESS
    TABLESPACE INDEX_SPACE06 PCTFREE 5 INITRANS 2
    MAXTRANS 255 STORAGE (INITIAL 1M MINEXTENTS 1 MAXEXTENTS 2147483645 BUFFER_POOL
    DEFAULT),
    PARTITION INDEX_SPACE07
    LOGGING
    NOCOMPRESS
    TABLESPACE INDEX_SPACE07 PCTFREE
    5 INITRANS 2
    MAXTRANS 255 STORAGE (INITIAL 1M MINEXTENTS 1 MAXEXTENTS 2147483645 BUFFER_POOL
    DEFAULT),
    PARTITION INDEX_SPACE08
    LOGGING
    NOCOMPRESS
    TABLESPACE INDEX_SPACE08 PCTFREE
    5 INITRANS 2 MAXTRANS 255 STORAGE (INITIAL 1M MINEXTENTS 1 MAXEXTENTS
    2147483645
    BUFFER_POOL DEFAULT),
    PARTITION INDEX_SPACE09
    LOGGING
    NOCOMPRESS
    TABLESPACE
    INDEX_SPACE09 PCTFREE 5 INITRANS 2 MAXTRANS 255 STORAGE (INITIAL 1M MINEXTENTS
    1 MAXEXTENTS 2147483645 BUFFER_POOL
    DEFAULT))
    NOPARALLEL;
    Thanks in advance......
    Thanks,
    Edited by: sherkhan on Aug 24, 2011 3:36 AM
    Edited by: sherkhan on Aug 24, 2011 3:49 AM

    Have you verified that 'n' Index partition segments have got created so far ? (they would apepar as TEMPORARY segments only till the full index creation is completed). Have you monitored the session statistics and waits and confirmed that it is not waiting on something horrible ?
    A CREATE INDEX can well be NOLOGGING instead of LOGGING. It could also use PARALLEL but I always recommend setting it back to NOPARALLEL immediately after the CREATE is completed.
    You can also "quickly" build an empty index and then gradually create (i.e. build) each partition
    CREATE INDEX INDEX_SPACE0_IX_LOCAL  .........  UNUSABLE ;
    ALTER INDEX INDEX_SPACE0_IX_LOCAL REBUILD PARTITION PARTITION INDEX_SPACE01;
    ALTER INDEX INDEX_SPACE0_IX_LOCAL REBUILD PARTITION PARTITION INDEX_SPACE02;
    ...Hemant K Chitale

Maybe you are looking for