Mysql,Oracle數據庫連接數簡析

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.aiwalls.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.aiwalls.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;

 

 

作者 車水碼農

發佈留言

發佈留言必須填寫的電子郵件地址不會公開。 必填欄位標示為 *