Oracle DB Link Notes

Submitted by code_admin on Mon, 07/23/2018 - 09:36

dblink

  1. drop public database link MYLINK;
  2.  
  3. CREATE public DATABASE LINK mylink
  4. CONNECT TO RJMODI_SOURCE IDENTIFIED BY RJMODI_SOURCE
  5. USING '//ODIGettingStarted:3621/orcl';
  6.  
  7. select *
  8.  
  9. select *
  10. from RJMODI_TESTSOURCE.rjm_test;
  11.  
  12.  
  13. select *
  14. from all_objects
  15. where object_name like '%RJM%'
  16. ;
  17.  
  18.  
  19. select *
  20. from ALL_DB_LINKS
  21. ;

Another way

  1. drop public database link VM_TO_HOST;
  2.  
  3. CREATE public DATABASE LINK VM_TO_HOST
  4. CONNECT TO RJMODI_TEMP IDENTIFIED BY RJMODI_TEMP
  5. --USING '//cc-rjmetcal:1521/PDBORCL'
  6. using '(DESCRIPTION= (ADDRESS=(PROTOCOL=tcp)(HOST=cc-rjmetcal)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=PDBORCL)))'
  7. ;
  8.  
  9. select * from rjmodi_testsource.rjm_test@vm_to_host;

Tags

RJM Article Type
Quick Reference