用户通过DB Link对remote DB的表进行插入操作,报如下的错误:
ORA-04502: error occurred when looking up remote object
ORA-00604: error occurred at recursive SQL level 1
ORA-02020: too many database links in use
通过oerr查询oracle对02020错误的解释
[oracle@TEST ~]$ oerr ora 02020
02020, 00000, "too many database links in use"
// *Cause: The current session has exceeded the INIT.ORA open_links maximum.
// *Action: Increase the open_links limit, or free up some open links by
// committing or rolling back the transaction and canceling open
// cursors that reference remote databases.
由于open_links参数达到最大值导致的错误.
查看open_links参数的设置
SQL> show parameter link
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
open_links integer 4
open_links_per_instance integer 4
决定修改open_links参数,发现这个参数不能动态修改
查看数据库是否使用spfile
SQL> show parameter spfile;
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
spfile string /u01/app/oracle/oracle/product
/10.2.0/db_1/dbs/spfilesfcsys.ora
先修改open_links,找个合适的时间申请停机维护,让修改生效
SQL> alter system set open_links=12 scope=spfile;
在查看open_links的设置时注意到还有另外一个参数open_links_per_instance,决定查看一官方文档弄清楚这两个参数的数据含义
open_links:一个会话最多同时打的对remote database的连接数(oracle文档原文: OPEN_LINKS specifies the maximum number of concurrent open connections to remote databases in one session.)
OPEN_LINKS_PER_INSTANCE: specifies the maximum number of migratable open
connections globally for each database instance.
更详细的内容请自己查阅Oracle® Database Reference 10g Release 2 (10.2) B14237-03文档
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/7419833/viewspace-618011/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/7419833/viewspace-618011/