正确认识password file的作用

来源:pcdog 作者:佚名 2008-04-24 出处:pcdog.com

linux  oracle  oracle数据库  操作系统  
上一页 1 2 3 4 

    很多人可能会产生有这样的疑问,多个Exclusive的数据库是否可以共享一个口令文件(orapw)呢?

    继续回到试验中:

    SQL> show parameter passwordNAME TYPE VALUE

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

    remote_login_passwordfile string SHARED

    [oracle@jumper dbs]$ strings orapw

    ]\[Z

    ORACLE Remote Password file

    INTERNAL

    AB27B53EDC5FEF41

    8A8F025737A9097A

    注意这里仅记录着INTERNAL/SYS的口令

    REMOTE_LOGIN_PASSWORDFILE=EXCLUSIVE 时

    SQL> alter system set remote_login_passwordfile=exclusive scope=spfile;System altered.

    SQL> startup force;

    ORACLE instance started.

    Total System Global Area 235999908 bytes

    Fixed Size 451236 bytes

    Variable Size 201326592 bytes

    Database Buffers 33554432 bytes

    Redo Buffers 667648 bytes

    Database mounted.

    Database opened.

    SQL> !

    [oracle@jumper bin]$ cd $ORACLE_HOME/dbs

    [oracle@jumper dbs]$ strings orapw

    ]\[Z

    ORACLE Remote Password file

    HSJF

    INTERNAL

    AB27B53EDC5FEF41

    8A8F025737A9097A

    [oracle@jumper dbs]$ exit

    exit

    注意此处,以EXCLUSIVE方式启动以后,实例名称信息就会被写入口令文件。

    如果此时有其它实例以Exclusive模式启动仍然可以使用这个口令文件,口令文件中的实例名称同时被改写。

    这也就是说,数据库只在启动过程中才读取口令文件,数据库运行过程中并不锁定该文件,类似于pfile/spfile文件。

    SQL> select * from v$pwfile_users;USERNAME SYSDB SYSOP

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

    SYS TRUE TRUE

    SQL> grant sysdba to eygle;

    Grant succeeded.

    SQL> select * from v$pwfile_users;

    USERNAME SYSDB SYSOP

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

    SYS TRUE TRUE

    EYGLE TRUE FALSE

    SQL> !

    [oracle@jumper bin]$ cd $ORACLE_HOME/dbs

    [oracle@jumper dbs]$ strings orapw

    ]\[Z

    ORACLE Remote Password file

    HSJF

    INTERNAL

    AB27B53EDC5FEF41

    8A8F025737A9097A

    >EYGLE

    B726E09FE21F8E83

    注意:

    在此处我们可以增加SYSDBA用户,并且这些信息可以被写入到口令文件。

    如果我们在口令文件中增加了其他SYSDBA用户,这个文件就不能被其它Exclusive的实例共享。

    仔细了解过后,我们可以发觉,口令文件对于其他用户来说其实就是启到了一个sudo的作用。

    6.重建口令文件

    假如口令文件丢失,使用orapwd可以很方便的重建口令文件,详细的语法如下:

    [oracle@jumper oracle]$ orapwdUsage: orapwd file= password= entries= where

    file - name of password file (mand),

    password - password for SYS (mand),

    entries - maximum number of distinct DBA and OPERs (opt),

    There are no spaces around the equal-to (=) character.



上一页 1 2 3 4 
上一篇:解析Oracle数据库中管理实例的方法
下一篇:Oracle数据库中管理表空间和数据文件