Oracle 参数 OPEN_LINKS 官方解释,作用,如何配置最优化建议

本站中文解释

OPEN_LINKS参数用于限制Oracle数据库中的连接数量。其值的单位是最大的活动连接数,如果设置为0,则表示不允许任何未连接的客户端;如果设置为正整数N,则表示最多允许N个活动的连接。只有在Oracle数据库实例启动时将OPEN_LINKS参数设置为正整数,才能够正常接入客户端连接。

正确设置:

1. 确定您的Oracle数据库需要处理多少连接。一般来说,系统中每张表获得的最大连接数应小于或等于总连接数的一半,以避免资源竞争。

2. 在数据库启动的时候,使用ALTER SYSTEM语句来设置OPEN_LINKS参数。具体命令语法为:
ALTER SYSTEM SET OPEN_LINKS=n;
其中,n表示需要设置的最大连接数。

3. 测试数据库的活动连接数是否在预设范围内,如果未达到设置值,则可以继续扩充OPEN_LINKS值;如果超过设置值,则可以重新调整OPEN_LINKS值,以保证数据库正常运行。

官方英文解释

OPEN_LINKS specifies the maximum number of concurrent open connections to remote databases in one session. These connections include database links, as well as external procedures and cartridges, each of which uses a separate process.

Property Description

Parameter type

Integer

Default value

4

Modifiable

No

Modifiable in a PDB

Yes

Range of values

0 to 32768

Basic

No

Oracle counts one open link for the following:

  • For each user that references a public or private database link

  • For each external procedure or cartridge connection when it is executed for the first time

Both types of connections close when the session ends. You can also close a database link connection explicitly by issuing an ALTER SESSION CLOSE DATABASE LINK statement.

You should set this parameter to allow for the external procedure and cartridge connections expected during the session plus the number of databases referred to in typical distributed transactions (that is, a single SQL statement that references multiple databases), so that all the databases can be open to execute the statement. For example, if queries alternately access databases A, B, and C, and OPEN_LINKS is set to 2, time will be lost waiting while one connection is broken and another made. Increase the value if many different databases are accessed over time.

This parameter refers only to connections used for distributed transactions. Direct connections to a remote database specified as an application connects are not counted.

If you set OPEN_LINKS to 0, then no distributed transactions are allowed.

In a multitenant container database (CDB), the OPEN_LINKS parameter can be set at both the root and at the PDB level using either an initialization parameter file (PFILE) or server parameter file (SPFILE). You need to restart the instance or reopen the PDB for a new OPEN_LINKS value to become effective.

See Also:

“OPEN_LINKS_PER_INSTANCE” for information on setting open connections globally for a database instance


数据运维技术 » Oracle 参数 OPEN_LINKS 官方解释,作用,如何配置最优化建议