Table Name with more than 30 characters

14,024

Solution 1

All Oracle identifiers are limited to 30 characters. There is no option that lets you change that.

Solution 2

Synonyms will NOT work: source. Limits of 30 are hard and fast.

EDIT: After continued research oracle docs Unless java is in place here per comments even a synonym will not work to allow the exceeding of 30 characters.

Long story Short: You can't do what you want to do in the oracle environment.

Share:
14,024
apaderno
Author by

apaderno

I am a Drupal fan. I am a site moderator, user administrator, and Git administrator on Drupal.org. My task is blocking spammers, but also helping users with promoting their activity, their content, and the modules they host on Drupal.org.

Updated on July 17, 2022

Comments

  • apaderno
    apaderno almost 2 years

    I have a table in a MySQL database. The name of the table is more than 30 characters long and I want to make the same table in Oracle 11g, but Oracle only allows tables with a maximum of 30 characters in the name.
    I can't change the name of the table to make it less than 30 charachters, because the system is based on these tables, and it will cost me a lot if I change the name, so changing the table name is not the answer I am looking for.

    There is a table called user_tables, and when I describe the table it says the the table_name field has a datatype varchar2(30), so I tried to alter the table and make the table_name varchar2(255) but I couldn't, it gives me an error saying:

    ORA-00942: table or view does not exist

    I am connect as sys.

    Does anyone know how to solve my problem?

    • xQbert
      xQbert over 12 years
      Don't know if synonyms support characters over 30; but it may be a work around. The functional maximum length of the synonym name is 32 bytes. Names longer than 30 bytes are permitted for Java functionality only. If you specify a name longer than 30 bytes, then Oracle Database encrypts the name and places a representation of the encryption in the data dictionary. The actual encryption is not accessible, and you cannot use either your original specification or the data dictionary representation as the synonym name.link
    • eaolson
      eaolson over 12 years
      user_tables is part of the data dictionary, a set of read-only tables and views. You can not update any of the objects in the data dictionary.
    • Ben
      Ben over 12 years
      And if you could update the system tables you have absolutely no idea what effect it might have on every other system table.