Oracle 创建LinkedServer(不积跬步,无以至千里)

------------------------------------------------Database Link Begin------------------------------------------------


--DATABASE LINK (执行前需要修改用户名,密码,HOST,SERVICE_NAME)
declare v_count int;
begin
   select   count(*) into v_count 
   from   DBA_DB_LINKS   
   where   UPPER(DB_LINK) = UPPER('link_SK') AND OWNER = 'PUBLIC';
  if v_count > 0 then
    execute immediate 'DROP public DATABASE LINK LINK_SK ';
  end if;
end;
/


  create  public database link link_SanFu_SF connect to "*****" identified by "************" using '(DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = ***IP***)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = *******)
    )
  )'; 
 ------------------------------------------------Database Link End--------------------------------------------------
 


 

你可能感兴趣的:(Oracle 创建LinkedServer(不积跬步,无以至千里))