oracle 处理锁表,创建新的数据库实例


select saddr,sid,serial#,paddr,username,status from v$session where username is not null and username = 'EHR' ;

select 'alter system kill session '''||sid||','||serial#||''';' from v$session where username is not null and username = 'EHR' ;

alter system kill session '8,13';
alter system kill session '71,73';
alter system kill session '131,952';

 

drop user EHR cascade;
drop tablespace ehrdb INCLUDING CONTENTS;
drop tablespace ehrdbindex1 INCLUDING CONTENTS;

 

create tablespace ehrdb datafile '\home\oracle\ehrdb.dbf' size 200m autoextend on next 10m maxsize unlimited;
create tablespace ehrdbindex datafile '\home\oracle\ehrdbindex.dbf' size 200m autoextend on next 10m maxsize unlimited;
create user gxehr identified by gxehr default tablespace ehrdb;
grant resource,connect,dba to gxehr;

posted @ 2018-11-29 11:05  leolzi  阅读(310)  评论(0编辑  收藏  举报