orcle数据库常用命令

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/tianya9006/article/details/81001433
select count(*) from v$session;--查询oracle的连接数
select count(*) from v$session where status='ACTIVE';--查询oracle的并发连接数
select username,count(username) from v$session where username is not null group by username;--查看不同用户的连接数
select * from all_users;--查看所有用户:
--查看用户或角色系统权限(直接赋值给用户或角色的系统权限):
select * from dba_sys_privs;
select * from user_sys_privs;
--查看角色(只能查看登陆用户拥有的角色)所包含的权限
select * from role_sys_privs;
--查看用户对象权限:
select * from dba_tab_privs;
select * from all_tab_privs;
select * from user_tab_privs;
select count(*) from v$process; --当前的连接数
select value from v$parameter where name = 'processes'; --数据库允许的最大连接数
-- 修改最大连接数:
alter system set processes = 300 scope = spfile;
--重启数据库:
shutdown immediate;
startup;
--查看当前有哪些用户正在使用数据
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;
select count(*) from v$session #连接数
select count(*) from v$session where status='ACTIVE' #并发连接数
show parameter processes #最大连接
alter system set processes = value scope = spfile;重启数据库 #修改连接

猜你喜欢

转载自blog.csdn.net/tianya9006/article/details/81001433
今日推荐