您好,登錄后才能下訂單哦!
生產(chǎn)庫上要修改生產(chǎn)用戶的密碼,密碼修改完后就涉及到修改dblink的密碼。
11gR2版本之前只能刪除dblink后重建,11gR2版本后可以直接修改。
修改dblink的密碼有兩種方法:
1、刪除dblink后重建
2、直接修改dblink的用戶密碼
下面測試兩種方法:
測試庫版本:11.2.0.4.0
創(chuàng)建兩個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
修改遠端數(shù)據(jù)庫密碼
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,則賦權(quán)grant alter database link to zx;
免責聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進行舉報,并提供相關(guān)證據(jù),一經(jīng)查實,將立刻刪除涉嫌侵權(quán)內(nèi)容。