ORACLE 建用户、表空间脚本


--建表空间
create tablespace <用户>
datafile 'D:\oradatadev\<用户>.dbf' size 200m
autoextend on
next 50m maxsize 4096m
extent management local;

create temporary tablespace <用户>_temp
tempfile 'D:\oradatadev\<用户>_temp.dbf' size 100M
autoextend on
next 50m maxsize 20480m
extent management local;

--建用户

create user <用户> identified by
12345 default tablespace <用户> temporary tablespace <用户>_temp;

grant connect,resource to <用户>;
grant create any view to <用户>;
grant debug any procedure to <用户> ;
GRANT DBA TO <用户>;
grant select on sys.dba_pending_transactions to <用户>;
grant select on sys.pending_trans$ to <用户>;
grant select on sys.dba_2pc_pending to <用户>;
grant execute on sys.dbms_system to <用户>;

SELECT username,SID,serial# FROM v$session;

--删除用户
drop user <用户> cascade
--删除表空间
DROP TABLESPACE <用户> INCLUDING CONTENTS AND DATAFILES;
DROP TABLESPACE <用户>_temp INCLUDING CONTENTS AND DATAFILES;

 

posted @ 2015-11-06 11:03  taony  阅读(282)  评论(0编辑  收藏  举报