<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Oracle Database Tips blog &#187; create oracle db link</title>
	<atom:link href="http://oracle-database-tips.com/wp/tag/create-oracle-db-link/feed" rel="self" type="application/rss+xml" />
	<link>http://oracle-database-tips.com/wp</link>
	<description>News for Oracle professionals</description>
	<lastBuildDate>Fri, 03 Feb 2012 10:37:02 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Create Oracle database link</title>
		<link>http://oracle-database-tips.com/wp/dblinks/create-oracle-database-link</link>
		<comments>http://oracle-database-tips.com/wp/dblinks/create-oracle-database-link#comments</comments>
		<pubDate>Fri, 23 Oct 2009 11:59:00 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[DB Links]]></category>
		<category><![CDATA[create oracle db link]]></category>
		<category><![CDATA[database users]]></category>
		<category><![CDATA[global name]]></category>
		<category><![CDATA[global names]]></category>
		<category><![CDATA[security risk]]></category>
		<category><![CDATA[word public]]></category>

		<guid isPermaLink="false">http://oracle-database-tips.com/wp/?p=110</guid>
		<description><![CDATA[Syntax and explanation on creating Oracle database links.]]></description>
			<content:encoded><![CDATA[<p>Syntax :</p>
<p>CREATE {PUBLIC} DATABASE LINK<br />
{CONNECT TO<br />
IDENTIFIED BY  }<br />
USING &#8216;  &#8216;;</p>
<p>Privileges needed</p>
<p>When creating an oracle database link, you can decide to create it privately,<br />
for use only by the owner of the database link,<br />
or publicly, for use by all other database users who have the right privileges.</p>
<p>If you do not specify the word &#8216;PUBLIC&#8217; in the create statement, the database link will be created as a private one by default.<br />
Once a public database link has been created, it will be owned by a special user named &#8216;PUBLIC&#8217;.</p>
<p>The second decision is to create it with a hard-coded username and password, or without access credentials.<br />
If you create a public database link without access credentials, any user accessing it will do so with his own username and password.</p>
<p>Take care when creating a public dblink with a hardcoded username and password, it is a security risk.</p>
<p>Creation</p>
<p>Now that you are ready to create it, you must provide a database link name<br />
(this is what your db link will be called).</p>
<p>One common problem with dblinks is that Oracle will not allow you to create a db link whose name is different from the global name<br />
of the remote database if the local database&#8217;s &#8216;GLOBAL_NAMES&#8217; initialization parameter is set to &#8216;TRUE&#8217;.</p>
<p>Lastly, you must specify a valid tnsnames alias which Oracle will use to connect to the remote database.<br />
To test if your tnsnames.ora alias is valid, try to access it through sql*plus on your local server.</p>
<p>To be able to create a database link, you will need to have the system privilege<br />
&#8216;CREATE DATABASE LINK&#8217;<br />
or<br />
&#8216;CREATE PUBLIC DATABASE LINK&#8217;<br />
granted to you.</p>
<p>The remote user will need to have at least &#8216;CREATE SESSION&#8217; privileges.</p>
<p>Examples:<br />
Let&#8217;s create a private database link using a hard-coded username and password.</p>
<p>SQL&gt;Create database link remotedb connect to scott identified by tiger using &#8216;remotedb.world.com&#8217;;<br />
Database link created.</p>
<p>The same db link without a username/password:</p>
<p>SQL&gt;create database link remotedb using &#8216;remotedb.world.com&#8217;;<br />
Database link created.</p>
<p>Here&#8217;s an example to create a public database link with a username and password:</p>
<p>SQL&gt; create public database link remotedb connect to scott identified by tiger using &#8216;remotedb.world.com&#8217;;<br />
Database link created.</p>
<p>Here&#8217;s a public database link without a username and password.</p>
<p>SQL&gt;create public database link remotedb using &#8216;remotedb.world.com&#8217;;<br />
Database link created.</p>
<p>Recommended reading:</p>
<div id="content">
<li><a title="opens new window" onclick="window.open('http://www.oracle-database-tips.com/cgi-bin/counter.pl?url=http%3A%2F%2Fdownload.oracle.com%2Fdocs%2Fcd%2FB19306_01%2Fserver.102%2Fb14231%2Fds_admin.htm%23i1007820&amp;referrer=http%3A%2F%2Fwww.oracle-database-tips.com%2Fcreate_oracle_database_link.html'); return false;" href="http://download.oracle.com/docs/cd/B19306_01/server.102/b14231/ds_admin.htm#i1007820" target="_blank">Oracle Administrator&#8217;s Guide: Create oracle database link</a></li>
<li><a title="opens new window" onclick="window.open('http://www.oracle-database-tips.com/cgi-bin/counter.pl?url=http%3A%2F%2Fdownload.oracle.com%2Fdocs%2Fcd%2FB19306_01%2Fserver.102%2Fb14200%2Fstatements_5005.htm%23SQLRF01205&amp;referrer=http%3A%2F%2Fwww.oracle-database-tips.com%2Fcreate_oracle_database_link.html'); return false;" href="http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/statements_5005.htm#SQLRF01205" target="_blank">SQL Reference: Oracle create database link syntax</a></li>
</div>
]]></content:encoded>
			<wfw:commentRss>http://oracle-database-tips.com/wp/dblinks/create-oracle-database-link/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

