oracle修改用户密码的方法

修改oracle用户的密码有以下方法:

普通用户

(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, Linux, 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 .

IGNORECASE
If 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.

原文地址:https://blog.51cto.com/14337216/2406428

时间: 2024-10-26 10:30:46

oracle修改用户密码的方法的相关文章

Oracle修改用户密码

如何在Oracle中修改用户密码 在Oracle数据库中,使用alter user来修改用户密码. 语法 ALTER USER user_name IDENTIFIED BY new_password; 参数说明: user_name: 要修改密码的Oracle数据库用户. new_password: 要修改成的新密码. 示例: 如果你想重置用户名为DDW用户的密码为autumn,你可以使用以下语句来修改: ALTER USER DDW IDENTIFIED BY autumn;

Sqlserver 命令行方式修改 用户密码的方法

1. 之前写了一个 可以使用  ssms 的方式修改密码的情况 2. 还有办法是执行命令 exec sp_password null,'newpassword','sa' # sa 是用户名 newpassword 是新密码 还有一个办法 alter login sa with password='newpassword' 注意有等号 注意有with 注意是 alter login 不是 alter user 3. 其实还有一个办法 不是登录 ssms 是使用sqlcmd的方式来处理. SQLC

oracle修改用户密码180天为不限制

默认情况下oracle 数据库安装完成后,用户的密码有效期为180天,如果密码过期失效会影响业务运行,所以要修改为不限制 登录sqlplus Connected to Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 Connected as hml SQL> select username,profile from dba_users; **查看用户使用的配置文件 USERNAME                       P

mysql修改用户密码的方法及命令

转: 方法1: 用SET PASSWORD命令 首先登录MySQL. 格式:mysql> set password for 用户名@localhost = password('新密码'); 例子:mysql> set password for [email protected] = password('123'); 方法2:用mysqladmin 格式:mysqladmin -u用户名 -p旧密码 password 新密码 例子:mysqladmin -uroot -p123456 passw

在非域环境中修改域用户密码的方法

前几天有个单位,新配置了一台服务器,做文件服务器,为网络中提供共享文件夹服务,该单位大约有50多个用户.服务器采用Windows Server 2008 R2操作系统,升级到Active Directory,为单位每个职工创建了一个用户名,在服务器上除了为每个用户创建一个"共享文件夹"保存个人数据外,还创建了"公共"共享文件夹,保存单位的数据,并且在公共文件夹中创建了若干子目录,通过用户权限,设置只让指定用户上传.修改其中的文件. 在开始规划的时候,是计划让单位的所

Oracle dba权限下修改用户密码 授予用户权限 解锁用户

1.修改用户密码 alter user scott identified by 123 2.授予用户权限 grant connect,resource to scott 3.解锁用户 alter user scott account unlock

如何实现Oracle修改用户权限 .

这里将介绍Oracle修改用户权限的实现过程,包括一些权限管理方面的东西.希望通过本文能对大家了解Oracle修改用户权限有所帮助. ORACLE数据库用户与权限管理 ORACLE是多用户系统,它允许许多用户共享系统资源.为了保证数据库系统的安全,数据库管理系统配置了良好的安全机制. 2. 1 ORACLE数据库安全策略 建立系统级的安全保证 系统级特权是通过授予用户系统级的权利来实现,系统级的权利(系统特权)包括:建立表空间.建立用户.修改用户的权利.删除用户等.系统特权可授予用户,也可以随时

oracle 11g 用户密码过期问题解决

今天听同事讲到oracle密码过期问题,才想起来oracle 11g默认用户密码有效期为180天,oracle 10g默认用户密码为无期.oracle 11g用户密码过期会提示ORA-28001密码过期或ORA-28002密码将过期的错误.用户密码过期有可能导致应用连接出现问题,例如使用oracle 11g为数据库的vcenter,其vpx用户密码过期有可能导致vcenter服务无法运行: 解决oracle 11g用户密码过期的问题可以通过更改用户密码解决:alter user *** iden

passwd修改用户密码

语法:passwd[username] 等创建完账户后,默认是没有设置密码的.虽然没有密码,但该账户同样登录不了系统.只有设置好密码后才可以登录系统.在为用户创建密码时,安全起见,请尽量设置复杂一些. 建议按照以下规则设置密码: (1)长度大于10个字符: (2)密码中包含大小写字母数字以及特殊字符 * .& .%等: (3)不规则性(不要出现happy.love.Linux.7758520等等单词或者数字:) (4)不要带有自己名字.公司名字.自己电话.自己生日等. [[email prote