您的位置:首页 > 数据库 > Oracle

ORACLE用户创建过程

2013-12-05 10:48 381 查看
对于ORACLE用户创建过程,估计大家在熟悉不过了,无论是自己练习玩,

还是工作用,都免不了做这步,有的人已经熟练的记住了,有的人还是喜欢复制粘贴,

把创建用户的脚本存在记事本里,直接拿来用。但是这种脚本太简单,所以最容易被弄丢了。

关键时刻找不到,又没记住。烦了吧!所以最好记住,忘了就看看这里!

第一步:创建表空间

create tablespace ICB datafile 'D:\oracle\product\10.2.0\oradata\icb\icb.dbf' size 2048M

autoextend on next 256M maxsize unlimited logging extent management local autoallocate segment space management auto;

alter tablespace ICB add datafile 'D:\oracle\product\10.2.0\oradata\icb\icb01.dbf' size 2048M autoextend on next 256M;

注意:“maxsize unlimited logging extent management local autoallocate segment space management auto” 这段可以根据需要可不加;

“alter tablespace ICB add datafile 'D:\oracle\product\10.2.0\oradata\icb\icb01.dbf' size 2048M autoextend on next 256M" 不需要可不加。

第二步:创建用户

create user test

identified by "test"

default tablespace ICB

temporary tablespace TEMP

profile DEFAULT

quota unlimited on system

quota unlimited on test

quota unlimited on users;

第三步:授权

-- Grant/Revoke role privileges

grant connect to test with admin option;

grant resource to test with admin option;

-- Grant/Revoke system privileges

grant create any table to test;

grant create any view to test;

grant create table to test with admin option;

grant select any table to test;

grant unlimited tablespace to test with admin option;

注意:权限根据需要自己来设置。

最后:就是退出

exit;

总结:oracle用户的创建一共就三个步骤,

1)创建表空间(如果表空间已存在,则可以不做这步)

2)创建用户

3)授权
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: