首页 > 数据库 > Oracle > Oracle基础结构之OS验证和口令文件验证
n 操作系统验证:如果以创建数据库的用户登录,则Oracle将验证过程交给操作系统时,不需要经Oracle验证,直接就可以登录(例如windows下创建Oracle数据库的用户自动被添加到ora_dba组内,linux下要属于dba组)
n 口令文件验证:验证由Oracle来做,需要输入口令;
1)口令文件中存放sysdba/sysoper用户的用户名及口令,允许用户通过口令文件验证,在数据库未启动之前登陆,从而启动数据库(在数据库没有启动之前,数据库内建用户是无法通过数据库来验证身份的;如果没有口令文件,在数据库未启动之前就只能通过操作系统认证)。
2)使用Rman,很多时候需要在nomount,mount等状态对数据库进行处理,所以通常要求sysdba权限如果属于本地DBA组,可以通过操作系统认证登陆。
3)如果是远程sysdba登陆,需要通过passwordfile认证(参数要设置为SHARED or Exclusive,然后配合sql.net来实现).
4)设置初始化参数 REMOTE_LOGIN_PASSWORDFILE=(NODE/SHARED/EXCLUSIVE)
REMOTE_LOGIN_PASSWORDFILE : specifies whether Oracle checks for a password file.
|
Property |
Description |
|
Parameter type |
String |
|
Syntax |
REMOTE_LOGIN_PASSWORDFILE={NONE | SHARED} |
|
Default value |
SHARED |
|
Modifiable |
No |
|
Basic |
Yes |
|
Real Application Clusters |
Multiple instances must have the same value. |
NONE:Oracle ignores any password file. Therefore, privileged users must be authenticated by the operating system.
SHARED:One or more databases can use the password file. The password file can contain SYS as well as non-SYS user;(共享口令文件,如果有多个实例,则使用一个口令文件,这张模式不能使用alter user * identified by来修改sys的密码,只能重建口令文件来修改sys密码)
EXCLUSIVE:(独享的、独占)如果有多个实例,可以有单独的口令文件且可以使用alter user 修改sys密码。目前Oracle10 不使用这个参数,但保留了该参数。效果和shared是一样的)
5)创建口令文件:
C:\Documents and Settings\Administrator>orapwd
Usage: orapwd file=
where
file - name of password file (required), (创建的密码文件)
password - password for SYS will be prompted if not specified at command line, (创建sys用户的口令)
entries - maximum number of distinct DBA (optional),
(MAX_USER 口令文件中可以存放的最大用户数。即拥有sysdba和sysoper身份登陆的用户数)
force - whether to overwrite existing file (optional), (强制覆盖已存在的密码文件)
ignorecase - passwords are case-insensitive (optional),
nosysdba - whether to shut out the SYSDBA logon (optional Database Vault only). (sysdba用户不可以登陆)
There must be no spaces around the equal-to (=) character.
例: orapwd file=$ORACLE_HOME/dbs/testpwd.ora password=testoracle entries=1 force=y
select * from v$pwfile_users;
USERNAME SYSDB SYSOP
------------------------------ ----- -----
SYS TRUE TRUE
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/14710393/viewspace-1084394/ ,如需转载,请注明出处,否则将追究法律责任。