标签:user 用户 username bsp style linu tab cal sel
su - oracle sqlplus /nolog conn /as sysdba create tablespace scaninvoice logging datafile ‘/u01/app/oracle/oradata/mas/scaninvoice.dbf‘ size 200M autoextend on next 100m extent management local; create temporary tablespace scaninvoice_tmp tempfile ‘/u01/app/oracle/oradata/mas/scaninvoice_tmp.dbf‘ size 50m autoextend on next 50m maxsize 20480m extent management local; create user username identified by password default tablespace scaninvoice temporary tablespace scaninvoice_tmp; grant dba to trainhec ; grant dba,create session,resource,connect to trainhec ; exit;
# su - oracle $ sqlplus /nolog SQL> conn /as sysdba
2.1 表空间: 一般在开发情况下,我们当然不会使用用户的默认表空间,所以这时我们需要创建一个表空间.
create tablespace scaninvoice logging datafile ‘/u01/app/oracle/oradata/mas/scaninvoice.dbf‘ size 200M autoextend on next 100m extent management local;
注:datafile后面是表空间的物理存储路径,文件名的后缀可以随便. 若没有dbf文件,则系统会自动创建。
2.2 临时表空间
create temporary tablespace scaninvoice_tmp tempfile ‘/u01/app/oracle/oradata/mas/scaninvoice_tmp.dbf‘ size 50m autoextend on next 50m maxsize 20480m extent management local;
create user username identified by password; //使用默认表空间 USER create user username identified by password default tablespace scaninvoice temporary tablespace scaninvoice_tmp; //指定默认表空间和临时表空间 (推荐)
grant dba to trainhec ;
grant dba,create session,resource,connect to trainhec ;
exit;
alter user username identified by password;
默认情况下用户创建好后系统会默认给该用户分配一个表空间(users); 我们可以通过下面的sql语句来查看一下所有用户所在的表空间.
select username,default_tablespace from dba_users;
alter user scaninvoice default tablespace scaninvoice;
Oracle学习笔记_05_ 一个创建表空间、创建用户、授权的完整过程
标签:user 用户 username bsp style linu tab cal sel
原文地址:http://www.cnblogs.com/shirui/p/7879641.html