1、查看当前的数据库连接数
select count() from vprocess2、数据库允许的最大连接数selectvaluefromvprocess
2、数据库允许的最大连接数
select value from vprocess2、数据库允许的最大连接数selectvaluefromvparameter where name=‘processes’
3、修改数据库最大连接数
alter system set process=300 scope=spfile
4、当前的session连接数
select count() from vsession;5、当前并发连接数selectcount(∗)fromvsession;
5、当前并发连接数
select count(*) from vsession;5、当前并发连接数selectcount(∗)fromvsession where status=‘ACTIVE’;
6、关闭重启数据库
shutdown immediate --关闭数据库
startup --重启数据库
7、查看不同用户的连接数
select username,count(username) from vsessionwhereusernameisnotnullgroupbyusername;−−8、查看所有用户select∗fromallusers;−−9、查看用户或角色系统权限(直接赋值给用户或角色的系统权限)select∗fromdbasysprivs;select∗fromusersysprivs;10、查看角色(只能查看登陆用户拥有的角色)所包含的权限select∗fromrolesysprivs;11、查看用户对象权限select∗fromdbatabprivs;select∗fromalltabprivs;select∗fromusertabprivs;12、查看用户所有角色select∗fromdbaroles;13、查看用户或角色所拥有的角色select∗fromdbaroleprivs;select∗fromuserroleprivs;14、查看哪些用户有sysdba或sysoper系统权限(查询时需要相应权限)select∗fromVsession where username is not null group by username;--
8、查看所有用户
select * from all_users;--
9、查看用户或角色系统权限(直接赋值给用户或角色的系统权限)
select * from dba_sys_privs;
select * from user_sys_privs;
10、查看角色(只能查看登陆用户拥有的角色)所包含的权限
select * from role_sys_privs;
11、查看用户对象权限
select * from dba_tab_privs;
select * from all_tab_privs;
select * from user_tab_privs;
12、查看用户所有角色
select * from dba_roles;
13、查看用户或角色所拥有的角色
select * from dba_role_privs;
select * from user_role_privs;
14、查看哪些用户有sysdba或sysoper系统权限(查询时需要相应权限)
select * from Vsessionwhereusernameisnotnullgroupbyusername;−−8、查看所有用户select∗fromallusers;−−9、查看用户或角色系统权限(直接赋值给用户或角色的系统权限)select∗fromdbasysprivs;select∗fromusersysprivs;10、查看角色(只能查看登陆用户拥有的角色)所包含的权限select∗fromrolesysprivs;11、查看用户对象权限select∗fromdbatabprivs;select∗fromalltabprivs;select∗fromusertabprivs;12、查看用户所有角色select∗fromdbaroles;13、查看用户或角色所拥有的角色select∗fromdbaroleprivs;select∗fromuserroleprivs;14、查看哪些用户有sysdba或sysoper系统权限(查询时需要相应权限)select∗fromVPWFILE_USERS;
15、查看当前有哪些用户正在使用数据
SELECT osuser, a.username,cpu_time/executions/1000000||‘s’, sql_fulltext,machine from vsessiona,vsession a, vsessiona,vsqlarea b where a.sql_address =b.address order by cpu_time/executions desc;