a我考网

 找回密码
 立即注册

QQ登录

只需一步,快速开始

扫一扫,访问微社区

查看: 69|回复: 0

[综合] Oracle入门指南:创建用户

[复制链接]
发表于 2012-8-4 13:54:49 | 显示全部楼层 |阅读模式
创建用户     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
  • 回复

    使用道具 举报

    您需要登录后才可以回帖 登录 | 立即注册

    本版积分规则

    Archiver|手机版|小黑屋|Woexam.Com ( 湘ICP备18023104号 )

    GMT+8, 2024-5-3 11:03 , Processed in 0.206803 second(s), 21 queries .

    Powered by Discuz! X3.4 Licensed

    © 2001-2017 Comsenz Inc.

    快速回复 返回顶部 返回列表