ALTER Table of the default Oracle and the length of name of column Type

Hi all

I want to increase the length of the table names and the names of the columns in Oracle.

By default, it is set like this:

SQL > dba_tab_columns desc;

TABLE_NAME NOT NULL VARCHAR2 (30)
COLUMN_NAME NOT NULL VARCHAR2 (30)
...

Is it possible to change the VARCHAR2 (30) to VARCHAR2 (100)?

Published by: sukrandere on 12:21 10.Mar.2010

Table names and column are all two identifiers
According to the documentation, the maximum length of an identifier is 30 characters.
It is hard coded in the database software and you can't change it.
Or do you need to change.

---------------
Sybrand Bakker
Senior Oracle DBA

Tags: Database

Similar Questions

  • ALTER TABLE with the column NULL time consuming

    Hello

    I have a table with nearly 2 million documents (about 10 GB size table) when I perform the following change statement its run fast

    ALTER TABLE tbl_1 ADD (DEFAULT col_4 NUMBER 100 NOT NULL);

    but when I do not give the NOT NULL in the alter its taking a long time to complete this i.e tbl_1 of ALTER TABLE ADD (NUMBER col_4 by DEFAULT 100); once I do the column as NOT NULL.

    Can someone explain why is it happening like that regarding the execution point.

    Thanks in advance.

    I can reproduce the effect in 11.2.0.1 - but not in 12.1.0.1.

    drop table tbl_1;

    create table tbl_1

    as

    Select rownum id

    , lpad ('* ', 50,' *') padding

    of the double

    connect by level<=>

    ALTER TABLE tbl_1 ADD (NUMBER col_4 by DEFAULT 100);

    --> slow in 11.2.0.1; fast 12.1.0.1

    ALTER TABLE tbl_1 ADD (DEFAULT col_4 NUMBER 100 NOT NULL);

    --> Quick 11.2.0.1 and 12.1.0.1

    A SQL trace for two operations (11g) shows that the altar slow (without the constraint explicit non-null) made explicit (and tedious) update of any row in the table:

    Update 'TBL_1"set"COL_4"= 100

    call the query of disc elapsed to cpu count current lines

    ------- ------  -------- ---------- ---------- ---------- ----------  ----------

    Parse        1      0.00       0.02          0          1          0           0

    Run 1 11,63 33.56 8336 1016125 2053531 1000000

    Fetch        0      0.00       0.00          0          0          0           0

    ------- ------  -------- ---------- ---------- ---------- ----------  ----------

    Total 2 11,63 33,58 8336 1016126 2053531 1000000

    The other trace file does not contain the explicit Update. I guess in the optimized case that oracle stores somewhere that col_4 has the value 100 and updates only the line of the block after completing DML operations. But that's just a guess.

  • I have a table of the adf, I added a column that contains a button that I created, when I click it must remove this row in the table, but it is not, please help

    I have a table of the adf, I added a column that contains a button that I created, when I click it must remove this row in the table, but it is not, please help

    I don't understand. You use vo and eo for you to use business components.

    Again, this kind of code call in trouble.

    You must post the changes to make them visible to the eo find vo. You must then run the query for the changes in the business layer strips then you must update the iterator he table is based on.

    In your code I see that happen, hooch maybe because it is more often than not formatted and undocumented.

    My advice is to do a small test case that you can manage with easy sql. Once you get it to run transfer you the results to the actual application.

    Timo

  • ALTER TABLE SHRINK the SPACE COMPACT takes a long time

    Hello
    I run:
    ALTER TABLE TOM. TAB1 SHRINK SPACE COMPACT;
    ALTER TABLE TOM. TAB1 SHRINK SPACE WATERFALL;


    The "ALTER TABLE TOM. Tab1 SHRINK SPACE COMPACT"was completed in 2 hours, but"ALTER TABLE TOM. Tab1 SHRINK SPACE WATERFALL"is still underway after 8 hours, less than the size of the table TAB1 and index:

    NOM_SEGMENT... GB
    TAB1................................. 166
    IDX01................................ 83
    SYS_C00......................... 42
    IDX02............................. 142
    IDX03.............................. 66
    IDX04............................. 122


    Why 'SHRINK the SPACE COMPACT' takes a lot of time?
    Is it possible to check how much time should I take?

    Thanks in advance!

    Running

    ALTER INDEX TOM. TAB1_IDX03 SHRINK SPACE COMPACT;

    ALTER INDEX TOM. TAB1_IDX03 SHRINK SPACE;

    set is useless, as does 'SHRINK the SPACE' that means "SHRINK SPACE COMPACT" and much more (see the quote from the Doc Oracle Hemant).  2, 'SHRINK the SPACE' is the operation that will take more time.  So if 'SHRINK the SPACE' is what you wanted (reclaim space) and you can afford to wait, run 'SHRINK the SPACE' only.

    "SHRINK the COMPACT SPACE" is a part of the work that 'SHRINK the SPACE' is only.  Generally, use you it when time is at a premium: you run SHRINK SPACE COMPACT a weekday evening (because SHRINK the SPACE does not fit in one night and accrue hourly) and you run SHRINK SPACE on the weekend to finish following the recovery of your space.

    Regarding the fact that the entire segment or a partition after another, I have no experience - I both of their time and test methods.  Perhaps running several sessions at the same time on different partitions would save time (but be more heavy on the CPU and storage).

    Also note that SHRINK the AREA generates a lot of REDO (keep an eye on the free space of your ARCHIVELOG destination).  With your data volume, I would expect dozens (or even hundreds) of gigabytes of roll forward must be generated.

  • Multiple tables with the same field name

    Hi, I have a query that pulls a field named 'Total' from 20 different tables (week1 - semaine20). When I try to view the results as #Week1.Total #, for example, I get an error saying that Total is not defined in week1. I also tried totalHours.Week1.Total (totalHours is the name of my request), but get the same thing - Week1.Total is not defined in totalHours. Help, please! Thank you!

    Alias your colunms...

    SELECT
    request.ID, request. FirstName, request. LastName,
    Request.SEM, request.year, request.banner,
    Week1.id AS wk1_ID, Week1.Total AS wk1_total,
    Week2.id AS wk2_ID, Week2.Total AS wk2_total,
    Week3.id AS wk3_ID, Week3.Total AS wk3_total,
    Week4.id AS wk4_ID AS Week4.Total wk4_total...
    ... etc.

    They will now have different names in the output. (The table name prefix that is used in your query on each column is never displayed in the output.)

    Phil

  • The value of name of column

    Hi gurus

    I'm stuck on 1 Scenario and need your help. I have the following table:

    Create table

    drop table age_rate;

    CREATE TABLE age_rate
    (
    age_0_4 number 4,
    age_5_20 number 4,
    age_21_34 number 4,
    age_35_44 number 4
    );

    -------------------------------

    Insertion

    INSERT INTO age_rate

    SELECT 45, 50, 60, 90 double UNION ALL

    SELECT 45, 50, 60, 88 OF double UNION ALL

    SELECT the 40, 50, 60, 90 double UNION ALL

    SELECT 5, 50, 60 and 88 DOUBLE;

    -------------------------------

    Query on table

    SELECT * from age_rate;

    The query result

    age_0_4 age_5_20 age_21_34 age_35_44

    45                          50                     60                     90

    45                          50                     60                     88

    40                          50                     60                     90

    5                            50                     60                     88

    Power required

    Rate Min_age Max_age

    -The lower is age band 0_4

    45            0           4

    45            0           4

    40            0           4

    5              0           4

    -The lower is age band 5_20

    50            5           20

    50            5           20

    50            5           20

    50            5           20

    -The lower is age band 21_34

    60 21 34

    60 21 34

    60 21 34

    60 21 34

    -The lower is age band 35_44

    90 35 44

    88 35 44

    90 35 44

    88 35 44

    Rules

    -I have all the data in the rows each column online create separate lines and add 2 columns automatically Min_age and Max_age and insert the value on these columns based on the name of the column for example if the column name as age_0_4 then insert 0 in min_age and 4 in max_age means values for Min_age and Max_age extracted from the base of the column name. I don't know if it's possible or not, but I appreciate if someone can give me the solution for this problem... Do you like answers. Thank you


    Hello

    I'm not 100% sure what you want.  Do you want 16 production lines at a time, which is 4 lines of output for each line that is actually in the table?

    This looks like a job for the UNPIVOT operator:

    SELECTION rate

    min_age

    Case min_age

    WHEN 0 THEN 4

    WHEN 5 THEN 20

    WHEN 21 AND 34

    WHEN 35 THEN 44

    END AS max_age

    Of age_rate

    UNPIVOT (rate

    FOR min_age IN (age_0_4 0)

    age_5_20 AS 5

    age_21_34 AS 21

    age_35_44 AS 35

    )

    )

    ORDER BY min_age

    ;

  • I wish to see the sender's name first column when you view the Inbox before the subject? How can I fix this?

    I have been using Outlook for awhile now. I stayed at thunderbird recently. I feel good. However, I would like to know how to set the column first as the column message sender. I don't know that there should be a way to customize that? Help the mozilla team. Thank you, haris

    The buttons of the column can be moved in any order by drag-and - drop. Right click on a button in the column to select the columns to display.

  • Problem with the length of a CLOB data type

    Hello

    In my application, I have a page with an interactive report of written blogs - on this page, you can add a new blog (text box - CLOB data type), discovered a blog or edit a blog.
    There is something going wrong with the size of the blog text. I know APEX cannot accept that 32K text and I've seen the great value saving thread, but this isn't the solution to my problem.

    The problem is that when I add a blog with say about 4000 characters, it is saved in the database, but the interactive report, when I click on the view or edit icons for this blog, the blog text field appears empty. For small items (< 4000 characters), there is no problem.
    Anyone know why this is happening and how to fix this?
    Thank you!

    There seems to be a bug in the calculation of the value of the element Source when the Source Type is a SQL query and the data type of the selected column is CLOB. I'll file a bug for this. For now, I have demonstrated how you can use a type of function PL/SQL source instead. Please see point P3_TEXT:

    beginfor c1 in (select blog_textfrom blogwhere blog_id = :P3_BLOG_ID) loop  return c1.blog_text;end loop;return null;end;
    

    Scott

  • Index on the Table of the Publisher (the CDC configuration)

    We have installation Aync Auto Journal CDC on Oracle 11.1.0.7. Everything works well, but had a question about the performance of select on tables owned by the Publisher.

    According to my understanding, the changes are captured in the tables belonged to the Publisher and Subscriber had view based on these tables. Our data warehouse application reads these views (tables both editor)

    I'm not seeing any indexes on tables in the editor and see as bad performance on select on these views/tables. Thinking to create indexes on columns - CSCN$ ROW_ID$, on which we build our selection.

    Can someone share such an experience or any idea on this...?

    Thank you in advance!
    Mahesh

    Mahesh,

    I saw two or three questions identical to what you say. It is possible to create additional indexes on changing tables (the table of the editor you alluded) on columns as CSCN$, RSID$ etc. Since the imputation has fill in the change table, it would have a minor overload to fill these indices as well.

    Thank you
    Florent

  • OLIVIER, how to import a field in a particular table from the warehouse of dat

    Hello

    I'm trying to import a particular column in a table in the data warehouse to the RPD. where this column came from the etl mapping.
    In fact, I know how to import a table or a particular column in the RPD in a stand alone RPD. SO I just what to know it is the same process in out of box RPD or is it different?

    Thank you

    Published by: 990266 on March 4, 2013 08:50

    The same process.
    The method below would be easy to import.

    Expand the specific table in the physical layer, select any column duplicate and rename to actual or new column column and set the data type, save it.

    If brand aid

  • ALTER TABLE hf_altertest ADD COLUMN does not

    I am using ORACLE 11g and my FDI is Developer SQL 4.1.1

    It's all free PC version that has limits.

    I tried on:

    CREATE TABLE hf_altertest

    (

    contact_id INTEGER NOT NULL

    , name VARCHAR (25)

    , last_name VARCHAR (35)

    PRIMARY KEY (contact_id)

    );

    ALTER TABLE hf_altertest State to add a CHAR (2) COLUMN;

    But when I go to run the ALTER TABLE statement then I get following error:

    rror starting at line: 1 323 in command.

    ALTER TABLE hf_altertest State to add a CHAR (2) COLUMN

    Error report-

    SQL error: ORA-00904: invalid identifier

    00904, 00000 - '% s: invalid identifier '.

    * Cause:

    * Action:

    I can run the same code in MySQL without error.

    This leads me to think that maybe I'm just bumping into a limit in the free version of PC.

    Any thoughts?

    3003916 wrote:

    I am using ORACLE 11g and my FDI is Developer SQL 4.1.1

    It's all free PC version that has limits.

    ALTER TABLE hf_altertest State to add a CHAR (2) COLUMN;

    But when I go to run the ALTER TABLE statement then I get following error:

    rror starting at line: 1 323 in command.

    ALTER TABLE hf_altertest State to add a CHAR (2) COLUMN

    Error report-

    SQL error: ORA-00904: invalid identifier

    00904, 00000 - '% s: invalid identifier '.

    * Cause:

    * Action:

    I can run the same code in MySQL without error.

    This leads me to think that maybe I'm just bumping into a limit in the free version of PC.

    Any thoughts?

    There is no LIMIT to the 'free' version  If you read the error message he said THAT was not a valid identifier.  Just to show you that I tried your erroneous statement

    ALTER TABLE hf_altertest ADD COLUMN state2 CHAR(2);
    

    and here is the indicator error message in SQL +.

    SQL * more: Production of liberation 12.1.0.2.0 Tue Oct 15 14:34:57 2015

    Copyright (c) 1982, 2014, Oracle.  All rights reserved.

    Connected to:

    Oracle Database 11 g Enterprise Edition Release 11.2.0.4.0 - 64 bit Production

    With the partitioning, Real Application Clusters, Automatic Storage Management, OLAP

    and Data Mining options

    Add a COLUMN state2 TANK (2)

    *

    ERROR on line 2:

    ORA-00904: invalid identifier

    As you can see (and as the previous poster of response indicates), the 'COLUMN' KEYWORD is not necessary when adding new columns.  Only when 'RENAME' is used, then you add the keyword COLUMN.

    See the documentation for the syntax of ALTER TABLE here--> http://docs.oracle.com/database/121/SQLRF/statements_3001.htm#SQLRF01001

    See specific clause RENAME syntax here--> http://docs.oracle.com/database/121/SQLRF/statements_3001.htm#i2183480

  • foreign key ALTER TABLE QUERY PROBLEM

    HAI ALL,

    ANY SUGGESTION PLEASE?

    UNDER: foreign key ALTER TABLE QUERY PROBLEM

    I want TO CREATE AND ALTER TABLE foreign key:

    1.TABLE:HAEMATOLOGY1
    COLUMN: HMTLY_PATIENT_NUM
    WITH
    TABLE: PATIENTS_MASTER1
    COLUMN: PATIENT_NUM (THIS IS THE KEY PRIMARY AND UNIQUE)

    1.TABLE:HAEMATOLOGY1
    COLUMN: HMTLY_TEST_NAME
    WITH
    TABLE: TESTS_MASTER1
    COLUMN: TEST_NAME ((C'EST LA CLÉ UNIQUE))
    ---------------


    SQL + QUERY DATA:
    -----------
    ALTER TABLE HAEMATOLOGY1
    Key constraint SYS_C002742_1 foreign (HMTLY_PATIENT_NUM)
    references PATIENTS_MASTER1 (PATIENT_NUM);

    ERROR on line 2:
    ORA-01735: invalid option of ALTER TABLE

    NOTE: THE NAME OF THE CONSTRAINTS: SYS_C002742_1 TAKEN FROM ORACLE ENTP TABLE DETAILS. MGR.
    ---------
    ALTER TABLE HAEMATOLOGY1
    Key constraint SYS_C002735_1 foreign (HMTLY_TEST_NAME)
    references TESTS_MASTER1 (TEST_NAME);

    ERROR on line 2:
    ORA-01735: invalid option of ALTER TABLE

    NOTE: THE NAME OF THE CONSTRAINTS: SYS_C002735_1 TAKEN FROM ORACLE ENTP TABLE DETAILS. MGR.

    ==============

    4 TABLES OF LABORATORY CLINIC FOR DATA ENTRY AND GET REPORT ONLY FOR THE TESTS CARRIED OUT FOR PARTICULAR

    PATIENT.

    TABLE1:PATIENTS_MASTER1
    COLUMNS: PATIENT_NUM, PATIENT_NAME,

    VALUES:
    PATIENT_NUM
    1
    2
    3
    4
    PATIENT_NAME
    BENAMER
    GIROT
    KKKK
    PPPP
    ---------------
    TABLE2:TESTS_MASTER1
    COLUMNS: TEST_NUM, TEST_NAME

    VALUES:
    TEST_NUM
    1
    2
    TEST_NAME
    HEMATOLOGY
    DIFFERENTIAL LEUKOCYTE COUNT
    -------------

    TABLE3:HAEMATOLOGY1
    COLUMNS:
    HMTLY_NUM, HMTLY_PATIENT_NUM, HMTLY_TEST_NAME, HMTLY_RBC_VALUE, HMTLY_RBC_NORMAL_VALUE

    VALUES:
    HMTLY_NUM
    1
    2
    HMTLY_PATIENT_NUM
    1
    3
    MTLY_TEST_NAME
    HEMATOLOGY
    HEMATOLOGY
    HMTLY_RBC_VALUE
    5
    4
    HMTLY_RBC_NORMAL_VALUE
    4.6 - 6.0
    4.6 - 6.0
    ------------

    TABLE4:DIFFERENTIAL_LEUCOCYTE_COUNT1
    COLUMNS: DLC_NUM, DLC_PATIENT_NUM, DLC_TEST_NAME, DLC_POLYMORPHS_VALUE, DLC_POLYMORPHS_

    NORMAL_VALUE,

    VALUES:
    DLC_NUM
    1
    2
    DLC_PATIENT_NUM
    2
    3
    DLC_TEST_NAME
    DIFFERENTIAL LEUKOCYTE COUNT
    DIFFERENTIAL LEUKOCYTE COUNT
    DLC_POLYMORPHS_VALUE
    42
    60
    DLC_POLYMORPHS_NORMAL_VALUE
    40-65
    40-65
    -----------------


    Thank you
    RCS
    E-mail:[email protected]
    --------

    ALTER TABLE HAEMATOLOGY1
    ADD Key constraint SYS_C002742_1 foreign (HMTLY_PATIENT_NUM)
    references PATIENTS_MASTER1 (PATIENT_NUM);

  • change the length of field

    Using database Oracle 9.2.0.5 on Oracle Enterprise Linux and Oracle Report Builder 10.1.2.0.2 on Microsoft Windows XP Professional SP2.

    I have changed the length of a varchar2 column in my database from 4 to 8 and to update the fields that correspond to this column in my reports.

    How this is done?

    Open your query, add space and press OK... your domain should now reflect the changes made to the database.

  • Generate the DDL - change is a new column and I want to generate an alter table.

    All, morning

    I searched and searched all over the Data Modeler and I can't find this option... but I found it easily in the designer.
    I hope you can help me.

    V3.0.0.665 SQL Developer Data Modeler.

    I added a new column to a table, and when I generate the DDL I wish it were an alter table add column rather than a table to create.
    This feature is in the designer, so I think it would be in the Data Modeler.

    Just in case my description isn't clear, here are the high level steps, then it is clear.

    1 create logic model
    2. create the relational logic.
    3. create the physical relationship.
    4 generate the DDL and run in the database. At this point, I'm going to production with my system, and all right.
    5. at this point, we have an enhancement request. For the model, it will be a new column in a table.
    6. update of the logic model.
    7. relational update logic
    8 physical update of relational
    9 generate the DDL. Here, I would have generate it know that it needs to generate an alter table add column and does not create the table.
    This is something I do a lot as all my models are in production. I can't find how to do this step to get data Modeler to generate the altar.
    Designer done exceptionally well.

    Quite often, it is more than a single column. Changes can be many and made over time and at the time of generating the DDL you remember not every single amendment. To have the tool discover these changes for you and generate the appropriate DDL is a feature that I consider as very high.

    I hope that is clear and you can help me.

    See you soon
    Chris...

    Hi Chris,

    you need to compare your model on database - database relational model even import and use the option 'swap target' - in this case 'expressions of alter' against the database will be generated.
    You can watch demonstrations here http://www.oracle.com/technetwork/developer-tools/datamodeler/demonstrations-224554.html
    It would probably be more useful http://download.oracle.com/otn_hosted_doc/sqldev/importddl/importddl.html
    Sooner or later your changes will require the table to be recreated, and you will need to backup your data - you can consider using the 'Advanced DDL' option - script is generated that will land your table content (including LOBs) to the system of files accessible from the database and restore after changes. Well not try directly on the production system :).

    Philippe

  • Is it possible to create a shuttle component in Oracle ADF, where the available and selected lists are tables of the adf?

    Hi all


    We use JDeveloper Studio Edition Version 12.1.3.0.0 and deployed on GlassFish Server Open Source Edition 3.1.2.2 (build 5) and connect to the SQLServer database.


    Is it possible to create a shuttle component in Oracle ADF, where the available and selected lists are tables of the adf?



    I did a POC sample on it. I can share with you. I can't put in my dropbox because dropbox is blocked in my network. Share your email. I'll send the POC through

Maybe you are looking for