--查看哪些表被锁住了select b.owner,b.object_name,a.session_id,a.locked_mode from v$locked_object a,dba_objects b where b.object_id = a.OBJECT_ID; --查询引起死锁的会话select b.username,b.sid,b.serial#,logon_time from v$locked_object a , v$session b where a.session_id =…
问题现象: 查看oracle是否有表被锁 解决方法: select sid,serial#,program,terminal,username,b.object_id,c.object_name from v$session a, v$locked_object b, dba_objects c where a.sid = b.session_id and b.object_id = c.object_id;…
查看当前用户的缺省表空间 SQL>select username,default_tablespace from user_users; 查看当前用户的角色 SQL>select * from user_role_privs; 查看当前用户的系统权限和表级权限 SQL>select * from user_sys_privs; SQL>select * from user_tab_privs; 查看用户下所有的表 SQL>select * from user_tables;…
场景:在做数据库巡检时,检查大表是必不可少的操作,可以查看各表占用表空间的大小 代码: as sizes,q.num_rows,t.segment_type from dba_segments t left join dba_tables q on t.segment_name=q.table_name and t.owner=q.owner where t.segment_type='TABLE' and t.tablespace_name='TS_AAA' --需要查看的表空间 desc…