remote_login_passwordfile参数 2012-11-02 16:54:10
分类: Oracle
转自:http://www.dbasky.com/oracle/remote_login_passwordfile_sqlnet_ora.html
今天复习的一个知识点:
remote_login_passwordfile,一直对这个参数的认识只是停留在它控制是否sys用户能在远程使用密码文件认证登录,对于他的值设置,适用情况没有更深的研究,今天就打算做一些小实验来探索他的使用。
本次测试基于windows的oracle 10g,可能测试结果会有偏差。
首先阅读10g reference文档中的描述:
作用:这个参数控制oracle是否检查密码文件 取值范围:none,shared(默认) none:oracle会忽略任何密码文件,此时有权限的用户(比如sys)必须使用操作系统认证。 shared:一个或多个数据库可以使用密码文件,这时密码文件中可以包含sys和非sys用户 exclusive:这个参数10g中取消了,但为了向后兼容,你可以设置,与shared功能一样。 rac中多个实例应该有相同的值。
在oracle数据库没有启动之前,oracle内的用户是无法通过oracle来认证的,sys用户要启动oracle,就必须使用别的认证方式:一是密码文件认证,二是操作系统认证。
操作系统认证:通常要求该用户属于本地DBA组,然后通过操作系统认证登录到oracle,从而来启动数据库。
密码文件认证:如果是远程以sys用户登录来启动数据库,那么只有通过密码文件认证来登录了。
这个时候remote_login_passwordfile就来控制是否可以远程来登录。
1.remote_login_passwordfile = NONE
此时不能使用任何密码文件来登录数据库,只能在本地通过操作系统认证来起停数据库,远程sysdba登录是不被允许的,即使你$ORACLE_HOME/dbs下有密码文件。这样类似在别的机器上使用sqlplus sys/oracle@orcl as sysdba语句的登录都会报错。此时,即使你在本地机器上OEM database control也是会报错的,提示无效的用户名密码,实际也是不能用密码文件验证身份。
2.remote_login_passwordfile = SHARED
此时可以在远程使用密码文件认证来登录数据库,如果本地没有密码文件,或者密码文件丢失,也是不能登录成功的,此时可以使用orapwd重新创建密码文件。remote_login_passwordfile = SHARED时,更改sys用户密码是不被允许的。同时授予除sys外的其他用户sysdba权限也是不允许的。此时可以通过密码文件在本机成功登录OEM database control。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
|
SQL> show parameter pass
NAME TYPE VALUE ------------------------------------ ----------- ------------------------------ remote_login_passwordfile string SHARED
SQL> select * from v$pwfile_users;
USERNAME SYSDB SYSOP ------------------------------ ----- ----- SYS TRUE TRUE
SQL> alter user sys identified by oracle;
alter user sys identified by oracle * ERROR at line 1: ORA-28046: Password change for SYS disallowed
SQL> grant sysdba to test;
grant sysdba to test * ERROR at line 1: ORA-01999: password file cannot be updated in SHARED mode
|
windows系统中,shared模式下打开数据库的话不能删除pwd.ora文件,看来oralce会锁定这个文件给多个数据库使用。
2.remote_login_passwordfile = EXCLUSIVE
oracle 10g文档中说exclusive与shared有相同的行为,可是我做的实验的结果并不是这样,可见oracle的文档也不能全信。11g中这个错误被修正了。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44
|
SQL> alter system set remote_login_passwordfile=exclusive scope=spfile;
System altered.
SQL> shutdown immediate;
Database closed. Database dismounted. ORACLE instance shut down.
SQL> startup
ORA-32004: obsolete and/or deprecated parameter(s) specified ORACLE instance started. Total System Global Area 264241152 bytes Fixed Size 1296160 bytes Variable Size 163580128 bytes Database Buffers 92274688 bytes Redo Buffers 7090176 bytes Database mounted.
Database opened. SQL> SQL> SQL> show parameter remote NAME TYPE VALUE ------------------------------------ ----------- ------------------------ remote_archive_enable string true remote_dependencies_mode string TIMESTAMP remote_listener string remote_login_passwordfile string EXCLUSIVE remote_os_authent boolean FALSE remote_os_roles boolean FALSE SQL> SQL> SQL> grant sysdba to test; Grant succeeded. SQL> SQL> show parameter compati NAME TYPE VALUE ------------------------------------ ----------- ------------------------ compatible string 10.2.0.3.0 plsql_v2_compatibility boolean FALSE
|
当我又重新置会shared 模式时
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
|
SQL> alter system set remote_login_passwordfile =shared scope=spfile
System altered.
SQL> shutdown immediate;
Database closed. Database dismounted. ORACLE instance shut down . SQL> startup
ORA-32004: obsolete and/or deprecated parameter(s) specified
ORACLE instance started. Total System Global Area 264241152 bytes Fixed Size 1296160 bytes Variable Size 163580128 bytes Database Buffers 92274688 bytes Redo Buffers 7090176 bytes Database mounted. Database opened.
SQL> show parameter pass NAME TYPE VALUE ------------------------------------ ----------- --------- remote_login_passwordfile string SHARED
SQL> select * from v$pwfile_users;
USERNAME SYSDB SYSOP ------------------------------ ----- ----- SYS TRUE TRUE TEST TRUE FALSE
SQL> SQL> grant sysdba to test;
grant sysdba to test *
ERROR at line 1: ORA-01999: password file cannot be updated in SHARED mode
SQL> revoke sysdba from test;
revoke sysdba from test *
ERROR at line 1: ORA-01999: password file cannot be updated in SHARED mode
|
分享到:
相关推荐
之前用PL/SQL DEVELOPER和SQLPLUS 登录数据库都没有问题,就是应用程序通过JDBC连接Oracle时无法成功连接,出现ORA-12505错误listener does not currently know of SID given in connect descriptor
sqlplus / as sysdba时出现ORA-01031 insufficient privilege
主要介绍了解决windows10下"sqlplus / as sysdba"执行提示无权限问题,在文中给大家介绍了Windows下sqlplus “/as sysdba”登陆报“ORA-01031: insufficient privileges”处理方法,感兴趣的朋友跟随脚本之家小编...
win 8 升级 win 10 后,oracle 11g 无法启动及客户端连接,命令行sqlplus登录,startup 时报 ORA-00119 和 ORA-00132 的错误。 1. sqlplus /nolog 2. conn / as sysdba 3. startup 报错: ORA-00119 和 ORA-00132
PL/SQL培训_Les01 sqlplus的使用
使用PL/SQL登录ORACLE数据 报错,error while trying to retrieve text for error ORA-01804,的解决方法,操作步骤,在windows server 2008R2 64位,oracle 12C,PLSQL Developer 12 64位,以上使用环境正常,
PL/SQL Developer Language Settings语言设置: 改为简体中文 菜 单 栏: Tools ->preferences->User Interface -> Appearance -> Language 从下拉菜单中选择 “Chinese.lang”。 Change to English MENU Bar: 工具 -...
1.练习利用SQL*Plus编写、执行PL/SQL程序的命令。 2.记录执行命令和操作过程中遇到的问题及解决方法,注意从原理上解释原因。 3.练习利用PLSQL Developer编写和管理存储过程、存储函数和触发器等。
oracle视图操作工具,文件中包含注册码和应用软件,安装可直接使用
前言 最近在工作中遇到了一个问题,错误是Oracle dbca时报错:ORA-12547: TNS:lost contact,通过查找相关的资料...于是再sqlplus / as sysdba敲回车,也是报ORA-12547: TNS:lost contact, 基于之前的工程经验,先
1、Oracle 10g的完美安装,明白清楚的图解(且附:解释) 2、Oracle 10g的完全卸载 3、以sqlplus as sysdba(浏览器)登录Oracle数据库 执行sql*iplus 操作
Navicat for oracle、PL/SQL 都可以使用这个插件。instantclient-basic-win-x86-64-11.2.0.1.0,instantclient-sqlplus-windows.x64-11.2.0.4.0,解压合并到一个文件夹中。
PL/SQL developer 12.07 注册码,亲测有效 PL/SQL developer 12.07 注册码,亲测有效 PL/SQL developer 12.07 注册码,亲测有效
最新版PL/SQL 10.01 oracle维护工具,完全可以代替oracle自带sqlplus,使用方便,功能强大
sql> conn /as sysdba sql> conn system /密码 ----------------------- disconn断开连接 关闭数据库: (abort参数是强制关闭) shutdown (normal/transactional/abort) 启动数据库: conn /as sysdba startup ...
NULL 博文链接:https://ajita.iteye.com/blog/1725304
简单来说,用PL/SQL执行下一下几个脚本就可以了。 特别要注意:PL/SQL登录时,要选择以sysdba的方式登录。同时用户要有dba的权限(如通过system用户给新用户分配权限:grant connect, resource, dba to scott) ...
Oracle的学习笔记,很有用的啊!里面有sqlplus,PL/SQL.对编程的朋友很有用
$sqlplus '/as sysdba' SQL> @?/rdbms/admin/dbmslm.sql --用来创建DBMS_LOGMNR包,该包用来分析日志文件。 SQL> @?/rdbms/admin/dbmslmd.sql --用来创建DBMS_LOGMNR_D包,该包用来创建数据字典文件。