search
HomeDatabaseMysql Tutorial ORACLE连接超限修改,ORA-00064,ORA-12571,ORA-24324及用户连接查看

(一)ORACLE连接超限修改我们需要调整oracle数据库的最大链接数,而这个链接数的调整是在oacle下的dbs目录下init.ora文件中调整的。ORACLE的连接数(sessions)与

(一)ORACLE连接超限修改

我们需要调整oracle数据库的最大链接数,而这个链接数的调整是在oacle下的dbs目录下init.ora文件中调整的。
ORACLE的连接数(sessions)与其参数文件中的进程数(process)有关,它们的关系如下:
sessions=(1.1*process+5)
但是我们增加process数时,往往数据库不能启动了。这因为我们还漏调了一个unix系统参数:它是核心参数中的semmns,这是unix系统的信号量参数。每个process会占用一个信号量。semmns调整后,需要重新启动unix操作系统,参数才能生效。不过它的大小会受制于硬件的内存或ORACLE SGA。范围可从200——2000不等。

但是,Processes的修改不仅应该调整init.ora文件中的参数,而且应该调整OS的内核参数,象AIX,HPUX,Solaris,SCO,UNIXWare都是这样,OS的调整是需要重新启动的,而且这个参数的设置不能简单按照多少个终端要连到这个服务器上而定,最关键是考虑会有多少同时连上的session(在使用一些共享连接的中间件时,一般就不需要太大),当然还要考虑一些Oracle的后台进程,还有一些系统维护工作需要多一些连接等。

 

1.数据库连接超限时,新的连接会失败,查看数据库允许连接数

SQL> show parameter processes

NAME                                 TYPE
------------------------------------ ----------------------
VALUE
------------------------------
aq_tm_processes                      integer
1
db_writer_processes                  integer
1
job_queue_processes                  integer
10
log_archive_max_processes            integer
2
processes                            integer

NAME                                 TYPE
------------------------------------ ----------------------
VALUE
------------------------------
150

#--------------数据库连接数是150,修改连接数
SQL>
SQL> alter system set processes=5000 scope=spfile;

系统已更改。

SQL> alter system set sessions=5000 scope=spfile;

系统已更改。

SQL> shutdown immediate
数据库已经关闭。
已经卸载数据库。
ORACLE 例程已经关闭。

SQL> startup
ORA-00064: object is too large to allocate on this O/S (1,4800000)
SQL> startup
ORA-00064: object is too large to allocate on this O/S (1,4800000)

#-----------------------------以上修改最大连接数失败,最大连接数与OS有关、

#-----------------------------不考虑OS是最大连接数可能修改失败

例如以下的Unix实例(引自)

核心主要相关的参数的调整如下:

SHMMAX 1000000000

SHMMIN 1

SHMMNI 200

SHMSEG 15

SEMMNI 1000

SEMMSL 300

SEMMNS 230

SEMOPM 20

其中semmni,semmns,semmsl要加大,至少要比processes大18 ;

SEMMNI(10,10000;150):指定在核心中信号识别的数量。这是可以在任意给定时间被激活的唯一信号设置数量。缺省值是150。最大值由系统自动调整产生。

SEMMSL(25,300;150):指定每个信号识别中信号量的最大值。缺省值是25。
SEMMNS 除最大db外的所有db 的PROCESSES之和+2*最大db的PROCESSES+10*

实例数。如3个实例进程数分别为100、100、200,则=(100+100)+2*200+10*3=630

SEMOPM(10,20;10):指定在每个系统调用semop中能够被执行的信号操作量的最大值。缺省值是10。

SHMMAX(131072,1073741824;524288):指定了共享内存部分大小的最大值。等于0.5

× 物理内存字节数

SHMMNI(10,1000;100):指定了系统范围内共享内存标识的最大值。

SHMSEG(6,香港虚拟主机,15;6):指定了与每个进程相关连的共享内存块(或标识)的数量。缺省值是6。与每个进程相关连的共享内存块的最大值与进程拥有的未使用空间有关。因此,尽管一个进程拥有少于SHMSEG数值的共享内存块,它也有可能因为其有限的空间而不能与其它进程相联系。

