Pages

Wednesday, March 19, 2014

How to create database link in oracle

What is database link?

A database link is a schema object in one database that enables you to access objects on another database. The other database need not be an Oracle Database system. 

How to create a database link in Oracle? 

To create database link you must specify the database link name, the remote user to connect to, the password for the remote user and the TNS service name for the database link connection. Below are the command to create database link in oracle.

create public database link mylink connect to remote_username identified by mypassword using 'tns_service_name';

How to access object in database link

To access object in database link you can use @link_name as query below :

SELECT * FROM employees@local;

for more information about oracle database link, you can find in oracle docs page

 

Tuesday, March 18, 2014

How to set ORACLE_HOME in Windows Environment Variable

What is ORACLE_HOME used for?


The ORACLE_HOME is an environment variable which is used to set and define the path of Oracle Home (server) Directory.

What is ORACLE_BASE used for?

* The ORACLE_BASE is also an environment variable to define the base/root level directory where you will have the Oracle Database directory tree - ORACLE_HOME defined under the ORACLE_BASE directory. 

How to set ORACLE_HOME in Environment variable

To set the ORACLE_HOME environment variable go to My Computer -> Properties -> Advanced -> Environment Variables -> System Variables -> New/Edit/Delete.


oracle home environment variable
After setting the environment variables, open a fresh CMD tool and check whether they set properly or not. Do not try on already opened CMD tool to make sure the variables set or not.

How to check if ORACLE_HOME is set

Open cmd and type this command
C:\echo %ORACLE_HOME% 
Don't Forget To Join Our Community
×
Widget