Change Data type column - Performance of Index in Oracle 10g

Hi,
I have a table with too many rows (over 2000000 rows) . I have changed datatype (NUMBER to VARCHAR2) of an indexed column (the index is only for this column), using a temporay backup table:
CREATE TABLE BKTABLE AS SELECT FIELD, ROWID AS IDROW FROM ORIGNALTABLE;
UPDATE ORIGNALTABLE SET FIELD = NULL;
ALTER ORIGNALTABLE MODIFY FIELD VARCHAR2(256);
UPDATE ORIGNALTABLE A SET FIELD = (SELECT FIELD FROM BKTABLE B WHERE B.IDROW = A.IDROW);
This way worked OK.
There is any performance knowed issue over an index of ORIGNALTABLE? Need rebuild this index?
Thks!

Need rebuild this index? YES
ALWAYS
Post Operating System (OS) name & version for DB server system.
Post results of
SELECT * from v$version
or post Oracle version to 4 decimal places

Similar Messages

  • How to Change Date-Type to Char-Type with Format?, When it.....

    I'd like to Change format Data from Date-Type Column to char-type
    especially, as 'YYYYMMDD' Format, But There are some Error Message.
    I already know, to_char(sysdate, 'yyyymmdd') from dual,
    But When it Applied my Table (has Date Type Column )....
    That SQL was Error...
    Table Description
    ===================
    GUBUN     NOT NULL     NUMBER(7)
    POLCD     NOT NULL     NUMBER(7)
    TITLE          VARCHAR2(200)
    VALUE          NUMBER(7)
    SIDATE          VARCHAR2(20)
    SQL
    ================================
    SELECT TO_CHAR(SIDATE,'YYYYMMDD') as V_SIDATE , -- <== Error
    TO_CHAR(SYSDATE,'YYYYMMDD') as V_TODAY -- <== Ok
    FROM T_POLL
    Error Msg
    ================================
    ORA-01722: invalid number
    .....I don't know Why... plz. help me, it's Urgent...-_-;
    ICQ : 40751557
    MSN : [email protected]
    Finally, sorry for my poor English...

    The reason for the error is you are applying a TO_CHAR function to a character datatype. SIDATE is a character. That field should be a date field. If for some reason, you need it to stay as a character field then you will need to change it to a date then change it back to a character.
    TO_CHAR(TO_DATE(SIDATE,'put format here'),'YYYYMMDD')

  • Change data type from number(11,6) to number (11,8)

    I have a table, which has a million records...I have to change data type of some of the columns from number (11,6) to number (11,8).
    I thought of taking the backup of the table , truncating the original table, change the data type and then insert data back.
    Is it a safe option considering so many records ?

    the first number is precision and the second is scale:
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14196/schema002.htm#sthref472
    so yes, 11,6 can hold larger numbers than 11,8
    create table foobar (two number(5,2),
                         three number(5,3))
    insert into foobar values (123.45,12.345); 
    --works fine
    insert into foobar values (123.45,123.45);
    --gives error ORA-01438: value larger than specified precision allowed for this column

  • Changing data types of  fields in structures

    Hello,
       Currently we are working for upgrade to ECC 6.0 .
       In some transactions we are using BAPI_MATERIAL_SAVEDATA to create material.
      We have some additional fields in MARA and MARC table , which we fill using BAPI_TE_MARA and BAPI_TE_MARC structures.
        In these structures we have different data types for fields earlier in 4.6C
    Now this function module is only working if we change  data types of  fields in these structures only to char type. It is going for dump , if we maintain any other data type.
      Could any body tell me why should we change for char data type ?
    Regards,
      SATYA

    Hi,
    Check enhancement category (Extras --> Enhancement Category) for structures before enhancement. For example, for BAPI_TE_MARA structure, enhancement category is given as character type or numeric type. That means you can add the fields of data type only C and N. No other data types are allowed. If you select as not classified then you can add any data type. This option plays important role while enhancement.
    Regards,
    Prasanth

  • Moving a table with long data type column

    hi
    1.how to move a table with a long data type column in 8.1.7.3.0 ver database.
    alter table APPLSYS.FND_LOBS_DOCUMENT move lob(BLOB_CONTENT) store as (tablespace testing)
    ERROR at line 1:
    ORA-00997: illegal use of LONG datatype
    2. and a table with varray type column
    alter table APPLSYS.WF_ERROR move lob("USER_DATA"."PARAMETER_LIST") store as (tablespace testing)
    ERROR at line 1:
    ORA-22917: use VARRAY to define the storage clause for this column or attribute
    table description is:
    SQL> desc applsys.wf_error;
    Name Null? Type
    Q_NAME VARCHAR2(30)
    MSGID NOT NULL RAW(16)
    CORRID VARCHAR2(128)
    PRIORITY NUMBER
    STATE NUMBER
    DELAY DATE
    EXPIRATION NUMBER
    TIME_MANAGER_INFO DATE
    LOCAL_ORDER_NO NUMBER
    CHAIN_NO NUMBER
    CSCN NUMBER
    DSCN NUMBER
    ENQ_TIME DATE
    ENQ_UID NUMBER
    ENQ_TID VARCHAR2(30)
    DEQ_TIME DATE
    DEQ_UID NUMBER
    DEQ_TID VARCHAR2(30)
    RETRY_COUNT NUMBER
    EXCEPTION_QSCHEMA VARCHAR2(30)
    EXCEPTION_QUEUE VARCHAR2(30)
    STEP_NO NUMBER
    RECIPIENT_KEY NUMBER
    DEQUEUE_MSGID RAW(16)
    SENDER_NAME VARCHAR2(30)
    SENDER_ADDRESS VARCHAR2(1024)
    SENDER_PROTOCOL NUMBER
    USER_DATA APPS.WF_EVENT_T
    lob column:
    SQL> select owner,table_name,column_name from dba_lobs where table_name='WF_ERROR';
    OWNER TABLE_NAME COLUMN_NAME
    APPLSYS WF_ERROR "USER_DATA"."PARAMETER_LIST"
    APPLSYS WF_ERROR "USER_DATA"."EVENT_DATA"
    pls help me
    thanks and regards
    srinivas

    1. Export and import
    2. Sql*Plus 'copy' command
    It is a good idea to move from 'LONG' to 'CLOB'.

  • How to change data type of attribute in caf

    hi.
    this is my problem.
    i been added a attribute in an entity service called emloyee. named "Birthday", use the data type "com.sap.caf.core.date".
    when i tried modify the entity service, i hit exception about "DST Daylight Saving Time".
    because of DST, the date will add an hour such like "1957/04/01 00:00:00.0" to "1957/04/01 01:00:00.0", and com.sap.caf.core.date will throw an exception.
    is anyone had same problem like me?
    how to fixed it(if passable)?
    and, how to change data type?
    thanks.

    Hi Sruthi,
    all you need to do on this is open the report go to the parameters, select the parameter that you wish to change and click "Edit". This will allow you to change thefield to a date rather than a date time.
    Regards,
    Noel

  • How to insert in long data type column

    I would like to know how could I insert data in a long data type column.
    Thanks

    Don't use LONG, use CLOB instead. You can write to CLOBs using the DBMS_LOB package.
    Cheers, APC

  • Getting past days data based on DATE data type column

    I am trying to extract last 2 days data using date data type column with below query,
    select * from tbl
    where col < col -2;
    this is not showing me any data. please help where i am making mistake. guide please. thx

    Hi,
    When you say "last 2 days" do you mean the 48 hours right before run-time?
    If so, you want to compare col to SYSDATE:
    select  *
    from    tbl
    where   col  >  SYSDATE - 2
    and     col  <= SYSDATE
    ;If you mean the "last 2 days" before some other event, then replace SYSDATE with that date in both places above.
    If you were trying
    where   col  >  col - 2then you should have been getting all rows that have a non-NULL col. If you were getting no results, then something is very wrong.
    I hope this answers your question.
    If not, post a little sample data (CREATE TABLE and INSERT statements, relevant columns only) for all the tables involved, and the results you want from that data.
    If the results depend on when you run the query, then give a couple of different examples, with the run-time. for example "If I run this at 03:00:00 on July 1, 2012, then I should get ... but if I run ir at 15:00:00 on July 1, 2012, then the results should be ...".
    Explain, using specific examples, how you get those results from that data.
    Always say what version of Oracle you're using.
    See the forum FAQ {message:id=9360002}

  • How to change data type of content type column.

    Hi all,
    I am having one content type. I have 10 columns in it. There are two rich text columns in my content type. I have attached this content type to pages library. I want to change the data type of this rich text column  to "Full
    HTML content with formatting and constraints for publishing".
    Please assist me with this issue.
    amol

    Hi,
    From your description, my understanding is that you want to change the data type for rich text column in content type.
    The field type of Full HTML content with formatting and constraints for publishing is "Invalid", you could refer to this article:https://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spfieldtype.aspx.
    You also could test it by create a Full HTML content with formatting and constraints for publishing column and get the its type with C# code below:
    //change the URL to your SharePoint site
    using (SPSite site = new SPSite("http://sp/sites/sharepoint2013"))
    using (SPWeb web = site.OpenWeb())
    SPFieldType type = web.Fields["Column name"].Type;
    I have tested it with the PowerShell, it cannot hange the rich text column to “Full HTML content with formatting and constraints for publishing” column. If you want to edit the rich text column, you could not change the type of the column as the screenshot
    below:
    As a workaround, you could follow these steps to accomplish your requirement:
    Create a “Full HTML content with formatting and constraints for publishing” type column in the content type.
    Enter your site columns by clicking gear icon -> Site Settings -> Site columns under Web Designer Galleries under section.
    Find and delete the rich text column you want to change.
    Find the column you have created in step 1, and change the column’s name to the name of the text column you have deleted in step 3.
    But you will lose the data of the rich text column in pages library with this method.
    Best Regards,
    Vincent Han
    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

  • Error changing data type to date in column containing blanks

    I am pulling data from an OLAP cube into PowerPivot. My data set contains several date columns wich are formatted as YYYY-MM-DD string values. After successfully importing the data, I am trying to set the data type of these columns to date.
    Apparently, when the column contains blank values, the conversion fails:
    The following system error occurred:  Type mismatch. Datatype conversion failed for [Table: 'SO fact table', Column: 'Shipping Date LastDateDate', Value: ''].
    When the column contains no blanks, the conversion succeeds.
    Would anyone have an idea for working around this issue ?
    Is there some MDX magic that I could use in my query in order to cast blank dates to something that PowerPivot would accept to convert, or to make the conversion to the date format right at the source ? 

    Hello,
    I did a quick test with data from Excel sheet formatted as text containing ISO date values with one blank value, in Power Pivot I then changed it to type "Date" and it works without an issue; so it must have an other reason:
    You can try to use the
    DAX function "DateValue" to convert the values
    Olaf Helper
    [ Blog] [ Xing] [ MVP]

  • How to dynamically change data type

    Hi 
    Let say I have 1 byte in the folowwing hex format (1F )
    Then if I say convert it to 24 bit then the number should become 1F 00 00 and if I say convert it 32 bit the number should become 1F000000
    Could you please help me to implement this in LabVIEW ?
    Thanks

    Ah right, now I see why you mentioned dynamically changing the data type - LabVIEW is a strictly typed language which means you must end up with one of the numeric formats in LabVIEW (with 64-bits being the largest). If you're going to have more than 8 bytes, I'm not sure what the solution would be, if you're going to have 8 bytes or less then I would just assume the worst case and convert/fit the numbers into a U64.
    Here's an example:
    I am starting off with an empty U64, taking each input byte and shifting the U64 left by one byte and then adding the input byte.
    I guess that leads to my next question - what are you going to do with the numbers? Would having an array of U8's or converting the bytes to a character string not be better? If you have a string or array these can have a dynamic length so you can more easily manipulate the data (e.g. by performing string/array indexing functions).
    Certified LabVIEW Architect, Certified TestStand Developer
    NI Days (and A&DF): 2010, 2011, 2013, 2014
    NI Week: 2012, 2014
    Knowledgeable in all things Giant Tetris and WebSockets

  • Data type column size does not match size of values returned

    I've tried searching but couldn't find what I was looking for, sorry if this has been answered or is a duplicate.
    I am using the (Java) method below to get the column definitions of a table. I am doing this through an ODBC connection (using Oracle ODBC driver) and I have NO CHOICE in the matter.
    The problem I am having is that one particular column has a column size is smaller than the size of the data it purportedly holds (ie attendance_code = varchar size 3 but data value is "Absent". I suspect the data is actually a look up to situation, where my attendance_code column has a value of 'ABS' and Oracle goes and fetchs the "Absent" value.
    My issue is that the meta data returned from ODBC is the actual column definition (ie varchar(3) and not varchar2(10) for example).
    The resultset metadata has a size of 3 for the column in question, and querying the schema also yields 3 for that column.
    How do I resolve this? I do not have access to all_columns table etc. I have to do it using ODBC metadata only.
    I've tried recreating the situation using the Oracle XE DB, but as I am not familiar with Oracle, I do not know how to recreate this scenario (which would then lead me to test other options with ODBC).
    TIA.
    The select I am using is SELECT * FROM <tableName>.
    public ArrayList<SchemaColumn> getColumnsForTable(String catalog,
    String schema,
    String tableName) {
    ArrayList<SchemaColumn> columns = new ArrayList<SchemaColumn>();
    ResultSet rs = null;
    try {
    DatabaseMetaData metaData = connection.getMetaData();
    rs = metaData.getColumns(catalog, schema, tableName, "%");
    SchemaColumn column;
    while (rs.next()) {
    column = new SchemaColumn();
    column.setName(rs.getString("COLUMN_NAME"));
    column.setDataType(rs.getInt("DATA_TYPE"));
    column.setTypeName(rs.getString("TYPE_NAME"));
    column.setColumnSize(rs.getInt("COLUMN_SIZE")); <-------- this is the value that is coming back smaller than the data it actually returns
    column.setDecimalDigits(rs.getInt("DECIMAL_DIGITS"));
    column.setNumPrecisionRadix(rs.getInt("NUM_PREC_RADIX"));
    column.setNullable(rs.getInt("NULLABLE"));
    column.setRemarks(rs.getString("REMARKS"));
    column.setDefaultValue(rs.getString("COLUMN_DEF"));
    column.setSqlDataType(rs.getInt("SQL_DATA_TYPE"));
    column.setSqlDateTimeSub(rs.getInt("SQL_DATETIME_SUB"));
    column.setCharOctetLength(rs.getInt("CHAR_OCTET_LENGTH"));
    column.setOrdinalPosition(rs.getInt("ORDINAL_POSITION"));
    columns.add(column);
    } catch (Exception e) {
    Log.getLogger().error("Could not capture table schema");
    closeResultSet(rs);
    return columns;
    }

    I can't say I've ever seen a case where a column held more data than it was declared as, and would have to file that under "see it to believe it" category.
    Even if that somehow were the case, I'd expect the ODBC driver to return what the column is defined as anyway, not the data. The data changes with every row, but I'd expect the table metadata to be consistent, and refer to the table definition.
    For grins though, can you provide system.out.println output of the metadata, and also a "describe xxxx" from sqlplus if you can, where xxx is the table name?
    ie,
    while (rs.next()) {
    System.out.println("column name is " + rs.getString("COLUMN_NAME"));
    System.out.println("data type is " + rs.getInt("DATA_TYPE"));
    ..etc..
    Greg

  • How to change data type from Integer to Double?

    In a data set, BIP treat Oracle number type column as Integer. How to change it to double?

    Hi,
    This could be possible with the tcode RSD2 in BW.
    But before you do this you need to remove this KF from the cubes/dso in which they are used.Otherwise i don think you can do this.
    Once the change is done you could add them back to the DataTargets and load the data as required.
    Regards,
    Anoop

  • How to edit/change data type on report that was selected by mistake

    Hello there
    I created a report in APEX and one column is giving error because the data type of one column supposed to be a varchar2 but somehow the report was created with a Date data type. I want to change the data type without recreating the whote report. Can someone help? I tried to edit the report but couldn't be able to figure out.
    HELP....

    I found a solution for this, thank you.

  • Changing data types in database

    Hi,
    We are using Oracle 10g database.
    We changed the data type from DateTime to DateTimestamp. There are a whole bunch of joins defined in Discoverer's EUL. is there a work around this as all the reports written is not working because of this change?
    Thanks.

    Hi,
    I assume you mean the joins in the EUL. Then, no, if you remap the folders the joins will follow. However, if you use timestamps datatypes in your joins then the column will be converted to date before the data is joined.
    Rod West

Maybe you are looking for

  • Get value from Table/Recordset Cell into a JSP variable

    Can anyone please help with this ?... I need to get a cell value from a selected row of a table into a variable to pass to a java bean. 1 - The dynamic table is populated by a recordset named "rs" and has a submit button for each row . 2 - The user c

  • A JavaBean that gives information about a job - saving parameter problem

    Hi, I'm working on a Java-Applet that gives the user some information about the running job. I modified a solution from Casey Bowden (thx to him) that lanches a seperate applet, from the current forms session, to update the user on the status of the

  • Why can't Acrobat Pro find printers?

    I have been running Acrobat Pro 8 on Vista Business for more than two years and suddenly, it cannot find our networked printers. Alll other software loaded on the computer, including Adobe Reader 9, print without any problems and Acrobat Pro used to.

  • Releasing Memory

    Following observations were made in the task manager of windows NT for Oracle.exe initially process Oracle.exe was taking CPU 00 and MEM USAGE 52604 K then a INSERT Is issued for insertion of about 50,000 records process Oracle.exe was taking CPU 99

  • IE10 Previewing issue when creating a 240x320px prototype

    I am creating a prototype for a screen that is 240x320px in size and since updating to the latest IE 10 release today it now blows the live BC live preview out to full screen. Has anyone else had a similar issue? If so is there a fix for it, either w