Home| Progetto| Web| Faq| Acronimi | ||||||||||||
Argomenti Documenti pubblicabili:1120
Scripts:1282 Documenti non pubblicabili:162 Categorie tematiche:68 .Net |_C# |_Visual basic.net |_Asp.net Active Server Pages C++ Cascade Style Sheet JavaScript Mysql Php Xml Java |_Java 2 Micro Edition |_Java server pages |_Java Servlet Oracle |_PLSQL PostgreSQL Unix
Oracle...
Info:
Conversioni implicita tipi
Oracle...
Script:
dbms_output.put_line
Unix...
Tip:
Rimuovere un file in Unix / Delete a file
PLSQL...
Script:
Cursore implicito SQL
Oracle...
Tip:
LICENCE_MAX_USERS
Oracle...
Faq:
Rename column
Shell scripting...
Script:
Array in do while construct
La rabbia è creativa, la depressione è senza utilità
Dyson, Freeman J.
Php Funzione mail()
Charles Babbage(1791-1871) nel 1823 ottenne dal governo 100 Sterline per la costruzione del calcolatore Different Engine.
La rabbia è creativa, la depressione è senza utilità
Dyson, Freeman J.
|
Oracle
Home >Oracle > Quick guide on oracle database objects and namespaces naming rules and guidelines
It is of the utmost importance to follow some naming standards and guidelines in the process of designing Oracle database. Frequently a database with poorly naming standards unveils bad design, planning and organization. Good naming policy reflects strong design and helps programmer to work faster and smoother. It is even more important when the database containing hundreds of tables and thousands of other objects. The project leader should always adopt a naming convention, write it down and enforce it. Naming characters length rules. One byte is usually means one character. Database name max length is 8 bytes, database link up to 128 bytes, all other database objects (schema/user, table, column, view, procedure, etc.) up to 30 chars and no more, try to keep anyway schema names shorter as much as you can. When trying to create an object with a name longer then allowed, Oracle returns:
ORA-00972: identifier is too long
Only letters, numbers, and the underscore are allowed in names. Although Oracle allows special chars such as $, #, % they are not necessary and may cause unexpected problems. If an object identifier includes multiple parts separated by periods, then each attribute can be up to 30 bytes long:
"schema"."table"."column"
If Objects share a namespace they cannot have the same name. The following schema objects share one namespace:
Within the same schema there cannot exist two objects of the same namespace with same name. SQL> create view t1 as select * from all_objects; View created. SQL> create table t1 (n number); create table t1 (n number) * ERROR at line 1: ORA-00955: name is already used by an existing object
So these objects can be named as objects in different namespace. Thought it is not recommended, in the same schema you may have table and index with same name: SQL> create table test.x1 (n number); Table created. SQL> create index test.x1 on x1(n); Index created. Each schema in the database has its own namespaces for the objects it contains. This means, for example, that two tables in different schemas are in different namespaces and can have the same name. -- in the example customer and catalog are schema names create table customer.t1 (n number); create table catalog.t1 (n number); The following non schema objects also have their own individual namespace:
Naming conventionsGenerally, db objects naming policy should refer to common programming principles, objects and variables naming rules.In Oracle usually, object name cannot begin with numbers, with special chars: CREATE TABLE 1t (n number) * ERROR at line 1: ORA-00903: invalid table name By default object name is case insensitive and oracle store names in its catalogue all in upper case SQL> select object_name from all_objects order by 1; OBJECT_NAME ------------------------------ BOOTSTRAP$ CON$ C_TS# IND$ I_COL2 I_CON2 (...) By standards, when an object is created it is stored as uppercase. So it is very convenient retrieve in the catalogue views info about the object without worrying about upper or lower case. SQL> create table My_numbers (n number); select table_name from user_tables where table_name = 'MY_NUMBERS'; Table created. SQL> TABLE_NAME ------------------------------ MY_NUMBERS Forcing naming standard (not recommended)It is possible forcing default naming rules using double quotes (") around the object name.Double quotes allow you to specify upper and lower case, and having object name beginning with number or special char. SQL> Drop table MY_NUMBERS; SQL> create table "My_Numbers" (n number); SQL> select table_name from user_tables where table_name = 'My_Numbers'; TABLE_NAME ------------------------------ My_Numbers SQL> Create table "%t" (n number); Table created. SQL> Create table “$t" (n number); Table created. SQL> create table "1t" (n number); Table created. Note that If you use doublequotes (") and user chars lower case to create an object, when searching its info in the dictionary it is necessary referring to the object exactly by its name (case sensitive) : -- the praeviously created table My_Numbers must be referred case sensitive -- otherwise not results from dictionary’s queries SQL> select table_name from user_tables where table_name = 'MY_NUMBERS'; no rows selected --- or if you like to drop it SQL> Drop table MY_NUMBERS; Drop table MY_NUMBERS * ERROR at line 1: ORA-00942: table or view does not exist -- to drop it use drop table "My_Numbers"; SQL> insert into "My_Numbers" values (2); 1 row created. Suggestion: keep everything in the old standard way, do not use " when create an objects, search and management it easy and clean, unless you have real reasons to differentiate within lower and upper case. Try to keep object name short (around 20 chars) while meaningfully. Rarely there is the need to name and referring objects with lower and uppers or with special chars. To differentiate class of objects in the same namespace us, for examples, prefixes: US_LOG, AP_LOG for the user and application log tables. Most of it, as always, keep it simple. Warning: include(ads/text468x15.html): failed to open stream: No such file or directory in D:\inetpub\webs\fishscriptcom\documents\view_document.php on line 131 Warning: include(): Failed opening 'ads/text468x15.html' for inclusion (include_path='.;C:\php\pear') in D:\inetpub\webs\fishscriptcom\documents\view_document.php on line 131 Tutorial ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Script ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Comandi ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Codici errore ![]() ![]() ![]() ![]() ![]() |
Cerca
Oracle...
Info:
Spazio su disco per motore Oracle 10g
Il web è un giovane media: infatti ha solo 10 anni di età.
Si pensi alla televisione o al cinema all'età di 10 anni. A quei tempi questi media erano primitivi, ancora alla ricerca della loro strada.
Venivano esplorati i limiti della nuova tecnologia, ma grandi progressi dovevano ancora essere raggiunti.
Oggi, i professionisti del web si trovano nella stessa fase. Sono pionieri che stanno ancora esplorando i limiti del nuovo media. Senza dubbio, i nostri nipoti, quando vedranno quello che abbiamo fatto pensaranno a qualcosa di elementare.
C'è ancora molto da scopire su quello che il Web può fare e suo come può essere utilizzato.
Jason Foss
Il web è un giovane media: infatti ha solo 10 anni di età.
Si pensi alla televisione o al cinema all'età di 10 anni. A quei tempi questi media erano primitivi, ancora alla ricerca della loro strada.
Venivano esplorati i limiti della nuova tecnologia, ma grandi progressi dovevano ancora essere raggiunti.
Oggi, i professionisti del web si trovano nella stessa fase. Sono pionieri che stanno ancora esplorando i limiti del nuovo media. Senza dubbio, i nostri nipoti, quando vedranno quello che abbiamo fatto pensaranno a qualcosa di elementare.
C'è ancora molto da scopire su quello che il Web può fare e suo come può essere utilizzato.
Jason Foss
Oracle...
Info:
SHARED_SERVER
Oracle...
Citazioni:
Designing an efficient Schema ...
Oracle...
Definizioni:
Variabile bind
Oracle...
Definizioni:
Scalar Subquery
Shell scripting...
Script:
Array
fishScript.Com is accessible by Mobile access technology
as mobile phones, Palm and Pocket PC .
Nicoleta e Marco Magnani tutorial, examples, courses, esempi, corsi, esercizi, appunti vari Dottoressa Nicoleta Dragu Formatrice Docente Insegnante Mediatrice Culturale Dott. Marco Magnani Universita La Sapienza Roma Master Computer Science Hunter College New York , Data Base Administrator DBA oracle System architect |