ITPub博客

首页 > 数据库 > Oracle > 使用oracle的操作系统认证(Operating System Authentication)的方法

使用oracle的操作系统认证(Operating System Authentication)的方法

原创 Oracle 作者:cnhtm 时间:2010-02-03 21:46:36 0 删除 编辑

对数据库管理员使用操作系统认真的方法,(b14231 第63页)

1、创建操作系统用户

创建操作系统用户,并将这个用户指定为dba用户组

ora_test@root[/root]> useradd -G dba -g oinstall oradba
ora_test@root[/root]> id oradba
uid=501(oradba) gid=502(oinstall) groups=502(oinstall),501(dba)
[@more@]

2、修改用户的密码

ora_test@root[/root]> passwd oradba
Changing password for user oradba.
New UNIX password:
BAD PASSWORD: it is based on a dictionary word
Retype new UNIX password:
passwd: all authentication tokens updated successfully.

3、登录的新创建的用户

ora_test@root[/root]> su - oradba

4、编辑用户的环境变量,指定ORACLE_HOME和ORACLE_SID

[oradba@ora_test ~]$ cat .bash_profile
# .bash_profile

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi

# User specific environment and startup programs

ORACLE_HOME=/oracle/app/10.1; export ORACLE_HOME

PATH=$PATH:$HOME/bin:$ORACLE_HOME/bin

export PATH

ORACLE_SID=cnhtm; export ORACLE_SID

5、使环境变量生效

[oradba@ora_test ~]$ . ./.bash_profile

6、登录数据库

登录数据库,不指定用户名、密码(使用操作系统认证)

[oradba@ora_test ~]$ sqlplus / as sysdba

SQL*Plus: Release 10.2.0.1.0 - Production on Sat Feb 6 21:37:15 2010

Copyright (c) 1982, 2005, Oracle. All rights reserved.


Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options

7、检查用户schema

SQL> show user
USER is "SYS"
SQL>

--end--

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/22049049/viewspace-1031159/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2009-07-06

  • 博文量
    104
  • 访问量
    812115