当前位置: 电脑软硬件应用网 > 设计学院 > 网络编程 > 数据库 > 正文 |
|
|||
正确认识password file的作用 | |||
2008-4-25 10:03:49 文/Henry 出处:赛迪网 | |||
许多人都知道,在数据库没有正式启动前,数据库的内建用户是无法通过数据库来验证身份的,但口令文件中存放sysdba/sysoper用户的用户名及口令却允许用户通过口令文件验来证,它可以在数据库未启动之前登录,然后再启动数据库。 (假如没有口令文件,在数据库未启动之前就只能通过操作系统认证)
(假如是远程sysdba登录,需要通过passwordfile认证)
local:
Connected to: Oracle9i Enterprise Edition Release 9.2.0.3.0 - Production With the Partitioning, OLAP and Oracle Data Mining options JServer Release 9.2.0.3.0 - Production
--------------------- ----------- ------------------------------ remote_login_passwordfile string NONE remote: E:\Oracle\ora92\bin>sqlplus /nologSQL*Plus: Release 9.2.0.4.0 - Production on 星期四 4月 15 09:39:22 2004Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.SQL> connect sys/oracle@hsjf as sysdbaERROR:ORA-01017: invalid username/password; logon denied
SQL> alter system set remote_login_passwordfile=exclusive scope=spfile;
ORACLE instance started.
Fixed Size 451576 bytes Variable Size 104857600 bytes Database Buffers 25165824 bytes Redo Buffers 667648 bytes Database mounted. Database opened. SQL> show parameter pass
------------------------------ ----------- -------------- remote_login_passwordfile string EXCLUSIVE SQL> alter user sys identified by oracle; User altered. remote: E:\Oracle\ora92\bin>sqlplus /nologSQL*Plus: Release 9.2.0.4.0 - Production on 星期四 4月 15 09:47:11 2004Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.SQL> connect sys/oracle@hsjf as sysdba已连接。SQL> show userUSER 为"SYS"SQL>
3.继续测试
Server: SQL> ! [oracle@jumper oracle]$ cd $ORACLE_HOME/dbs [oracle@jumper dbs]$ ls orapwhsjf orapwhsjf [oracle@jumper dbs]$ mv orapwhsjf orapwhsjf.bak [oracle@jumper dbs]$
E:\Oracle\ora92\bin>sqlplus /nolog
ERROR: ORA-01031: insufficient privileges
SQL>
ORACLE instance started.
Fixed Size 451576 bytes Variable Size 104857600 bytes Database Buffers 25165824 bytes Redo Buffers 667648 bytes ORA-01990: error opening password file '/opt/oracle/product/9.2.0/dbs/orapw' ORA-27037: unable to obtain file status Linux Error: 2: No such file or directory Additional information: 3 我们可以通过orapwd重建口令文件来解决此问题 此处我们恢复口令文件就可以了
[oracle@jumper oracle]$ mv $ORACLE_HOME/dbs/orapwhsjf.bak orapwhsjf [oracle@jumper oracle]$ exit exit
--多个数据库可以共享一个口令文件,但是只可以识别一个用户:SYS
------------------------------ ----- ----- SYS TRUE TRUE
grant sysdba to eygle * ERROR at line 1: ORA-01994: GRANT failed: cannot add users to public password file
SQL> show parameter password
---------------------- ----------- ---------------------------- remote_login_passwordfile string SHARED |
|||
关于45IT | About 45IT | 联系方式 | 版权声明 | 网站导航 | |
Copyright © 2003-2011 45IT. All Rights Reserved 浙ICP备09049068号 |