首页 > Linux操作系统 > Linux操作系统 > ORA-24777:
今天遇到了ORA-24777错误,通过METALINK
ORA-24777: use of non-migratable database link not allowed
Cause: The transaction, which needs to be migratable between sessions, tried to
access a remote database from a non-multi threaded server process.
Action: Perform. the work in the local database or open a connection to the re
mote database from the client. If multi threaded server option is installed, con
nect to the Oracle instance through the dispatcher
感觉有点不知所云,然后看了下BAIDU发现很多同学都是设置了shared dblink 来解决的然后看了shared DBLINK的概念:
*********************************************************** This article is being delivered in Draft form. and may contain errors. Please use the MetaLink "Feedback" button to advise Oracle of any issues related to this article. ************************************************************* PURPOSE ------- UNDERSTANDING AND CONFIGURATION OF SHARED DATABASE LINKS SCOPE & APPLICATION ------------------- Every application that references a remote server using a standard database link establishes a connection between the local database and the remote database. Many users running applications simultaneously can cause a high number of connections between the local and remote databases. Shared database links enable you to limit the number of network connections required between the local server and the remote server. To use shared database links, the local server must run in multi-threaded server (MTS) mode. The remote server can either run in MTS mode, or it can run in dedicated server mode. Shared Database Links ----------------------------- Shared database links are different from standard database links in two ways: Network connections made with shared database links can be shared among those, that use the same database link schema object. When a user needs to make a connection to a remote server from a particular database link. The user can reuse the connections already established to the remote server. When you use a shared database link, a network connection is established directly out of the shared server on the local server. For a non shared dblink, if the local server was a multi-threaded server, this connection would have been established through the local dispatcher requiring data to go through that dispatcher. A rule of thumb is to use shared dblinks when the number of users accessing a dblink is expected to be much larger than the number of shared servers in the local database. Otherwise, if you have one user and ten shared servers that user can require up to 10 connections to the remote server. Each shared server may have established a connection to the remote server, since each shared server may have been used by that user. In this case, you would want to use a standard database link. Configuration of Shared Database Links --------------------------------------- To create a shared dblink you use the Shared parameter in the sql create database link command: CREATE SHARED DATABASE LINK[CONNECT TO IDENTIFIED BY ]|[CONNECT TO CURRENT_USER] AUTHENTICATED BY IDENTIFIED BY [USING ' ']; Whenever you create a Shared Database Link, the clause AUTHENTICATED BY is required. There must be an account on the remote database with the specified USERID/PASSWORD and CREATE SESSION privilege. No other privileges are required.
http://www.eygle.com/archives/2007/11/howto_change_global_name.html
我们应该都很熟悉global_name这个词,在进行db link的创建时,通常都需要关注一下global_name.
注意,我这里说的不是初始化参数global_names。
通过视图global_name可以获得当前参数的设置:
SQL> select * from global_name;
GLOBAL_NAME
--------------------------------------------------
WAPDB.REGRESS.RDBMS.DEV.US.ORACLE.COM
那么这个global_name视图的数据来自何处呢?
通过global_name视图的创建语句我们可以获得如下信息:
create or replace view global_name
(global_name)
as
select value$ from sys.props$ where name = 'GLOBAL_DB_NAME'
我们看到global_name中的信息实际上是来自props$内部表的,取得的信息是其中的global_db_name字段。
SQL> select value$ from sys.props$ where name = 'GLOBAL_DB_NAME';
VALUE$
--------------------------------------------------
WAPDB.REGRESS.RDBMS.DEV.US.ORACLE.COM
SQL> select * from global_name;
GLOBAL_NAME
--------------------------------------------------
WAPDB.REGRESS.RDBMS.DEV.US.ORACLE.COM
这里得到的是通常数据库创建的缺省设置,在生产环境中,我们可以通过如下命令来修改Global_name:
SQL> alter database rename global_name to WAPDB.EYGLE.COM;
Database altered
SQL> select * from global_name;
GLOBAL_NAME
--------------------------------------------------
WAPDB.EYGLE.COM
这个global_name为什么很重要呢?
因为在创建db link的时候,db Link的最终格式与此相关,实际上global_name由两部分组成,DB_NAME和DB_DOMAIN。在创建db link的时候,Oracle会自动将db_domain作为后缀添加上去。而且一旦加入就很难变更。
所以在进行高级复制、Streams复制等配置时,最好首先将多个节点的global_name规划好。
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/7728585/viewspace-739428/ ,如需转载,请注明出处,否则将追究法律责任。