Important Rule Change to Object Naming in Oracle
Problems with the 30-character limit are now in the past — both when it comes to migration projects and when it comes to giving meaningful object names.
Join the DZone community and get the full member experience.
Join For FreeOracle 12c Release 2 has recently been made available for end users. In this article, I would like to mention the important rule change in object naming standards with Oracle 12c Release 2.
One of the problems we often encounter when developing on Oracle DB is the 30-byte (known as 30 characters) limit on object naming. Despite the fact that object names are the most important indications of objects, we often could not give enough open object names because of this character limit. This situation could become even tougher when it comes to moving objects (i.e. table-view) from databases that have an object naming limit larger than Oracle.
With Oracle 12c Release 2, the name limit to be given to objects has been changed from 30 bytes to 128 bytes (128 characters if we use 1-byte characters) — a huge change!
Now, let's see what happened before Oracle 12c R2:
CREATE TABLE SATIS_YENI_DONUSUM_RAPORLARI_2016
(
DONEM NUMBER,
URUN_KODU NUMBER,
TUTAR NUMBER
);
ORA-00972: identifier is too long
CREATE TABLE SATIS_YENI
(
DONEM_DONEM_DONEM_DONEM_DONEM_DONEM NUMBER,
URUN_KODU NUMBER,
TUTAR NUMBER
);
ORA-00972: identifier is too long
As you can see, I gave the table name in the first example and the column name in the second example above the 30-character limit. In both cases, I got the same error and could not complete the operation.
Now, let's see what we can do with the new update:
CREATE TABLE SATIS_YENI_DONUSUM_RAPORLARI_2016
(
DONEM_DONEM_DONEM_DONEM_DONEM_DONEM NUMBER,
URUN_KODU_URUN_KODU_URUN_KODU_URUN_KODU_URUN_KODU_URUN_KODU NUMBER,
TUTAR_TUTAR_TUTAR_TUTAR_TUTAR_TUTAR NUMBER
);
Table SATIS_YENI_DONUSUM_RAPORLARI_2016 created.
SELECT * FROM SATIS_YENI_DONUSUM_RAPORLARI_2016;
CREATE VIEW VW_SATIS_YENI_DONUSUM_RAPORLARI_2016
AS
SELECT 1 TEST FROM DUAL;
VIEW VW_SATIS_YENI_DONUSUM_RAPORLARI_2016 created.
As you can see in the examples, I could give names up to 128 characters.
I think that the problems we are experiencing with the 30-character limit are left behind (both when it comes to migration projects and when it comes to giving meaningful object names).
Opinions expressed by DZone contributors are their own.
Trending
-
The SPACE Framework for Developer Productivity
-
Design Patterns for Microservices: Ambassador, Anti-Corruption Layer, and Backends for Frontends
-
A Complete Guide to AWS File Handling and How It Is Revolutionizing Cloud Storage
-
Observability Architecture: Financial Payments Introduction
Comments