<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: Recreating Database Link</title>
	<atom:link href="http://askdba.org/weblog/2009/01/recreating-database-link/feed/" rel="self" type="application/rss+xml" />
	<link>http://askdba.org/weblog/2009/01/recreating-database-link/</link>
	<description>Writing About Our Experiences With Oracle Databases</description>
	<lastBuildDate>Fri, 18 May 2012 09:57:53 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
	<item>
		<title>By: Amit</title>
		<link>http://askdba.org/weblog/2009/01/recreating-database-link/#comment-1960</link>
		<dc:creator>Amit</dc:creator>
		<pubDate>Thu, 12 Mar 2009 18:25:21 +0000</pubDate>
		<guid isPermaLink="false">http://askdba.org/weblog/?p=332#comment-1960</guid>
		<description>Actually password field is empty in link$ in 10g. I was trying to use password field from DBA_USERS view.  While checking further I found that we can also get the encrypted password from field &quot;passwordx&quot; from SYS.LINK$

&lt;pre&gt;

SQL&gt; SELECT NAME,HOST,USERID,PASSWORDX FROM SYS.LINK$;

NAME                                     HOST       USERID     PASSWORDX
---------------------------------------- ---------- ---------- ----------------------------------------
TO_AMIT.REGRESS.RDBMS.DEV.US.ORACLE.COM  test10     AMIT       0524F74E2CD3E3B4E10F290B25DBE943B6
TO_AMIT.REGRESS.RDBMS.DEV.US.ORACLE.COM  test10     AMIT       0524F74E2CD3E3B4E10F290B25DBE943B6
TO_AMIT.REGRESS.RDBMS.DEV.US.ORACLE.COM  test10     AMIT       0524F74E2CD3E3B4E10F290B25DBE943B6
&lt;/pre&gt;

This is same as the password which we get from dbms_metadata.get_ddl function. Meanwhile in case of 8i you can use below query to extract script for creating database link for particular user

