oracle创建用户方案,Oracle教程之Oracle管理用户(一)--Oracle建立用户

1、概念

(1)用户 User:用户(账户)是定义在数据库里的一个名称。

(2)特权用户:特权用户是指具有特殊权限(sysdba 或 sysoper)的数据库用户。

SYSDBA 自动具备了DBA角色的所有权限,而sysoper则不具备DBA角色的权限。

(3)方案(Schema):方案是用户所拥有数据库对象的集合。

2、用户认证方式

(1)OS认证:是指使用OS检查用户、口令和用户身份的方式。

(2)database认证

3、建立用户

(1)建立数据库认证的用户

SQL> create user rose

2  identified by oracle

3     default tablespace users

4       temporary tablespace temp

5         quota 10m on users

6  password expire; ——用户一登录密码就过期,需要重新设定

User created.

SQL> grant create session to rose;

Grant succeeded.

SQL> conn rose/oracle

ERROR:

ORA-28001: the password has expired

Changing password for rose

New password:

Retype new password:

Password changed

Connected.

(2)建立OS认证(操作系统认证)用户(sys 用户属于os 认证)

SQL> show parameter auth

NAME                                 TYPE        VALUE

------------------------------------ ----------- ------------------------------

os_authent_prefix                    string      ops$ ——创建OS认证的用户名前面一定要加上这个参数

remote_os_authent                    boolean     FALSE

1  create user ops$oracle        ——创建用户,不要加双引号

2    identified externally

3      profile default

4        default tablespace users

5        temporary tablespace temp

6*    quota 10m on users

SQL> /

User created.

SQL> select username,account_status from dba_users;

USERNAME        ACCOUNT_STATUS

--------------- -------------------------

OUTLN           OPEN

SYS             OPEN

SYSTEM          OPEN

ROSE            OPEN

SCOTT           OPEN

ops$oracle      OPEN

TOM             OPEN

DBSNMP          EXPIRED & LOCKED

TSMSYS          EXPIRED & LOCKED

DIP             EXPIRED & LOCKED

10 rows selected.

SQL> select username ,password ,PROFILE,DEFAULT_TABLESPACe,TEMPORARY_TABLESPACE from dba_users;

USERNAME        PASSWORD             PROFILE         DEFAULT_TABLESP TEMPORARY_TABLE

--------------- -------------------- --------------- --------------- ---------------

OUTLN           4A3BA55E08595C81     DEFAULT         SYSTEM          TEMP

SYS             8A8F025737A9097A     DEFAULT         SYSTEM          TEMP

SYSTEM          2D594E86F93B17A1     DEFAULT         SYSTEM          TEMP

ROSE            1166A1F535AF6EFB     DEFAULT         USERS           TEMP

SCOTT           F894844C34402B67     DEFAULT         USERS           TEMP

ops$oracle      EXTERNAL             DEFAULT         USERS           TEMP

TOM             0473A0A9140BFBD7     DEFAULT         USERS           TEMP

DBSNMP          E066D214D5421CCC     DEFAULT         SYSAUX          TEMP

TSMSYS          3DF26A8B17D0F29F     DEFAULT         USERS           TEMP

DIP             CE4A36B8E06CA59C     DEFAULT         USERS           TEMP

SQL> grant create session to ops$oracle;

Grant succeeded.

SQL> exit

Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.2.0 - Production

With the Partitioning, OLAP and Data Mining options

[oracle@solaris10 ~]$id

uid=100(oracle) gid=100(oinstall)

[oracle@solaris10 ~]$sqlplus /  ——登录不需要提供用户名和密码(oracle 必须属于os的dba组)

SQL*Plus: Release 10.2.0.2.0 - Production on Wed Mar 14 16:07:43 2012

Copyright (c) 1982, 2005, Oracle.  All Rights Reserved.

Connected to:

Oracle Database 10g Enterprise Edition Release 10.2.0.2.0 - Production

With the Partitioning, OLAP and Data Mining options

SQL> show user

USER is "OPS$ORACLE"

更多oracle视频教程:http://crm2.qq.com/page/portalpage/wpa.php?uin=800060152&f=1&ty=1&aty=0&a=&from=6

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值