Oracle重建用户

删除用户:

1. sqlplus / as sysdba

2.drop user username cascade

如果报错:ORA-01940: cannot drop a user that is currently connected

需要先删除进程:select sid,serial# from v$session where username='USERNAME';

(注:此处需要大写)

alter system kill session 'sid,serial';


新建用户:

create user username identified by password default tablespace  表空间 Temporary TABLESPACE Temp;

grant connect,resource,dba to username;


删除Oracle用户下的所有数据:

select 'drop table '||table_name||';'
from cat
where table_type='TABLE' ;



你可能感兴趣的:(数据库)