今日在做一个测试,测试内容为:A库同步DBLINK连接B库,当B库进程(process)数达到上限时,A库通过DBLINK再次连接B库会出现什么现象,
下面,我就带大家一起去做一个实验,验证一下会出现什么情况:
###修改B库process数
修改B库进程数process便于尽快验证结论,
SQL*Plus: Release 11.2.0.4.0 Production on Tue Jan 5 23:20:46 2016
Copyright (c) 1982, 2013, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> alter system set processes=5 scope=spfile; ---修改proces参数为5
System altered.
SQL> shutdown immediate; ---重启数据库使参数生效
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup; ---启动数据库
ORACLE instance started.
Total System Global Area 839282688 bytes
Fixed Size 2257880 bytes
Variable Size 566234152 bytes
Database Buffers 268435456 bytes
Redo Buffers 2355200 bytes
Database mounted.
Database opened.
SQL> show parameter processes
NAME TYPE VALUE
------------------------------------ ---------------------------------------------------------------- ------------------------------
aq_tm_processes integer 1
db_writer_processes integer 1
gcs_server_processes integer 0
global_txn_processes integer 1
job_queue_processes integer 1000
log_archive_max_processes integer 4
processes integer 40 --修改成5,怎么成40了
###查看预警文件
Tue Jan 05 23:22:36 2016
Adjusting the default value of parameter parallel_max_servers
from 40 to 10 due to the value of parameter processes (40)
意思是:受参数parallel_max_servers 限制,因此只能修改为40
###A库创建DBLINK到B库
CREATE PUBLIC DATABASE LINK LINK_XULQ CONNECT TO xulq IDENTIFIED BY "xulq"
USING '(DESCRIPTION=(CONNECT_DATA=(SID=XULQ))(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.56.12)(PORT=1521)))'
SQL> select count(*) from dual@link_xulq;
COUNT(*)
----------
1 ---测试连接正常
###设法发出40个进程
测试时,使用TOAD不断进行连接,当达到process上线时,再次,从A库连接B库报错如下:
ORA-02019: 未找到远程数据库的连接说明
###解决该问题的方法
适当调整B库进程是process即可,调整完成后记得重启数据库。