首页 > 数据库 >oracle修改用户密码的方法

oracle修改用户密码的方法

时间:2023-05-04 14:01:34浏览次数:51  
标签:name argument 用户 number 密码 file entries oracle password

Oracle用户名及默认密码

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

普通用户  

(1)通过alter user语法来进行修改 ,这也是最常见的方式:

(2) 第二种方式,是通过password命令来修改:


从安全性角度来说 ,推荐大家通过第二种方式来修改用户密码,这样可防止明文密码泄露。


sys用户

另外关于sys用户密码,不要使用password以及alter user 方式去修改,原因主要如下:

(1) 当REMOTE_LOGIN_PASSWORDFILE参数设置为shared时,我们使用alter user 修改sys密码时,会报

ORA-28046: Password change for SYS disallowed error.

测试如下:


(2) 大多数内部递归SQL都使用SYS用户。因此,如果您试图在数据库打开时使用ALTER USER语句更改此密码,则可能会导致死锁。


因此,对于sys用户我们需要使用orapwd来进行修改:

[oracle@orcl 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.

 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


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.

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. 

标签:name,argument,用户,number,密码,file,entries,oracle,password
From: https://www.cnblogs.com/lcword/p/17371030.html

相关文章

  • 解决上传md文件时出现的“<Fault 401: '请配置正确的用户名与访问令牌(access token),
    使用的工具:pycnbolg下载地址:https://github.com/dongfanger/pycnblog具体操作按这位大神的博客:如何在博客园上传markdown文件-NotYourferry-博客园(cnblogs.com)出现报错如图:偶然看到这两位的评论:于是我将config.yaml中的password改成了我的令牌,就上传成功了。......
  • 综合能源系统优化 数据来源《考虑用户侧柔性负荷的社区综合能源系统日前优化调度_刘蓉
    综合能源系统优化数据来源《考虑用户侧柔性负荷的社区综合能源系统日前优化调度_刘蓉晖》%%风电+储能+电网交易+燃气轮机+燃气锅炉+电制冷机+(%燃料电池FC+溴化锂制冷机LBR+余热锅炉)有电负荷+热负荷+冷负荷加上环境成本简单注释清楚相对于大众版本,注释经过本人优化MATLAB+y......
  • ORACLE用户基础汇总
    一用户访问问题1.登录用户账号时用户锁定SQL>connectORACLE_OCM/oracleERROR:ORA-28000:帐户已被锁定查看用户资源配置:selecta.username,b.profile,b.resource_name,b.limitfromdba_usersa,dba_profilesbwherea.username='ORACLE_OCM'anda.profile=b.profil......
  • nginx 开启目录索引及简单用户认证
    目录索引及简单用户认证ngx_http_autoindex_module模块可以支持目录列表浏览,开启方式location/{autoindexon;}开启后就可以通过浏览器访问目录下的文件列表,像很多镜像资源站一样。可以文件浏览下载。这时候如果对某个目录不是所有用户可以访问下载,则可以使用ngx_htt......
  • 【HMS Core】获取用户信息接口,返回 session timeout
    【问题描述】集成华为账号服务,获取用户信息,调用相关接口一直返回sessiontimeout,参考链接:https://developer.huawei.com/consumer/cn/doc/development/HMSCore-References/get-user-info-0000001060261938​ 【解决方案】1、如果是走的端测的比如OkHttpClient这种方式的是需......
  • Oracle表空间迁移
    1.检查数据文件状态STATUS为AVAILABLEselectFILE_ID,FILE_NAME,TABLESPACE_NAME,STATUSfromdba_data_files;2.关闭数据库shutdownimmediate3.cp数据文件cp/data/oradata/sms/tbs_mobile_10_001.dbf/data1/oradata/tbs_mobile_10_001.dbfcp/data/oradata/sm......
  • Debian用户获取ROOT权限
    首先登陆超级管理员账户,在Terminal命令行内输入su,“Enter”键后,输入超级管理员密码,即进入root账户输入命令apt-getinstallsudo,"Enter"键后,系统即开始安装sudo输入命令adduserjomsudo,“Enter”键将我的用户名jom添加到sudo组内,大家根据实际将自己的用......
  • mysql忘记密码
    在忘记MySQL密码的情况下,可以通过--skip-grant-tables关闭服务器的认证,然后重置root的密码,具体操作步骤如下。步骤1):关闭正在运行的MySQL服务。打开cmd进入MySQL的bin目录。步骤2):输入mysqld--console--skip-grant-tables--shared-memory命令。–skip-gr......
  • vue学习 第十天(1) css高级技巧 ----CSS用户界面样式 / vertical-align属性应用
    用户界面样式 1)鼠标样式cursorli{cursor:pointer;}设置或检索在对象上移动的鼠标指针采用何种系统预定义的光标形状。 2、轮廓线outline给表单添加outline:0;或者outline:none;样式之后,就可以去掉默认的蓝色边......
  • 一个excel文件中用不同密码实现打开不同表格
    一个excel文件中用不同密码实现打开不同表格ALT+F11打开VBAProjectCTRL+R找到ThisWorkBook双击打开粘贴如下代码PrivateSubWorkbook_BeforeClose(CancelAsBoolean)Dimy,arrarr=Sheets("权限管理").Range("A1").CurrentRegionFory=2ToUBound(arr,2)Sheets(a......