init.ora中调整为:

processes = 50 # SMALL

#processes = 100 # MEDIUM

# processes = 200 # LARGE


SQL> startup
---------------在services.msc将orcl重启,导致错误ORA-00064
ORA-12571: TNS: 包写入程序失败
SQL> startup
ORA-24324: 未初始化服务句柄
ORA-01041: 内部错误,hostdef 扩展名不存在
SQL> startup
ORA-24324: 未初始化服务句柄
ORA-01041: 内部错误,hostdef 扩展名不存在


------------------------------------------------

2.修改最大连接数错误ORA-00064,数据库启动不了

#----------------------(1)ORACLE SYS DBA连接,香港虚拟主机,此时因为ORA-12571错误,其他用户无法连接
SQL> conn sys/oracle@orcl as sysdba
已连接到空闲例程。

#----------------------(2)以pfile 启动数据库

SQL> startup pfile='D:\oracle\admin\orcl\pfile\init.ora.105201216493' open
ORACLE 例程已经启动。

Statement
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
How do you alter a table in MySQL using the ALTER TABLE statement?How do you alter a table in MySQL using the ALTER TABLE statement?Mar 19, 2025 pm 03:51 PM

The article discusses using MySQL's ALTER TABLE statement to modify tables, including adding/dropping columns, renaming tables/columns, and changing column data types.

How do I configure SSL/TLS encryption for MySQL connections?How do I configure SSL/TLS encryption for MySQL connections?Mar 18, 2025 pm 12:01 PM

Article discusses configuring SSL/TLS encryption for MySQL, including certificate generation and verification. Main issue is using self-signed certificates' security implications.[Character count: 159]

How do you handle large datasets in MySQL?How do you handle large datasets in MySQL?Mar 21, 2025 pm 12:15 PM

Article discusses strategies for handling large datasets in MySQL, including partitioning, sharding, indexing, and query optimization.

What are some popular MySQL GUI tools (e.g., MySQL Workbench, phpMyAdmin)?What are some popular MySQL GUI tools (e.g., MySQL Workbench, phpMyAdmin)?Mar 21, 2025 pm 06:28 PM

Article discusses popular MySQL GUI tools like MySQL Workbench and phpMyAdmin, comparing their features and suitability for beginners and advanced users.[159 characters]

How do you drop a table in MySQL using the DROP TABLE statement?How do you drop a table in MySQL using the DROP TABLE statement?Mar 19, 2025 pm 03:52 PM

The article discusses dropping tables in MySQL using the DROP TABLE statement, emphasizing precautions and risks. It highlights that the action is irreversible without backups, detailing recovery methods and potential production environment hazards.

How do you represent relationships using foreign keys?How do you represent relationships using foreign keys?Mar 19, 2025 pm 03:48 PM

Article discusses using foreign keys to represent relationships in databases, focusing on best practices, data integrity, and common pitfalls to avoid.

How do you create indexes on JSON columns?How do you create indexes on JSON columns?Mar 21, 2025 pm 12:13 PM

The article discusses creating indexes on JSON columns in various databases like PostgreSQL, MySQL, and MongoDB to enhance query performance. It explains the syntax and benefits of indexing specific JSON paths, and lists supported database systems.

How do I secure MySQL against common vulnerabilities (SQL injection, brute-force attacks)?How do I secure MySQL against common vulnerabilities (SQL injection, brute-force attacks)?Mar 18, 2025 pm 12:00 PM

Article discusses securing MySQL against SQL injection and brute-force attacks using prepared statements, input validation, and strong password policies.(159 characters)

See all articles

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)
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

MinGW - Minimalist GNU for Windows

MinGW - Minimalist GNU for Windows

This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

ZendStudio 13.5.1 Mac

ZendStudio 13.5.1 Mac

Powerful PHP integrated development environment

VSCode Windows 64-bit Download

VSCode Windows 64-bit Download

A free and powerful IDE editor launched by Microsoft

DVWA

DVWA

Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

mPDF

mPDF

mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),