Thứ Ba, 1 tháng 12, 2020

Thủ tục tạo dblink bằng user khác

CREATE OR REPLACE PROCEDURE user1.cre_dbl
IS
    v_sql   LONG;
BEGIN
    v_sql :=
        'CREATE DATABASE LINK dblink1
 CONNECT TO user1
 IDENTIFIED BY paswd
 USING '
        || ''''
        || '(DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.1)(PORT = 1521))
    (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.2)(PORT = 1521))
      (LOAD_BALANCE = yes)
      (FAILOVER = yes)
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = db1)
    )
  )'
        || '''';

    EXECUTE IMMEDIATE v_sql;
END;
/

begin
user1.cre_dbl;
end;

drop procedure user1.cre_dbl;

---------

CREATE OR REPLACE PROCEDURE user1.drop_dbl
IS
BEGIN
    EXECUTE IMMEDIATE 'drop DATABASE LINK dblink1';
END;
/
begin
user1.drop_dbl;
end;

drop procedure user1.drop_dbl;

KẾT NỐI VỚI CHUYÊN GIA TRẦN VĂN BÌNH: 📧 Mail: binhoracle@gmail.com ☎️ Mobile: 0902912888 ⚡️ Skype: tranbinh48ca 👨 Facebook: https://www.facebook.com/BinhOracleMaster 👨 Inbox Messenger: https://m.me/101036604657441 (profile) 👨 Fanpage: https://www.facebook.com/tranvanbinh.vn 👨 Inbox Fanpage: https://m.me/tranvanbinh.vn 👨👩 Group FB: https://www.facebook.com/groups/OracleDBAVietNam 👨 Website: http://www.tranvanbinh.vn 👨 Blogger: https://tranvanbinhmaster.blogspot.com 🎬 Youtube: http://bit.ly/ytb_binhoraclemaster 👨 Tiktok: https://www.tiktok.com/@binhoraclemaster?lang=vi 👨 Linkin: https://www.linkedin.com/in/binhoracle 👨 Twitter: https://twitter.com/binhoracle 👨 Địa chỉ: Tòa nhà Sun Square - 21 Lê Đức Thọ - Phường Mỹ Đình 1 - Quận Nam Từ Liêm - TP.Hà Nội #OracleTutorial #OracleDBA #OracleDatabaseAdministration #học oracle database #oca #ocp #oce #ocm

ĐỌC NHIỀU

Trần Văn Bình - Oracle Database Master