灯火互联
管理员
管理员
  • 注册日期2011-07-27
  • 发帖数41778
  • QQ
  • 火币41290枚
  • 粉丝1086
  • 关注100
  • 终身成就奖
  • 最爱沙发
  • 忠实会员
  • 灌水天才奖
  • 贴图大师奖
  • 原创先锋奖
  • 特殊贡献奖
  • 宣传大使奖
  • 优秀斑竹奖
  • 社区明星
阅读:2710回复:0

[mysql]Mysql,Oracle数据库连接数简析

楼主#
更多 发布于:2012-09-01 02:19

Mysql,Oracle数据库连接数简析

Mysql

01
D:\Program Files\MySQL\MySQL Server 5.1\bin>mysql -u root -p
02
Enter password: ****
03
Welcome to the MySQL monitor.  Commands end with ; or \g.
04
Your MySQL connection id is 183  www.atcpu.com  
05
Server version: 5.1.58-community MySQL Community Server (GPL)
06

07
Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
08
This software comes with ABSOLUTELY NO WARRANTY. This is free software,
09
and you are welcome to modify and redistribute it under the GPL v2 license
10

11
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
12
-- 使用xuexi数据库
13
mysql> use xuexi
14
Database changed
15
-- 查看字符集
16
mysql> SHOW VARIABLES LIKE 'character_set%';
17
-- 控制台汉字乱码,将编码改为gbk,控制台就可以显示中文了
18
mysql> set character_set_results='gbk';
19
-- 查看连接数  www.atcpu.com  
20
mysql> SHOW PROCESSLIST;--100条
21
mysql> show full processlist;
22
-- 服务器的状态信息
23
mysql> show status;

Oracle

01
SQL> conn / as sysdba
02
Connected.
03
-- 连接数
04
SQL> select count(*) from v$session;
05
-- 并发连接数
06
SQL> Select count(*) from v$session where status='ACTIVE';
07
--最大连接
08
SQL> show parameter processes;
09
-- 修改processes和sessions值
10
SQL> alter system set processes=300 scope=spfile;
11
SQL> alter system set sessions=300 scope=spfile;




作者 车水码农


喜欢0 评分0
游客

返回顶部