Showing posts with label database link in oracle db. Show all posts
Showing posts with label database link in oracle db. Show all posts

Wednesday, August 16, 2023

database link in oracle database

 Make sure we have database entries of target db in tnsnames.ora

------------------------------------------------------------------

CREATE DATABASE LINK remote_db_link
CONNECT TO username IDENTIFIED BY password
USING 'remote_database_tns';

CREATE PUBLIC DATABASE LINK link_name
CONNECT TO username IDENTIFIED BY password
USING 'tns_string';

[oracle@pm admin]$ cat tnsnames.ora
chennai  =    # ----> this is "tns_string"
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = pm.shaikh.com)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SID = chennai)
    )
  )


SELECT * FROM remote_table@remote_db_link;


drop public database link db_link_name;
drop database link db_link_name;

select * from all_db_links;
select * from dba_db_links;
select * from user_db_links;

set lines 400;
col owner for a10;
col db_link for a30;
col username for a20;
col host for a20;
select owner,db_link,username,host from all_db_links;

Enable OpenSSH on Windows 11

Step 1: Install OpenSSH Server You can do this via PowerShell (run as Administrator ): Check if it's already available: Get-WindowsCapab...