Home Database Mysql Tutorial 建立与Oracle服务器连接的两种连接模式

建立与Oracle服务器连接的两种连接模式

Jun 07, 2016 pm 03:07 PM
o oracle Establish server model Enter connect

欢迎进入Oracle社区论坛,与200万技术人员互动交流 >>进入 在建立Oracle数据库的时候,应该会在数据库建立助手向导上面看到这么一个选项,就是数据库的连接模式采用什么方式。在Oracle9i或者10g中,可以看到有2种连接模式,一种叫做专用服务器连接(dedicate

欢迎进入Oracle社区论坛,与200万技术人员互动交流 >>进入

    在建立Oracle数据库的时候,应该会在数据库建立助手向导上面看到这么一个选项,就是数据库的连接模式采用什么方式。在Oracle9i或者10g中,可以看到有2种连接模式,一种叫做专用服务器连接(dedicated server) ,另外一种叫做共享服务器连接(shared server)。下面我们来分类说一下这两种连接方式的不同点。

    专用服务器模式就是说每次在对Oracle进行访问的时候,Oracle服务器的Listener会得到这个访问请求,然后回为这个访问创建一个新的进程来进行服务。所以说,对于每一个客户端的访问,都会生成一个新的进程进行服务,是一种类似一对一的映射关系。这种连接模式的一个很重要的特点就是UGA(用户全局域)是存储在PGA(进程全局域)中的,这个特性也很好说明了当前用户的内存空间是按照进程来进行分配的。

    而另外的共享服务器连接则是一种在程序编写的时候通常会用到的连接池(pool)的概念。采用这种模式的话,在数据库的初始化的时候就会创建一批服务器连接的进程,然后把这些连接进程放入一个连接池来进行管理。初始化的池中的进程数量在数据库初始化建立的时候是可以手动设置的。在连接建立的时候,Listener首先接受到客户端的建立连接的请求,然后Listener去生成一个叫做调度器(dipatcher)的进程与客户端进行连接。调度器把把客户端的请求放在SGA(系统全局域)的一个请求队列中,然后再共享服务器连接池中查找有无空闲的连接,然后让这个空闲的服务器进行处理。处理完毕以后再把处理结果放在SGA的相应队列中。调度器通过查询相应队列,得到返回结果,再返回给客户端。这种连接模式的优点在于服务器进程的数量可以得到控制,不大可能出现因为连接人数过多而造成服务器内存崩溃。但是由于增加了复杂度以及请求相应队列,可能性能上有所下降。

    总之,在开发阶段中,用第一种专用服务器可能好一些,因为少了一些中间的复杂度,而且开发的时候一般连接的数量也少。而在多个应用同时使用一个数据库的实际应用环境下,采用第二种方法可能好一些,因为如果到时候突然有1000个或者10000个请求连接的话,数据库服务器如果同时建立10000个连接,肯定要受不了的。当然,也要看到时候的实际情况如何再做决定,两者没有绝对的哪种好哪种不好的差别。

建立与Oracle服务器连接的两种连接模式

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Chat Commands and How to Use Them
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

How to check tablespace size of oracle How to check tablespace size of oracle Apr 11, 2025 pm 08:15 PM

To query the Oracle tablespace size, follow the following steps: Determine the tablespace name by running the query: SELECT tablespace_name FROM dba_tablespaces; Query the tablespace size by running the query: SELECT sum(bytes) AS total_size, sum(bytes_free) AS available_space, sum(bytes) - sum(bytes_free) AS used_space FROM dba_data_files WHERE tablespace_

How to encrypt oracle view How to encrypt oracle view Apr 11, 2025 pm 08:30 PM

Oracle View Encryption allows you to encrypt data in the view, thereby enhancing the security of sensitive information. The steps include: 1) creating the master encryption key (MEk); 2) creating an encrypted view, specifying the view and MEk to be encrypted; 3) authorizing users to access the encrypted view. How encrypted views work: When a user querys for an encrypted view, Oracle uses MEk to decrypt data, ensuring that only authorized users can access readable data.

How to view instance name of oracle How to view instance name of oracle Apr 11, 2025 pm 08:18 PM

There are three ways to view instance names in Oracle: use the "sqlplus" and "select instance_name from v$instance;" commands on the command line. Use the "show instance_name;" command in SQL*Plus. Check environment variables (ORACLE_SID on Linux) through the operating system's Task Manager, Oracle Enterprise Manager, or through the operating system.

How to uninstall Oracle installation failed How to uninstall Oracle installation failed Apr 11, 2025 pm 08:24 PM

Uninstall method for Oracle installation failure: Close Oracle service, delete Oracle program files and registry keys, uninstall Oracle environment variables, and restart the computer. If the uninstall fails, you can uninstall manually using the Oracle Universal Uninstall Tool.

How to import oracle database How to import oracle database Apr 11, 2025 pm 08:06 PM

Data import method: 1. Use the SQLLoader utility: prepare data files, create control files, and run SQLLoader; 2. Use the IMP/EXP tool: export data, import data. Tip: 1. Recommended SQL*Loader for big data sets; 2. The target table should exist and the column definition matches; 3. After importing, data integrity needs to be verified.

How to get time in oracle How to get time in oracle Apr 11, 2025 pm 08:09 PM

There are the following methods to get time in Oracle: CURRENT_TIMESTAMP: Returns the current system time, accurate to seconds. SYSTIMESTAMP: More accurate than CURRENT_TIMESTAMP, to nanoseconds. SYSDATE: Returns the current system date, excluding the time part. TO_CHAR(SYSDATE, 'YYY-MM-DD HH24:MI:SS'): Converts the current system date and time to a specific format. EXTRACT: Extracts a specific part from a time value, such as a year, month, or hour.

How to set up users of oracle How to set up users of oracle Apr 11, 2025 pm 08:21 PM

To create a user in Oracle, follow these steps: Create a new user using the CREATE USER statement. Grant the necessary permissions using the GRANT statement. Optional: Use the RESOURCE statement to set the quota. Configure other options such as default roles and temporary tablespaces.

How to create oracle dynamic sql How to create oracle dynamic sql Apr 12, 2025 am 06:06 AM

SQL statements can be created and executed based on runtime input by using Oracle's dynamic SQL. The steps include: preparing an empty string variable to store dynamically generated SQL statements. Use the EXECUTE IMMEDIATE or PREPARE statement to compile and execute dynamic SQL statements. Use bind variable to pass user input or other dynamic values ​​to dynamic SQL. Use EXECUTE IMMEDIATE or EXECUTE to execute dynamic SQL statements.

See all articles