Create a db_link__oracle with no domain name in Oracle 10g

Source: Internet
Author: User
Create a db_link with no domain name in Oracle 10g:
The records are as follows:
It is invalid to restart the database with ALTER statement this modification method.
ALTER DATABASE rename Global_name to ORCL;
--use ALTER statement This modification method, restart the database, valid. But not the result I want, although the domain name changes after the shortened, but the establishment of db_link and domain names exist.
ALTER DATABASE rename Global_name to ORCL. qiangguo.com;
--Use UPDATE statement This modification method, restart the database, valid. Create Db_link no domain name exists.
Update global_name set global_name= ' ORCL ';
Microsoft Windows [version 5.2.3790]
(C) Copyright 1985-2003 Microsoft Corp.
C:\Documents and Settings\administrator>sqlplus "/as SYSDBA"
Sql*plus:release 10.2.0.1.0-production on Wednesday March 19 14:22:37 2008
Copyright (c) 1982, +, Oracle. All rights reserved.
Connect to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0-production
With the partitioning, OLAP and Data Mining options
Sql> Show parameter global_name;
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
Global_names Boolean FALSE
Sql> Show Parameter Global_name
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
Global_names Boolean FALSE
Sql> select * from Global_name;
Global_name
--------------------------------------------------------------------------------
ORCL. Regress. Rdbms. DEV. US. Oracle.com
sql> ALTER DATABASE rename Global_name to ORCL;
The database has changed.
Sql> select * from Global_name; As you can see here, the direct modification of global_name to "ORCL" does not work.
Global_name
--------------------------------------------------------------------------------
ORCL. Regress. Rdbms. DEV. US. Oracle.com
sql> shutdown immediate;
The database has been closed.
The database has been unloaded.
The ORACLE routine has been closed.
Sql> Startup
The ORACLE routine has started.
Total System Global area 289406976 bytes
Fixed Size 1248576 bytes
Variable Size 134218432 bytes
Database buffers 146800640 bytes
Redo buffers 7139328 bytes
Database loading complete.
The database is already open.
Sql> select * from Global_name; ---Restart the database, it still does not work, Global_name has not become the "ORCL" I want.
Global_name
--------------------------------------------------------------------------------
ORCL. Regress. Rdbms. DEV. US. Oracle.com
sql> ALTER DATABASE rename Global_name to ORCL. qiangguo.com; -If modified to "ORCL" with the domain name. Qiangguo.com ", the restart database will work, the domain name has changed.
The database has changed.
Sql> select * from Global_name;
Global_name
--------------------------------------------------------------------------------
ORCL. Qiangguo.com
sql> ALTER DATABASE rename Global_name to ORCL; -Try again to "ORCL", still not.
The database has changed.
Sql> select * from Global_name;
Global_name
--------------------------------------------------------------------------------
ORCL. Ahdx.com
sql> Update global_name set global_name= ' ORCL '; --If you use the UPDATE statement to modify, restart the database, successful. Ha ha.
1 rows have been updated.
Sql> select * from Global_name;
Global_name
--------------------------------------------------------------------------------
ORCL
Sql> select * from Global_name;
Global_name
--------------------------------------------------------------------------------
ORCL
Sql> commit;
Submit completed.
sql> shutdown Immediate
The database has been closed.
The database has been unloaded.
The ORACLE routine has been closed.
Sql> Startup
The ORACLE routine has started.
Total System Global area 289406976 bytes
Fixed Size 1248576 bytes
Variable Size 134218432 bytes
Database buffers 146800640 bytes
Redo buffers 7139328 bytes
Database loading complete.
The database is already open.
Sql> SELECT * FROM global_name;--if you modify it with the UPDATE statement, restart the database successfully. Ha ha.
Global_name
--------------------------------------------------------------------------------
ORCL
Sql>
Analysis: Global_name View
The statement to create the Global_name view is as follows:
Create or Replace view Global_name
As
Select value$ from sys.props$ where name = ' Global_db_name '
You cannot directly modify the sys.props$ internal table, and you will be told that you have insufficient permissions.
So you can change it with update.
The verification is as follows:
Sql> select * from Global_name;
Global_name
--------------------------------------------------------------------------------
ORCL
Sql> Select value$ from sys.props$ where name = ' Global_db_name ';
value$
--------------------------------------------------------------------------------
ORCL
Sql> (Dynasty network wangchao.net.cn)
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.