Oracle程序管理常用查詢語句

2021-07-13 23:39:12 字數 1397 閱讀 8759

查詢資料庫當前程序的連線數:

select count(*) from v$process;

檢視資料庫當前會話的連線數:

elect count(*) from v$session;

檢視資料庫的併發連線數:

select count(*) from v$session where status=』active』;

檢視當前資料庫建立的會話情況:

select sid,serial#,username,program,machine,status from v$session;

查詢資料庫允許的最大連線數:

select value from v$parameter where name = 『processes』;

或者:show parameter processes;

修改資料庫允許的最大連線數:

alter system set processes = 300 scope = spfile;

(需要重啟資料庫才能實現連線數的修改)

重啟資料庫:

shutdown immediate;

startup;

檢視當前有哪些使用者正在使用資料:

select osuser,a.username,cpu_time/executions/1000000』s』 ,sql_fulltext,machine

from vse

ssio

na,v

sqlarea b

where a.sql_address = b.address

order by cpu_time/executions desc;

啟動oracle

su - oracle

sqlplus system/pwd as sysdba //進入sql

startup //啟動資料庫

lsnrctl start //啟動監聽

sqlplus 「/as sysdba」

shutdown immediate;

startup mount; pr

oces

s,看下

現在系統

有多少連

接數,然

後再查詢

sele

ctva

luef

romv

parameter where name = 『processes』 ,看下oracle設定中設定了多少連線數,一般乙個應用都會使用20個,所以如果你開了幾個應用的話(web、pl/sql、……)就會出這個問題了,這時只需要執行下

alter system set processes = 300 scope = spfile;

就可以了,當然300可以根據實際情況設定。

oracle常用查詢

查詢庫表中大資料量的表 select owner,segment name,sum bytes 1024 1024 m from dba segments where segment type in table index and owner bomc2 group by segment name,...

oracle常用查詢

select from dba users 檢視所有使用者 select from user all tables 查詢當前使用者表空間 select from user source 查詢所有函式和儲存過程 select from v session 檢視當前使用者連線 select from s...

Oracle常用查詢

顯示資料庫所有分割槽表的資訊 dba part tables 顯示當前使用者可訪問的所有分割槽表資訊 all part tables 顯示當前使用者所有分割槽表的資訊 user part tables 顯示表分割槽資訊 顯示資料庫所有分割槽表的詳細分割槽資訊 dba tab partitions 顯...