schema and user
第一步,以sys用户登陆SQL并建立普通用户storm和penguin:
$ sqlplus / as sysdba
SQL> create user storm identified by storm;(密码)
User created.
SQL> create user penguin identified by penguin;
User created.
第二步,赋予一些基本的权限给新建的用户storm和penguin:
SQL> grant connect,create table,resource to storm,penguin;
Grant succeeded.
grant XXX to user;,grant是授权的作用,这里的XXX可以是一个角色role,也可以是权限,例如grant role to user;,或grant insert on table to user
Connect 角色,是授予最终用户的典型权利,最基本的权利,能够连接到Oracle数据库中,并在对其他用户的表有访问权限时,做SELECT、UPDATE、INSERTT等操作
Resource 角色,是授予开发人员的,能在自己的方案中创建表、序列、视图等。
DBA角色,是授予系统管理员的,拥有该角色的用户就能成为系统管理员了,它拥有所有的系统权限。
第三步,以storm用户登陆,创建一张表并插入数据:
SQL> conn storm/storm
Connected.
SQL> create table t (id int);
Table created.
SQL> insert into t values(1);
1 row created.
SQL> commit;
Commit complete.