ORACLE创建表空间、用户语句

近日项目遇到ORACLE数据库,将常用操作语句记录于此。

--创建表空间
create tablespace tablespace_name
datafile 'G:\oracle\Administrator\oradata\amop\amop_support.dbf'
size 500M
autoextend on next 100M
maxsize unlimited;

--创建临时表空间

create temporary tablespace temporary_tablespace_name
tempfile 'G:\oracle\Administrator\oradata\amop\amop_support_temp.dbf'
size 500M
autoextend on
next 100M maxsize unlimited
extent management local;

--删除表空间及数据库文件
--drop tablespace tablespace_name including contents and datafiles;

--创建用户
create user username identified by password
profile default
default tablespace tablespace_name
temporary tablespace temporary_tablespace_name
account unlock;

--赋予用户权限
grant connect,resource to username ;
grant create any sequence to username ;
grant create any table to username ;
grant delete any table to username ;
grant insert any table to username ;
grant select any table to username ;
grant unlimited tablespace to username ;
grant execute any procedure to username ;
grant update any table to username ;
grant create any view to username ;

如上~

 

posted @ 2017-12-25 17:09  昨夜的风  阅读(22532)  评论(0编辑  收藏  举报