select &#039;create database link &#039;&#124;&#124;a.db_link&#124;&#124;&#039; connect to &#039;&#124;&#124;a.username&#124;&#124;&#039; identified by &#039;&#124;&#124;b.password&#124;&#124;&#039; using &#039;&#039;&#039;&#124;&#124;a.HOST&#124;&#124;&#039;&#039;&#039;;&#039; from dba_db_links a, sys.link$ b, dba_users c where a.owner=c.username and b.owner#=c.user_id and a.db_link=b.name and a.host=b.host and a.owner=&#039;&amp;user&#039; ;</description>
		<content:encoded><![CDATA[<p>Actually password field is empty in link$ in 10g. I was trying to use password field from DBA_USERS view.  While checking further I found that we can also get the encrypted password from field &#8220;passwordx&#8221; from SYS.LINK$</p>
<pre>

SQL> SELECT NAME,HOST,USERID,PASSWORDX FROM SYS.LINK$;

NAME                                     HOST       USERID     PASSWORDX
---------------------------------------- ---------- ---------- ----------------------------------------
TO_AMIT.REGRESS.RDBMS.DEV.US.ORACLE.COM  test10     AMIT       0524F74E2CD3E3B4E10F290B25DBE943B6
TO_AMIT.REGRESS.RDBMS.DEV.US.ORACLE.COM  test10     AMIT       0524F74E2CD3E3B4E10F290B25DBE943B6
TO_AMIT.REGRESS.RDBMS.DEV.US.ORACLE.COM  test10     AMIT       0524F74E2CD3E3B4E10F290B25DBE943B6
</pre>
<p>This is same as the password which we get from dbms_metadata.get_ddl function. Meanwhile in case of 8i you can use below query to extract script for creating database link for particular user</p>
<p>select &#8216;create database link &#8216;||a.db_link||&#8217; connect to &#8216;||a.username||&#8217; identified by &#8216;||b.password||&#8217; using &#8221;&#8217;||a.HOST||&#8221;&#8217;;&#8217; from dba_db_links a, sys.link$ b, dba_users c where a.owner=c.username and b.owner#=c.user_id and a.db_link=b.name and a.host=b.host and a.owner=&#8217;&#038;user&#8217; ;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: coskan</title>
		<link>http://askdba.org/weblog/2009/01/recreating-database-link/#comment-1928</link>
		<dc:creator>coskan</dc:creator>
		<pubDate>Tue, 10 Mar 2009 21:08:40 +0000</pubDate>
		<guid isPermaLink="false">http://askdba.org/weblog/?p=332#comment-1928</guid>
		<description>HI Amit, 

Thank you very much for the info and Gary thank you very much for the update. 

One question ;


you said;

In case of 10g passwords are stored in encrypted format in SYS.LINK$.

I checked ;

The password column on both 10.2.0.4/10.2.0.3  is empty. Do you use a lower version ?</description>
		<content:encoded><![CDATA[<p>HI Amit, </p>
<p>Thank you very much for the info and Gary thank you very much for the update. </p>
<p>One question ;</p>
<p>you said;</p>
<p>In case of 10g passwords are stored in encrypted format in SYS.LINK$.</p>
<p>I checked ;</p>
<p>The password column on both 10.2.0.4/10.2.0.3  is empty. Do you use a lower version ?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Amit</title>
		<link>http://askdba.org/weblog/2009/01/recreating-database-link/#comment-1489</link>
		<dc:creator>Amit</dc:creator>
		<pubDate>Fri, 30 Jan 2009 17:21:19 +0000</pubDate>
		<guid isPermaLink="false">http://askdba.org/weblog/?p=332#comment-1489</guid>
		<description>Yeah.. I didn&#039;t realize that DBMS_METADATA.GET_DDL can also be used. I tried the same and it worked :)


SQL&gt; select dbms_metadata.get_ddl(&#039;DB_LINK&#039;,&#039;TO_AMIT.REGRESS.RDBMS.DEV.US.ORACLE.COM&#039;,&#039;TEST&#039;) from dual;

SQL&gt; select dbms_metadata.get_ddl(&#039;DB_LINK&#039;,&#039;TO_AMIT.REGRESS.RDBMS.DEV.US.ORACLE.COM&#039;,&#039;TEST&#039;) from dual;


Thanks Gary !!</description>
		<content:encoded><![CDATA[<p>Yeah.. I didn&#8217;t realize that DBMS_METADATA.GET_DDL can also be used. I tried the same and it worked <img src='http://askdba.org/weblog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>SQL&gt; select dbms_metadata.get_ddl(&#8216;DB_LINK&#8217;,'TO_AMIT.REGRESS.RDBMS.DEV.US.ORACLE.COM&#8217;,'TEST&#8217;) from dual;</p>
<p>SQL&gt; select dbms_metadata.get_ddl(&#8216;DB_LINK&#8217;,'TO_AMIT.REGRESS.RDBMS.DEV.US.ORACLE.COM&#8217;,'TEST&#8217;) from dual;</p>
<p>Thanks Gary !!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Gary</title>
		<link>http://askdba.org/weblog/2009/01/recreating-database-link/#comment-1469</link>
		<dc:creator>Gary</dc:creator>
		<pubDate>Thu, 29 Jan 2009 00:17:27 +0000</pubDate>
		<guid isPermaLink="false">http://askdba.org/weblog/?p=332#comment-1469</guid>
		<description>I read the metalink note.
I think it boils down to the string for IDENTIFIED BY VALUES isn&#039;t the one in DBA_USERS PASSWORD column.
However DBMS_METADATA.GET_DDL does get the appropriate value.
Try the following :

create database link hr connect to hr identified by hr using &#039;XE&#039;;
select dbms_metadata.get_ddl(&#039;DB_LINK&#039;,&#039;HR&#039;) from dual;
CREATE DATABASE LINK &quot;HR&quot;
 CONNECT TO &quot;HR&quot; IDENTIFIED BY VALUES &#039;05C5ECC5A6E55600878A1D2614915CA506&#039;
 USING &#039;XE&#039;
select * from dual@hr;</description>
		<content:encoded><![CDATA[<p>I read the metalink note.<br />
I think it boils down to the string for IDENTIFIED BY VALUES isn&#8217;t the one in DBA_USERS PASSWORD column.<br />
However DBMS_METADATA.GET_DDL does get the appropriate value.<br />
Try the following :</p>
<p>create database link hr connect to hr identified by hr using &#8216;XE&#8217;;<br />
select dbms_metadata.get_ddl(&#8216;DB_LINK&#8217;,'HR&#8217;) from dual;<br />
CREATE DATABASE LINK &#8220;HR&#8221;<br />
 CONNECT TO &#8220;HR&#8221; IDENTIFIED BY VALUES &#8217;05C5ECC5A6E55600878A1D2614915CA506&#8242;<br />
 USING &#8216;XE&#8217;<br />
select * from dual@hr;</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Served from: askdba.org @ 2012-05-18 17:06:01 by W3 Total Cache -->
