본문 바로가기

프로그램/DB

[sybase] user connection 개수 확인 방법

Mukang_TEST:[/sybase/ASE-12_5]isql -Usa -Pmukangsa

1> sp_configure 'user_conn'
2> go
 Parameter Name                 Default     Memory Used Config Value         Run Value   Unit                 Type      
 ------------------------------ ----------- ----------- ------------         ----------- -------------------- ----------
 number of user connections              25       66505         300                  300 number               dynamic   

(1 row affected)
(return status = 0)


2. User Connection 사용개수 확인
1> sp_monitorconfig "number of user connections"
2> go
Usage information at date and time: May  7 2012  4:19PM.
 
 Name                      Num_free    Num_active  Pct_act Max_Used            Num_Reuse  
 ------------------------- ----------- ----------- ------- -----------         -----------
 number of user connection          94         206  68.67          300                   0
(return status = 0)

 

 

 

[SYBASE] User Connection 개수 확인

 
Sybase에서 User Connection의 개수를 확인하는 방법과 그 값을 수정하는 방법에 대해서 알아 본다.

1. isql 접속
Sybase는 Oracle의 sqlplus와 같은 기능을 하는 프로그램이 isql이다. isql을 이용하여 Sybase Database Server의 상태를 모니터링하고 쿼리를 수행할 수 있으며 서버 파라미터를 수정할 수도 있다.


# su - sybase
$ isql -Usa -Pdba

isql에 접속하는 방법은 간단한다. isql -U[username] -P[password]로 접속이 가능하다. 서버의 파라미터를 변경하기 위해서는 sa권한으로 접속을 할 수 있어야 한다.

2. User Connection 사용개수 확인
사용하고 있는 User Connection의 개수를 확인하기 위해서 isql에서 다음과 같이 입력해 준다.


1> sp_monitorconfig "number of user connections"
2> go

Usage information at date and time: Dec 13 2007 10:41AM.
 
 Name                      Num_free    Num_active  Pct_act Max_Used            Num_Reuse  
 ------------------------- ----------- ----------- ------- -----------         -----------
 number of user connection         183         217  54.25          237                   0

 

Num_free : 남아있는 User Connection 수
Num_active : 사용중인 User Connection 수
Max_Used : Sybase가 기동된 이후 가장 많이 사용한 User Connection 수


3. 설정되어 있는 User Connection 개수 확인
설정되어 있는 User Connection의 개수를 확인하기 위해서는 다음과 같이 입력하면 된다.


1> sp_configure "number of user connections"
2> go
 Parameter Name                 Default     Memory Used Config Value         Run Value   Unit                 Type      
 ------------------------------ ----------- ----------- ------------         ----------- -------------------- ----------
 number of user connections              25       94119         400                  400 number               dynamic

 

Default : 기본 값
Memory Used : User Connection이 사용하는 메모리 사용률
Config Value : 설정된 값
Run Value : 사용할 수 있는 값

4. User Connection 개수 설정
User Connection 개수는 다음과 같이 설정한다.


1> sp_configure "number of user connections",500
2> go

 

1> sp_monitorconfig "number of user connections"
2> go
Usage information at date and time: May  7 2012  4:28PM.
 
 Name                      Num_free    Num_active  Pct_act Max_Used            Num_Reuse  
 ------------------------- ----------- ----------- ------- -----------         -----------
 number of user connection          56         244  81.33          300                   0
(return status = 0)
1> sp_configure "number of user connections"
2> go
 Parameter Name                 Default     Memory Used Config Value         Run Value   Unit                 Type      
 ------------------------------ ----------- ----------- ------------         ----------- -------------------- ----------
 number of user connections              25       66505         300                  300 number               dynamic   

(1 row affected)
(return status = 0)

 


select config,substring(name,1,30) from master..sysconfigures where config = 103

select config,value as config_runval from master..syscurconfigs where config = 103

select config_admin(22,103,2,0,'active_connections',null) as num_active

select config_admin(22,103,3,0,'hwm_connections',null) as max_active

select config_admin(22,103,1,0,null,null) as syst_value


 

모니터링 전체 보기

sp_monitorconfig 'all'

 

Connection 보기

sp_who [spid]

or

sp_ps (ASE 안됨)

 

Connection 끊기

kill [spid]

sp_terminate [spid] (ASE 안됨)

 

execute utility...sp_who

execute utility...sp_terminate 12, "immedi ate"

'프로그램 > DB' 카테고리의 다른 글

[sybase] 날짜 처리  (0) 2012.07.31
오라클 트리거 OLD & NEW  (0) 2012.07.31
[sybase] sql 명령어  (0) 2012.05.07