(查询数据库正在使用的用户)
select l.session_id,o.owner,o.object_name
from v$locked_object l,dba_objects o
where l.object_id=o.object_id
(查询数据库使用对象)
SELECT sid, serial#, username,osuser
FROM sys.v_$session
KILL掉这些对像:
ALTER SYSTEM KILL SESSION 'sid,serial#'
以DBA角色, 查看当前数据库里锁的情况可以用如下SQL语句:
select t2.username,t2.sid,t2.serial#,t2.logon_time
from v$locked_object t1,v$session t2
where t1.session_id=t2.sid order by t2.logon_time;
杀掉锁:
alter system kill session 'sid,serial#';
查询数据库有效期:
SELECT * FROM dba_profiles WHERE profile='DEFAULT' AND resource_name='PASSWORD_LIFE_TIME' ;
查询使用用户:
SELECT username,PROFILE FROM dba_users;
将SQL修改为长期有效时间:(UNLIMITED)
ALTER PROFILE DEFAULT LIMIT PASSWORD_LIFE_TIME UNLIMITED;