AI智能
改变未来

修改oracle数据库连接数(ora-12516)

错误代码:ora-12516: TNS: 监听程序找不到符合协议堆栈要求的可用处理程

解决方案:

1.使用dba权限连接数据库sqlplus / as sysdba2.查看当前连接和最大连接数-- 查询当前连接select count(*) from v$process;-- 查询最大连接数select value from v$parameter where name = \'processes\';3.查看当前session数和最大session数-- 当前session数select count(*) from v$session;-- 查看最大session数select value from v$parameter where name = \'sessions\';4.根据上面的连接数去扩大对应的参数-- 修改sessionalter system set sessions=400 scope = spfile;-- 修改processesalter system set processes = 3000 scope = spfile;5.修改配置之后需要重启服务shutdown immediate;startup mount;alter database open;6.如果使用的是pdb数据库,那么需要启动pdb-- 查看所有的pdbselect con_id,name,open_mode from v$pdbs;-- 启动pdbalter pluggable database pdb名称 open;

下面是完整的处理经过

Windows PowerShell版权所有 (C) 2014 Microsoft Corporation。保留所有权利。PS C:\\Users\\Administrator> sqlplus / as sysdbaSQL*Plus: Release 12.1.0.2.0 Production on 星期二 6月 2 13:54:44 2020Copyright (c) 1982, 2014, Oracle.  All rights reserved.连接到:Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit ProductionWith the Partitioning, OLAP, Advanced Analytics and Real Application Testing optionsSQL> select count(*) from v$process;COUNT(*)----------291SQL> select value from v$parameter where name = \'processes\'2  ;VALUE--------------------------------------------------------------------------------300SQL> show parameter sessions;NAME                                 TYPE        VALUE------------------------------------ ----------- ------------------------------java_max_sessionspace_size           integer     0java_soft_sessionspace_limit         integer     0license_max_sessions                 integer     0license_sessions_warning             integer     0sessions                             integer     480shared_server_sessions               integerSQL> show parameter processes;NAME                                 TYPE        VALUE------------------------------------ ----------- ------------------------------aq_tm_processes                      integer     1db_writer_processes                  integer     2gcs_server_processes                 integer     0global_txn_processes                 integer     1job_queue_processes                  integer     1000log_archive_max_processes            integer     4processes                            integer     300SQL> show parameter processes;NAME                                 TYPE        VALUE------------------------------------ ----------- ------------------------------aq_tm_processes                      integer     1db_writer_processes                  integer     2gcs_server_processes                 integer     0global_txn_processes                 integer     1job_queue_processes                  integer     1000log_archive_max_processes            integer     4processes                            integer     300SQL> select count(*) from v$process;COUNT(*)----------287SQL> alter system set processes = 3000 scope = spfile;系统已更改。SQL> select count(*) from v$session;COUNT(*)----------192SQL> alter system set sessions=400 scope = spfile;系统已更改。SQL> shutdown immediate;数据库已经关闭。已经卸载数据库。ORACLE 例程已经关闭。SQL> startup mountORACLE 例程已经启动。Total System Global Area 1.0335E+10 bytesFixed Size                  5415672 bytesVariable Size            2919238920 bytesDatabase Buffers         7381975040 bytesRedo Buffers               28135424 bytes数据库装载完毕。SQL>SQL>SQL> alter database open;数据库已更改。SQL> select name,cdb from v$database;NAME      CDB--------- ---ORCL      YESSQL> select 1 from dual;1----------1SQL> select con_id,name,open_mode from v$pdbs;CON_ID NAME                           OPEN_MODE---------- ------------------------------ ----------2 PDB$SEED                       READ ONLY3 NAME1         				  MOUNTED4 NAME2                          MOUNTEDSQL> alter pluggable database NAME1 open;插接式数据库已变更。SQL> alter pluggable database NAME2 open;插接式数据库已变更。SQL> select con_id,name,open_mode from v$pdbs;CON_ID NAME                           OPEN_MODE---------- ------------------------------ ----------2 PDB$SEED                       READ ONLY3 NAME1         				  READ WRITE4 NAME2            			  READ WRITESQL> EXIT;从 Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit ProductionWith the Partitioning, OLAP, Advanced Analytics and Real Application Testing options 断开PS C:\\Users\\Administrator>
赞(0) 打赏
未经允许不得转载:爱站程序员基地 » 修改oracle数据库连接数(ora-12516)