Oracle用户创建过程

2014-11-24 17:39:52 · 作者: · 浏览: 0

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


第一步:创建表空间


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)授权


参考阅读: