<?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>DJS Consulting Tech Blog &#187; Oracle</title>
	<atom:link href="http://techblog.djs-consulting.com/category/databases/oracle/feed" rel="self" type="application/rss+xml" />
	<link>http://techblog.djs-consulting.com</link>
	<description>Technical Information You Can Use</description>
	<lastBuildDate>Mon, 02 Jan 2012 18:44:33 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Oracle SQL Developer 2.1 Debian Package</title>
		<link>http://techblog.djs-consulting.com/2010/oracle-sql-developer-2-1-debian-package.html</link>
		<comments>http://techblog.djs-consulting.com/2010/oracle-sql-developer-2-1-debian-package.html#comments</comments>
		<pubDate>Tue, 02 Mar 2010 19:11:26 +0000</pubDate>
		<dc:creator>Daniel</dc:creator>
				<category><![CDATA[Oracle]]></category>
		<category><![CDATA[deb]]></category>
		<category><![CDATA[oracle]]></category>
		<category><![CDATA[sql developer]]></category>

		<guid isPermaLink="false">http://techblog.johnson/?p=185</guid>
		<description><![CDATA[It had been a while since I had updated SQL Developer. It turns out that version 2.1 was released March 1st of this year. I&#8217;ve downloaded it and created a Debian package. It can be downloaded from the DJS Consulting &#8230; <a href="http://techblog.djs-consulting.com/2010/oracle-sql-developer-2-1-debian-package.html">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>It had been a while since I had updated SQL Developer. It turns out that version 2.1 was released March 1st of this year. I&#8217;ve downloaded it and created a Debian package. It can be <a title="Download SQL Developer 2.1 Debian Package" href="http://djs-consulting.com/linux/software/sqldeveloper/sqldeveloper_2.1.1.64.39-2_all.deb">downloaded</a> from the <a title="DJS Consulting Linux Software Repository" href="http://djs-consulting.com/linux/software">DJS Consulting Linux Software Repository</a>.</p>
<p>I&#8217;ve used it with Sun&#8217;s Java 6 Update 18; I have not tested it with OpenJDK. If you have problems getting it to work, you may want to check the <a title="Oracle SQL Developer Debian Package • DJS Consulting Tech Blog" href="/2008/oracle-sql-developer-debian-package.html">previous post</a> on this topic.</p>
]]></content:encoded>
			<wfw:commentRss>http://techblog.djs-consulting.com/2010/oracle-sql-developer-2-1-debian-package.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Oracle SQL Developer Debian Package</title>
		<link>http://techblog.djs-consulting.com/2008/oracle-sql-developer-debian-package.html</link>
		<comments>http://techblog.djs-consulting.com/2008/oracle-sql-developer-debian-package.html#comments</comments>
		<pubDate>Wed, 29 Oct 2008 13:17:14 +0000</pubDate>
		<dc:creator>Daniel</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Oracle]]></category>
		<category><![CDATA[PostgreSQL]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[alien]]></category>
		<category><![CDATA[deb]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[oracle]]></category>
		<category><![CDATA[rpm]]></category>
		<category><![CDATA[sql developer]]></category>

		<guid isPermaLink="false">http://techblog.johnson/?p=167</guid>
		<description><![CDATA[Oracle SQL Developer is a Java-based tool that provides a graphical interface to a database. While it&#8217;s main focus is Oracle (of course), it can be hooked up, via JDBC, to many other databases, such as MySQL, PostgreSQL, and SQL &#8230; <a href="http://techblog.djs-consulting.com/2008/oracle-sql-developer-debian-package.html">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a title="Oracle SQL Developer • Oracle" href="http://www.oracle.com/technology/products/database/sql_developer/index.html">Oracle SQL Developer</a> is a Java-based tool that provides a graphical interface to a database. While it&#8217;s main focus is Oracle (of course), it can be hooked up, via JDBC, to many other databases, such as MySQL, PostgreSQL, and SQL Server. It&#8217;s similar to <a href="http://www.toadsoft.com/">Toad</a>, but is provided by Oracle at no cost.</p>
<p>Oracle provides SQL Developer in either an RPM, or a generic binary install. I like the ability to manage packages, but I&#8217;ve never had much luck at getting RPM to run on Ubuntu. I downloaded the RPM file, and, using <a href="http://kitenet.net/~joey/code/alien/">alien</a>, I converted the package to a .deb package (Debian package format) and installed it. It worked like a charm!</p>
<p>I haven&#8217;t tested it with gcj, but using Sun&#8217;s Java 6 update 7 from the Ubuntu repositories, it ran just fine. After you install the package, do a directory list on /usr/lib/jvm. You&#8217;re looking for the Sun JDK &#8211; if it&#8217;s installed, you&#8217;ll have a symlink java-6-sun that points to java-6-sun-1.6.0.07. Once you&#8217;ve determined the location of the JDK, run &#8220;sqldeveloper&#8221; from the command line &#8211; the program will prompt you for the path to your JDK. Enter it (probably &#8220;/usr/lib/jvm/java-6-sun&#8221;) and you&#8217;re good to go. (You have to install the package as root &#8211; but, for the rest of these steps, use your normal user, not root, as this puts settings in a .sqldeveloper directory off your home directory.) The package installs an icon in the &#8220;Programming&#8221; or &#8220;Development&#8221; group. Once you&#8217;ve told it where the JDK is, you can use this to launch it.</p>
<p><a title="SQL Developer 1.5.1 Debian Package • DJS Consulting Linux Software Repository" href="http://djs-consulting.com/linux/software/sqldeveloper/sqldeveloper_1.5.54.40-2_all.deb">Download SQL Developer 1.5.1 Debian Package</a></p>
]]></content:encoded>
			<wfw:commentRss>http://techblog.djs-consulting.com/2008/oracle-sql-developer-debian-package.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Transferring Data Between Oracle and SQL Server</title>
		<link>http://techblog.djs-consulting.com/2007/transferring-data-between-oracle-and-sql-server.html</link>
		<comments>http://techblog.djs-consulting.com/2007/transferring-data-between-oracle-and-sql-server.html#comments</comments>
		<pubDate>Mon, 09 Jul 2007 21:23:10 +0000</pubDate>
		<dc:creator>Daniel</dc:creator>
				<category><![CDATA[Oracle]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[data]]></category>
		<category><![CDATA[dts]]></category>
		<category><![CDATA[instant client]]></category>
		<category><![CDATA[oracle]]></category>
		<category><![CDATA[sql server]]></category>

		<guid isPermaLink="false">http://techblog.johnson/?p=102</guid>
		<description><![CDATA[There are lots of &#8220;how to&#8221; articles on sharing data between Oracle and SQL Server. Most of these involve installing Oracle&#8217;s code base on the SQL Server machine, then using that instance to link tables within Oracle. This technique does &#8230; <a href="http://techblog.djs-consulting.com/2007/transferring-data-between-oracle-and-sql-server.html">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>There are lots of &#8220;how to&#8221; articles on sharing data between Oracle and SQL Server. Most of these involve installing Oracle&#8217;s code base on the SQL Server machine, then using that instance to link tables within Oracle. This technique does not require that, thanks to a product from Oracle called <a title="Download Oracle Instant Client" href="http://www.oracle.com/technology/tech/oci/instantclient/index.html">Oracle Instant Client</a>.</p>
<p>To set up the Oracle piece, download the packages for &#8220;Basic&#8221; and &#8220;ODBC Supplement&#8221;, and follow the instructions for installation, on the machine with SQL Server. (This is not an &#8220;install&#8221; per se &#8211; it&#8217;s basically an unzip.) Next, you&#8217;ll need to provide a TNSNAMES.ORA file &#8211; this can be any valid file, including a simple shell with an &#8220;ifile=&#8221; statement pointing to a common TNSNAMES.ORA file. Finally, set the environment variable TNS_ADMIN to point to the directory where this TNSNAMES.ORA file resides.</p>
<p>Now, you can easily create a DTS script through SQL Server to push or pull data however you&#8217;d like. Oracle Instant Client will appear in the drop-down list of providers, and you&#8217;ll be able to specify your connection the way you normally do (i.e., &#8220;DB01.WORLD&#8221;).</p>
<p>Happy migrating!</p>
]]></content:encoded>
			<wfw:commentRss>http://techblog.djs-consulting.com/2007/transferring-data-between-oracle-and-sql-server.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Transferring CLOBs Across Linked Oracle Databases</title>
		<link>http://techblog.djs-consulting.com/2007/transferring-clobs-across-linked-oracle-databases.html</link>
		<comments>http://techblog.djs-consulting.com/2007/transferring-clobs-across-linked-oracle-databases.html#comments</comments>
		<pubDate>Fri, 15 Jun 2007 20:04:02 +0000</pubDate>
		<dc:creator>Daniel</dc:creator>
				<category><![CDATA[Oracle]]></category>
		<category><![CDATA[PL/SQL]]></category>
		<category><![CDATA[algorithm]]></category>
		<category><![CDATA[clob]]></category>
		<category><![CDATA[data]]></category>
		<category><![CDATA[linked database]]></category>
		<category><![CDATA[oracle]]></category>

		<guid isPermaLink="false">http://techblog.johnson/?p=90</guid>
		<description><![CDATA[Linking databases in Oracle make it easy to share data, and can be useful for replication. However, there is a limitation in Oracle that prevents Character Large Objects (CLOBs) from coming across these links. The following technique uses stored procedures &#8230; <a href="http://techblog.djs-consulting.com/2007/transferring-clobs-across-linked-oracle-databases.html">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Linking databases in Oracle make it easy to share data, and can be useful for replication. However, there is a limitation in Oracle that prevents Character Large Objects (CLOBs) from coming across these links. The following technique uses stored procedures and a temporary table to pull CLOBs across a database link.</p>
<p>First, you&#8217;ll need the temporary table, which will hold a sequence number, the primary key for the table where you&#8217;ll want to reconstruct the CLOB, and some text. This table can reside in the source or destination database, but must be linked from the other one. For our purposes, it looks like this&#8230;</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
</pre></td><td class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">CREATE</span> <span style="color: #993333; font-weight: bold;">TABLE</span> clob_xfer_area
<span style="color: #66cc66;">&#40;</span>
  cxa_pk      <span style="color: #993333; font-weight: bold;">NUMBER</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">12</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">,</span>
  cxa_number  <span style="color: #993333; font-weight: bold;">NUMBER</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">12</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">,</span>
  cxa_text    varchar2<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">4000</span> byte<span style="color: #66cc66;">&#41;</span>
<span style="color: #66cc66;">&#41;</span>;
<span style="color: #993333; font-weight: bold;">ALTER</span> <span style="color: #993333; font-weight: bold;">TABLE</span> clob_xfer_area <span style="color: #993333; font-weight: bold;">ADD</span>
<span style="color: #66cc66;">&#40;</span>
  <span style="color: #993333; font-weight: bold;">CONSTRAINT</span> pk_cxa_id
    <span style="color: #993333; font-weight: bold;">PRIMARY</span> <span style="color: #993333; font-weight: bold;">KEY</span> <span style="color: #66cc66;">&#40;</span>cxa_pk<span style="color: #66cc66;">,</span> cxa_number<span style="color: #66cc66;">&#41;</span>
<span style="color: #66cc66;">&#41;</span>;</pre></td></tr></table></div>

<p>Second, you&#8217;ll need the procedure in the source database that breaks the CLOB apart and populates the temporary table.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
</pre></td><td class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">SET</span> serveroutput <span style="color: #993333; font-weight: bold;">ON</span> <span style="color: #993333; font-weight: bold;">SIZE</span> <span style="color: #cc66cc;">1000000</span>
<span style="color: #993333; font-weight: bold;">SET</span> <span style="color: #993333; font-weight: bold;">LINES</span> <span style="color: #cc66cc;">1000</span>
<span style="color: #993333; font-weight: bold;">SET</span> pages <span style="color: #cc66cc;">0</span>
<span style="color: #993333; font-weight: bold;">SET</span> tab off
<span style="color: #993333; font-weight: bold;">SET</span> feedback <span style="color: #993333; font-weight: bold;">ON</span>
&nbsp;
<span style="color: #993333; font-weight: bold;">CREATE</span> <span style="color: #993333; font-weight: bold;">OR</span> <span style="color: #993333; font-weight: bold;">REPLACE</span>
<span style="color: #993333; font-weight: bold;">PROCEDURE</span> break_clobs_apart
<span style="color: #993333; font-weight: bold;">IS</span>
&nbsp;
  v_line_number   <span style="color: #993333; font-weight: bold;">NUMBER</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">3</span><span style="color: #66cc66;">&#41;</span>;
  v_text_piece    varchar2<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">4000</span><span style="color: #66cc66;">&#41;</span>;
  v_total_length  <span style="color: #993333; font-weight: bold;">NUMBER</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">12</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
  cursor clob_cur <span style="color: #993333; font-weight: bold;">IS</span>
    <span style="color: #993333; font-weight: bold;">SELECT</span> twc_pk<span style="color: #66cc66;">,</span> twc_clob_field
    <span style="color: #993333; font-weight: bold;">FROM</span>   table_with_clob;
&nbsp;
<span style="color: #993333; font-weight: bold;">BEGIN</span> <span style="color: #808080; font-style: italic;">/* { */</span>
&nbsp;
  <span style="color: #993333; font-weight: bold;">FOR</span> clob_rec <span style="color: #993333; font-weight: bold;">IN</span> clob_cur loop <span style="color: #808080; font-style: italic;">/* { */</span>
&nbsp;
    v_total_length :<span style="color: #66cc66;">=</span> <span style="color: #cc66cc;">1</span>;
    v_line_number  :<span style="color: #66cc66;">=</span> <span style="color: #cc66cc;">0</span>;
&nbsp;
    while <span style="color: #66cc66;">&#40;</span>v_total_length <span style="color: #66cc66;">&lt;=</span>
           DBMS_LOB<span style="color: #66cc66;">.</span>GETLENGTH<span style="color: #66cc66;">&#40;</span>clob_rec<span style="color: #66cc66;">.</span>twc_clob_field<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span> loop <span style="color: #808080; font-style: italic;">/* { */</span>
&nbsp;
      v_line_number :<span style="color: #66cc66;">=</span> v_line_number <span style="color: #66cc66;">+</span> <span style="color: #cc66cc;">1</span>;
      v_text_piece :<span style="color: #66cc66;">=</span> DBMS_LOB<span style="color: #66cc66;">.</span>SUBSTR<span style="color: #66cc66;">&#40;</span>clob_rec<span style="color: #66cc66;">.</span>twc_clob_field<span style="color: #66cc66;">,</span>
        <span style="color: #cc66cc;">3999</span><span style="color: #66cc66;">,</span> v_total_length<span style="color: #66cc66;">&#41;</span>;
      v_total_length :<span style="color: #66cc66;">=</span> v_total_length <span style="color: #66cc66;">+</span> <span style="color: #cc66cc;">3999</span>;
&nbsp;
      <span style="color: #993333; font-weight: bold;">INSERT</span> <span style="color: #993333; font-weight: bold;">INTO</span> clob_xfer_area <span style="color: #66cc66;">&#40;</span>
        cxa_pk<span style="color: #66cc66;">,</span>
        cxa_number<span style="color: #66cc66;">,</span>
        cxa_text
      <span style="color: #66cc66;">&#41;</span>
        <span style="color: #993333; font-weight: bold;">VALUES</span> <span style="color: #66cc66;">&#40;</span>
          clob_rec<span style="color: #66cc66;">.</span>twc_pk<span style="color: #66cc66;">,</span> <span style="color: #808080; font-style: italic;">-- cxa_pk</span>
          v_line_number<span style="color: #66cc66;">,</span>   <span style="color: #808080; font-style: italic;">-- cxa_number</span>
          v_text_piece     <span style="color: #808080; font-style: italic;">-- cxa_text</span>
        <span style="color: #66cc66;">&#41;</span>;
&nbsp;
    <span style="color: #993333; font-weight: bold;">END</span> loop; <span style="color: #808080; font-style: italic;">/* } of while */</span>
&nbsp;
  <span style="color: #993333; font-weight: bold;">END</span> loop; <span style="color: #808080; font-style: italic;">/* } of clob_cur */</span>
&nbsp;
<span style="color: #993333; font-weight: bold;">END</span>; <span style="color: #808080; font-style: italic;">/* } of procedure break_clobs_apart */</span></pre></td></tr></table></div>

<p>Third, you&#8217;ll need a procedure in the destination database that puts the CLOB back together, and deletes the data from the temporary table.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
</pre></td><td class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">SET</span> serveroutput <span style="color: #993333; font-weight: bold;">ON</span> <span style="color: #993333; font-weight: bold;">SIZE</span> <span style="color: #cc66cc;">1000000</span>
<span style="color: #993333; font-weight: bold;">SET</span> <span style="color: #993333; font-weight: bold;">LINES</span> <span style="color: #cc66cc;">1000</span>
<span style="color: #993333; font-weight: bold;">SET</span> pages <span style="color: #cc66cc;">0</span>
<span style="color: #993333; font-weight: bold;">SET</span> feedback <span style="color: #993333; font-weight: bold;">ON</span>
<span style="color: #993333; font-weight: bold;">SET</span> tab off
&nbsp;
<span style="color: #993333; font-weight: bold;">CREATE</span> <span style="color: #993333; font-weight: bold;">OR</span> <span style="color: #993333; font-weight: bold;">REPLACE</span>
<span style="color: #993333; font-weight: bold;">PROCEDURE</span> put_clobs_together
<span style="color: #993333; font-weight: bold;">IS</span>
  v_new_clob   <span style="color: #993333; font-weight: bold;">CLOB</span>;
&nbsp;
  cursor pk_cur <span style="color: #993333; font-weight: bold;">IS</span>
    <span style="color: #993333; font-weight: bold;">SELECT</span> <span style="color: #993333; font-weight: bold;">DISTINCT</span> cxa_pk
    <span style="color: #993333; font-weight: bold;">FROM</span>   clob_xfer_area;
&nbsp;
  cursor piece_cur<span style="color: #66cc66;">&#40;</span>p_cxa_pk <span style="color: #993333; font-weight: bold;">NUMBER</span><span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">IS</span>
    <span style="color: #993333; font-weight: bold;">SELECT</span> cxa_text
    <span style="color: #993333; font-weight: bold;">FROM</span>   clob_xfer_area
    <span style="color: #993333; font-weight: bold;">WHERE</span>  cxa_pk <span style="color: #66cc66;">=</span> p_cxa_pk
    <span style="color: #993333; font-weight: bold;">ORDER</span> <span style="color: #993333; font-weight: bold;">BY</span> cxa_number;
&nbsp;
<span style="color: #993333; font-weight: bold;">BEGIN</span> <span style="color: #808080; font-style: italic;">/* { */</span>
&nbsp;
  <span style="color: #993333; font-weight: bold;">FOR</span> pk_rec <span style="color: #993333; font-weight: bold;">IN</span> pk_cur loop <span style="color: #808080; font-style: italic;">/* { */</span>
&nbsp;
    DBMS_LOB<span style="color: #66cc66;">.</span>CREATETEMPORARY<span style="color: #66cc66;">&#40;</span>v_new_clob<span style="color: #66cc66;">,</span> <span style="color: #993333; font-weight: bold;">TRUE</span><span style="color: #66cc66;">&#41;</span>;
    DBMS_LOB<span style="color: #66cc66;">.</span><span style="color: #993333; font-weight: bold;">OPEN</span><span style="color: #66cc66;">&#40;</span>v_new_clob<span style="color: #66cc66;">,</span> DBMS_LOB<span style="color: #66cc66;">.</span>LOB_READWRITE<span style="color: #66cc66;">&#41;</span>;
&nbsp;
    <span style="color: #993333; font-weight: bold;">FOR</span> piece_rec <span style="color: #993333; font-weight: bold;">IN</span> piece_cur<span style="color: #66cc66;">&#40;</span>pk_rec<span style="color: #66cc66;">.</span>cxa_pk<span style="color: #66cc66;">&#41;</span> loop <span style="color: #808080; font-style: italic;">/* { */</span>
&nbsp;
      DBMS_LOB<span style="color: #66cc66;">.</span>WRITEAPPEND<span style="color: #66cc66;">&#40;</span>v_new_clob<span style="color: #66cc66;">,</span> <span style="color: #993333; font-weight: bold;">LENGTH</span><span style="color: #66cc66;">&#40;</span>piece_rec<span style="color: #66cc66;">.</span>cxa_text<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">,</span>
        piece_rec<span style="color: #66cc66;">.</span>cxa_text<span style="color: #66cc66;">&#41;</span>;
&nbsp;
    <span style="color: #993333; font-weight: bold;">END</span> loop;  <span style="color: #808080; font-style: italic;">/* } of piece_cur */</span>
&nbsp;
    DBMS_LOB<span style="color: #66cc66;">.</span>CLOSE<span style="color: #66cc66;">&#40;</span>v_new_clob<span style="color: #66cc66;">&#41;</span>;
&nbsp;
    <span style="color: #993333; font-weight: bold;">UPDATE</span> dest_table_with_clob
      <span style="color: #993333; font-weight: bold;">SET</span>  migrated_clob <span style="color: #66cc66;">=</span> v_new_clob
      <span style="color: #993333; font-weight: bold;">WHERE</span> dtwc_pk <span style="color: #66cc66;">=</span> pk_rec<span style="color: #66cc66;">.</span>cxa_pk;
&nbsp;
  <span style="color: #993333; font-weight: bold;">END</span> loop; <span style="color: #808080; font-style: italic;">/* } of pk_cur */</span>
&nbsp;
  <span style="color: #993333; font-weight: bold;">DELETE</span> <span style="color: #993333; font-weight: bold;">FROM</span> clob_xfer_area;
&nbsp;
<span style="color: #993333; font-weight: bold;">END</span>; <span style="color: #808080; font-style: italic;">/* } of procedure put_clobs_together */</span></pre></td></tr></table></div>

<p>Finally, you&#8217;ll need a procedure that controls the whole thing. We&#8217;ll assume that this procedure is loaded in the destination database, and the source database is linked with the name &#8220;source&#8221;.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
</pre></td><td class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">SET</span> <span style="color: #993333; font-weight: bold;">LINES</span> <span style="color: #cc66cc;">1000</span>
<span style="color: #993333; font-weight: bold;">SET</span> pages <span style="color: #cc66cc;">0</span>
<span style="color: #993333; font-weight: bold;">SET</span> feedback <span style="color: #993333; font-weight: bold;">ON</span>
<span style="color: #993333; font-weight: bold;">SET</span> tab off
&nbsp;
<span style="color: #993333; font-weight: bold;">CREATE</span> <span style="color: #993333; font-weight: bold;">OR</span> <span style="color: #993333; font-weight: bold;">REPLACE</span>
<span style="color: #993333; font-weight: bold;">PROCEDURE</span> xfer_clobs
<span style="color: #993333; font-weight: bold;">IS</span>
&nbsp;
<span style="color: #993333; font-weight: bold;">BEGIN</span> <span style="color: #808080; font-style: italic;">/* { */</span>
&nbsp;
  break_clobs_apart@<span style="color: #993333; font-weight: bold;">SOURCE</span>;
  put_clobs_together;
&nbsp;
<span style="color: #993333; font-weight: bold;">END</span>; <span style="color: #808080; font-style: italic;">/* } */</span></pre></td></tr></table></div>

<p>(This does not include a commit &#8211; the changes will not be persistent unless they are committed.)</p>
<p>Of course, these processes could (and, to be useful, likely would) be integrated into other procedures and scripts. But, this framework will successfully transfer CLOBs across linked databases in Oracle.</p>
]]></content:encoded>
			<wfw:commentRss>http://techblog.djs-consulting.com/2007/transferring-clobs-across-linked-oracle-databases.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

