搜索
首页数据库mysql教程Oracle的RAC环境下SYS密码修改

在rac中,如果你仅仅是在一个节点上运行alter user sys的命令,完成更改后,数据库自动在此节点上更新密码文件。但是,在其他节点

sys是数据库库中权限最高的用户,在登录时,我们可以用os认证的方式直接登录,也可以利用sqlplus “sys/your_password@your_tnsnames as sysdba”来登录。特别是对于后面的这种远程登录,,在第三方的备份备份软件中需要配置。因此这个文件对于使用了第三方备份软件的数据库系统,就比较重要了。

在单实例,如果我们在数据库执行了更改密码的命令:alter user sys identified by new_password;这个时候,数据库就会自动的改写$Oracle_HOME/dbs/下的密码文件,将里面的内容改成新密码。但是在rac中,这就是一个比较需要注意的地方了。

在rac中,如果你仅仅是在一个节点上运行alter user sys的命令,完成更改后,数据库自动在此节点上更新密码文件。但是,在其他节点中,这个密码文件不会被更新,还是原来的密码文件。这就造成了一个很奇特的现象:在一个3节点的rac中,rac1上登录数据库后更改了sys的密码,在rac1主机上的密码文件被更新,rac2和rac3主机上密码文件不会被更新,仍然能用老密码来登录rac2和rac3。
rac1:

rac1-> ll
……
-rw-r-----  1 oracle oinstall  1536 Jun 21  2009 orapwdevdb1
 
##我们看到这边的密码文件还是2009年6月21日的。我们到数据库更改sys密码。
 
rac1-> sqlplus "/ as sysdba"
 
SQL*Plus: Release 10.2.0.1.0 - Production on Tue Mar 30 22:31:59 2010
 
Copyright (c) 1982, 2005, Oracle.  All rights reserved.
 
 
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, Real Application Clusters, OLAP and Data Mining options
 
SQL> alter user sys identified by oracle123;
 
User altered.
 
SQL>
 
## 我们看到密码文件被更新
rac1-> ls -l
……
-rw-r-----  1 oracle oinstall  1536 Mar 30 22:33 orapwdevdb1
rac1-> date
Tue Mar 30 22:33:42 CST 2010
rac1->
rac2上:

rac2-> ll
……
-rw-r-----  1 oracle oinstall  1536 Jun 21  2009 orapwdevdb2
 
##密码文件未被更新
rac3:

rac3-> cd $ORACLE_HOME/dbs
rac3-> ll
……
-rw-r-----  1 oracle oinstall  1536 Jun 21  2009 orapwdevdb3
rac3->
 
## rac3上的密码文件也未被更新。
## 新密码无法登录rac3和rac2,但是可以用老密码远程登录rac3和rac2,用新密码远程登录rac1.
[root@rac3 root]# sqlplus "sys/oracle123@DEVDB3 as sysdba"
 
SQL*Plus: Release 10.2.0.1.0 - Production on Tue Mar 30 22:46:18 2010
 
Copyright (c) 1982, 2005, Oracle.  All rights reserved.
 
ERROR:
ORA-01017: invalid username/password; logon denied
 
 
Enter user-name:
ERROR:
ORA-01017: invalid username/password; logon denied
 
 
Enter user-name:
ERROR:
ORA-01017: invalid username/password; logon denied
 
 
SP2-0157: unable to CONNECT to ORACLE after 3 attempts, exiting SQL*Plus
[root@rac3 root]
[root@rac3 admin]# sqlplus "sys/oracle@DEVDB2 as sysdba"
 
SQL*Plus: Release 10.2.0.1.0 - Production on Tue Mar 30 23:59:22 2010
 
Copyright (c) 1982, 2005, Oracle.  All rights reserved.
 
 
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, Real Application Clusters, OLAP and Data Mining options
 
SQL> exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, Real Application Clusters, OLAP and Data Mining option
 
[root@rac3 admin]# sqlplus "sys/oracle@DEVDB3 as sysdba"
 
SQL*Plus: Release 10.2.0.1.0 - Production on Tue Mar 30 23:58:49 2010
 
Copyright (c) 1982, 2005, Oracle.  All rights reserved.
 
 
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, Real Application Clusters, OLAP and Data Mining options
 
SQL> exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, Real Application Clusters, OLAP and Data Mining options
[root@rac3 admin]#
 
