普通用户
(1)通过alter user语法来进行修改 ,这也是最常见的方式:
http://img.blog.itpub.net/blog/2019/06/06/72d7cc8a5eb5f0fe.png?x-oss-process=style/bb
(2) 第二种方式,是通过password命令来修改:
http://img.blog.itpub.net/blog/2019/06/06/041fe0b0d8ae0c7c.png?x-oss-process=style/bb
从安全性角度来说 ,推荐大家通过第二种方式来修改用户密码,这样可防止明文密码泄露。
sys用户
另外关于sys用户密码,不要使用password以及alter user 方式去修改,原因主要如下:
(1) 当REMOTE_LOGIN_PASSWORDfile参数设置为shared时,我们使用alter user 修改sys密码时,会报
ORA-28046: Password change for SYS disallowed error.
测试如下:
http://img.blog.itpub.net/blog/2019/06/06/250ba0601abec7ab.png?x-oss-process=style/bb
(2) 大多数内部递归sql都使用SYS用户。因此,如果您试图在数据库打开时使用ALTER USER语句更改此密码,则可能会导致死锁。
因此,对于sys用户我们需要使用orapwd来进行修改:
[[email protected] dbs]$ orapwd file=‘orapworcl‘ entrIEs=5 force=y 这里注意等号左右不能有空格;
关于orapwd说明引用官网,如下:
Argument Description
file name to assign to the password file. You must supply a complete path. If you supply only a file name,the file is written to the current directory.
ENTRIES (Optional) Maximum number of entrIEs (user accounts) to permit in the file.
FORCE (Optional) If y,permits overwriting an existing password file.
IGnorECASE (Optional) If y,passwords are treated as case-insensitive.
file
This argument sets the name of the password file being created. You must specify the full path name for the file. This argument is mandatory.
The file name required for the password file is operating system specific. Some operating systems require the password file to adhere to a specific format and be located in a specific directory. Other operating systems allow the use of environment variables to specify the name and location of the password file.
table 1-1 Lists the required name and location for the password file on the UNIX,linux,and windows platforms. For other platforms,consult your platform-specific documentation.
table 1-1 required Password file name and Location on UNIX,and windows
Platform required name required Location)
UNIX and linux
orapw ORACLE_SID
ORACLE_HOME /dbs
windows
PWD ORACLE_SID .ora
ORACLE_HOME \database
郑州不孕不育医院×××:http://www.zzchyy110.com/zztjyy/
For example,for a database instance with the SID orclDW,the password file must be named orapworclDW on linux and PWDorclDW.ora on windows.
In an Oracle Real Application Clusters environment on a platform that requires an environment variable to be set to the path of the password file,the environment variable for each instance must point to the same password file.
郑州妇科医院:http://jbk.39.net/yiyuanzaixian/sysdfkyy/
Caution:
It is critically important to the security of your system that you protect your password file and the environment variables that IDentify the location of the password file. Any user with access to these Could potentially compromise the security of the connection.
ENTRIES
This argument specifIEs the number of entrIEs that you require the password file to accept. This number corresponds to the number of distinct users allowed to connect to the database as SYSDBA or SYSOPER . The actual number of allowable entrIEs can be higher than the number of users,because the ORAPWD utility continues to assign password entrIEs until an operating system block is filled. For example,if your operating system block size is 512 bytes,it holds four password entrIEs. The number of password entrIEs allocated is always a multiple of four.
EntrIEs can be reused as users are added to and removed from the password file. If you intend to specify REMOTE_LOGIN_PASSWORDfile=EXCLUSIVE,and to allow the granting of SYSDBA and SYSOPER privileges to users,this argument is required.
Caution:
When you exceed the allocated number of password entrIEs,you must create a new password file. To avoID this necessity,allocate more entrIEs than you think you will ever need.
FORCE
This argument,if set to Y,enables you to overwrite an existing password file. An error is returned if a password file of the same name already exists and this argument is omitted or set to N .
IGnorECASEIf this argument is set to y,passwords are case-insensitive. That is,case is ignored when comparing the password that the user supplIEs during login with the password in the password file.
总结以上是内存溢出为你收集整理的oracle修改用户密码的方法全部内容,希望文章能够帮你解决oracle修改用户密码的方法所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)