生产库上要修改生产用户的密码,密码修改完后就涉及到修改dblink的密码。
让客户满意是我们工作的目标,不断超越客户的期望值来自于我们对这个行业的热爱。我们立志把好的技术通过有效、简单的方式提供给客户,将通过不懈努力成为客户在信息化领域值得信任、有价值的长期合作伙伴,公司提供的服务项目有:空间域名、网站空间、营销软件、网站建设、向阳网站维护、网站推广。
11gR2版本之前只能删除dblink后重建,11gR2版本后可以直接修改。
修改dblink的密码有两种方法:
1、删除dblink后重建
2、直接修改dblink的用户密码
下面测试两种方法:
测试库版本:11.2.0.4.0
创建两个dblink,一个PUBLIC另一个PRIVATE
create PUBLIC database link link_101 connect to SYSTEM identified by "123456" using '(DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.56.11)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = mydb) ) )'; create database link link_102 connect to SYSTEM identified by "123456" using '(DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.56.11)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = mydb) ) )'; sys@ORCL>select * from dual@link_101; DUM --- X sys@ORCL>select * from dual@link_102; DUM --- X
修改远端数据库密码
SQL> alter user system identified by "654321"; User altered. sys@ORCL>select * from dual@link_101; select * from dual@link_101 * ERROR at line 1: ORA-01017: invalid username/password; logon denied ORA-02063: preceding line from LINK_101 sys@ORCL>select * from dual@link_102; select * from dual@link_102 * ERROR at line 1: ORA-01017: invalid username/password; logon denied ORA-02063: preceding line from LINK_102
方法一:
sys@ORCL>drop public database link link_101; Database link dropped. sys@ORCL>drop database link link_102; Database link dropped. create PUBLIC database link link_101 connect to SYSTEM identified by "654321" using '(DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.56.11)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = mydb) ) )'; create database link link_102 connect to SYSTEM identified by "654321" using '(DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.56.11)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = mydb) ) )'; sys@ORCL>select * from dual@link_101; DUM --- X sys@ORCL>select * from dual@link_102; DUM --- X
方法二:
sys@ORCL>select * from dual@link_101; select * from dual@link_101 * ERROR at line 1: ORA-01017: invalid username/password; logon denied ORA-02063: preceding line from LINK_101 sys@ORCL>select * from dual@link_102; select * from dual@link_102 * ERROR at line 1: ORA-01017: invalid username/password; logon denied ORA-02063: preceding line from LINK_102 sys@ORCL>alter public database link link_101 connect to system identified by "654321"; Database link altered. sys@ORCL>alter database link link_102 connect to system identified by "654321"; Database link altered. sys@ORCL>select * from dual@link_101; DUM --- X sys@ORCL>select * from dual@link_102; DUM --- X
方法二如果提示ORA-01031: insufficient privileges,则赋权grant alter database link to zx;
名称栏目:Oracle修改DatabaseLink密码
文章URL:https://www.cdcxhl.com/article8/jgpoip.html
成都网站建设公司_创新互联,为您提供品牌网站设计、关键词优化、小程序开发、商城网站、网站内链、网站策划
声明:本网站发布的内容(图片、视频和文字)以用户投稿、用户转载内容为主,如果涉及侵权请尽快告知,我们将会在第一时间删除。文章观点不代表本网站立场,如需处理请联系客服。电话:028-86922220;邮箱:631063699@qq.com。内容未经允许不得转载,或转载时需注明来源: 创新互联