创建用户 SQL> Create User username2 i; O- T2 y! r; r. e! C
Identified by password
+ q+ u' _8 K2 i' X a Default Tablespace tablespace
$ F1 F O" _1 i8 {' I4 v Temporary Tablespace tablespace& `5 w* C2 O4 x& @/ k% e
Profile profile
( y8 |) X3 G6 ~3 | Quota integer/unlimited on tablespace;- }/ n# ?% d6 B
例:1 x, x2 j4 R: U# ^' f
SQL> Create user acc01
3 m& x7 l* J9 C7 {3 O& Q identified by acc01 // 如果密码是数字,请用双引号括起来
+ v# @5 `* P( J! Y- g8 U default tablespace account
9 ~. T7 a! l& Y! T temporary tablespace temp
0 x% g5 Q) E: r6 g! N' V6 E profile default
. H! c. Y# T8 m* t: B1 b quota 50m on account;
: u7 i: o1 y, X$ x0 j SQL> grant connect, resource to acc01;& g3 p9 D+ ?/ R- _7 k
" s% R, @3 J9 H+ _! N) E" q
查询用户缺省表空间、临时表空间' i7 m3 N& N' T' Q
SQL> select username, default_tablespace, temporary_tablespace from dba_users;$ X0 x+ o( w* @9 p2 Y
5 L4 _. E4 g" s7 w, I) v; w 查询系统资源文件名: |& o7 ~; p3 z2 q' W. S9 H
SQL> select * from dba_profiles;* A5 |. m0 [7 R$ z/ L s
资源文件类似表,一旦创建就会保存在数据库中。, L: _' x4 o0 K; X6 k
SQL> select username, profile, default_tablespace, temporary_tablespace from dba_users;
6 ~" \0 @% h4 N& E) ^+ M- E SQL> create profile common limit
4 a# T& S* i# u+ @' ~ failed_login_attempts 5
" Y" K. g O! @9 Y' h+ c$ M% h idle_time 5;9 l! _9 s0 U/ [: W1 I6 Z/ a6 H
SQL> Alter user acc01 profile common |