oracle数据库运维指令

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/guying4875/article/details/88572189

1. 查看oracle数据库当前连接数

select count(*) from v$session

2. 查看当前并发数量

Select count(*) from v$session where status='ACTIVE'

3. 数据库允许的最大连接数

 select value from v$parameter where name = 'processes' 

4. 查看每个用户的连接数量

select username,count(username) from v$session where username is not null group by username;

5. 修改最大连接数

alter system set processes = 300 scope = spfile;

6. 查看当前用户所执行的语句,耗时,机器mac

SELECT
  osuser, a.username,cpu_time/executions/1000000||'s',
 sql_fulltext,machine
from v$session a, v$sqlarea b
where a.sql_address =b.address 
order by cpu_time/executions desc;

7. 查看最近所做的操作

select * from v$sql

猜你喜欢

转载自blog.csdn.net/guying4875/article/details/88572189