[root@rac3 admin]# sqlplus "sys/oracle123@devdb1 as sysdba"
 
SQL*Plus: Release 10.2.0.1.0 - Production on Wed Mar 31 00:23:27 2010
 
Copyright (c) 1982, 2005, Oracle.  All rights reserved.
 
 
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, Real Application Clusters, OLAP and Data Mining options
 
SQL>

linux

声明
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn
如何使用Alter Table语句在MySQL中更改表?如何使用Alter Table语句在MySQL中更改表?Mar 19, 2025 pm 03:51 PM

本文讨论了使用MySQL的Alter Table语句修改表,包括添加/删除列,重命名表/列以及更改列数据类型。

如何为MySQL连接配置SSL/TLS加密?如何为MySQL连接配置SSL/TLS加密?Mar 18, 2025 pm 12:01 PM

文章讨论了为MySQL配置SSL/TLS加密,包括证书生成和验证。主要问题是使用自签名证书的安全含义。[角色计数:159]

您如何处理MySQL中的大型数据集?您如何处理MySQL中的大型数据集?Mar 21, 2025 pm 12:15 PM

文章讨论了处理MySQL中大型数据集的策略,包括分区,碎片,索引和查询优化。

哪些流行的MySQL GUI工具(例如MySQL Workbench,PhpMyAdmin)是什么?哪些流行的MySQL GUI工具(例如MySQL Workbench,PhpMyAdmin)是什么?Mar 21, 2025 pm 06:28 PM

文章讨论了流行的MySQL GUI工具,例如MySQL Workbench和PhpMyAdmin,比较了它们对初学者和高级用户的功能和适合性。[159个字符]

如何使用Drop Table语句将表放入MySQL中?如何使用Drop Table语句将表放入MySQL中?Mar 19, 2025 pm 03:52 PM

本文讨论了使用Drop Table语句在MySQL中放下表,并强调了预防措施和风险。它强调,没有备份,该动作是不可逆转的,详细介绍了恢复方法和潜在的生产环境危害。

如何在JSON列上创建索引?如何在JSON列上创建索引?Mar 21, 2025 pm 12:13 PM

本文讨论了在PostgreSQL,MySQL和MongoDB等各个数据库中的JSON列上创建索引,以增强查询性能。它解释了索引特定的JSON路径的语法和好处,并列出了支持的数据库系统。

您如何用外国钥匙代表关系?您如何用外国钥匙代表关系?Mar 19, 2025 pm 03:48 PM

文章讨论了使用外国密钥来代表数据库中的关系,重点是最佳实践,数据完整性和避免的常见陷阱。

如何保护MySQL免受常见漏洞(SQL注入,蛮力攻击)?如何保护MySQL免受常见漏洞(SQL注入,蛮力攻击)?Mar 18, 2025 pm 12:00 PM

文章讨论了使用准备好的语句,输入验证和强密码策略确保针对SQL注入和蛮力攻击的MySQL。(159个字符)

See all articles

热AI工具

Undresser.AI Undress

Undresser.AI Undress

人工智能驱动的应用程序,用于创建逼真的裸体照片

AI Clothes Remover

AI Clothes Remover

用于从照片中去除衣服的在线人工智能工具。

Undress AI Tool

Undress AI Tool

免费脱衣服图片

Clothoff.io

Clothoff.io

AI脱衣机

AI Hentai Generator

AI Hentai Generator

免费生成ai无尽的。

热门文章

R.E.P.O.能量晶体解释及其做什么(黄色晶体)
3 周前By尊渡假赌尊渡假赌尊渡假赌
R.E.P.O.最佳图形设置
3 周前By尊渡假赌尊渡假赌尊渡假赌
R.E.P.O.如果您听不到任何人,如何修复音频
3 周前By尊渡假赌尊渡假赌尊渡假赌

热工具

Atom编辑器mac版下载

Atom编辑器mac版下载

最流行的的开源编辑器

Dreamweaver Mac版

Dreamweaver Mac版

视觉化网页开发工具

VSCode Windows 64位 下载

VSCode Windows 64位 下载

微软推出的免费、功能强大的一款IDE编辑器

适用于 Eclipse 的 SAP NetWeaver 服务器适配器

适用于 Eclipse 的 SAP NetWeaver 服务器适配器

将Eclipse与SAP NetWeaver应用服务器集成。

EditPlus 中文破解版

EditPlus 中文破解版

体积小,语法高亮,不支持代码提示功能