global_name of Oracle database
Global_name of the Oracle database, as mentioned in the database link and global_names parameters, when setting the Global_names initialization parameter to TRUE, the local database link name must be GLOBAL_ with the remote database Name is the same, you can use database links normally. Then how to query the database global_name it.
Sql> Col global_name for A30
Sql> select * from Global_name;
Global_name
------------------------------
Dmdb
So how to modify Global_name.
ALTER DATABASE
RENAME Global_name to New_name;
Be careful not to use the update global_name set global_name= "to set Global_name to NULL, otherwise the database will not start, and the error is reported ora-00600[18061] or ora-00600[18062." You cannot open it until you restore it with a backup. (see Metalink note 743676.1).
So what kind of object is Global_name?
Sql> Select Owner,object_name,object_type from dba_objects where object_name= ' global_name ';
OWNER object_name object_type
---------- -------------------- --------------------
SYS Global_name VIEW
Public global_name synonym
Sql> Select text from dba_views where view_name= ' global_name ';
TEXT
----------------------------------------------------------------
Select value$ from sys.props$ where name = ' Global_db_name '
You can see that global_name is actually a view, derived from the sys.props$ table, and this table is a very important table about database properties, don't change the contents of this table at will, otherwise it can cause unexpected and irreparable loss.
When you use alert database rename Global_name, if you set a global_name similar to "dmdb.com" name, then change the name later, there is no conventional way to remove "." Separator.
Sql> select * from Global_name;
Global_name
------------------------------
Dmdb
sql> ALTER DATABASE rename Global_name to dmdb.com;
Database altered.
Sql> select * from Global_name;
Global_name
------------------------------
Dmdb.com
sql> ALTER DATABASE rename Global_name to dmdb.cn;
Database altered.
Sql> select * from Global_name;
Global_name
------------------------------
Dmdb. CN
sql> ALTER DATABASE rename Global_name to Dmdb;
Database altered.
Sql> select * from Global_name;
Global_name
------------------------------
Dmdb. CN
sql> ALTER DATABASE rename Global_name to DM;
Database altered.
Sql> select * from Global_name;
Global_name
------------------------------
Dm. CN
sql> ALTER DATABASE rename Global_name to dm.com.cn;
Database altered.
Sql> select * from Global_name;
Global_name
------------------------------
DM.COM.CN
sql> ALTER DATABASE rename Global_name to Dmdb;
Database altered.
Sql> select * from Global_name;
Global_name
------------------------------
DMDB.COM.CN
sql> ALTER DATABASE rename Global_name to dmdb.net;
Database altered.
Sql> select * from Global_name;
Global_name
------------------------------
Dmdb.net
To remove the dot delimiter, use update only:
sql> Update global_name set global_name= ' Dmdb ';
1 row updated.
Sql> commit;
Commit complete.
Sql> select * from Global_name;
Global_name
------------------------------
Dmdb
Solemn tip: Unless you have to, do not update the Global_name view, immediate update, do not update the Global_name base table props$, not to update global_name to empty. #数据库