<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-7984768457924132022</id><updated>2012-01-27T09:53:34.359-08:00</updated><title type='text'>A SQL Developer ... @dermotoneill</title><subtitle type='html'>Database Migrations and more</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://dermotoneill.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7984768457924132022/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://dermotoneill.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Dermot O'Neill</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>39</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-7984768457924132022.post-5588914890795040956</id><published>2012-01-27T09:17:00.000-08:00</published><updated>2012-01-27T09:53:34.371-08:00</updated><title type='text'>Sybase and SQL Server Image Data Move</title><content type='html'>SQL Developer can move data online and offline.&lt;br /&gt;&lt;div&gt;&lt;div&gt;Online is really only for small amounts of data (&amp;lt;100mb). &lt;/div&gt;&lt;div&gt;For larger sets of data with greater performance and much better logging, the Offline Data Move feature should be used.&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;a href="http://1.bp.blogspot.com/-1-kFtCyJhaQ/TyLcwNugYfI/AAAAAAAAGWo/F1RMqOvR1n0/s1600/offlineDataMove.png"&gt;&lt;img style="cursor:pointer; cursor:hand;width: 400px; height: 300px;" src="http://1.bp.blogspot.com/-1-kFtCyJhaQ/TyLcwNugYfI/AAAAAAAAGWo/F1RMqOvR1n0/s400/offlineDataMove.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5702362799081021938" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;SQL Developer will create two sets of scripts. &lt;/div&gt;&lt;div&gt;One to dump out the data using Sybase/SQL Servers BCP tool to DAT files on the disk. &lt;/div&gt;&lt;div&gt;The second set of scripts to read the DAT files and load the data into the Oracle tables using Oracle SQL*Loader. &lt;/div&gt;&lt;div&gt;As the scripts are just plain text files they should be inspected and can be modified to suit your needs.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Because SQL Developer knows the names of all the tables and each columns name/datatype it can do a good job of defining these scripts, so very little has to be modified.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Currently there is an issue moving large Images from Sybase/SQL Server to Oracle using the offline data move scripts SQL Developer generate. But with a little change you can get them to move correctly.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;For this little test , the first thing is to &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;div style="font-family: 'times new roman'; "&gt;&lt;/div&gt;&lt;div style="font-family: 'times new roman'; "&gt;&lt;b&gt;Insert an Image into Sybase using BCP.&lt;/b&gt;&lt;/div&gt;&lt;div style="font-family: 'times new roman'; "&gt;&lt;ul&gt;&lt;li&gt;Create a table with one column in Sybase of type IMAGE&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div&gt;&lt;span  &gt;&lt;i&gt;&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;blockquote&gt;&lt;div&gt;&lt;span  &gt;&lt;i&gt;CREATE TABLE loadimage (col1 IMAGE)&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span  &gt;&lt;i&gt;go&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;div&gt;&lt;span  &gt;&lt;i&gt;&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: 'times new roman'; "&gt;&lt;ul&gt;&lt;li&gt;Make sure the Sybase database can INSERT from BCP (note this database is called loadimage)&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div&gt;&lt;span  &gt;&lt;i&gt;&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;blockquote&gt;&lt;div&gt;&lt;span  &gt;&lt;i&gt;use master&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span  &gt;&lt;i&gt;go&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span  &gt;&lt;i&gt;sp_dboption "loadimage", "select into", true&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span  &gt;&lt;i&gt;go&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span  &gt;&lt;i&gt;use loadimage&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span  &gt;&lt;i&gt;go&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span  &gt;&lt;i&gt;checkpoint&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span  &gt;&lt;i&gt;go&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;div&gt;&lt;span  &gt;&lt;i&gt;&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: 'times new roman'; "&gt;&lt;ul&gt;&lt;li&gt;The bcp.fmt needs to have the correct size of the imagefile specified, in this case 1551333.&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;span  &gt;&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;blockquote&gt;&lt;div&gt;&lt;i&gt;&lt;span  &gt;10.0&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;span  &gt;1&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;span  &gt;1 SYBIMAGE 0 1551333"" 1 col1&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;div&gt;&lt;i&gt;&lt;span  &gt;&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div style="font-family: 'times new roman'; "&gt;&lt;ul&gt;&lt;li&gt;From the command line load an image into the Sybase table using Sybase BCP&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div&gt;&lt;span  &gt;&lt;i&gt;&lt;blockquote&gt;bcp loadimage..loadimage in image3.jpg -Usa -P -S&lt;servername&gt;  -f bcp.fmt -T2000000&lt;/servername&gt;&lt;/blockquote&gt;&lt;blockquote&gt;&lt;br /&gt;&lt;/blockquote&gt;&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;This should load up the image3.jpg into the Sybase table.&lt;/div&gt;&lt;div&gt;It can be viewed from SQL Developer.&lt;/div&gt;&lt;div&gt;Just browse to the Sybase table, click on the data tab. Double click the (BLOB) item and choose "View As Image".&lt;/div&gt;&lt;div&gt;&lt;a href="http://2.bp.blogspot.com/-2KPHHBdiuss/TyLgq5eOOBI/AAAAAAAAGW0/DF_JcHucS14/s1600/viewSybaseImage.png"&gt;&lt;img src="http://2.bp.blogspot.com/-2KPHHBdiuss/TyLgq5eOOBI/AAAAAAAAGW0/DF_JcHucS14/s400/viewSybaseImage.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5702367105791178770" style="cursor: pointer; width: 400px; height: 273px; " /&gt;&lt;/a&gt; &lt;/div&gt;&lt;div&gt;&lt;a href="http://4.bp.blogspot.com/-yA6zpBSYsDU/TyLhLEzfO_I/AAAAAAAAGXA/yAcPUIHW7mA/s1600/sybaseimagevisible.png"&gt;&lt;img src="http://4.bp.blogspot.com/-yA6zpBSYsDU/TyLhLEzfO_I/AAAAAAAAGXA/yAcPUIHW7mA/s400/sybaseimagevisible.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5702367658588978162" style="cursor: pointer; width: 400px; height: 272px; " /&gt;&lt;/a&gt; &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Now we need to move it to Oracle.&lt;/div&gt;&lt;div&gt;Migrate the Sybase database to Oracle, but choose Offline Data Move in step 8 of the migration wizard.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The following changes need to be performed against the scripts SQL Developer generates for you.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;The unload_script.bat needs to be changed as BCP by default will truncate to 32K.&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span  &gt;&lt;i&gt;mkdir data&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span  &gt;&lt;i&gt;mkdir log&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span  &gt;&lt;i&gt;bcp "[loadimage].[dbo].[loadimage]" out "data\dbo_loadimage.loadimage.dat" &lt;b&gt; -T 1552503 &lt;/b&gt; -c -t "&lt;eofd&gt;" -r "&lt;eord&gt;" -U%2 -P%3 -S%1&lt;/eord&gt;&lt;/eofd&gt;&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;span  &gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span  &gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;The -T 1552503 denotes the largest Image in that column. &lt;/div&gt;&lt;div&gt;This can be found by querying the Sybase table.&lt;/div&gt;&lt;div&gt;&lt;span style="color: rgb(51, 51, 51); text-align: -webkit-auto; background-color: rgb(255, 255, 255); "&gt;&lt;span  &gt;&lt;i&gt;select max(datalength(&lt;col_name&gt;)) from &lt;tablename&gt;&lt;/tablename&gt;&lt;/col_name&gt;&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="color: rgb(51, 51, 51); font-family: Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif; font-size: 13px; text-align: -webkit-auto; background-color: rgb(255, 255, 255); "&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: -webkit-auto;"&gt;&lt;div style="text-align: left; "&gt;Now the DAT file will include all the IMAGE data in HEX format, and it will not be truncated.&lt;/div&gt;&lt;div style="text-align: left; "&gt;Next we have to load it into Oracle and those scripts need a little change as well.&lt;/div&gt;&lt;div style="text-align: left; "&gt;SQL Developer creates scripts which&lt;/div&gt;&lt;div style="text-align: left; "&gt;1) Create a new CLOB column to hold the HEX string&lt;/div&gt;&lt;div style="text-align: left; "&gt;2) Process the CLOB HEX string into a BLOB using a procedure&lt;/div&gt;&lt;div style="text-align: left; "&gt;3) Remove the CLOB column&lt;/div&gt;&lt;div style="text-align: left; "&gt;This is necessary as you cannot load a large HEX string directly into a BLOB column in Oracle.&lt;/div&gt;&lt;div style="text-align: left; "&gt;This action is performed for you, but this is a default limit to the size of the HEX string SQL*Loader will read, and this needs to be changed.&lt;/div&gt;&lt;div style="text-align: left; "&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left; "&gt;Open the control/&lt;b&gt;dbo_loadimage.loadimage.ctl&lt;/b&gt; file&lt;/div&gt;&lt;div style="text-align: left; "&gt;&lt;div&gt;&lt;span  &gt;&lt;i&gt;load data&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span  &gt;&lt;i&gt;infile 'data/dbo_loadimage.loadimage.dat'&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span  &gt;&lt;i&gt; "str '&lt;eord&gt;'"&lt;/eord&gt;&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span  &gt;&lt;i&gt;into table dbo_loadimage.loadimage&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span  &gt;&lt;i&gt;fields terminated by '&lt;eofd&gt;'&lt;/eofd&gt;&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span  &gt;&lt;i&gt;trailing nullcols&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span  &gt;&lt;i&gt;(&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span  &gt;&lt;i&gt;SQLDEVELOPER_CLOB_1  CHAR(&lt;b&gt;20000000&lt;/b&gt;) &lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span  &gt;&lt;i&gt;)&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Change the size of the CHAR column. This is the temporary column the scripts will create for you to load in the HEX String.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Once this is done you can run the script to load the image data into the Oracle table.&lt;/div&gt;&lt;div&gt;&lt;span  &gt;&lt;i&gt;oracle_ctl.bat system oracle@11GR1&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Notice that the rows are loaded fairly fast into the CLOB columns as HEX strings. But it does take some time to process these HEX strings into BLOBs.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Once the load is finished the Images can be inspected in SQL Developer&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;a href="http://4.bp.blogspot.com/-AeHs7gX-yjk/TyLj5PLDixI/AAAAAAAAGXM/x4NtU2t1u7s/s1600/oracleimage.png"&gt;&lt;img src="http://4.bp.blogspot.com/-AeHs7gX-yjk/TyLj5PLDixI/AAAAAAAAGXM/x4NtU2t1u7s/s400/oracleimage.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5702370650669419282" style="cursor: pointer; width: 400px; height: 271px; " /&gt;&lt;/a&gt; &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style="text-align: left; "&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left; "&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left; "&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="color: rgb(51, 51, 51); font-family: Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif; font-size: 13px; text-align: -webkit-auto; background-color: rgb(255, 255, 255); "&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7984768457924132022-5588914890795040956?l=dermotoneill.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7984768457924132022/posts/default/5588914890795040956'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7984768457924132022/posts/default/5588914890795040956'/><link rel='alternate' type='text/html' href='http://dermotoneill.blogspot.com/2012/01/sybase-and-sql-server-image-data-move.html' title='Sybase and SQL Server Image Data Move'/><author><name>Dermot O'Neill</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/-1-kFtCyJhaQ/TyLcwNugYfI/AAAAAAAAGWo/F1RMqOvR1n0/s72-c/offlineDataMove.png' height='72' width='72'/></entry><entry><id>tag:blogger.com,1999:blog-7984768457924132022.post-5146166340573840832</id><published>2011-10-12T06:39:00.001-07:00</published><updated>2011-10-12T06:53:29.113-07:00</updated><title type='text'>JDeveloper Group By Insight Preference</title><content type='html'>During Oracle OpenWorld a customer asked how to turn off the autogenerate of GROUP BY clause when using JDeveloper.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;SQL Developer has a preference&lt;/div&gt;&lt;div&gt;&lt;img src="http://3.bp.blogspot.com/-FEHaCIAu0qE/TpWZYuCp0GI/AAAAAAAAGVw/78jB8WVt2LA/s400/sqldevPref.PNG" style="cursor:pointer; cursor:hand;width: 400px; height: 286px;" border="0" alt="" id="BLOGGER_PHOTO_ID_5662600756443336802" /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;But JDeveloper is missing this preference, and it is turned on by default. &lt;/div&gt;&lt;div&gt;This will be rectified in a future realese of JDeveloper but in the mean time there is a workaround.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;1) Close JDeveloper.&lt;/div&gt;&lt;div&gt;2) Open JDevelopers product-preferences.xml file.&lt;/div&gt;&lt;div&gt;This can be found  under &lt;/div&gt;&lt;div&gt;c:\Users\&lt;username&gt;\AppData\Roaming\JDeveloper\&lt;version&gt;\o.jdeveloper\ &lt;/version&gt;&lt;/username&gt;&lt;/div&gt;&lt;div&gt;on windows 7. Or in the usual place applications persist preferences in your OS.&lt;/div&gt;&lt;div&gt;3)Add the following after the ide tag.&lt;br /&gt;&lt;br /&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;&amp;lt;hash n="DBConfig"&amp;gt;&lt;br /&gt;     &amp;lt;value n="AUTOGENERATEGROUPBY" v="false"/&amp;gt;&lt;br /&gt;     &amp;lt;hash n="EXTENSION"/&amp;gt;&lt;br /&gt;     &amp;lt;value n="INDENT_CACHE_NUMBER" v="2"/&amp;gt;&lt;br /&gt;     &amp;lt;value n="INDENT_CACHE_USE_TAB" v="false"/&amp;gt;&lt;br /&gt;  &amp;lt;/hash&amp;gt;&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;   &lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;.&lt;img src="http://2.bp.blogspot.com/-8pJpxAt4kTw/TpWZJNpuVWI/AAAAAAAAGVk/c3rbTtstVCg/s400/preference.PNG" border="0" alt="" id="BLOGGER_PHOTO_ID_5662600490050803042" style="cursor: pointer; width: 400px; height: 170px; " /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;4) Restart JDeveloper, and Autogenerate GROUP BY should not turned off.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7984768457924132022-5146166340573840832?l=dermotoneill.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7984768457924132022/posts/default/5146166340573840832'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7984768457924132022/posts/default/5146166340573840832'/><link rel='alternate' type='text/html' href='http://dermotoneill.blogspot.com/2011/10/jdeveloper-group-by-insight-preference.html' title='JDeveloper Group By Insight Preference'/><author><name>Dermot O'Neill</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/-FEHaCIAu0qE/TpWZYuCp0GI/AAAAAAAAGVw/78jB8WVt2LA/s72-c/sqldevPref.PNG' height='72' width='72'/></entry><entry><id>tag:blogger.com,1999:blog-7984768457924132022.post-8164085007333088113</id><published>2011-08-26T04:07:00.000-07:00</published><updated>2011-08-26T06:12:25.901-07:00</updated><title type='text'>Very Large Migrations</title><content type='html'>Most of the time SQL Developer does a good job of migrating a database from SQL Server, Sybase ,... To Oracle. But there are some tricks to help  make very large migrations perform smoother.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;This talks about Large migrations in terms of object numbers , not amount of data in tables. &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;If your migrating 50 databases at once, and each has 1,000 tables, 1,000 views , 1,000 procedures . That is a lot of meta data to churn through and  sometimes we find&lt;/div&gt;&lt;div&gt;memory issues , open cursors ,... can be a problem.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;We are always working to reduce the amount of resources required to perform the migrations , but for the moment (SQL Dev 3.0) here are a few tricks which just might make the difference between the migration failing and the migration completing.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;Memory&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;By Default SQL Developer startups with&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;&lt;span class="Apple-style-span"&gt;AddVMOption  -XX:MaxPermSize=128M &lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span"&gt;(found in sqldeveloper\sqldeveloper\bin\sqldeveloper.conf)&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span"&gt;AddVMOption -Xmx640M&lt;span class="Apple-style-span"&gt; &lt;span class="Apple-style-span"&gt;(found in sqldeveloper\ide\bin\ide.conf)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span"&gt;AddVMOption -Xms128M&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;	&lt;/span&gt; (found in sqldeveloper\ide\bin\ide.conf)&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;This is usually fine, but ... if you have more memory, SQL Dev maybe able to use it.&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;When using SQL Developer 32 bit on a 32 bit machine with a 32 bit JDK. The following is ok&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;&lt;span class="Apple-style-span"&gt;AddVMOption -XX:MaxPermSize=128M&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;	&lt;/span&gt;(found in sqldeveloper\sqldeveloper\bin\sqldeveloper.conf)&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span"&gt;AddVMOption -Xmx1024M&lt;span class="Apple-style-span"&gt; &lt;span class="Apple-style-span"&gt;(found in sqldeveloper\ide\bin\ide.conf)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span"&gt;AddVMOption -Xms256M&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space: pre; "&gt;	  &lt;/span&gt; (found in sqldeveloper\ide\bin\ide.conf)&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;When using SQL Developer 64 bit on  a 64 bit machine with a 64 bit JDK. The following is ok . As long as you have the memory.&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-style-span"&gt;&lt;ul&gt;&lt;li&gt;AddVMOption -XX:MaxPermSize=512M&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;	&lt;/span&gt;(found in sqldeveloper\sqldeveloper\bin\sqldeveloper.conf)&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;AddVMOption -Xmx4096M&lt;span class="Apple-style-span"&gt; (found in sqldeveloper\ide\bin\ide.conf)&lt;/span&gt;&lt;/li&gt;&lt;li&gt;AddVMOption -Xms2048M &lt;span class="Apple-style-span"&gt;(found in sqldeveloper\ide\bin\ide.conf)&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;&lt;b&gt;Oracle Database&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;By Default Oracle uses a small maximum of open cursors allowed. When migrating large databases SQL Developer does tend to open a lot of cursors against the Oracle database which has the migration repository. We have worked on minimizing this and will continue to do so, but the workaround at the moment is to set this limit higher in the Oracle database you create your migration repository in.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: medium; "&gt;ALTER SYSTEM SET open_cursors=10000 COMMENT='' SCOPE=BOTH&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" &gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;&lt;div&gt;Note if you are migrating multibyte databases (objects names are in chinese, japanese ,.. ) you should create the migration repository in a UTF-8 Oracle database. Otherwise the object names may not be saved/migrated correctly.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;SQL Developer&lt;/b&gt;&lt;/div&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;SQL Developer obviously interacts with the migration repository. For example to convert a stored procedure. It queries the migration repository to retrieve the captured SQL and then inserts into the repository the converted SQL.  Not only that, SQL Developer also queries the migration repository to identify name changes, data type of columns and so on. These round trips back and forth to the migration repository can slow down a migration.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;If you are migrating large amounts of Stored Procedures, Triggers, Views, Functions it is best to install SQL Developer on the same machine as the Oracle database that contains the migration repository. This will remove the network overhead and speed up the migration.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;&lt;b&gt;Migrate Incrementally&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;SQL Developers Migration Wizard allows you to define the entire migration you want up front,  and then  kick it off.  This is ok for smaller migrations, but I think it best that most migrations perform the migration incrementally.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;The migration wizard allow you perform each step of the migration by itself. This enables you to review each step of the migration before proceeding to the next.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;Just click the "Proceed to Summary" checkbox at the bottom left of the wizard and then click Next. The wizard will then only perform the steps you have choosen so far.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-style-span" style="font-size: 16px; "&gt;&lt;a href="http://3.bp.blogspot.com/-7C5jEwiXeW0/TleVWjknhCI/AAAAAAAAGVE/9JzIRGe9Hz0/s1600/capture.png" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"&gt;&lt;img src="http://3.bp.blogspot.com/-7C5jEwiXeW0/TleVWjknhCI/AAAAAAAAGVE/9JzIRGe9Hz0/s400/capture.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5645144872670692386" style="cursor: pointer; width: 400px; height: 300px; " /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;When this step is complete you will get a chance to review the result and then kick off the wizard again , straight back into the wizard at the correct step.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;Not only that but breaking it into steps also helps with  memory/cursor issues.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;&lt;b&gt;Redundant Objects&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;Some times a database which is being migrated contains a lot of objects which are redundant or not required to migrate. If there is a substantial amount  of these objects, its best to remove them  from the captured model so as they do not consume resources going forward.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;Right click the objects in the captured model you do not want and choose delete.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;Note that this is a model and not connected to your Source SQL Server, Sybase ,... database. &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;So those source objects are not deleted , just items in your model saved in the migration repository.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;a href="http://3.bp.blogspot.com/-md5gMQdcOFw/TleWn60uVsI/AAAAAAAAGVM/66mQ7e-4WR0/s1600/delete.png" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"&gt;&lt;img src="http://3.bp.blogspot.com/-md5gMQdcOFw/TleWn60uVsI/AAAAAAAAGVM/66mQ7e-4WR0/s400/delete.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5645146270481667778" style="cursor: pointer; width: 400px; height: 337px; " /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;&lt;b&gt;Generation Script&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;Very large databases will have very large generation script. By default SQL Developer generates one big script which is then run to create all the target objects in Oracle.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;But there is a preference (Migration &amp;gt; Generation Options &amp;gt; A File Per Object) to split each object (table,trigger,view,...) definition into  a separate file.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;Then a master script calls each file individually to create the objects.  This means a much smaller master file.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;It is also handy if you want to source control the object definitions.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-style-span" style="font-size: 16px; "&gt;&lt;a href="http://1.bp.blogspot.com/-pWnHBH24O-o/TleXdTC69VI/AAAAAAAAGVU/iCS2eyrxHLs/s1600/fileperobject.png" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"&gt;&lt;img src="http://1.bp.blogspot.com/-pWnHBH24O-o/TleXdTC69VI/AAAAAAAAGVU/iCS2eyrxHLs/s400/fileperobject.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5645147187516732754" style="cursor: pointer; width: 400px; height: 286px; " /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7984768457924132022-8164085007333088113?l=dermotoneill.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7984768457924132022/posts/default/8164085007333088113'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7984768457924132022/posts/default/8164085007333088113'/><link rel='alternate' type='text/html' href='http://dermotoneill.blogspot.com/2011/08/very-large-migrations.html' title='Very Large Migrations'/><author><name>Dermot O'Neill</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/-7C5jEwiXeW0/TleVWjknhCI/AAAAAAAAGVE/9JzIRGe9Hz0/s72-c/capture.png' height='72' width='72'/></entry><entry><id>tag:blogger.com,1999:blog-7984768457924132022.post-5525821717985423631</id><published>2011-03-02T09:14:00.001-08:00</published><updated>2011-03-02T09:28:52.396-08:00</updated><title type='text'>Empty Space and Single Space Data Move</title><content type='html'>Empty Space strings, that is Strings with no text whats so ever '', are treated differently by different databases.&lt;br /&gt;Oracle treats an empty string '' as NULL&lt;br /&gt;Sybase treats an empty string '' as a single spaced string ' '&lt;br /&gt;Some other database support empty strings&lt;br /&gt;&lt;br /&gt;In the migration preferences you can decide how to handle empty strings.&lt;br /&gt;You can either migrate them to&lt;br /&gt;1) ' ' A single space.&lt;br /&gt;or&lt;br /&gt;2) NULL (which is how Oracle would interpret an empty string anyway)&lt;br /&gt;&lt;br /&gt;There is one other thing to note.&lt;br /&gt;JTDS 1.2 (the recommended JDBC driver for Sybase and SQL Server) returns an empty string even when the data in the Sybase or SQL Server database is a single space.&lt;br /&gt;This is a bug in JTDS, but it should be noted that if you keep the default option of migrating empty strings to a single space, you should see no issue.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7984768457924132022-5525821717985423631?l=dermotoneill.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7984768457924132022/posts/default/5525821717985423631'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7984768457924132022/posts/default/5525821717985423631'/><link rel='alternate' type='text/html' href='http://dermotoneill.blogspot.com/2011/03/empty-space-and-single-space-data-move.html' title='Empty Space and Single Space Data Move'/><author><name>Dermot O'Neill</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-7984768457924132022.post-734002351761342162</id><published>2011-02-11T03:34:00.000-08:00</published><updated>2011-02-11T06:46:31.717-08:00</updated><title type='text'>FLOAT data type migration</title><content type='html'>Sybase FLOAT is generally used to save non integer numbers like fractions where no number of precision can hold the exact value. Sybase  FLOATs do not store an exact value&lt;br /&gt;"It stores slightly imprecise representations of real numbers as binary fractions at the hardware level"&lt;br /&gt;&lt;a href="http://www.sybase.com/detail?id=20313"&gt;http://www.sybase.com/detail?id=20313&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Oracle has two data types, FLOAT and BINARY_FLOAT.&lt;br /&gt;&lt;a href="http://stackoverflow.com/questions/332492/oracle-floats-vs-number"&gt;http://stackoverflow.com/questions/332492/oracle-floats-vs-number&lt;/a&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;FLOAT is really a decimal data type with exact values (basically it is a NUMERIC)&lt;br /&gt;&lt;/li&gt;&lt;li&gt;BINARY_FLOAT  is a binary data type which better maps to Sybase FLOAT data type&lt;/li&gt;&lt;/ul&gt;If you migrate from Sybase FLOAT to Oracle FLOAT any value inserted will be treated as a specific explicit numeric, which will not behave like Sybase FLOAT.&lt;br /&gt;If you migrate from Sybase FLOAT to Oracle BINARY_FLOAT then any value inserted will be treated as a binary imprecise number, just like Sybase.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;SYBASE&lt;/span&gt;&lt;br /&gt;drop table testfloat&lt;br /&gt;go&lt;br /&gt;create table testfloat (floatcol float)&lt;br /&gt;go&lt;br /&gt;insert into testfloat values(1.005)&lt;br /&gt;go&lt;br /&gt;insert into testfloat values(1.0049999999999999)&lt;br /&gt;go&lt;br /&gt;select * from testfloat  --both values are displayed as 1.005&lt;br /&gt;go&lt;br /&gt;select * from testfloat where floatcol = 1.005 --returns both rows&lt;br /&gt;go&lt;br /&gt;select * from testfloat where floatcol = 1.0049999999999999 --returns both rows&lt;br /&gt;go&lt;br /&gt;select * from testfloat where floatcol = 1.0049999999999998 --returns both rows&lt;br /&gt;go&lt;br /&gt;select * from testfloat where floatcol = 1.0049999999999997 --returns NO rows&lt;br /&gt;go&lt;br /&gt;select * from testfloat where floatcol = 1.004999994--returns NO rows&lt;br /&gt;go&lt;br /&gt;select * from testfloat where floatcol = 1.004999493 --returns NO rows&lt;br /&gt;go&lt;br /&gt;&lt;br /&gt;So it looks like Sybase stores 1.005 as  1.0049999999999999, but displays it to the clients (like isql, jdbc)  as 1.005&lt;br /&gt;A comparison can be made with the literal 1.005 (though not recommended  as float should never be compared in this way)&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;ORACLE&lt;/span&gt;&lt;br /&gt;DROP table testfloat;&lt;br /&gt;create table testfloat(floatcol float, binaryfloatcol binary_float ,varchar2floatcol varchar2(100) );&lt;br /&gt;insert into testfloat values(1.005,1.005,'1.005') ;&lt;br /&gt;insert into testfloat values(1.0049999999999999,1.0049999999999999,'1.0049999999999999');&lt;br /&gt;select * from testfloat; --both values are displayed as 1.005 for BINARY_FLOAT and a mix as FLOAT&lt;br /&gt;select * from testfloat where floatcol = 1.005;  --returns one row&lt;br /&gt;select * from testfloat where floatcol = 1.0049999999999999 ;  --returns one row&lt;br /&gt;select * from testfloat where floatcol = 1.0049999999999998 ;  --returns NO rows&lt;br /&gt;select * from testfloat where floatcol = 1.0049999999999997 ;  --returns NO rows&lt;br /&gt;&lt;br /&gt;select * from testfloat where binaryfloatcol = 1.005;  --returns two rows&lt;br /&gt;select * from testfloat where binaryfloatcol = 1.0049999999999999 ;  --returns two rows&lt;br /&gt;select * from testfloat where binaryfloatcol = 1.0049999999999998 ;  --returns  two rows&lt;br /&gt;select * from testfloat where binaryfloatcol = 1.0049999999999997 ;  --returns two rows&lt;br /&gt;&lt;br /&gt;select * from testfloat where binaryfloatcol = 1.004999994 ;  --returns two rows&lt;br /&gt;select * from testfloat where binaryfloatcol = 1.004999493 ;  --returns no row&lt;br /&gt;&lt;br /&gt;Oracle stores FLOAT values as explicit numbers whereas BINARY_FLOAT values are not as precise. Oracle also displays 1.005 for both values in BINARY_FLOAT.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Conclusion&lt;/span&gt;&lt;br /&gt;From the above test cases it looks like Oracle BINARY_FLOAT is a much better match than Oracle FLOAT for Sybase FLOAT, but it should be noted that since Sybase FLOAT and Oracle BINARY_FLOAT are not precise numbers , comparing equivalence is not identical between databases.&lt;br /&gt;&lt;br /&gt;floats , be they Sybase FLOATs or Oracle BINARY_FLOATs should never be directly compared, rather a range of values should be matched.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Notes&lt;/span&gt;&lt;br /&gt;Sybase BCP dumps out both floats as 1.0049999999999999&lt;br /&gt;JDBC query against Sybase returns both floats as 1.005.&lt;br /&gt;&lt;br /&gt;So during a SQL Developer data move, online will insert 1.005 , but offline will insert  1.0049999999999999. This doesn't really  matter if the Oracle data type is BINARY_FLOAT, but it does if you use Oracle FLOAT data type.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7984768457924132022-734002351761342162?l=dermotoneill.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7984768457924132022/posts/default/734002351761342162'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7984768457924132022/posts/default/734002351761342162'/><link rel='alternate' type='text/html' href='http://dermotoneill.blogspot.com/2011/02/float-data-type-migration.html' title='FLOAT data type migration'/><author><name>Dermot O'Neill</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-7984768457924132022.post-3891749703846680041</id><published>2011-02-09T03:57:00.000-08:00</published><updated>2011-06-09T05:50:07.981-07:00</updated><title type='text'>Migration Reports 3.0</title><content type='html'>&lt;div style="text-align: left;"&gt;We have revamped the migration reports in SQL Developer 3.0 to provide significantly more information about your migration.  Instead of "hiding" this information under the Migration Report navigator , now the reports can be viewed by double clicking on any of the folder nodes in the Migration navigator. The reports are smart enough to tailor the information depending on where in the Migration Navigator you click.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Status&lt;/span&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_H4TtZUn_Tz8/TVJ7LrdoLjI/AAAAAAAAGJw/WqPv50KyDVA/s1600/Status.png"&gt;&lt;img src="http://3.bp.blogspot.com/_H4TtZUn_Tz8/TVJ7LrdoLjI/AAAAAAAAGJw/WqPv50KyDVA/s400/Status.png" alt="" id="BLOGGER_PHOTO_ID_5571651129586495026" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Gives you a heads up of the status of each migration project/model.&lt;br /&gt;Also provides links which when double clicked, launch the migration wizard to perform the appropriate action&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;span style="font-weight: bold;"&gt;Summary&lt;/span&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_H4TtZUn_Tz8/TVJ77jogKPI/AAAAAAAAGJ4/glaWHotQWYk/s1600/summary.png"&gt;&lt;img src="http://3.bp.blogspot.com/_H4TtZUn_Tz8/TVJ77jogKPI/AAAAAAAAGJ4/glaWHotQWYk/s400/summary.png" alt="" id="BLOGGER_PHOTO_ID_5571651952118343922" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Provides the number of objects (tables, procedures, views , ... ) involved in each of the migration projects.It then breaks down into the number of objects in each database or owner.&lt;br /&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Analysis&lt;/span&gt;&lt;br /&gt;&lt;a href="http://4.bp.blogspot.com/_H4TtZUn_Tz8/TVJ8kpJ9QnI/AAAAAAAAGKA/OY3a9R8vewk/s1600/Analysis.png"&gt;&lt;img src="http://4.bp.blogspot.com/_H4TtZUn_Tz8/TVJ8kpJ9QnI/AAAAAAAAGKA/OY3a9R8vewk/s400/Analysis.png" alt="" id="BLOGGER_PHOTO_ID_5571652657975476850" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Provides fine grain details about the databases and objects being migrated.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;SQL Size Chart&lt;/span&gt;&lt;br /&gt;Visualize size of all SQL Objects&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;SQL Size Summary&lt;/span&gt;&lt;br /&gt;Number of  SQL Objects with similar sizes&lt;br /&gt;&lt;/div&gt;&lt;span style="font-weight: bold;"&gt;        SQL Size Details&lt;/span&gt;&lt;br /&gt;&lt;div style="text-align: left;"&gt;&lt;span style="font-weight: bold;"&gt;        &lt;/span&gt;Line size for every SQL Object&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;        &lt;/span&gt;&lt;span style="font-weight: bold;"&gt;Columns&lt;/span&gt;&lt;span style="font-weight: bold;"&gt;        &lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;        &lt;/span&gt;Details of all captured colums&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;        &lt;/span&gt;&lt;span style="font-weight: bold;"&gt;Name Changes&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;        &lt;/span&gt;All the name changes between the captured objects and the converted objects&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;        &lt;/span&gt;&lt;span style="font-weight: bold;"&gt;Dependencies&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;        &lt;/span&gt;Dependency tree between store procedures and other objects&lt;br /&gt;&lt;a href="http://4.bp.blogspot.com/_H4TtZUn_Tz8/TVKPM-OUNQI/AAAAAAAAGKQ/L85VcwGAmZ4/s1600/Analysis2.png"&gt;&lt;img src="http://4.bp.blogspot.com/_H4TtZUn_Tz8/TVKPM-OUNQI/AAAAAAAAGKQ/L85VcwGAmZ4/s400/Analysis2.png" alt="" id="BLOGGER_PHOTO_ID_5571673142034969858" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Temporary Table Summary&lt;/span&gt;&lt;br /&gt;Summary of the number of temporary tables per project / database&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Temporary Table Details&lt;/span&gt;&lt;br /&gt;List of all temporary tables identified and their parent procedure&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Parameters&lt;/span&gt;&lt;br /&gt;List of all procedure and function parameters including new params&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Capture Issues&lt;/span&gt;&lt;br /&gt;&lt;a href="http://1.bp.blogspot.com/_H4TtZUn_Tz8/TVKP2p3qhJI/AAAAAAAAGKY/AlVHRpskeSo/s1600/captureIssues.png"&gt;&lt;img src="http://1.bp.blogspot.com/_H4TtZUn_Tz8/TVKP2p3qhJI/AAAAAAAAGKY/AlVHRpskeSo/s400/captureIssues.png" alt="" id="BLOGGER_PHOTO_ID_5571673858125759634" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;There should be no capture issues, but if an issues occurs it will be listed here&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Conversion Status&lt;/span&gt;&lt;br /&gt;&lt;a href="http://3.bp.blogspot.com/_H4TtZUn_Tz8/TVKQKUU9_ZI/AAAAAAAAGKg/e94_-ZV9Lyc/s1600/ConversionStatus.png"&gt;&lt;img src="http://3.bp.blogspot.com/_H4TtZUn_Tz8/TVKQKUU9_ZI/AAAAAAAAGKg/e94_-ZV9Lyc/s400/ConversionStatus.png" alt="" id="BLOGGER_PHOTO_ID_5571674195940474258" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Lists the number of Procedures, Triggers and Views which converted or failed to convert&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Conversion Issues&lt;/span&gt;&lt;br /&gt;&lt;a href="http://2.bp.blogspot.com/_H4TtZUn_Tz8/TVKXaVxM2OI/AAAAAAAAGLQ/jr_7-wKxRFA/s1600/conversionIssues.png"&gt;&lt;img src="http://2.bp.blogspot.com/_H4TtZUn_Tz8/TVKXaVxM2OI/AAAAAAAAGLQ/jr_7-wKxRFA/s400/conversionIssues.png" alt="" id="BLOGGER_PHOTO_ID_5571682167786625250" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Reports on all the issues which where encountered during the conversion.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Errors &lt;/span&gt;denote objects which failed to convert.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Limitations&lt;/span&gt; denote objects which converted but a particular statement or clause was not supported&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Target Status&lt;/span&gt;&lt;br /&gt;&lt;a href="http://3.bp.blogspot.com/_H4TtZUn_Tz8/TVKQ8U8h6mI/AAAAAAAAGKw/fdxhg3YAF3Q/s1600/TargetStatus.png"&gt;&lt;img src="http://3.bp.blogspot.com/_H4TtZUn_Tz8/TVKQ8U8h6mI/AAAAAAAAGKw/fdxhg3YAF3Q/s400/TargetStatus.png" alt="" id="BLOGGER_PHOTO_ID_5571675055099865698" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;After selecting an appropriate connection to the target database and clicking refresh, this report will list all the objects in the converted model and their status in the target database. Valid, Invalid or Missing&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Target Issues&lt;/span&gt;&lt;br /&gt;&lt;a href="http://2.bp.blogspot.com/_H4TtZUn_Tz8/TVKRhaUgBII/AAAAAAAAGK4/haGAFPIfmkQ/s1600/TargetIssues.png"&gt;&lt;img src="http://2.bp.blogspot.com/_H4TtZUn_Tz8/TVKRhaUgBII/AAAAAAAAGK4/haGAFPIfmkQ/s400/TargetIssues.png" alt="" id="BLOGGER_PHOTO_ID_5571675692197741698" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;After choosing the appropriate Target connection and clicking refresh, this looks at the issues of each object in the target database.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Data Quality&lt;/span&gt;&lt;br /&gt;&lt;a href="http://1.bp.blogspot.com/_H4TtZUn_Tz8/TVKR8cUfECI/AAAAAAAAGLA/-PHWPRvDR4Q/s1600/DataQuality.png"&gt;&lt;img src="http://1.bp.blogspot.com/_H4TtZUn_Tz8/TVKR8cUfECI/AAAAAAAAGLA/-PHWPRvDR4Q/s400/DataQuality.png" alt="" id="BLOGGER_PHOTO_ID_5571676156591018018" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;After selecting the appropriate&lt;br /&gt;Model, Source Connection and Target Connection click Analysis.&lt;br /&gt;&lt;br /&gt;You will be prompted to continue as you are reminded that a full table scan of all the tables on the source connection and target connection will take place.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;SELECT count(*) from tablename  &lt;each table="" name=""&gt; is performed against each table and the values inserted into the migration repository.&lt;/each&gt;&lt;br /&gt;&lt;each table="" name=""&gt;&lt;/each&gt;&lt;br /&gt;&lt;each table="" name=""&gt;Once complete, click refresh. Each table migrated is listed with the source row number and the target row number, making it easy to identify tables where all the data was not migrated&lt;/each&gt;&lt;br /&gt;&lt;each table="" name=""&gt;&lt;/each&gt;&lt;br /&gt;&lt;each table="" name=""&gt;&lt;span style=" font-style: italic; font-weight: bold;font-family:lucida grande;" &gt;Note that SELECT count(*) from tablename  &lt;/span&gt;&lt;each table=""&gt;&lt;span style=" font-style: italic; font-weight: bold;font-family:lucida grande;" &gt; may make a significant impact on the performance of the source and target database so best run only on non production databases.&lt;/span&gt;&lt;/each&gt;&lt;/each&gt;&lt;br /&gt;&lt;each table="" name=""&gt;&lt;each table=""&gt;&lt;/each&gt;&lt;/each&gt;&lt;br /&gt;&lt;each table="" name=""&gt;&lt;each table=""&gt;&lt;/each&gt;&lt;/each&gt;&lt;br /&gt;&lt;each table="" name=""&gt;&lt;each table=""&gt;&lt;span style="font-weight: bold;"&gt;Model Comparison&lt;/span&gt;&lt;/each&gt;&lt;/each&gt;&lt;br /&gt;&lt;each table="" name=""&gt;&lt;each table=""&gt;&lt;/each&gt;&lt;/each&gt;&lt;a href="http://4.bp.blogspot.com/_H4TtZUn_Tz8/TVKTDgH5D0I/AAAAAAAAGLI/SoWbpv3Nn80/s1600/Model%2BComparison.png"&gt;&lt;img src="http://4.bp.blogspot.com/_H4TtZUn_Tz8/TVKTDgH5D0I/AAAAAAAAGLI/SoWbpv3Nn80/s400/Model%2BComparison.png" alt="" id="BLOGGER_PHOTO_ID_5571677377382649666" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;After choosing the first captured model and the second captured model click refresh. The differences between the models will be listed.&lt;br /&gt;&lt;br /&gt;This is useful when trying to identify changes to your source database over a period of time , sometimes called the delta.&lt;br /&gt;&lt;br /&gt;This knowledge can help identify any new or modified objects which require migration.&lt;br /&gt;&lt;each table="" name=""&gt;&lt;each table=""&gt;&lt;/each&gt;&lt;/each&gt;&lt;br /&gt;&lt;each table="" name=""&gt;&lt;each table=""&gt;&lt;/each&gt;&lt;/each&gt;&lt;br /&gt;&lt;each table="" name=""&gt;&lt;each table=""&gt;&lt;/each&gt;&lt;/each&gt;&lt;br /&gt;&lt;each table="" name=""&gt;&lt;each table=""&gt;&lt;/each&gt;&lt;/each&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7984768457924132022-3891749703846680041?l=dermotoneill.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7984768457924132022/posts/default/3891749703846680041'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7984768457924132022/posts/default/3891749703846680041'/><link rel='alternate' type='text/html' href='http://dermotoneill.blogspot.com/2010/11/migration-reports-30.html' title='Migration Reports 3.0'/><author><name>Dermot O'Neill</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_H4TtZUn_Tz8/TVJ7LrdoLjI/AAAAAAAAGJw/WqPv50KyDVA/s72-c/Status.png' height='72' width='72'/></entry><entry><id>tag:blogger.com,1999:blog-7984768457924132022.post-2397767095182599730</id><published>2010-12-22T00:47:00.000-08:00</published><updated>2010-12-22T03:39:57.450-08:00</updated><title type='text'>SQL Developer DB2 Connection</title><content type='html'>SQL Developer 2.1.1 (and 3.0) supports browsing of IBM DB2 LUW 7, 8, 9 databases.&lt;br /&gt;IBM DB2 iSeries and ZSeries Z/OS are not supported at this time.&lt;br /&gt;&lt;br /&gt;To connect to DB2 LUW, SQL Developer first needs the correct JDBC driver.&lt;br /&gt;Only one specific JDBC driver is supported.&lt;br /&gt;db2jcc.jar with db2jcc_license_cu.jar&lt;br /&gt;&lt;br /&gt;All other IBM drivers are not supported and may cause problems even if the above two drivers are specified. So best to only add the above two.&lt;br /&gt;&lt;br /&gt;These drivers are usually found in your own DB2 database install or DB2 client install.&lt;br /&gt;They are also available when you agree to the license (please check this first) and download IBMs DB2 Express-C database or  Data Studio Standalone administration tools&lt;br /&gt;&lt;a href="http://www-01.ibm.com/software/data/db2/express/download.html"&gt;http://www-01.ibm.com/software/data/db2/express/download.html&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Once you have a DB2 client or database installed you can search for the specific JDBC jar files.&lt;br /&gt;&lt;ul&gt;&lt;li&gt;db2jcc.jar&lt;/li&gt;&lt;li&gt;db2jcc_license_cu.jar&lt;/li&gt;&lt;/ul&gt;Note you cannot use db2jcc4.jar and this would cause issues if added to SQL Developers Third Party JDBC Drivers list.&lt;br /&gt;&lt;br /&gt;Heres what my preference page looks like. (note, JTDS is for SQL Server and Sybase)&lt;br /&gt;&lt;a href="http://4.bp.blogspot.com/_H4TtZUn_Tz8/TRHhW2VhE0I/AAAAAAAAGCs/wV5NbQHcLkk/s1600/preferences.PNG"&gt;&lt;img style="float: left; margin: 0pt 10px 10px 0pt; cursor: pointer; width: 400px; height: 208px;" src="http://4.bp.blogspot.com/_H4TtZUn_Tz8/TRHhW2VhE0I/AAAAAAAAGCs/wV5NbQHcLkk/s400/preferences.PNG" alt="" id="BLOGGER_PHOTO_ID_5553467598183666498" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Once the correct jar file has been added you now have an extra DB2 tab in the connections dialog&lt;br /&gt;&lt;br /&gt;&lt;a href="http://4.bp.blogspot.com/_H4TtZUn_Tz8/TRHjWyxlwMI/AAAAAAAAGDE/zp0N2Ki-AhI/s1600/connection2.PNG"&gt;&lt;img style="float: left; margin: 0pt 10px 10px 0pt; cursor: pointer; width: 400px; height: 256px;" src="http://4.bp.blogspot.com/_H4TtZUn_Tz8/TRHjWyxlwMI/AAAAAAAAGDE/zp0N2Ki-AhI/s400/connection2.PNG" alt="" id="BLOGGER_PHOTO_ID_5553469796250927298" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Once you add your connection details you can browse your DB2 database objects.&lt;br /&gt;&lt;a href="http://3.bp.blogspot.com/_H4TtZUn_Tz8/TRHhzVSuFFI/AAAAAAAAGC8/KwwIYzH5L2Y/s1600/browse.PNG"&gt;&lt;img style="float: left; margin: 0pt 10px 10px 0pt; cursor: pointer; width: 400px; height: 256px;" src="http://3.bp.blogspot.com/_H4TtZUn_Tz8/TRHhzVSuFFI/AAAAAAAAGC8/KwwIYzH5L2Y/s400/browse.PNG" alt="" id="BLOGGER_PHOTO_ID_5553468087529772114" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;You can learn more about migrating to Oracle from IBM DB2 LUW here&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="http://www.oracle.com/technetwork/database/migration/index-084442.html"&gt;http://www.oracle.com/technetwork/database/migration/index-084442.html&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://download.oracle.com/docs/cd/E15846_01/doc.21/e15222/migration.htm#CHDECEIA"&gt;http://download.oracle.com/docs/cd/E15846_01/doc.21/e15222/migration.htm#CHDECEIA&lt;/a&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.oracle.com/technetwork/database/migration/db2-084087.html"&gt;http://www.oracle.com/technetwork/database/migration/db2-084087.html&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://download.oracle.com/docs/cd/E15846_01/doc.21/e15286/toc.htm"&gt;http://download.oracle.com/docs/cd/E15846_01/doc.21/e15286/toc.htm&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7984768457924132022-2397767095182599730?l=dermotoneill.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7984768457924132022/posts/default/2397767095182599730'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7984768457924132022/posts/default/2397767095182599730'/><link rel='alternate' type='text/html' href='http://dermotoneill.blogspot.com/2010/12/sql-developer-db2-connection.html' title='SQL Developer DB2 Connection'/><author><name>Dermot O'Neill</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_H4TtZUn_Tz8/TRHhW2VhE0I/AAAAAAAAGCs/wV5NbQHcLkk/s72-c/preferences.PNG' height='72' width='72'/></entry><entry><id>tag:blogger.com,1999:blog-7984768457924132022.post-5996562779190691112</id><published>2010-12-02T05:23:00.000-08:00</published><updated>2010-12-02T05:40:07.141-08:00</updated><title type='text'>SQL Server and Sybase Browsing</title><content type='html'>SQL Developer 3.0 (EA3) makes it easier to browse your SQL Server and Sybase servers.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://2.bp.blogspot.com/_H4TtZUn_Tz8/TPeeIRtDTiI/AAAAAAAAGBY/uVrwXUfk5LM/s1600/browsing.PNG"&gt;&lt;img style="float: left; margin: 0pt 10px 10px 0pt; cursor: pointer; width: 400px; height: 273px;" src="http://2.bp.blogspot.com/_H4TtZUn_Tz8/TPeeIRtDTiI/AAAAAAAAGBY/uVrwXUfk5LM/s400/browsing.PNG" alt="" id="BLOGGER_PHOTO_ID_5546075331158560290" border="0" /&gt;&lt;/a&gt;All databases on your server are now available under the one connection, not just the default databases selected in the new connection dialog.&lt;br /&gt;&lt;br /&gt;As long as your login has the privileges you can browse the objects in databases other than your default database.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;When it comes to issuing commands/queries in the worksheet you can reference objects outside of the default database explicitly&lt;br /&gt;&lt;span style="font-family: courier new; font-weight: bold;"&gt;SELECT * FROM databasename.owner.table1&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;or you can change the default database using a worksheet "hint"&lt;br /&gt;&lt;span style="font-family: courier new; font-weight: bold;"&gt;/*sqldev:stmt*/USE databasename;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new; font-weight: bold;"&gt;SELECT * FROM table1&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;or you can choose the default databases in the navigator&lt;br /&gt;&lt;br /&gt;&lt;a href="http://4.bp.blogspot.com/_H4TtZUn_Tz8/TPefU6SDOaI/AAAAAAAAGBg/JWyE1Ii3Ytg/s1600/defaultdb.png"&gt;&lt;img style="float: left; margin: 0pt 10px 10px 0pt; cursor: pointer; width: 400px; height: 300px;" src="http://4.bp.blogspot.com/_H4TtZUn_Tz8/TPefU6SDOaI/AAAAAAAAGBg/JWyE1Ii3Ytg/s400/defaultdb.png" alt="" id="BLOGGER_PHOTO_ID_5546076647721220514" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Note that the default is set for the life of the session only. If you want to change the default database permanently you can do this in the New Connection Dialog. Just right click the connection and choose Properties. Then click "Retrieve Databases", choose the default databases and click save.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Another nice feature is the Schema Browser, which makes working on one database/owners objects much neater.&lt;br /&gt;&lt;a href="http://4.bp.blogspot.com/_H4TtZUn_Tz8/TPefzkO4ROI/AAAAAAAAGBo/ztgPTBeFwFQ/s1600/schemaBrowser.PNG"&gt;&lt;img style="float: left; margin: 0pt 10px 10px 0pt; cursor: pointer; width: 400px; height: 273px;" src="http://4.bp.blogspot.com/_H4TtZUn_Tz8/TPefzkO4ROI/AAAAAAAAGBo/ztgPTBeFwFQ/s400/schemaBrowser.PNG" alt="" id="BLOGGER_PHOTO_ID_5546077174378284258" border="0" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7984768457924132022-5996562779190691112?l=dermotoneill.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7984768457924132022/posts/default/5996562779190691112'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7984768457924132022/posts/default/5996562779190691112'/><link rel='alternate' type='text/html' href='http://dermotoneill.blogspot.com/2010/12/sql-server-and-sybase-browsing.html' title='SQL Server and Sybase Browsing'/><author><name>Dermot O'Neill</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_H4TtZUn_Tz8/TPeeIRtDTiI/AAAAAAAAGBY/uVrwXUfk5LM/s72-c/browsing.PNG' height='72' width='72'/></entry><entry><id>tag:blogger.com,1999:blog-7984768457924132022.post-7566502197896491586</id><published>2010-11-19T14:55:00.000-08:00</published><updated>2010-11-19T15:01:20.178-08:00</updated><title type='text'>SQL Developer 3.0 Migration Features</title><content type='html'>Barry McGillin has a breakdown of the new migration features of SQL Developer 3.0&lt;br /&gt;&lt;a href="http://barrymcgillin.blogspot.com/2010/10/migration-features-in-sql-developer-30.html"&gt;http://barrymcgillin.blogspot.com/2010/10/migration-features-in-sql-developer-30.html&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;And an article on the new Estimation Report&lt;br /&gt;&lt;a href="http://barrymcgillin.blogspot.com/2010/10/migration-estimation-from-sql-developer.html"&gt;http://barrymcgillin.blogspot.com/2010/10/migration-estimation-from-sql-developer.html&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;I'm going to flesh out some of these on this blog&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7984768457924132022-7566502197896491586?l=dermotoneill.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7984768457924132022/posts/default/7566502197896491586'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7984768457924132022/posts/default/7566502197896491586'/><link rel='alternate' type='text/html' href='http://dermotoneill.blogspot.com/2010/11/sql-developer-30-migration-features.html' title='SQL Developer 3.0 Migration Features'/><author><name>Dermot O'Neill</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-7984768457924132022.post-6326686976934411567</id><published>2010-11-11T03:59:00.000-08:00</published><updated>2010-11-17T07:54:39.325-08:00</updated><title type='text'>Copy To Oracle</title><content type='html'>SQL Developer 3.0 EA1 introduces the Copy to Oracle feature.&lt;br /&gt;&lt;br /&gt;Copy to Oracle  copies a table from a non Oracle database, like SQL Server, Sybase and MS Access to Oracle.  The action can be found by right clicking one or more selected non Oracle tables and choosing "Copy To Oracle".&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_H4TtZUn_Tz8/TOP6KI9kcPI/AAAAAAAAF_E/F6xv3vcO-7c/s1600/Copy_toOracle.PNG"&gt;&lt;img style="cursor: pointer; width: 383px; height: 226px;" src="http://2.bp.blogspot.com/_H4TtZUn_Tz8/TOP6KI9kcPI/AAAAAAAAF_E/F6xv3vcO-7c/s400/Copy_toOracle.PNG" alt="" id="BLOGGER_PHOTO_ID_5540547018707202290" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Its very handy if you just want to get a particular table or a handful of tables into Oracle including their data. There is no setup required and its very easy to do.&lt;br /&gt;&lt;br /&gt;The "Migrate to Oracle"  differs in that it provides user,procedures,trigger,view, constraints, keys, indexes and table migration. Whereas "Copy to Oracle" only supports the basic table migration.&lt;br /&gt;&lt;br /&gt;MS Access customers may find "Copy to Oracle" particularly useful as it doesn't require any  system privileges to access the  databases metadata.&lt;br /&gt;MS Access connections also have "Copy to Oracle" available on right click of the connection to easily allow all tables to be copied.&lt;br /&gt;&lt;br /&gt;With all migrations , the migrated table and data should be verified as complete.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7984768457924132022-6326686976934411567?l=dermotoneill.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7984768457924132022/posts/default/6326686976934411567'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7984768457924132022/posts/default/6326686976934411567'/><link rel='alternate' type='text/html' href='http://dermotoneill.blogspot.com/2010/11/copy-to-oracle.html' title='Copy To Oracle'/><author><name>Dermot O'Neill</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_H4TtZUn_Tz8/TOP6KI9kcPI/AAAAAAAAF_E/F6xv3vcO-7c/s72-c/Copy_toOracle.PNG' height='72' width='72'/></entry><entry><id>tag:blogger.com,1999:blog-7984768457924132022.post-8630795758374061366</id><published>2010-11-11T03:56:00.000-08:00</published><updated>2010-11-24T14:12:19.065-08:00</updated><title type='text'>Workheet Hints</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_H4TtZUn_Tz8/TOb33VKumCI/AAAAAAAAF_Y/bQ7XmslPVsE/s1600/ws_hint.PNG"&gt;&lt;img style="float: left; margin: 0pt 10px 10px 0pt; cursor: pointer; width: 237px; height: 400px;" src="http://4.bp.blogspot.com/_H4TtZUn_Tz8/TOb33VKumCI/AAAAAAAAF_Y/bQ7XmslPVsE/s400/ws_hint.PNG" alt="" id="BLOGGER_PHOTO_ID_5541388921472981026" border="0" /&gt;&lt;/a&gt;SQL Developer currently doesn't support proprietary commands of non Oracle databases like SQL Server, Sybase ... . But a new feature call Worksheet Hints allows these commands to be executed.&lt;br /&gt;&lt;br /&gt;SQL Developers Worksheet has to parse commands to identify their start and finish and their type (query, or update ,... ).&lt;br /&gt;We recognize Oracle SQL , PL/SQL and SQL*Plus , but we have yet to work on other databases syntax.&lt;br /&gt;&lt;br /&gt;So at the moment if you running a command against MySQL, SQL Server or  Sybase, it has to be fairly similar to an Oracle statement for it to be  recognized and run correctly.&lt;br /&gt;EX: SELECT, INSERT,UPDATE,DELETE.&lt;br /&gt;&lt;br /&gt;Things like MySQL&lt;br /&gt;&lt;i&gt;use [databasename]&lt;/i&gt;&lt;br /&gt;or&lt;br /&gt;&lt;i&gt;show databases&lt;/i&gt;&lt;br /&gt;are not recognized yet.&lt;br /&gt;&lt;br /&gt;Full MySQL recognition will not make it into SQL Developer 3.0 ,&lt;br /&gt;but  SQL Developer 3 EA2 does allow you to give the  Worksheet parser a hint as to what type of statement it is and how to  execute it.&lt;br /&gt;&lt;br /&gt;The hint is placed in front of the command, and&lt;br /&gt;the command has to be  terminated with a forward slash on its own line, or a semi colon.&lt;br /&gt;&lt;br /&gt;The two hints are&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;/*sqldev:query*/&lt;/span&gt; if your expecting a result set to be returned&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;/*sqldev:stmt*/&lt;/span&gt; if you are expecting nothing returned&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;MySQL Example:&lt;/span&gt;&lt;br /&gt;If you connect to your MySQL connection you can perform the following&lt;br /&gt;&lt;i style="font-family: courier new; color: rgb(51, 51, 51);"&gt;/*sqldev:query*/show databases;&lt;/i&gt;&lt;br /&gt;&lt;i style="font-family: courier new; color: rgb(51, 51, 51);"&gt;/*sqldev:stmt*/use dermot;&lt;/i&gt;&lt;br /&gt;&lt;i style="font-family: courier new; color: rgb(51, 51, 51);"&gt;select database();&lt;/i&gt;&lt;br /&gt;&lt;i style="font-family: courier new; color: rgb(51, 51, 51);"&gt;/*sqldev:stmt*/use information_schema;&lt;/i&gt;&lt;br /&gt;&lt;i style="font-family: courier new; color: rgb(51, 51, 51);"&gt;select database();&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;The same goes for SQL Server , Sybase ,.... commands which are not recognized by our Worksheet.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Sybase Example:&lt;/span&gt;&lt;br /&gt;&lt;i style="font-family: courier new; color: rgb(51, 51, 51);"&gt;/sqldev:query*/sp_help;&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;Appreciate this is not an ideal solution, but until we recognize the syntax correctly this may help out.&lt;br /&gt;Just to be clear, we are not supporting all MySQL/SQL Server/Sybase  commands yet. But hopefully using a "hint" might be of some use.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7984768457924132022-8630795758374061366?l=dermotoneill.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7984768457924132022/posts/default/8630795758374061366'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7984768457924132022/posts/default/8630795758374061366'/><link rel='alternate' type='text/html' href='http://dermotoneill.blogspot.com/2010/11/workheet-hints.html' title='Workheet Hints'/><author><name>Dermot O'Neill</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_H4TtZUn_Tz8/TOb33VKumCI/AAAAAAAAF_Y/bQ7XmslPVsE/s72-c/ws_hint.PNG' height='72' width='72'/></entry><entry><id>tag:blogger.com,1999:blog-7984768457924132022.post-8971449872017024123</id><published>2010-11-11T03:55:00.000-08:00</published><updated>2010-11-25T01:53:02.481-08:00</updated><title type='text'>SQL Developer Automatic Connection Definition</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_H4TtZUn_Tz8/TOcDxj_4CPI/AAAAAAAAF_0/b9DqvtMbcRY/s1600/oldconnection.png"&gt;&lt;img style="float: left; margin: 0pt 10px 10px 0pt; cursor: pointer; width: 400px; height: 392px;" src="http://4.bp.blogspot.com/_H4TtZUn_Tz8/TOcDxj_4CPI/AAAAAAAAF_0/b9DqvtMbcRY/s400/oldconnection.png" alt="" id="BLOGGER_PHOTO_ID_5541402016514312434" border="0" /&gt;&lt;/a&gt;When creating users in Oracle , you then have to create a connection in SQL Developer, repeating the information.&lt;br /&gt;&lt;br /&gt;So you would run something like this in the SQL Worksheet&lt;br /&gt;CREATE USER dermo IDENTIFIED BY dermo;&lt;br /&gt;GRANT CONNECT,RESOURCE TO dermo;&lt;br /&gt;&lt;br /&gt;Then you would have to create a SQL Developer connection.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://2.bp.blogspot.com/_H4TtZUn_Tz8/TOcFQh72eBI/AAAAAAAAGAE/OXSdWPfz_WQ/s1600/newconn.PNG"&gt;&lt;img style="float: left; margin: 0pt 10px 10px 0pt; cursor: pointer; width: 400px; height: 211px;" src="http://2.bp.blogspot.com/_H4TtZUn_Tz8/TOcFQh72eBI/AAAAAAAAGAE/OXSdWPfz_WQ/s400/newconn.PNG" alt="" id="BLOGGER_PHOTO_ID_5541403648048134162" border="0" /&gt;&lt;/a&gt;In SQL Developer 3.0 you can use the SQL Worksheet to create the connection for you.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;CREATE CONNECTION connectionname(CREATE USER username IDENTIFIED BY password);&lt;br /&gt;GRANT CONNECT,RESOURCE to username;&lt;br /&gt;&lt;br /&gt;&lt;img src="file:///C:/Users/dermot/AppData/Local/Temp/moz-screenshot-1.png" alt="" /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7984768457924132022-8971449872017024123?l=dermotoneill.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7984768457924132022/posts/default/8971449872017024123'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7984768457924132022/posts/default/8971449872017024123'/><link rel='alternate' type='text/html' href='http://dermotoneill.blogspot.com/2010/11/sql-developer-automatic-connection.html' title='SQL Developer Automatic Connection Definition'/><author><name>Dermot O'Neill</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_H4TtZUn_Tz8/TOcDxj_4CPI/AAAAAAAAF_0/b9DqvtMbcRY/s72-c/oldconnection.png' height='72' width='72'/></entry><entry><id>tag:blogger.com,1999:blog-7984768457924132022.post-6586545422960289491</id><published>2010-11-11T03:45:00.000-08:00</published><updated>2010-11-19T14:51:53.605-08:00</updated><title type='text'>Cross Database Bridge Statement</title><content type='html'>Oracle allows you to query separate databases using Database Links.&lt;br /&gt;You can even setup a Database Link in an Oracle database with a non Oracle database such as SQL Server or Sybase.&lt;br /&gt;&lt;br /&gt;Creating these types of Database Links can take some time, and sometimes you just want to reference a small bit of data on another Database and use it in your query.&lt;br /&gt;&lt;br /&gt;SQL Developer allows you define connections to multiple databases including non Oracle databases. You can query each connection separately but until now you couldn't easily query different data sources (connections) at the same time in the one statement.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_H4TtZUn_Tz8/TOb_BlidrAI/AAAAAAAAF_s/wKYexIWf7fE/s1600/bridge.PNG"&gt;&lt;img style="display: block; margin: 0px auto 10px; text-align: center; cursor: pointer; width: 400px; height: 238px;" src="http://4.bp.blogspot.com/_H4TtZUn_Tz8/TOb_BlidrAI/AAAAAAAAF_s/wKYexIWf7fE/s400/bridge.PNG" alt="" id="BLOGGER_PHOTO_ID_5541396794247588866" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;BRIDGE statement&lt;br /&gt;This is a SQL Developer only command. It is not supported in SQL*Plus or directly in the Oracle database. SQL Developer interprets this statement and performs multiple actions to return the result.&lt;br /&gt;&lt;br /&gt;BRIDGE statement can be used in two ways&lt;br /&gt;1) To copy a table and its data from one connection to another&lt;br /&gt;2) To facilitate cross connection/database queries&lt;br /&gt;&lt;br /&gt;&lt;pre style="font-family: Andale Mono,Lucida Console,Monaco,fixed,monospace; color: rgb(0, 0, 0); background-color: rgb(238, 238, 238); font-size: 12px; border: 1px dashed rgb(153, 153, 153); line-height: 14px; padding: 5px; overflow: auto; width: 100%;height: 300px;"&gt;&lt;code&gt;--*******INTRO*******&lt;br /&gt;--The BRIDGE command is an Oracle SQL Developer client command&lt;br /&gt;--It is not suported by any other product (SQL*Plus,....)&lt;br /&gt;--It is used within Oracle SQL Developer to enable the "Copy to Oracle" feature and peform complex migration reports&lt;br /&gt;--It is not suported as a standalone command, but can be experimented with&lt;br /&gt;--The BRIDGE command is still immature and the parsing of its syntax including spaces is still basic.&lt;br /&gt;&lt;br /&gt;-- *******SETUP*******&lt;br /&gt;-- CREATE MS Access Northwind connection called, accessNorthwind&lt;br /&gt;-- CREATE SQL Server 2005 Northwind connection called, sqlserverNorthwind&lt;br /&gt;-- CREATE MySQL 5 world connection called, mysqlWorld&lt;br /&gt;-- Run each part of this script against an Oracle connection&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;-- This new Oracle SQL Developer client command to create a SQL Developer Connection at the same time as creating a schema&lt;br /&gt;CREATE CONNECTION oracleTest(GRANT DBA TO oracleTest identified by oracleTest);&lt;br /&gt;CREATE CONNECTION oracleTest2(CREATE USER oracleTest2 identified by oracleTest2);&lt;br /&gt;GRANT connect,resource,create view to oracleTest2;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;--*******FEATURE SUMMARY*******&lt;br /&gt;-- BRIDGE command can be used in two distinct ways&lt;br /&gt;-- 1) TO COPY A TABLE from one connection (A third party connection or oracle connection) to another connection.&lt;br /&gt;-- 2) BRIDGE QUERIES (TO QUERY TABLES OVER MULTIPLE CONNECTIONS)&lt;br /&gt;-- COPY A TABLE is fairly straight forward, you specify the target table name and the query and connection used to define and populate the target table&lt;br /&gt;-- BRIDGE QUERIES  uses the same method as above to move data from different connections to a target connection, but it then allows you to specify a query to run against the newly migrated tables/data.&lt;br /&gt;-- It then DROPs the new Tables after the Query has run. From a user point of view it looks like a Query have taken place between different connections as they never see the target tables created,populated,queries and droped behind the scenes.&lt;br /&gt;&lt;br /&gt;--*******SYNTAX*******&lt;br /&gt;/*&lt;br /&gt;&amp;lt;BRIDGE&amp;gt;:&lt;br /&gt;BRIDGE &amp;lt;TABLEDEFINITION&amp;gt; ( ',' &amp;lt;TABLEDEFINTION&amp;gt;)*&lt;br /&gt;[&amp;lt;targetQuery&amp;gt;] ;&lt;br /&gt;&lt;br /&gt;&amp;lt;TABLEDEFINITION&amp;gt;:&lt;br /&gt;[&amp;lt;targetConnectionName&amp;gt;](&amp;lt;newTargetTableName&amp;gt;)  AS [&amp;lt;sourceConnectionName&amp;gt;](&amp;lt;SOURCEQUERY&amp;gt;)[APPEND|REPLACE]&lt;br /&gt;&lt;br /&gt;&amp;lt;SOURCEQUERY&amp;gt;:&lt;br /&gt;SQL valid on the sourceConnection. Supports Dynamic Substitution.&lt;br /&gt;({&amp;lt;defaultQuery}) gets replaced with a comma delimited list of values&lt;br /&gt;{&amp;lt;defaultQuery} iterates the source query for each value returned&lt;br /&gt;&lt;br /&gt;*/&lt;br /&gt;--*******COPY A TABLE*******&lt;br /&gt;-- CROSS CONNECTION TABLE/DATA MIGRATION&lt;br /&gt;--This creates a new NEWcustomers1 table in the current connection(oracle), using a table from access (customers) referenced through the accessNorthwind connection.&lt;br /&gt;BRIDGE NEWcustomers1 AS accessNorthwind(SELECT * FROM customers);&lt;br /&gt;&lt;br /&gt;--Note that the SQL that defines the target table is run against the source Connection (accessNorthwind), so you have to use the source databases SQL syntax. In this case, MS Access.&lt;br /&gt;BRIDGE NEWcustomers2 AS accessNorthwind(SELECT TOP 10 * FROM customers);&lt;br /&gt;&lt;br /&gt;--A target table is defined using any valid query, so it doesnt have to be a straight copy of a particular table.Rows can be filtered, columns can be added, infact the target table could be based on a VIEW.&lt;br /&gt;--In this case, no rows are returned , but an empty table NEWcustomers3 is created&lt;br /&gt;BRIDGE NEWcustomers3 AS accessNorthwind(SELECT * FROM customers WHERE 1=2);&lt;br /&gt;&lt;br /&gt;--If a target table name already exists, then an error is thrown.&lt;br /&gt;--if you want to insert data to an existing table use the APPEND flag&lt;br /&gt;BRIDGE NEWcustomers3 AS accessNorthwind(SELECT TOP 10 * FROM customers)APPEND;&lt;br /&gt;BRIDGE NEWcustomers3 AS accessNorthwind(SELECT TOP 10 * FROM customers)APPEND;&lt;br /&gt;&lt;br /&gt;--If the table already exists but you want to replace it , use the REPLACE flag&lt;br /&gt;BRIDGE NEWcustomers3 AS accessNorthwind(SELECT TOP 10 * FROM customers)REPLACE;&lt;br /&gt;&lt;br /&gt;--Heres an example of how the target table can be defined using an "inline view". Note, NOW() is a MS Access function returning the current time&lt;br /&gt;BRIDGE NEWcustomers4 AS accessNorthwind(SELECT contactName, address AS NewAddress, NOW() AS currentTime FROM customers);&lt;br /&gt;&lt;br /&gt;--DYNAMIC SUBSTITUTION&lt;br /&gt;--A lot of times you want to filter the amount of rows being copied to the target table.&lt;br /&gt;--It is handy to use a resource on the target connection to define how to filter the source table.&lt;br /&gt;--Dynamic Substitution can be used to&lt;br /&gt;--A) sub in a list of values Ex: 'London','Dublin','San Francisco'&lt;br /&gt;--   Just place the substitution within ({})&lt;br /&gt;--B) iterate over the query n times using a differnt value&lt;br /&gt;--  Just place the substitution within {} with no round brakets&lt;br /&gt;--  Note that column names can be used as bind variables elsewhere in the source query&lt;br /&gt;&lt;br /&gt;--Example using dynamic substitution to create a list.&lt;br /&gt;--{SELECT 'London' FROM DUAL} is run first on the default connection, the list is substituted into the source query&lt;br /&gt;--SELECT * FROM customers WHERE city IN ('London')&lt;br /&gt;BRIDGE NEWcustomers5 AS accessNorthwind(SELECT * FROM customers WHERE city IN ({SELECT 'London' FROM DUAL}));&lt;br /&gt;&lt;br /&gt;--Example using dynamic substitution to iterate the query n times&lt;br /&gt;--  {select 'Categories' SQLDEVTABLENAME FROM DUAL UNION select 'Customers' SQLDEVTABLENAME FROM DUAL UNION select 'Employees' SQLDEVTABLENAME FROM DUAL} is run first on the default connection&lt;br /&gt;-- The following queries are created&lt;br /&gt;--  select count(*) AS numrows, 'Categories' AS name FROM Categories&lt;br /&gt;--  select count(*) AS numrows, 'Customers' AS name FROM Customers&lt;br /&gt;--  select count(*) AS numrows, 'Employeees' AS name FROM Employeees&lt;br /&gt;-- The rows from each query is inserted into the target table NEWLineSizes&lt;br /&gt;&lt;br /&gt;BRIDGE NEWLineSizes AS accessNorthwind(select count(*) AS numrows, ':SQLDEVTABLENAME' AS name FROM&lt;br /&gt;                                 {select 'Categories' SQLDEVTABLENAME FROM DUAL UNION select 'Customers' SQLDEVTABLENAME FROM DUAL UNION select 'Employees' SQLDEVTABLENAME FROM DUAL})APPEND;&lt;br /&gt;&lt;br /&gt;--Example of defining two target tables using a comma to seperate the two distinct tables.&lt;br /&gt;BRIDGE NEWcustomers6 AS accessNorthwind(SELECT * FROM customers),&lt;br /&gt;  NEWcustomers7 AS accessNorthwind(SELECT TOP 5 * FROM customers);&lt;br /&gt;&lt;br /&gt;--Example of defining two target tables using two seperate connection.&lt;br /&gt;--NEWcustomers8 uses an access connection, NEWemployees8 uses a SQL Server connection&lt;br /&gt;BRIDGE NEWcustomers8 AS accessNorthwind(SELECT * FROM customers),&lt;br /&gt;  NEWemployees8 AS sqlserverNorthwind(SELECT * FROM employees);&lt;br /&gt;&lt;br /&gt;--Example of creating the target table on a different connection from the default WorkSheet connection  &lt;br /&gt;BRIDGE oracleTest(NEWcustomer9) AS accessNorthwind(SELECT * FROM customers);&lt;br /&gt;&lt;br /&gt;--Example of creating on another target connection using the default connection to define the source&lt;br /&gt;BRIDGE oracleTest(Newcustomer10) AS (SELECT * FROM NEWcustomers1);&lt;br /&gt;&lt;br /&gt;--Example of using an Oracle connection as the source connection&lt;br /&gt;BRIDGE NewCustomer11 AS oracleTest(SELECT * FROM NewCustomer10);&lt;br /&gt;&lt;br /&gt;--********BRIDGE QUERIES**********&lt;br /&gt;--BRIDGE can be used to peform cross connection queries. The user does not need to know that tables are created and populated on the target as they are deleted automatically after the query has run&lt;br /&gt;--This show how to run an Oracle query against a MS Access table&lt;br /&gt;BRIDGE TEMPcustomers AS accessNorthwind(SELECT * FROM customers)&lt;br /&gt;SELECT * FROM TEMPcustomers WHERE rownum &amp;lt;=10;&lt;br /&gt;&lt;br /&gt;--This shows how you can join a MS Access table and an Oracle table together in one query&lt;br /&gt;BRIDGE TEMPcustomers AS accessNorthwind(SELECT * FROM customers)&lt;br /&gt;SELECT * FROM TEMPcustomers,all_users;&lt;br /&gt;&lt;br /&gt;--This shows how to query a MS Access database, a SQL Server database and an Oracle database all within the one query.&lt;br /&gt;--To do this in the Oracle database you would have to setup mutiple DATABASE LINKS which can be difficult to do.&lt;br /&gt;BRIDGE TEMPcustomers AS accessNorthwind(SELECT * FROM customers),&lt;br /&gt;  TEMPemployees AS sqlserverNorthwind(SELECT * FROM employees),&lt;br /&gt;  TEMPCustomersO  AS oracleTest(SELECT * FROM NewCustomer10)&lt;br /&gt;SELECT  * FROM TEMPcustomers, TEMPemployees, TEMPCustomersO;  &lt;br /&gt;&lt;br /&gt;-- MIGRATION EXAMPLES&lt;br /&gt;--RUN STATEMENT ON MIGRATION REPOSITORY CONNECTION&lt;br /&gt;-- This example is used in the migration reports to list the status of migrated objects.&lt;br /&gt;-- It queries the target Oracle database(connection) for the status of objects found in the migration repository.&lt;br /&gt;-- Both Oracle target database and Oracle migration repostitory can be on seperate Oracle databases&lt;br /&gt;BRIDGE all_objects$targetdb AS &amp;amp;&amp;amp;SQLDEVPREF_TARGETCONN(SELECT status,object_name,owner FROM all_objects WHERE UPPER(owner) IN ({SELECT DISTINCT UPPER(schemaname) FROM  mgv_all_schema_details}))&lt;br /&gt;SELECT r.desc_object_name,&lt;br /&gt;  d.schemaname,&lt;br /&gt;  'SQLDEV:LINK:&amp;amp;&amp;amp;SQLDEVPREF_TARGETCONN:null:'||UPPER(d.schemaname)||':'||r.DESC_OBJECT_NAME||':'||UPPER(d.objname)||':oracle.dbtools.migration.workbench.core.ConnectionAwareDrillLink' ObjectName,&lt;br /&gt;  NVL2(a.status,a.status,  'Missing') status&lt;br /&gt;FROM mgv_all_details d LEFT OUTER JOIN all_objects$targetdb a&lt;br /&gt;                  ON (UPPER(d.schemaname) = UPPER(a.owner)&lt;br /&gt;                  AND UPPER(d.objname) = UPPER(a.object_name)) , md_registry r&lt;br /&gt;WHERE d.capturedorconverted='CONVERTED'&lt;br /&gt;AND d.objtype in('MD_TABLES','MD_VIEWS','MD_INDEXES','MD_STORED_PROGRAMS','MD_TRIGGERS')&lt;br /&gt;AND r.object_name = d.objtype&lt;br /&gt;ORDER BY schemaName ASC, objtype DESC,objname ASC;&lt;br /&gt;&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7984768457924132022-6586545422960289491?l=dermotoneill.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7984768457924132022/posts/default/6586545422960289491'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7984768457924132022/posts/default/6586545422960289491'/><link rel='alternate' type='text/html' href='http://dermotoneill.blogspot.com/2010/11/cross-database-bridge-statement.html' title='Cross Database Bridge Statement'/><author><name>Dermot O'Neill</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_H4TtZUn_Tz8/TOb_BlidrAI/AAAAAAAAF_s/wKYexIWf7fE/s72-c/bridge.PNG' height='72' width='72'/></entry><entry><id>tag:blogger.com,1999:blog-7984768457924132022.post-4439247363444317324</id><published>2009-10-23T03:12:00.000-07:00</published><updated>2009-10-23T03:24:01.074-07:00</updated><title type='text'>Quick Export Query Results</title><content type='html'>When you run a query in the SQL Worksheet using "Run Statement" a Data Grid is used to display the results.&lt;br /&gt;&lt;br /&gt;If you then want to export these results youll find that the query is run again.&lt;br /&gt;This can be a pain if it is a long running query.&lt;br /&gt;The following may help.&lt;br /&gt;&lt;br /&gt;1) The Data Grid is only populated with 50 rows (by default) at a time. This is for performance reasons, but if you want to use CTRL C, to copy the results it will only copy the results which are currently present.&lt;br /&gt;&lt;br /&gt;So click on the data grid and do&lt;br /&gt;&lt;b&gt;CTRL END&lt;br /&gt;This will populate the data grid with the entire result set&lt;/b&gt;. When you perform a select all (CTRL A) and copy (CTRL C) you will get the entire result set, but a TAB is used as the delimiter which may not be good enough.&lt;br /&gt;&lt;br /&gt;2) Create a VIEW from the query and export from the VIEW&lt;br /&gt;CREATE OR REPLACE quickExportView AS &lt;original query=""&gt;&lt;br /&gt;&lt;br /&gt;Then in the navigator right click on the view and perform Export Data.&lt;br /&gt;In this way you dont have to run the query twice.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Things to Note&lt;br /&gt;1) When using the export, it will always wrap your original query as a subquery.&lt;br /&gt;SELECT * FROM (&lt;original query=""&gt;)&lt;br /&gt;&lt;br /&gt;It does this so it can perform column and row filtering.&lt;br /&gt;&lt;br /&gt;2) For a future release export will be based on the data grid so that the query does not need to be rerun&lt;br /&gt;&lt;br /&gt;3) Use "Run Statement" (F9) only for queries. It does support DDL and DML, but these are best executed using "Run Script"(F5)&lt;/original&gt;&lt;/original&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7984768457924132022-4439247363444317324?l=dermotoneill.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7984768457924132022/posts/default/4439247363444317324'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7984768457924132022/posts/default/4439247363444317324'/><link rel='alternate' type='text/html' href='http://dermotoneill.blogspot.com/2009/10/quick-export-query-results.html' title='Quick Export Query Results'/><author><name>Dermot O'Neill</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-7984768457924132022.post-578502421473140072</id><published>2009-10-19T08:52:00.001-07:00</published><updated>2009-10-19T08:54:13.273-07:00</updated><title type='text'>SQL Developers Directors Direction! OOW 2009</title><content type='html'>&lt;script src="http://static.livestream.com/scripts/playerv2.js?channel=openworldlive&amp;layout=playerEmbedDefault&amp;backgroundColor=0xffffff&amp;backgroundAlpha=1&amp;backgroundGradientStrength=0&amp;chromeColor=0x000000&amp;headerBarGlossEnabled=true&amp;controlBarGlossEnabled=true&amp;chatInputGlossEnabled=true&amp;uiWhite=true&amp;uiAlpha=0.5&amp;uiSelectedAlpha=1&amp;dropShadowEnabled=true&amp;dropShadowHorizontalDistance=10&amp;dropShadowVerticalDistance=10&amp;paddingLeft=10&amp;paddingRight=10&amp;paddingTop=10&amp;paddingBottom=10&amp;cornerRadius=10&amp;backToDirectoryURL=null&amp;bannerURL=null&amp;bannerText=null&amp;bannerWidth=320&amp;bannerHeight=50&amp;showViewers=true&amp;embedEnabled=true&amp;chatEnabled=true&amp;onDemandEnabled=true&amp;programGuideEnabled=false&amp;fullScreenEnabled=true&amp;reportAbuseEnabled=false&amp;gridEnabled=false&amp;initialIsOn=false&amp;initialIsMute=false&amp;initialVolume=10&amp;contentId=flv_4e63b4ea-2cb4-49d8-882c-9c740937575a&amp;initThumbUrl=http://mogulus-user-files.s3.amazonaws.com/chopenworldlive/2009/10/14/6a21554a-050c-4f7f-b79d-6168c06ddf62_400.jpg&amp;playeraspectwidth=16&amp;playeraspectheight=9&amp;mogulusLogoEnabled=true&amp;width=400&amp;height=400&amp;wmode=window" type="text/javascript"&gt;&lt;/script&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7984768457924132022-578502421473140072?l=dermotoneill.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7984768457924132022/posts/default/578502421473140072'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7984768457924132022/posts/default/578502421473140072'/><link rel='alternate' type='text/html' href='http://dermotoneill.blogspot.com/2009/10/sql-developer-directors-direction.html' title='SQL Developers Directors Direction! OOW 2009'/><author><name>Dermot O'Neill</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-7984768457924132022.post-4591044226710923837</id><published>2009-10-02T13:50:00.001-07:00</published><updated>2009-10-02T13:51:20.154-07:00</updated><title type='text'>Resizing dockable windows in SQL Developer 2.1</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_H4TtZUn_Tz8/SsZnvzkwYDI/AAAAAAAAE68/uUFnzi1nOQY/s1600-h/worksheet.jpg"&gt;&lt;img style="float:left; margin:0 10px 10px 0;cursor:pointer; cursor:hand;width: 400px; height: 274px;" src="http://4.bp.blogspot.com/_H4TtZUn_Tz8/SsZnvzkwYDI/AAAAAAAAE68/uUFnzi1nOQY/s400/worksheet.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5388108075191263282" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7984768457924132022-4591044226710923837?l=dermotoneill.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7984768457924132022/posts/default/4591044226710923837'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7984768457924132022/posts/default/4591044226710923837'/><link rel='alternate' type='text/html' href='http://dermotoneill.blogspot.com/2009/10/resizing-dockable-windows-in-sql.html' title='Resizing dockable windows in SQL Developer 2.1'/><author><name>Dermot O'Neill</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_H4TtZUn_Tz8/SsZnvzkwYDI/AAAAAAAAE68/uUFnzi1nOQY/s72-c/worksheet.jpg' height='72' width='72'/></entry><entry><id>tag:blogger.com,1999:blog-7984768457924132022.post-7197815799287182009</id><published>2009-07-01T05:27:00.000-07:00</published><updated>2009-07-01T09:16:12.740-07:00</updated><title type='text'>Antlr3 Code Too Big</title><content type='html'>Antlr3 can generate very large java files for complex grammars.&lt;br /&gt;Javac can have a problem compiling them due to the size limit of static initializers in a class file.&lt;br /&gt;&lt;br /&gt;An error like the following&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;: code too large&lt;br /&gt;&gt; &gt; [12:56:12] public static final String[] tokenNames = new String[] {&lt;br /&gt;&gt; &gt; [12:56:12] ^&lt;br /&gt;&gt; &gt; [12:56:12] 1 error&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;My solution was to post process the generated Java files.&lt;br /&gt;Moving a large section of static final initializers to a seperate interface(s).&lt;br /&gt;Then reference (implement) the interface in the original Java file.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 95%; height:150px;"&gt;&lt;code&gt;package oracle.dtools.ant.antlr3;&lt;br /&gt;import java.io.BufferedReader;&lt;br /&gt;import java.io.BufferedWriter;&lt;br /&gt;import java.io.File;&lt;br /&gt;import java.io.FileReader;&lt;br /&gt;import java.io.FileWriter;&lt;br /&gt;import java.io.IOException;&lt;br /&gt;&lt;br /&gt;import org.apache.tools.ant.Task;&lt;br /&gt;&lt;br /&gt;public class Antlr3PostProcess extends Task {&lt;br /&gt;    private File oldTarget = null;&lt;br /&gt;    private String pkg = null;&lt;br /&gt;    &lt;br /&gt;    private File newTarget= null;&lt;br /&gt;    private File currentInterface = null;&lt;br /&gt;    private int interfaceIndex = 0;&lt;br /&gt;    private int lineIndex = 0;&lt;br /&gt;    private final int MAXLINEINDEX = 1000;&lt;br /&gt;    private String name = null;&lt;br /&gt;    &lt;br /&gt;    public Antlr3PostProcess(){&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    public String getPkg() {&lt;br /&gt;        return pkg;&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    public void setPkg(String pkg) {&lt;br /&gt;        this.pkg = pkg;&lt;br /&gt;    }&lt;br /&gt;    &lt;br /&gt;    public File getTarget() {&lt;br /&gt;        return oldTarget;&lt;br /&gt;    }&lt;br /&gt;    &lt;br /&gt;    public void setOldTarget(File oldTarget) {&lt;br /&gt;        name = oldTarget.getName().substring(0,oldTarget.getName().indexOf('.'));&lt;br /&gt;        this.oldTarget = oldTarget;&lt;br /&gt;        newTarget = new File(oldTarget.getParentFile(),name+&amp;quot;_TMPANTLR3POST.java&amp;quot;);&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    public void execute() {&lt;br /&gt;        try{&lt;br /&gt;         boolean createFile =  newTarget.createNewFile();&lt;br /&gt;        moveBitSetConstantsToInterface();&lt;br /&gt;        //delete the old target and rename the new target&lt;br /&gt;        oldTarget.delete();&lt;br /&gt;        newTarget.renameTo(oldTarget);&lt;br /&gt;        } catch (Exception e){&lt;br /&gt;           &lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    private void moveBitSetConstantsToInterface() throws IOException {&lt;br /&gt;      //open the target file&lt;br /&gt;        BufferedReader reader = new BufferedReader(new FileReader(oldTarget));&lt;br /&gt;        BufferedWriter writerInterface = getNewInterfaceWriter();&lt;br /&gt;        BufferedWriter writerNewTarget = new BufferedWriter(new FileWriter(newTarget));&lt;br /&gt;&lt;br /&gt;        //... Loop as long as there are input lines.&lt;br /&gt;        String line = null;&lt;br /&gt;        while ((line=reader.readLine()) != null) {        &lt;br /&gt;            if(lineIndex &amp;gt; MAXLINEINDEX) {&lt;br /&gt;                lineIndex =0;&lt;br /&gt;                closeInterface(writerInterface)  ;&lt;br /&gt;                writerInterface  = getNewInterfaceWriter();&lt;br /&gt;            }&lt;br /&gt;            if(line.startsWith(&amp;quot;    public static final BitSet FOLLOW_&amp;quot;)){&lt;br /&gt;                lineIndex++;&lt;br /&gt;                writerInterface.write(line); &lt;br /&gt;                writerInterface.newLine();   // Write system dependent end of line.&lt;br /&gt;            } else if (line.startsWith(&amp;quot;public class &amp;quot;+name+&amp;quot; extends Parser&amp;quot;)) {&lt;br /&gt;                writerNewTarget.write(&amp;quot;public class &amp;quot;+name+&amp;quot; extends Parser implements &amp;quot;+getInterfaceName() +&amp;quot; {&amp;quot;); &lt;br /&gt;                writerNewTarget.newLine();   // Write system dependent end of line.&lt;br /&gt;            }&lt;br /&gt;            else {&lt;br /&gt;                writerNewTarget.write(line); &lt;br /&gt;                writerNewTarget.newLine();   // Write system dependent end of line.&lt;br /&gt;            }&lt;br /&gt;            &lt;br /&gt;        }&lt;br /&gt;        closeInterface(writerInterface);&lt;br /&gt;        //... Close reader and writer.&lt;br /&gt;        reader.close();  // Close to unlock.&lt;br /&gt;        //writerInterface.close();  // Close to unlock and flush to disk.&lt;br /&gt;        writerNewTarget.close();  // Close to unlock and flush to disk.&lt;br /&gt;        createInterfaceGroup();&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;    private void createInterfaceGroup() throws IOException {&lt;br /&gt;        currentInterface = new File(oldTarget.getParentFile(),getInterfaceName()+&amp;quot;.java&amp;quot;);&lt;br /&gt;        boolean createFile =currentInterface.createNewFile(); &lt;br /&gt;        BufferedWriter writerInterface =  new BufferedWriter(new FileWriter(currentInterface));&lt;br /&gt;        writerInterface.write(&amp;quot;package &amp;quot;+pkg+&amp;quot;;&amp;quot;);&lt;br /&gt;        writerInterface.newLine();&lt;br /&gt;        writerInterface.write(&amp;quot;import org.antlr.runtime.BitSet;&amp;quot;);&lt;br /&gt;        writerInterface.newLine();&lt;br /&gt;        writerInterface.write(&amp;quot;public interface &amp;quot;+getInterfaceName()+&amp;quot; extends &amp;quot;);&lt;br /&gt;        writerInterface.write(getInterfaceName()+&amp;quot;1&amp;quot;);&lt;br /&gt;        for(int i=2;i&amp;lt;=interfaceIndex;i++){&lt;br /&gt;            writerInterface.write(&amp;quot;,&amp;quot;+getInterfaceName()+i);&lt;br /&gt;        }&lt;br /&gt;        writerInterface.write(&amp;quot; {&amp;quot;);&lt;br /&gt;        writerInterface.newLine(); &lt;br /&gt;        writerInterface.write(&amp;quot;}&amp;quot;);&lt;br /&gt;        writerInterface.close();&lt;br /&gt;        &lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    private void closeInterface(BufferedWriter writerInterface) throws IOException {&lt;br /&gt;        writerInterface.newLine();&lt;br /&gt;        writerInterface.write(&amp;quot;}&amp;quot;);  &lt;br /&gt;        writerInterface.close();&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    private BufferedWriter getNewInterfaceWriter() throws IOException {&lt;br /&gt;        BufferedWriter writerInterface =  new BufferedWriter(new FileWriter(getNextInterfaceFile()));&lt;br /&gt;        createInterfaceHeading(writerInterface,currentInterface.getName().substring(0,currentInterface.getName().indexOf('.')),pkg);&lt;br /&gt;        return writerInterface;&lt;br /&gt;     &lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    private void createInterfaceHeading(BufferedWriter writerInterface,String interfaceName, String interfacePkg) throws IOException {&lt;br /&gt;        writerInterface.write(&amp;quot;package &amp;quot;+interfacePkg+&amp;quot;;&amp;quot;);&lt;br /&gt;        writerInterface.newLine();&lt;br /&gt;        writerInterface.write(&amp;quot;import org.antlr.runtime.BitSet;&amp;quot;);&lt;br /&gt;        writerInterface.newLine();&lt;br /&gt;        writerInterface.write(&amp;quot;public interface &amp;quot;+interfaceName+&amp;quot; {&amp;quot;);&lt;br /&gt;        writerInterface.newLine();&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    private File getNextInterfaceFile() throws IOException {&lt;br /&gt;        interfaceIndex++;&lt;br /&gt;        currentInterface = new File(oldTarget.getParentFile(),getInterfaceName()+interfaceIndex+&amp;quot;.java&amp;quot;);&lt;br /&gt;        boolean createFile =currentInterface.createNewFile(); &lt;br /&gt;        return currentInterface;&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    private String getInterfaceName() {&lt;br /&gt;        return name+&amp;quot;BitSet&amp;quot;;&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Define the Ant Task&lt;/span&gt;&lt;br /&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 95%; height:150px;"&gt;&lt;code&gt;&amp;lt;taskdef name=&amp;quot;Antlr3PostProcess&amp;quot; classname=&amp;quot;oracle.dtools.ant.antlr3.Antlr3PostProcess&amp;quot; classpath=&amp;quot;Your Classpath Here&amp;quot;&amp;gt;&lt;br /&gt;            &amp;lt;classpath&amp;gt;&amp;lt;path refid=&amp;quot;antlr.3&amp;quot; /&amp;gt;&amp;lt;path refid=&amp;quot;string.template&amp;quot; /&amp;gt;&amp;lt;/classpath&amp;gt;&lt;br /&gt;&amp;lt;/taskdef&amp;gt;&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Reference the task after the Antlr has generated the Java files, but before javac.&lt;/span&gt;&lt;br /&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 95%; height:150px;"&gt;&lt;code&gt;&amp;lt;replace file=&amp;quot;${antlr3.output}/Db2Parser.java&amp;quot; token=&amp;quot;public static final String[] tokenNames&amp;quot; value=&amp;quot;public final String[] tokenNames&amp;quot;/&amp;gt;&lt;br /&gt;&amp;lt;replace file=&amp;quot;${antlr3.output}/Db2Parser.java&amp;quot; token=&amp;quot;Db2Parser.tokenNames&amp;quot; value=&amp;quot;tokenNames&amp;quot;/&amp;gt;&lt;br /&gt;&amp;lt;Antlr3PostProcess oldTarget=&amp;quot;${antlr3.output}/Db2Parser.java&amp;quot; pkg=&amp;quot;oracle.dbtools.migration.parser.grammar.antlr3&amp;quot;&amp;gt;&lt;br /&gt;&amp;lt;/Antlr3PostProcess&amp;gt;    &lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7984768457924132022-7197815799287182009?l=dermotoneill.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7984768457924132022/posts/default/7197815799287182009'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7984768457924132022/posts/default/7197815799287182009'/><link rel='alternate' type='text/html' href='http://dermotoneill.blogspot.com/2009/07/antlr3-can-generate-very-large-java.html' title='Antlr3 Code Too Big'/><author><name>Dermot O'Neill</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-7984768457924132022.post-6502114726059940931</id><published>2009-04-15T14:30:00.000-07:00</published><updated>2009-07-01T05:18:10.742-07:00</updated><title type='text'>Antlr 3 Tips</title><content type='html'>AntlrWorks&lt;br /&gt;When dealing with large grammars start AntlrWorks with more memory otherwise it can hang.&lt;br /&gt;java -Xmx1g -jar antlrworks-1.2.3.jar &lt;br /&gt;&lt;br /&gt;Antlr 3 Parser&lt;br /&gt;Some Antlr rule names are not valid in Java and will cause a compilation issue.&lt;br /&gt;For example: byte: ... ;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7984768457924132022-6502114726059940931?l=dermotoneill.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7984768457924132022/posts/default/6502114726059940931'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7984768457924132022/posts/default/6502114726059940931'/><link rel='alternate' type='text/html' href='http://dermotoneill.blogspot.com/2009/04/antlr-3-lexer.html' title='Antlr 3 Tips'/><author><name>Dermot O'Neill</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-7984768457924132022.post-1939640843844750783</id><published>2009-03-16T07:23:00.000-07:00</published><updated>2010-06-04T06:48:22.472-07:00</updated><title type='text'>Line Count CLOB or VARCHAR2</title><content type='html'>I must be missing something, there has to be an easier way to count the number of lines in a VARCHAR2 or CLOB. &lt;br /&gt;For the moment this does the trick ,but Id appreciate a heads up for a better solution.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;length(regexp_replace(regexp_replace(TEXTVALUE,'^.*$','1',1,0,'m'),'\s',''))&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/functions130.htm#SQLRF06302&lt;br /&gt;&lt;br /&gt;The inner regexp_replace matches each line  = '^.*$'&lt;br /&gt;Replace each line with the '1' character.&lt;br /&gt;Beginning character = 1&lt;br /&gt;First occurance = 0&lt;br /&gt;Tell oracle its a multiline string = 'm'&lt;br /&gt;&lt;br /&gt;The outer regexp_replace removes the new lines left over. &lt;br /&gt;Counting the remaining characters gives you the line count.&lt;br /&gt;&lt;br /&gt;Ill have to look into a better solution.&lt;br /&gt; &gt;EDIT&lt;br /&gt;  Heres a much much more performant solution&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;LENGTH(TEXTVALUE) -  LENGTH(replace(TEXTVALUE,chr(10)))) &lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;replacing all CHR(10) (linefeed char) with nothing. Then compare with original length.&lt;br /&gt;&lt;br /&gt;A query which took me 40 minutes with the first query, now takes under a second.&lt;br /&gt;much faster than Oracle 11g, regexp_count as well.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7984768457924132022-1939640843844750783?l=dermotoneill.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7984768457924132022/posts/default/1939640843844750783'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7984768457924132022/posts/default/1939640843844750783'/><link rel='alternate' type='text/html' href='http://dermotoneill.blogspot.com/2009/03/line-count-clob-or-varchar2.html' title='Line Count CLOB or VARCHAR2'/><author><name>Dermot O'Neill</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-7984768457924132022.post-5267621194130167647</id><published>2009-02-02T04:45:00.000-08:00</published><updated>2009-02-04T07:27:08.102-08:00</updated><title type='text'>SQL Server 2005 CROSS APPLY conversion</title><content type='html'>SQL Server 2005 provides a CROSS APPLY clause which in Oracle terms allows a correlated inline view or table function.&lt;br /&gt;&lt;br /&gt;Heres some SQL Server CROSS APPLY background.&lt;br /&gt;&lt;a href="http://weblogs.sqlteam.com/jeffs/jeffs/archive/2007/10/18/sql-server-cross-apply.aspx"&gt;http://weblogs.sqlteam.com/jeffs/jeffs/archive/2007/10/18/sql-server-cross-apply.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;There are a couple of ways to convert this based on what exactly is trying to be done.&lt;br /&gt;But here are a few methods.&lt;br /&gt;&lt;br /&gt;There are 2 main uses of CROSS APPLY&lt;br /&gt;1) CROSS APPLY with a table function&lt;br /&gt;2) CROSS APPLY with a subquery (inline view in Oracleze)&lt;br /&gt;&lt;br /&gt;1) CROSS APPLY with a table function&lt;br /&gt;Jeff Smith put together this neat example of using a table function with CROSS APPLY&lt;br /&gt;&lt;a href="http://www.sqlteam.com/article/returning-complex-data-from-user-defined-functions-with-cross-apply"&gt;http://www.sqlteam.com/article/returning-complex-data-from-user-defined-functions-with-cross-apply&lt;br /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;I expanded this example to try out a few different scenarios&lt;br /&gt;&lt;pre style="border: 1px dashed rgb(153, 153, 153); padding: 5px; overflow: auto; font-family: Andale Mono,Lucida Console,Monaco,fixed,monospace; color: rgb(0, 0, 0); background-color: rgb(238, 238, 238); font-size: 12px; line-height: 14px; width: 95%; height: 150px;"&gt;&lt;code&gt;&lt;br /&gt;drop table emails&lt;br /&gt;go&lt;br /&gt;&lt;br /&gt;create table emails (ID int primary key, EmailAddress varchar(100))&lt;br /&gt;go&lt;br /&gt;--added 2 rows which cant be processed by EmailParse&lt;br /&gt;insert into emails&lt;br /&gt;select 1,'test1@gmail.com' union all&lt;br /&gt;select 2,'test2@gmail.com' union all&lt;br /&gt;select 3,'test3@gmail.com' union all&lt;br /&gt;select 4,'test' union all&lt;br /&gt;select 5, null &lt;br /&gt;go&lt;br /&gt;&lt;br /&gt;drop function EmailParse1&lt;br /&gt;go&lt;br /&gt;&lt;br /&gt;--return a table with (null,null) if you cant process&lt;br /&gt;create function EmailParse1 (@email varchar(1000))&lt;br /&gt;returns @t table (UserName varchar(20), Domain varchar(20))&lt;br /&gt;as&lt;br /&gt;begin&lt;br /&gt; declare @i int&lt;br /&gt;&lt;br /&gt; select @i = charindex('@', @email,1);&lt;br /&gt;&lt;br /&gt; if (@i &gt; 1)&lt;br /&gt;  insert into @t values (left(@email,@i-1), substring(@email,@i+1,20))&lt;br /&gt; else&lt;br /&gt;  insert into @t values (null,null)&lt;br /&gt;&lt;br /&gt; return &lt;br /&gt;end&lt;br /&gt;go&lt;br /&gt;&lt;br /&gt;drop function EmailParse2&lt;br /&gt;go&lt;br /&gt;&lt;br /&gt;--return nothing if you cant process&lt;br /&gt;create function EmailParse2 (@email varchar(1000))&lt;br /&gt;returns @t table (UserName varchar(20), Domain varchar(20))&lt;br /&gt;as&lt;br /&gt;begin&lt;br /&gt; declare @i int&lt;br /&gt;&lt;br /&gt; select @i = charindex('@', @email,1);&lt;br /&gt;&lt;br /&gt; if (@i &gt; 1)&lt;br /&gt;  insert into @t values (left(@email,@i-1), substring(@email,@i+1,20))&lt;br /&gt;   &lt;br /&gt;    --return nothing if not valid&lt;br /&gt;&lt;br /&gt; return &lt;br /&gt;end&lt;br /&gt;go&lt;br /&gt;&lt;br /&gt;drop function EmailParse3&lt;br /&gt;go&lt;br /&gt;&lt;br /&gt;--return multiple rows if you can process and nothing if you cant&lt;br /&gt;create function EmailParse3 (@email varchar(1000))&lt;br /&gt;returns @t table (UserName varchar(20), Domain varchar(20))&lt;br /&gt;as&lt;br /&gt;begin&lt;br /&gt; declare @i int&lt;br /&gt;&lt;br /&gt; select @i = charindex('@', @email,1);&lt;br /&gt;&lt;br /&gt; if (@i &gt; 1)&lt;br /&gt;    begin&lt;br /&gt;  insert into @t values (left(@email,@i-1), substring(@email,@i+1,20))&lt;br /&gt;    insert into @t values (left(@email,@i-1), substring(@email,@i+1,20)) --replicatge multiple rows&lt;br /&gt;    insert into @t values (left(@email,@i-1), substring(@email,@i+1,20)) --replicatge multiple rows&lt;br /&gt;    end&lt;br /&gt;        &lt;br /&gt; return &lt;br /&gt;end&lt;br /&gt;go&lt;br /&gt;&lt;br /&gt;drop function EmailParse4&lt;br /&gt;go&lt;br /&gt;&lt;br /&gt;--return multiple rows if you can process and a table(null,null) if you cant&lt;br /&gt;create function EmailParse4 (@email varchar(1000))&lt;br /&gt;returns @t table (UserName varchar(20), Domain varchar(20))&lt;br /&gt;as&lt;br /&gt;begin&lt;br /&gt; declare @i int&lt;br /&gt;&lt;br /&gt; select @i = charindex('@', @email,1);&lt;br /&gt;&lt;br /&gt; if (@i &gt; 1)&lt;br /&gt;    begin&lt;br /&gt;  insert into @t values (left(@email,@i-1), substring(@email,@i+1,20))&lt;br /&gt;        insert into @t values (left(@email,@i-1), substring(@email,@i+1,20)) --replicatge multiple rows&lt;br /&gt;        insert into @t values (left(@email,@i-1), substring(@email,@i+1,20)) --replicatge multiple rows&lt;br /&gt;    end&lt;br /&gt;    else &lt;br /&gt;        insert into @t values (null,null)&lt;br /&gt;&lt;br /&gt; return &lt;br /&gt;end&lt;br /&gt;go&lt;br /&gt;PRINT 'SELECT 1'&lt;br /&gt;go&lt;br /&gt;select * from emails cross apply  EmailParse1(emails.EmailAddress) s&lt;br /&gt;go&lt;br /&gt;&lt;br /&gt;PRINT 'SELECT 2'&lt;br /&gt;go&lt;br /&gt;select * from emails outer apply EmailParse1(emails.EmailAddress) s&lt;br /&gt;go&lt;br /&gt;&lt;br /&gt;PRINT 'SELECT 3'&lt;br /&gt;go&lt;br /&gt;select * from emails cross apply  EmailParse2(emails.EmailAddress) s&lt;br /&gt;go&lt;br /&gt;&lt;br /&gt;PRINT 'SELECT 4'&lt;br /&gt;go&lt;br /&gt;select * from emails outer apply EmailParse2(emails.EmailAddress) s&lt;br /&gt;go&lt;br /&gt;&lt;br /&gt;PRINT 'SELECT 5'&lt;br /&gt;go&lt;br /&gt;select * from emails cross apply EmailParse3(emails.EmailAddress) s&lt;br /&gt;go&lt;br /&gt;&lt;br /&gt;PRINT 'SELECT 6'&lt;br /&gt;go&lt;br /&gt;select * from emails outer apply  EmailParse3(emails.EmailAddress) s&lt;br /&gt;go&lt;br /&gt;PRINT 'SELECT 7'&lt;br /&gt;go&lt;br /&gt;select * from emails cross apply EmailParse4(emails.EmailAddress) s&lt;br /&gt;go&lt;br /&gt;&lt;br /&gt;PRINT 'SELECT 8'&lt;br /&gt;go&lt;br /&gt;select * from emails outer apply EmailParse4(emails.EmailAddress) s&lt;br /&gt;go&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Generic Oracle PL/SQL Solution&lt;br /&gt;&lt;pre style="border: 1px dashed rgb(153, 153, 153); padding: 5px; overflow: auto; font-family: Andale Mono,Lucida Console,Monaco,fixed,monospace; color: rgb(0, 0, 0); background-color: rgb(238, 238, 238); font-size: 12px; line-height: 14px; width: 95%; height: 150px;"&gt;&lt;code&gt;&lt;br /&gt;DROP TABLE emails;&lt;br /&gt;CREATE TABLE emails(id int, emailaddress varchar2(100));&lt;br /&gt;INSERT INTO emails VALUES(1,'test1@gmail.com');&lt;br /&gt;INSERT INTO emails VALUES(2,'test2@gmail.com');&lt;br /&gt;INSERT INTO emails VALUES(3,'test3@gmail.com');&lt;br /&gt;INSERT INTO emails VALUES(4,'test');&lt;br /&gt;INSERT INTO emails VALUES(5,null);&lt;br /&gt;&lt;br /&gt;DROP PACKAGE Email_pkg;&lt;br /&gt;/&lt;br /&gt;DROP TYPE emailAddressObject;&lt;br /&gt;/&lt;br /&gt;CREATE OR REPLACE TYPE emailAddressObject AS OBJECT&lt;br /&gt;(UserName VARCHAR2(20) , Domain VARCHAR2(20),status CHAR(1));&lt;br /&gt;/&lt;br /&gt;CREATE OR REPLACE PACKAGE Email_pkg&lt;br /&gt;AS&lt;br /&gt;TYPE emailAddressTable IS TABLE OF emailAddressObject;&lt;br /&gt;END;&lt;br /&gt;/&lt;br /&gt;CREATE OR REPLACE FUNCTION EmailParse1(v_email IN VARCHAR2)&lt;br /&gt;RETURN Email_pkg.emailAddressTable PIPELINED&lt;br /&gt;AS&lt;br /&gt;v_i NUMBER(10,0);&lt;br /&gt;BEGIN&lt;br /&gt;  v_i := INSTR(v_email, '@', 1);&lt;br /&gt;  IF ( v_i &gt; 1 ) THEN&lt;br /&gt;    PIPE ROW( emailAddressObject(SUBSTR(v_email, 0, v_i - 1), SUBSTR(v_email, v_i + 1, 20),'P' ));&lt;br /&gt;  ELSE&lt;br /&gt;    PIPE ROW(emailAddressObject(null,null,'P'));  -- This needs to pass as this null table was present in the original&lt;br /&gt;  END IF;&lt;br /&gt;  RETURN;&lt;br /&gt;END;&lt;br /&gt;/&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;CREATE OR REPLACE FUNCTION EmailParse2(v_email IN VARCHAR2)&lt;br /&gt;RETURN Email_pkg.emailAddressTable PIPELINED&lt;br /&gt;AS&lt;br /&gt;v_i NUMBER(10,0);&lt;br /&gt;BEGIN&lt;br /&gt;  v_i := INSTR(v_email, '@', 1);&lt;br /&gt;  IF ( v_i &gt; 1 ) THEN&lt;br /&gt;    PIPE ROW( emailAddressObject(SUBSTR(v_email, 0, v_i - 1), SUBSTR(v_email, v_i + 1, 20),'P' ));&lt;br /&gt; ELSE -- ADDED IN TO EMULATE&lt;br /&gt;    PIPE ROW(emailAddressObject(null,null,null)); &lt;br /&gt;  END IF;&lt;br /&gt;&lt;br /&gt;  RETURN;&lt;br /&gt;END;&lt;br /&gt;/&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;CREATE OR REPLACE FUNCTION EmailParse3(v_email IN VARCHAR2)&lt;br /&gt;RETURN Email_pkg.emailAddressTable PIPELINED&lt;br /&gt;AS&lt;br /&gt;v_i NUMBER(10,0);&lt;br /&gt;BEGIN&lt;br /&gt;  v_i := INSTR(v_email, '@', 1);&lt;br /&gt;  IF ( v_i &gt; 1 ) THEN&lt;br /&gt;    PIPE ROW( emailAddressObject(SUBSTR(v_email, 0, v_i - 1), SUBSTR(v_email, v_i + 1, 20),'P'));&lt;br /&gt;    PIPE ROW( emailAddressObject(SUBSTR(v_email, 0, v_i - 1), SUBSTR(v_email, v_i + 1, 20),'P')); --multirow&lt;br /&gt;    PIPE ROW( emailAddressObject(SUBSTR(v_email, 0, v_i - 1), SUBSTR(v_email, v_i + 1, 20),'P')); --multirow&lt;br /&gt; ELSE -- ADDED IN TO EMULATE&lt;br /&gt;    PIPE ROW(emailAddressObject(null,null,null)); &lt;br /&gt;  END IF;&lt;br /&gt;  RETURN;&lt;br /&gt;END;&lt;br /&gt;/&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;CREATE OR REPLACE FUNCTION EmailParse4(v_email IN VARCHAR2)&lt;br /&gt;RETURN Email_pkg.emailAddressTable PIPELINED&lt;br /&gt;AS&lt;br /&gt;v_i NUMBER(10,0);&lt;br /&gt;BEGIN&lt;br /&gt;  v_i := INSTR(v_email, '@', 1);&lt;br /&gt;  IF ( v_i &gt; 1 ) THEN&lt;br /&gt;    PIPE ROW( emailAddressObject(SUBSTR(v_email, 0, v_i - 1), SUBSTR(v_email, v_i + 1, 20),'P' ));&lt;br /&gt;    PIPE ROW( emailAddressObject(SUBSTR(v_email, 0, v_i - 1), SUBSTR(v_email, v_i + 1, 20),'P' )); --multirow&lt;br /&gt;    PIPE ROW( emailAddressObject(SUBSTR(v_email, 0, v_i - 1), SUBSTR(v_email, v_i + 1, 20),'P' )); --multirow&lt;br /&gt;  ELSE&lt;br /&gt;    PIPE ROW(emailAddressObject(null,null,'P'));   -- This needs to pass as this null table was present in the original&lt;br /&gt;  END IF;&lt;br /&gt;  RETURN;&lt;br /&gt;END;&lt;br /&gt;/&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;PROMPT SELECT 1&lt;br /&gt;--SELECT * FROM emails CROSS JOIN TABLE(EmailParse1(emails.emailaddress));&lt;br /&gt;SELECT * FROM emails INNER JOIN TABLE(EmailParse1(emails.emailaddress))s ON s.status='P';&lt;br /&gt;&lt;br /&gt;PROMPT SELECT 2&lt;br /&gt;SELECT * FROM emails LEFT OUTER JOIN TABLE(EmailParse1(emails.emailaddress))s ON 1=1; &lt;br /&gt;&lt;br /&gt;PROMPT SELECT 3&lt;br /&gt;SELECT * FROM emails INNER JOIN TABLE(EmailParse2(emails.emailaddress))s ON s.status ='P';&lt;br /&gt;PROMPT SELECT 4&lt;br /&gt;SELECT * FROM emails LEFT OUTER JOIN TABLE(EmailParse2(emails.emailaddress)) ON 1=1; &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;PROMPT SELECT 5&lt;br /&gt;SELECT * FROM emails INNER JOIN TABLE(EmailParse3(emails.emailaddress))s ON s.status = 'P';&lt;br /&gt;PROMPT SELECT 6&lt;br /&gt;SELECT * FROM emails LEFT OUTER JOIN TABLE(EmailParse3(emails.emailaddress)) ON 1=1; &lt;br /&gt;&lt;br /&gt;PROMPT SELECT 7&lt;br /&gt;SELECT * FROM emails INNER JOIN TABLE(EmailParse4(emails.emailaddress))s ON s.status = 'P';&lt;br /&gt;PROMPT SELECT 8&lt;br /&gt;SELECT * FROM emails LEFT OUTER JOIN TABLE(EmailParse4(emails.emailaddress)) ON 1=1; &lt;br /&gt;&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Explanation:&lt;/span&gt;&lt;br /&gt;The EmailParse functions get converted to Oracle pipelined table function.&lt;br /&gt;&lt;br /&gt;If the SQL Server table function always returns a table under all circumstances&lt;br /&gt;&lt;code&gt;insert into @t values (null,null) &lt;/code&gt;&lt;br /&gt;--see example EmailParse1, EmailParse4&lt;br /&gt;the conversion to Oracle is relatively straight forward.&lt;br /&gt;&lt;br /&gt;You can convert the &lt;br /&gt;SQL Server CROSS APPLY to Oracle CROSS JOIN&lt;br /&gt;And&lt;br /&gt;SQL Server OUTER APPLY to Oracle LEFT OUTER JOIN ... ON 1=1&lt;br /&gt;&lt;br /&gt;Heres the example just converting EmailParse1, EmailParse4 as they always return a table.&lt;br /&gt;&lt;pre style="border: 1px dashed rgb(153, 153, 153); padding: 5px; overflow: auto; font-family: Andale Mono,Lucida Console,Monaco,fixed,monospace; color: rgb(0, 0, 0); background-color: rgb(238, 238, 238); font-size: 12px; line-height: 14px; width: 95%; height: 150px;"&gt;&lt;code&gt;&lt;br /&gt;DROP TABLE emails;&lt;br /&gt;CREATE TABLE emails(id int, emailaddress varchar2(100));&lt;br /&gt;INSERT INTO emails VALUES(1,'test1@gmail.com');&lt;br /&gt;INSERT INTO emails VALUES(2,'test2@gmail.com');&lt;br /&gt;INSERT INTO emails VALUES(3,'test3@gmail.com');&lt;br /&gt;INSERT INTO emails VALUES(4,'test');&lt;br /&gt;INSERT INTO emails VALUES(5,null);&lt;br /&gt;&lt;br /&gt;DROP PACKAGE Email_pkg;&lt;br /&gt;/&lt;br /&gt;DROP TYPE emailAddressObject;&lt;br /&gt;/&lt;br /&gt;CREATE OR REPLACE TYPE emailAddressObject AS OBJECT&lt;br /&gt;(UserName VARCHAR2(20) , Domain VARCHAR2(20));&lt;br /&gt;/&lt;br /&gt;CREATE OR REPLACE PACKAGE Email_pkg&lt;br /&gt;AS&lt;br /&gt;TYPE emailAddressTable IS TABLE OF emailAddressObject;&lt;br /&gt;END;&lt;br /&gt;/&lt;br /&gt;CREATE OR REPLACE FUNCTION EmailParse1(v_email IN VARCHAR2)&lt;br /&gt;RETURN Email_pkg.emailAddressTable PIPELINED&lt;br /&gt;AS&lt;br /&gt;v_i NUMBER(10,0);&lt;br /&gt;BEGIN&lt;br /&gt;  v_i := INSTR(v_email, '@', 1);&lt;br /&gt;  IF ( v_i &gt; 1 ) THEN&lt;br /&gt;    PIPE ROW( emailAddressObject(SUBSTR(v_email, 0, v_i - 1), SUBSTR(v_email, v_i + 1, 20) ));&lt;br /&gt;  ELSE&lt;br /&gt;    PIPE ROW(emailAddressObject(null,null));  -- This needs to pass as this null table was present in the original&lt;br /&gt;  END IF;&lt;br /&gt;  RETURN;&lt;br /&gt;END;&lt;br /&gt;/&lt;br /&gt;&lt;br /&gt;CREATE OR REPLACE FUNCTION EmailParse4(v_email IN VARCHAR2)&lt;br /&gt;RETURN Email_pkg.emailAddressTable PIPELINED&lt;br /&gt;AS&lt;br /&gt;v_i NUMBER(10,0);&lt;br /&gt;BEGIN&lt;br /&gt;  v_i := INSTR(v_email, '@', 1);&lt;br /&gt;  IF ( v_i &gt; 1 ) THEN&lt;br /&gt;    PIPE ROW( emailAddressObject(SUBSTR(v_email, 0, v_i - 1), SUBSTR(v_email, v_i + 1, 20) ));&lt;br /&gt;    PIPE ROW( emailAddressObject(SUBSTR(v_email, 0, v_i - 1), SUBSTR(v_email, v_i + 1, 20) )); --multirow&lt;br /&gt;    PIPE ROW( emailAddressObject(SUBSTR(v_email, 0, v_i - 1), SUBSTR(v_email, v_i + 1, 20) )); --multirow&lt;br /&gt;  ELSE&lt;br /&gt;    PIPE ROW(emailAddressObject(null,null));   -- This needs to pass as this null table was present in the original&lt;br /&gt;  END IF;&lt;br /&gt;  RETURN;&lt;br /&gt;END;&lt;br /&gt;/&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;PROMPT SELECT 1&lt;br /&gt;--SELECT * FROM emails CROSS JOIN TABLE(EmailParse1(emails.emailaddress));&lt;br /&gt;SELECT * FROM emails CROSS JOIN TABLE(EmailParse1(emails.emailaddress))s ;&lt;br /&gt;&lt;br /&gt;PROMPT SELECT 2&lt;br /&gt;SELECT * FROM emails LEFT OUTER JOIN TABLE(EmailParse1(emails.emailaddress))s ON 1=1; &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;PROMPT SELECT 7&lt;br /&gt;SELECT * FROM emails CROSS JOIN TABLE(EmailParse4(emails.emailaddress))s;&lt;br /&gt;PROMPT SELECT 8&lt;br /&gt;SELECT * FROM emails LEFT OUTER JOIN TABLE(EmailParse4(emails.emailaddress)) ON 1=1; &lt;br /&gt;&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;If the SQL Server table function doesn't always return a function&lt;br /&gt;For example in EmailParse2, EmailsParse3&lt;br /&gt;&lt;br /&gt;It more difficult to convert to Oracle. The reason being there is a difference as to how SQL Server and Oracle interpret Table Functions when nothing is returned. &lt;br /&gt;The conversion require is more complex, but it will work in both scenarios so is a generic solution. If performing the conversion by hand then each query maybe modified to suit its own circumstances.&lt;br /&gt;&lt;br /&gt;In the above (generic) example the SQL Server EmailParse2 and EmailParse3 return nothing if it cant parse the email address. The last two values in emails cant be parsed ('dermot' and null).&lt;br /&gt;&lt;br /&gt;In SQL Server if nothing is returned by the table function then &lt;br /&gt;A) The Cross Apply happens and those null rows are restricted&lt;br /&gt;B) The Outer Apply happens and all the left hand side table rows are used.&lt;br /&gt;&lt;br /&gt;In Oracle if nothing is returned by the table function then the CAST to TABLE doesnt happen. This is the difference between Oracle and SQL Server.&lt;br /&gt;A) The Oracle CROSS JOIN happens and those null rows are restricted. Same as SQL Server&lt;br /&gt;B) The Oracle LEFT OUTER JOIN happens but as there is no right hand side table, the join fails. Restricting those rows in the left hand side table. This is different from  SQL Server, which returns all the rows in the left hand side table.&lt;br /&gt;&lt;br /&gt;So you may think that the solution is to make sure the Oracle always returns a table, even  emailAddressObject(null,null). &lt;br /&gt;Now the Oracle LEFT OUTER JOIN happens identically to SQL Server as there is a table to join against. But the Oracle CROSS JOIN returns all the rows, it doesn't restrict null values as it thinks it has a result (an empty table) to join with.&lt;br /&gt;&lt;br /&gt;So we need to limit the Oracle CROSS JOIN to only those rows which are successfully parsed. This could entail adding another field to the emailAddressObject with a status that can be checked. &lt;br /&gt;And changing the CROSS JOIN to &lt;br /&gt;INNER JOIN .. ON emailAddressObject.status ='P' -- 'P' for passed&lt;br /&gt;&lt;br /&gt;The conversion steps are&lt;br /&gt;1) Convert The SQL Server Table Function to an Oracle Pipelined Table function&lt;br /&gt;2) Create an Oracle Oracle TYPE &lt;br /&gt;&lt;code&gt;&lt;br /&gt;CREATE OR REPLACE TYPE emailAddressObject AS OBJECT(UserName VARCHAR2(20) , Domain VARCHAR2(20),status CHAR(1));&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;Notice the status field is new. This will appear in a select list if using SELECT *&lt;br /&gt;3)Make sure all Oracle Table Function return a table in all cases.&lt;br /&gt;If nothing was returned before pass back&lt;br /&gt;&lt;code&gt;PIPE ROW(emailAddressObject(null,null,null));&lt;/code&gt;&lt;br /&gt;If a null table was being passed back in  SQL Server &lt;br /&gt;&lt;code&gt;(insert into @t values (null,null)) &lt;/code&gt;&lt;br /&gt; return the following in Oracle.&lt;br /&gt;&lt;code&gt;PIPE ROW(emailAddressObject(null,null,'P'));&lt;/code&gt;&lt;br /&gt;4)SQL Server CROSS APPLY converts to Oracle  INNER JOIN .... ON s.status='P'&lt;br /&gt;5)SQL Server OUTER APPLY converts to Oracle LEFT OUTER JOIN .... ON 1 = 1&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;CROSS APPLY with a subquery (inline view in Oracleze)&lt;/span&gt;&lt;br /&gt;Oracle inline views cannot reference outer queries, they are effectively standalone and are instantiated inmemory before the outer query is processed.&lt;br /&gt;&lt;br /&gt;Heres a T-SQL Example that uses an inline view, based on Jeff Smith's example.&lt;br /&gt;&lt;pre style="border: 1px dashed rgb(153, 153, 153); padding: 5px; overflow: auto; font-family: Andale Mono,Lucida Console,Monaco,fixed,monospace; color: rgb(0, 0, 0); background-color: rgb(238, 238, 238); font-size: 12px; line-height: 14px; width: 95%; height: 150px;"&gt;&lt;code&gt;&lt;br /&gt;drop table customer&lt;br /&gt;go&lt;br /&gt;create table customer (emailid int, city varchar(100), country varchar(100))&lt;br /&gt;go&lt;br /&gt;insert into customer&lt;br /&gt;select 1,'new york','usa' union all&lt;br /&gt;select 2,'dublin','ireland' union all&lt;br /&gt;select 3,'hong kong', 'china'&lt;br /&gt;go&lt;br /&gt;select emails.ID, s.city, s.country&lt;br /&gt;from emails&lt;br /&gt;CROSS APPLY&lt;br /&gt;(select city,country from customer where emailid =emails.ID ) s;&lt;br /&gt;go&lt;br /&gt;&lt;br /&gt;select emails.ID, s.city, s.country&lt;br /&gt;from emails&lt;br /&gt;OUTER APPLY&lt;br /&gt;(select city,country from customer where emailid =emails.ID ) s;&lt;br /&gt;go&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Oracle wont allow the inline view ("s") to reference the emails table in the outer query. So there are a few ways to convert this.&lt;br /&gt;&lt;br /&gt;Oracle PL/SQL&lt;br /&gt;&lt;pre style="border: 1px dashed rgb(153, 153, 153); padding: 5px; overflow: auto; font-family: Andale Mono,Lucida Console,Monaco,fixed,monospace; color: rgb(0, 0, 0); background-color: rgb(238, 238, 238); font-size: 12px; line-height: 14px; width: 95%; height: 150px;"&gt;&lt;code&gt;&lt;br /&gt;drop table customer;&lt;br /&gt;/&lt;br /&gt;create table customer (emailid int, city varchar2(100), country varchar2(100));&lt;br /&gt;/&lt;br /&gt;insert into customer&lt;br /&gt;select 1,'new york','usa' from dual union all&lt;br /&gt;select 2,'dublin','ireland' from dual union all&lt;br /&gt;select 3,'hong kong', 'china' from dual ;&lt;br /&gt;&lt;br /&gt;/&lt;br /&gt;select emails.ID, s.city, s.country&lt;br /&gt;from emails&lt;br /&gt;INNER JOIN (select city,country,emailid from customer ) s&lt;br /&gt;ON s.emailid =emails.ID;&lt;br /&gt;/&lt;br /&gt;&lt;br /&gt;select emails.ID, s.city, s.country&lt;br /&gt;from emails&lt;br /&gt;LEFT OUTER JOIN&lt;br /&gt;(select city,country,emailid from customer) s&lt;br /&gt;ON  s.emailid =emails.ID;&lt;br /&gt;/&lt;br /&gt;&lt;/code&gt; &lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;The T-SQL CROSS APPLY  is converted to PL/SQL using an INNER JOIN with the correlation is pulled out as the ON condition.&lt;br /&gt;&lt;br /&gt;The T-SQL OUTER APPLY is converted to  PL/SQL using a LEFT OUTER JOIN, again the correlation is pulled out as the ON condition.&lt;br /&gt;&lt;br /&gt;Note that the inline view select list was modified to include any references in the ON clause.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7984768457924132022-5267621194130167647?l=dermotoneill.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7984768457924132022/posts/default/5267621194130167647'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7984768457924132022/posts/default/5267621194130167647'/><link rel='alternate' type='text/html' href='http://dermotoneill.blogspot.com/2009/02/sql-server-2005-cross-apply-conversion.html' title='SQL Server 2005 CROSS APPLY conversion'/><author><name>Dermot O'Neill</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-7984768457924132022.post-799168624716719374</id><published>2008-08-29T03:07:00.000-07:00</published><updated>2008-08-29T03:17:04.898-07:00</updated><title type='text'>Oracle Open World Migration Sessions</title><content type='html'>&lt;img src="http://1.bp.blogspot.com/_H4TtZUn_Tz8/SLfL6-LICGI/AAAAAAAAC9k/FywBJWpMdp0/s400/oow2008_cc_header.jpg" alt="" id="BLOGGER_PHOTO_ID_5239880905451374690" /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Oracle Open World 2008 is kicking off on the 21st September.&lt;br /&gt;&lt;cite&gt;www.&lt;b&gt;oracle&lt;/b&gt;.com/&lt;b&gt;openworld&lt;/b&gt;&lt;/cite&gt;&lt;br /&gt;&lt;br /&gt;There are some migrations sessions scheduled which can be signed up for now.&lt;br /&gt;&lt;br /&gt;&lt;a class="jive-link-external" href="http://www28.cplan.com/cc208/session_details.jsp?isid=298691&amp;amp;ilocation_id=208-1&amp;amp;ilanguage=english"&gt;S298684 : Hands-on Lab: Migrate Your Third-Party Database to Oracle Database 11g Today&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a class="jive-link-external" href="http://www28.cplan.com/cc208/session_details.jsp?isid=298684&amp;amp;ilocation_id=208-1&amp;amp;ilanguage=english"&gt;S298684 : Consolidate Your Desktop Databases to Oracle Database 11g&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Hope to see you there&lt;br /&gt;Dermot.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7984768457924132022-799168624716719374?l=dermotoneill.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7984768457924132022/posts/default/799168624716719374'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7984768457924132022/posts/default/799168624716719374'/><link rel='alternate' type='text/html' href='http://dermotoneill.blogspot.com/2008/08/oracle-open-world-migration-sessions.html' title='Oracle Open World Migration Sessions'/><author><name>Dermot O'Neill</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_H4TtZUn_Tz8/SLfL6-LICGI/AAAAAAAAC9k/FywBJWpMdp0/s72-c/oow2008_cc_header.jpg' height='72' width='72'/></entry><entry><id>tag:blogger.com,1999:blog-7984768457924132022.post-2023022521598335702</id><published>2008-06-12T04:40:00.000-07:00</published><updated>2008-12-10T15:37:04.932-08:00</updated><title type='text'>Offline Data Move DATEs</title><content type='html'>During the offline data move, scripts are created to use BCP to dump out your data in SQL Server or Sybase to .dat files.  Other scripts are created to use Oracle SQL*Loader to load the .dat files into the Oracle tables.&lt;br /&gt;&lt;br /&gt;Your SQL Server/ Sybase database will dump out the DATETIME and SMALLDATETIME values in formats which may not be recognized by Oracle.  So you have to specify what the format mask is.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;SQL Server / Sybase DataTypes&lt;/span&gt;&lt;br /&gt;DATETIME has millisecond precision.&lt;br /&gt;SMALLDATETIME has only second precision.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Oracle DataTypes&lt;/span&gt;&lt;br /&gt;DATE has only second precision&lt;br /&gt;TIMESTAMP has millisecond precision&lt;br /&gt;&lt;br /&gt;You can specify their format mask in the migration preferences.&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_H4TtZUn_Tz8/SFEM5zEgjOI/AAAAAAAACyg/mj-YFu51OHE/s1600-h/DataMovePref.png"&gt;&lt;img style="cursor: pointer;" src="http://3.bp.blogspot.com/_H4TtZUn_Tz8/SFEM5zEgjOI/AAAAAAAACyg/mj-YFu51OHE/s320/DataMovePref.png" alt="" id="BLOGGER_PHOTO_ID_5210960430945570018" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The preferences work like this&lt;br /&gt;&lt;ul&gt;&lt;li&gt;The &lt;span style="font-weight: bold;"&gt;Timestamp Mask&lt;/span&gt; is applied to the&lt;span style="font-weight: bold;"&gt; DATETIME&lt;/span&gt; Sybase or SQL Server values&lt;/li&gt;&lt;li&gt;The&lt;span style="font-weight: bold;"&gt; Date Mask&lt;/span&gt; is applied to the &lt;span style="font-weight: bold;"&gt;SMALLDATIME&lt;/span&gt; Sybase or SQL Server values.&lt;/li&gt;&lt;/ul&gt;So now the full date value is recognized by SQL*Loader.&lt;br /&gt;&lt;br /&gt;The best bit is that even if you map Sybases/ SQL Servers DATETIME to Oracles DATE (which is the default mapping). The TO_TIMESTAMP that happends in SQL*Loader will be implicitly converted to a DATE when inserted, and the milliseconds automatically truncated.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Here are some Defaults which you should specify in the Migration preferences&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;SQL Server&lt;/span&gt;&lt;br /&gt;&lt;span&gt;Timestamp Mask&lt;/span&gt;&lt;span style="font-weight: bold;"&gt; &lt;/span&gt;&lt;span&gt;Preference&lt;/span&gt;&lt;span style="font-weight: bold;"&gt;  = &lt;/span&gt;DATETIME in SQL Server  = 'yyyy-mm-dd HH24:mi:ss.ff3'&lt;br /&gt;Date Mask Preference= SMALLDATETIME in SQL Server  =   'yyyy-mm-dd HH24:mi:ss'&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Sybase&lt;/span&gt;&lt;br /&gt;Timestamp Mask Preference = DATETIME&lt;span style="font-family:monospace;"&gt; &lt;/span&gt;in Sybase = 'Mon dd yyyy hh:mi:ss:ff3AM'&lt;br /&gt;Date Mask Preference = SMALLDATETIME in Sybase  =   'Mon dd yyyy hh:mi:ss'&lt;br /&gt;&lt;br /&gt;You should check your .dat files to make sure the format is correct. You can regenerate the scipts after you change the preference. The formats are applied in the generated Oracle/*.ctl files.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7984768457924132022-2023022521598335702?l=dermotoneill.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7984768457924132022/posts/default/2023022521598335702'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7984768457924132022/posts/default/2023022521598335702'/><link rel='alternate' type='text/html' href='http://dermotoneill.blogspot.com/2008/06/offline-data-move-dates.html' title='Offline Data Move DATEs'/><author><name>Dermot O'Neill</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_H4TtZUn_Tz8/SFEM5zEgjOI/AAAAAAAACyg/mj-YFu51OHE/s72-c/DataMovePref.png' height='72' width='72'/></entry><entry><id>tag:blogger.com,1999:blog-7984768457924132022.post-4564649633715765411</id><published>2008-06-11T09:41:00.000-07:00</published><updated>2008-06-12T04:59:35.564-07:00</updated><title type='text'>SQL Developer Migration Workbench 1.5.1 for Sybase / SQL Server Quick Guide</title><content type='html'>This Quick Guide will run through the main steps you should take to perform a Sybase or SQL Server migration to Oracle.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Installation&lt;/span&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Download the latest version of &lt;a href="http://www.oracle.com/technology/software/products/sql/index.html"&gt;SQL Developer&lt;/a&gt; ( using 1.5.1 today), to your Development PC which can access your Oracle database and your SQL Server/ Sybase database. SQL Developer ships with the migration extensions built in.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Download and Install &lt;a href="http://www.oracle.com/technology/software/products/database/xe/index.html"&gt;Oracle XE&lt;/a&gt; if you dont have access to an exiting Oracle database.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;UnZip SQL Developer into its own directory (for example "SQLDev")&lt;/li&gt;&lt;li style="text-align: left; font-style: italic;"&gt;Don't use an existing ORACLE_HOME or ORACLE directory&lt;/li&gt;&lt;li&gt;Run sqldeveloper&lt;/li&gt;&lt;li style="text-align: left;"&gt;Setup the jtds driver (open source JDBC driver for Sybase and SQL Server) with SQL Developer&lt;/li&gt;&lt;li style="text-align: left;"&gt;&lt;span style="font-style: italic;"&gt;JTDS can be got using the Check For Updates feature.  Tools &gt; Prefereneces &gt; Extensions &gt; Check For Updates&lt;/span&gt;&lt;span&gt;. Walk through the wizard and choose any new migration updates and the JTDS driver.&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style="font-weight: bold;"&gt;Setup Connections &amp;amp; Migration Repository&lt;/span&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Create a connection to &lt;a href="http://www.oracle.com/technology/tech/migration/workbench/viewlets/sqlserverconnlauncher.html"&gt;Sybase or SQL Server&lt;br /&gt;&lt;/a&gt;&lt;/li&gt;&lt;li&gt;Create a connection to your Oracle database&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Create a new schema for  the migration repository (MIGREP)&lt;/li&gt;&lt;li style="text-align: left; font-style: italic;"&gt;GRANT DBA TO MIGREP IDENTIFIED BY MIGREP&lt;/li&gt;&lt;li style="text-align: left;"&gt;Create a connection to your migration repository schema (MIGREP)&lt;/li&gt;&lt;li style="text-align: left;"&gt;Associate the migration repository with this schema&lt;/li&gt;&lt;li style="text-align: left;"&gt;&lt;span style="font-style: italic;"&gt;Right Click the migration repository connection (MIGREP), Migration Repository &gt; Associate Migration Repository&lt;/span&gt;&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style="font-weight: bold;"&gt;Setup the Migration Preferences&lt;/span&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Setup the "Is Quoted Identifier On" &lt;a href="http://dermotoneill.blogspot.com/2008/04/sql-dev-15-migration-tip.html"&gt;preference&lt;/a&gt;&lt;/li&gt;&lt;li&gt;Setup the &lt;a href="http://dermotoneill.blogspot.com/2008/06/offline-data-move-dates.html"&gt;DATETIME and SMALLDATETIME format masks&lt;/a&gt; if required.&lt;/li&gt;&lt;/ul&gt;&lt;span style="font-weight: bold;"&gt;Capture your  Database&lt;/span&gt;&lt;br /&gt;Creates a "snapshot" of the Sybase / SQL Server database in our migration repository.&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Capture the Sybase / SQL Server  database (&lt;span style="font-style: italic;"&gt;dont use Quick Migrate!&lt;/span&gt;) .&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-style: italic;"&gt;Note there is an &lt;/span&gt;&lt;a style="font-style: italic;" href="http://www.oracle.com/technology/tech/migration/workbench/viewlets/oflauncher.html"&gt;offline capture&lt;/a&gt;&lt;span style="font-style: italic;"&gt; available as well if you cannot directly connect to your Sybase database&lt;/span&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Save the Captured Dialog Text (&lt;span style="font-style: italic;"&gt;Handy to have a list of captured number or objects&lt;/span&gt;)&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Identify any Capture Issues and Resolve (there shouldn't be any!)&lt;/li&gt;&lt;li&gt;Browse the Captured Model&lt;/li&gt;&lt;/ul&gt;&lt;span style="font-weight: bold;"&gt;Convert your Captured  Database to Oracle&lt;/span&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Convert the Captured Model to the Oracle Model&lt;/li&gt;&lt;li&gt;Choose the datatype mapping (best to use the default mapping)&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Save the Converted Dialog Text (&lt;span style="font-style: italic;"&gt;Handy to have a list of converted number of objects&lt;/span&gt;)&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Save the Migration Log &lt;/li&gt;&lt;li&gt;Identify any Convert Issues and &lt;a href="http://dermotoneill.blogspot.com/2008/04/what-to-do-if-proceduretriggerview.html"&gt;Resolve&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style="font-weight: bold;"&gt;Generate The Oracle Database (Schema and Objects)&lt;/span&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;"Generate" the Migration scripts&lt;/li&gt;&lt;li&gt;Run the Scripts using the SQL Worksheet to create your Oracle database.&lt;/li&gt;&lt;li&gt;Save the Result of the Generation Script&lt;/li&gt;&lt;/ul&gt;&lt;span style="font-weight: bold;"&gt;Project Plan&lt;/span&gt;&lt;br /&gt;Errm.  It looks like Im doing the plan in the middle of the project!&lt;br /&gt;But in reality the above steps can be completed for one database within hours, or a day or two. You havent converted any data, we have just been working on the database definition (tables, views, procedures,...). You may have lots of issues remaining, but you now know what has been automated for you and what manual work remains.  This is the time to step back and think of the entire project and plan.&lt;br /&gt;&lt;ul&gt;&lt;li&gt;How are you going to validate the Oracle database?&lt;/li&gt;&lt;li&gt;How are you going to rectify  conversion issues or objects which didnt convert?&lt;/li&gt;&lt;li&gt;How are you going to switch from Sybase / SQL Server to Oracle. Will there be downtime for users?&lt;/li&gt;&lt;li&gt;What apps are affected by the switch? What work is required to move them to Oracle?&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Enhance your Oracle Database&lt;/span&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Identify and Generation Issues and Resolve them in your Oracle database. Not in the converted model as there are better tools to work with real Oracle objects.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Verify that all the objects in your Sybase / SQL Server  database are present and valid in your Oracle database.&lt;/li&gt;&lt;/ul&gt;&lt;span style="font-weight: bold;"&gt;Move the Data from Sybase / SQL Server  to Oracle&lt;/span&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Data Move for small dataset  (&lt;100mb),&gt;&lt;/li&gt;&lt;li&gt;Data Move for large dataset (&gt;100mb) , use the &lt;a href="http://www.oracle.com/technology/tech/migration/workbench/viewlets/ofdm.html"&gt;offline datamove&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style="font-weight: bold;"&gt;Test &amp;amp; Tune&lt;/span&gt;&lt;br /&gt;The buck stops with you to validate that the migration is complete and succefull.  Note that this part can take longer than the migration itself.  How do you test your Sybase / SQL Server database currently? How will you verifiy that the Oracle database works as expected?&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Deploy&lt;/span&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Will the database definition have changed since you started the migration?&lt;/li&gt;&lt;li&gt;Will the data have changed? How to move it to Oracle. Using a delta or perform an entire data move again. &lt;/li&gt;&lt;/ul&gt;Your migration approach will differ, depending on the complexity of the database, the applications that run on top, your company standards,  .... . Hopefully the above steps will help.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7984768457924132022-4564649633715765411?l=dermotoneill.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7984768457924132022/posts/default/4564649633715765411'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7984768457924132022/posts/default/4564649633715765411'/><link rel='alternate' type='text/html' href='http://dermotoneill.blogspot.com/2008/06/sql-developer-migration-workbench-151_11.html' title='SQL Developer Migration Workbench 1.5.1 for Sybase / SQL Server Quick Guide'/><author><name>Dermot O'Neill</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-7984768457924132022.post-5654920232624762690</id><published>2008-06-11T04:44:00.000-07:00</published><updated>2008-06-13T06:14:18.848-07:00</updated><title type='text'>SQL Developer Migration Workbench 1.5.1</title><content type='html'>SQL Developer 1.5 released 8 weeks ago with the new Sybase capability, aiding migrations from Sybase 12 and Sybase 15 to Oracle.&lt;br /&gt;&lt;br /&gt;It worked pretty good, and we got some great feedback from customer using it in the real world on their migration projects. All the enhancements and now provided in SQL Developer 1.5.1 released on Monday. Thanks to all.&lt;br /&gt;&lt;br /&gt;Download it here&lt;br /&gt;&lt;a href="http://www.oracle.com/technology/products/database/sql_developer/index.html"&gt;http://www.oracle.com/technology/products/database/sql_developer/index.html&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Here are the main improvements&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Improved Offline Data Move Scripts including support for both DATETIME And SMALLDATETIME formats&lt;/li&gt;&lt;li&gt;Variable Name Collision Management&lt;/li&gt;&lt;li&gt;Temporary Table Name Collision Management&lt;/li&gt;&lt;li&gt;Sybase Identity Columns Converted Correctly&lt;/li&gt;&lt;li&gt;Emulation Packages Improved&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;Many of the Issues noted by some customers regarding SQL Developer such as ORACLE_HOME issues, Connections dissapearing, NLS settings, .. are resolved.&lt;br /&gt;&lt;br /&gt;List of Migration Bug fixes for 1.5.1&lt;br /&gt;&lt;pre style="border: 1px dashed rgb(153, 153, 153); padding: 5px; overflow: auto; font-family: Andale Mono,Lucida Console,Monaco,fixed,monospace; color: rgb(0, 0, 0); background-color: rgb(238, 238, 238); font-size: 12px; line-height: 14px; width: 100%;"&gt;&lt;code&gt; Num      Subject&lt;br /&gt;7137280  SYBASE 12 LINUX OFFLINE CAPTURE SCRIPTS NOT AVAILABLE&lt;br /&gt;7129820  CANNOT DROP CONVERTED INDEXES&lt;br /&gt;7113461  PROCEDURE VARIABLES NAMES ARE NOT COLLISIONED CORRECTLY&lt;br /&gt;7113269  EXECUTE PROCEDURE PARAMETER NAMING INCORRECT&lt;br /&gt;7046907  OFFLINE BLOB DATA MOVE "CREATE PROCEDURE" PREFERENCE SHOULD BE ON BY DEFAULT&lt;br /&gt;7046890  TEMPORARY TABLE NAMES NOT COLLISIONED&lt;br /&gt;7046870  CONVERTING IDENTIFIERS &amp;gt; 100 CHARS IN LENGHT CAUSED THE CONVERT PHASE TO FAIL&lt;br /&gt;7046785  NOEXPAND TABLE HINT IS NOT RECOGNIZED&lt;br /&gt;7022092  SYBASE: IDENTITY COLUMNS NOT CONVERTED TO SEQUENCE AND TRIGGER&lt;br /&gt;7005215  OTNFORUMS : OBJECT/DATABASE/MODEL WORDS USED INCONSISTENTLY&lt;br /&gt;6989645  IMPROVE TEMPORARY TABLE DEFINITION CONVERSION&lt;br /&gt;6989465  CURSOR STATUS SHOULD BE EMULATED @@SQLSTATUS : CURRENT LIMITATION&lt;br /&gt;6989025  SYBASE DATALENGTH FUNCTION NOT TRANSLATED&amp;lt; STILL LIMITATION&lt;br /&gt;6979464  TRIGGER INSERTED REFERENCE NOT TRANSLATED CORRECTLY IN MERGE STMT&lt;br /&gt;6976180  INVALID SYNTAX CAUSES THE TRANSLATOR TO LOOP/ HANG SQL DEV&lt;br /&gt;6970168  EMPTY STRING AND NULL COMPARISON NOT TRANSLATED CORRECTLY&lt;br /&gt;6953135  CONVERT FUNCTION NOT CORRECTLY EMULATED&lt;br /&gt;6944669  DOUBLE QUOTE LITERALS NOT TRANSLATED CORRECTLY&lt;br /&gt;6927102  COLUMN NAME DATA CAUSED SYNTAX ERROR&lt;br /&gt;6853149  NPE DISPLAYED WHEN CAPTURE INTO EXISTING MODEL CLICKED FOR THIRD PARTY DATABASES&lt;br /&gt;6853074  IN CAPTURED MODEL SELECT ALL TABLES RIGHT CLICK,RENAME &amp;amp; REMOVE FOLDER NOT WORKI&lt;br /&gt;5903238  UPGRADE EMULATION PACKAGE&lt;br /&gt;4529352  OMWB USING WRONG TEMPORARY TABLES INSIDE THE STORED PROCEDURE&lt;br /&gt;3545475  OMWB FAILS TO TRASLATE " TO ' IN SOME GROUP BY EXPRESSIONS&lt;br /&gt;2694450  T-SQL PARSER FAILS TO PARSE 'AFTER UPDATE' TRIGGER&lt;br /&gt;7038824  NTEXT TO NCLOB ON NON UNICODE DATABASE CORRUPT WITH CHINESE CHARACTER&lt;br /&gt;7013620  QUICK MIGRATE: PROVIDE INCORRECT PASSWORD, NEVER PROMPTS, JUST FAILS&lt;br /&gt;6994152  ORACLE_HOME ENVIRONMENT VARIABLE SOMETIMES HAS AN ADVERSE AFFECT ON MIGRATIONS&lt;br /&gt;6356767  EXCEPTION OCCURING ON CONNECTING TO A SQL SERVER CONNECTION&lt;br /&gt;2694526  OMWB DOES NOT STORE DEPENDENCY INFORMATION FOR FUNCTIONS&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7984768457924132022-5654920232624762690?l=dermotoneill.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7984768457924132022/posts/default/5654920232624762690'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7984768457924132022/posts/default/5654920232624762690'/><link rel='alternate' type='text/html' href='http://dermotoneill.blogspot.com/2008/06/sql-developer-migration-workbench-151.html' title='SQL Developer Migration Workbench 1.5.1'/><author><name>Dermot O'Neill</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-7984768457924132022.post-3553811053068792085</id><published>2008-06-05T06:36:00.000-07:00</published><updated>2008-06-05T06:40:56.797-07:00</updated><title type='text'>Oflline Data Move with Oracle XE</title><content type='html'>Noticed that sometimes I got an &lt;span class="jive-subject"&gt; ORA-12519 error when using the oracle_ctl.bat file which calls SQL*Loader to upload each dat file into its Oracle table.&lt;br /&gt;&lt;br /&gt;When I ran the script line by line I got no problems. Seemed like SQL*Loader was a little to fast for Oracle XE. Found this on the forums&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span class="jive-subject"&gt;Intermittent ORA-12519 error on 10g XE                     &lt;/span&gt;                     &lt;br /&gt;&lt;span class="jive-subject"&gt;http://forums.oracle.com/forums/thread.jspa?messageID=1252551&lt;br /&gt;&lt;br /&gt;After setting&lt;br /&gt;&lt;/span&gt;ALTER SYSTEM SET PROCESSES=150 SCOPE=SPFILE&lt;br /&gt;and restarting the database, my oracle_ctl.bat file ran without issues.&lt;br /&gt;&lt;span class="jive-subject"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7984768457924132022-3553811053068792085?l=dermotoneill.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7984768457924132022/posts/default/3553811053068792085'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7984768457924132022/posts/default/3553811053068792085'/><link rel='alternate' type='text/html' href='http://dermotoneill.blogspot.com/2008/06/oflline-data-move-with-oracle-xe.html' title='Oflline Data Move with Oracle XE'/><author><name>Dermot O'Neill</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-7984768457924132022.post-1501659623994333273</id><published>2008-05-21T06:54:00.001-07:00</published><updated>2008-05-21T07:01:06.810-07:00</updated><title type='text'>Using Regular Expression To Resolve Multiple Issues</title><content type='html'>One way to resolve issues which occur  too many times to fix by hand in the generation script is to use a regular expression to search and replace some problematic code.&lt;br /&gt;&lt;br /&gt;&lt;span style=";font-family:Tahoma;font-size:100%;color:black;"   &gt;&lt;span style="color: rgb(0, 0, 0);font-family:Tahoma;" &gt;&lt;st1:personname st="on"&gt;&lt;st1:personname st="on"&gt;Shiva Ramakrishnan&lt;/st1:personname&gt;&lt;/st1:personname&gt;&lt;/span&gt;&lt;/span&gt; provided these regular expressions&lt;br /&gt;&lt;pre style="border: 1px dashed rgb(153, 153, 153); padding: 5px; overflow: auto; font-family: Andale Mono,Lucida Console,Monaco,fixed,monospace; color: rgb(0, 0, 0); background-color: rgb(238, 238, 238); font-size: 12px; line-height: 14px; width: 100%;"&gt;&lt;code&gt;\(['][A-Za-z_ ]*\)&amp;amp; ----------------à \1'||chr(38)||'&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;\(['][A-Za-z_ ]*\)&amp;amp; \([A-Za-z_ ]*[']\)--------------------------à \1'||chr(38)||'\2&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;\(raw(\)\([0-9]*\)\() default 0\) ----------------------------------à \1\2) default '0'&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;\('12/31/9999'\) -------------------------------------------à to_date(\1,'mm/dd/yyyy')&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;CAST('9999-12-31' AS DATE) ----------àto_date(‘12/31/9999’,’mm/dd/yyyy’)&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;First one is replacing ‘&amp;amp;’ with CHR(38). SQLPLUS provides mechanism to overlook this. So this is not a major concern.&lt;/li&gt;&lt;li&gt;The second one is where RAW datatypes are assigned DEFAULT 0. I am reassigning with DEFAULT ‘0’&lt;/li&gt;&lt;li&gt;The third is a case of DATE Fields assigned as is. I think NLS_DATE parameters can be SET to overlook this. I am doing a global replacement.&lt;/li&gt;&lt;/ul&gt;Hope to have these automatically fixed soon.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7984768457924132022-1501659623994333273?l=dermotoneill.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7984768457924132022/posts/default/1501659623994333273'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7984768457924132022/posts/default/1501659623994333273'/><link rel='alternate' type='text/html' href='http://dermotoneill.blogspot.com/2008/05/using-regular-expression-to-resolve.html' title='Using Regular Expression To Resolve Multiple Issues'/><author><name>Dermot O'Neill</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-7984768457924132022.post-6636007090890296055</id><published>2008-05-21T06:19:00.001-07:00</published><updated>2008-12-10T15:37:05.105-08:00</updated><title type='text'>Captured And Converted Indexes Report</title><content type='html'>Heres a little SQL Developer user defined report to list the captured and converted indexes. You can change the query to list 1 or the other.&lt;br /&gt;&lt;br /&gt;Copy the following text and create a file called MigratedIndexes.xml with it.&lt;br /&gt;The In the SQL Developer User Defined Reports , Import the file. When you open the report you should choose the migration repository.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style="border: 1px dashed rgb(153, 153, 153); padding: 5px; overflow: auto; font-family: Andale Mono,Lucida Console,Monaco,fixed,monospace; color: rgb(0, 0, 0); background-color: rgb(238, 238, 238); font-size: 12px; line-height: 14px; width: 100%;"&gt;&lt;code&gt;&amp;lt;?xml version="1.0" encoding="UTF-8" ?&amp;gt;&amp;lt;displays&amp;gt;&amp;lt;display id="0b9c6f78-011a-1000-8001-0aa970396f91" type="" style="Table" enable="true"&amp;gt;&lt;br /&gt; &amp;lt;name&amp;gt;&amp;lt;![CDATA[List Captured And Converted Indexes]]&amp;gt;&amp;lt;/name&amp;gt;&lt;br /&gt; &amp;lt;description&amp;gt;&amp;lt;![CDATA[List Captured And Converted Indexes]]&amp;gt;&amp;lt;/description&amp;gt;&lt;br /&gt; &amp;lt;tooltip&amp;gt;&amp;lt;![CDATA[List Captured And Converted Indexes]]&amp;gt;&amp;lt;/tooltip&amp;gt;&lt;br /&gt; &amp;lt;drillclass&amp;gt;&amp;lt;![CDATA[null]]&amp;gt;&amp;lt;/drillclass&amp;gt;&lt;br /&gt; &amp;lt;CustomValues&amp;gt;&lt;br /&gt;     &amp;lt;TYPE&amp;gt;horizontal&amp;lt;/TYPE&amp;gt;&lt;br /&gt; &amp;lt;/CustomValues&amp;gt;&lt;br /&gt; &amp;lt;query&amp;gt;&lt;br /&gt;     &amp;lt;sql&amp;gt;&amp;lt;![CDATA[SELECT DISTINCT NVL(c.type, 'captured') type, t.project_name, t.catalog_name, t.schema_name, t.table_name, i.index_name, i.index_type&lt;br /&gt;FROM md_indexes i, mgv_all_tables t, md_connections c&lt;br /&gt;WHERE i.table_id_fk = t.table_id AND c.id = t.connection_id&lt;/code&gt;&lt;br /&gt;&lt;code&gt;ORDER BY type, t.project_name, t.catalog_name, t.schema_name, t.table_name, i.index_name]]&amp;gt;&amp;lt;/sql&amp;gt;&lt;br /&gt; &amp;lt;/query&amp;gt;&lt;br /&gt;&amp;lt;/display&amp;gt;&lt;br /&gt;&amp;lt;/displays&amp;gt;&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;&lt;img style="cursor: pointer;" src="http://3.bp.blogspot.com/_H4TtZUn_Tz8/SDQiifYbwUI/AAAAAAAACHA/wLtaINA8lKI/s320/MigrationIndexesReprot.png" alt="" id="BLOGGER_PHOTO_ID_5202821445454643522" border="0" /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7984768457924132022-6636007090890296055?l=dermotoneill.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7984768457924132022/posts/default/6636007090890296055'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7984768457924132022/posts/default/6636007090890296055'/><link rel='alternate' type='text/html' href='http://dermotoneill.blogspot.com/2008/05/captured-and-converted-indexes-report.html' title='Captured And Converted Indexes Report'/><author><name>Dermot O'Neill</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_H4TtZUn_Tz8/SDQiifYbwUI/AAAAAAAACHA/wLtaINA8lKI/s72-c/MigrationIndexesReprot.png' height='72' width='72'/></entry><entry><id>tag:blogger.com,1999:blog-7984768457924132022.post-7574318977551108154</id><published>2008-05-20T07:27:00.000-07:00</published><updated>2008-06-11T09:49:41.044-07:00</updated><title type='text'>Parameters Of A Procedure Call</title><content type='html'>&lt;span style="font-weight:bold;"&gt;**Update: This is now fixed in SQL Developer 1.5.1**&lt;/span&gt;&lt;br /&gt;A SQL Server and Sybase translation issue.&lt;br /&gt;If you executed a procedure from another procedure, and you specified the executed procedure parameter names, you may have got a doubling up of param names.&lt;br /&gt;&lt;br /&gt;T-SQL Example&lt;br /&gt;&lt;pre style="border: 1px dashed rgb(153, 153, 153); padding: 5px; overflow: auto; font-family: Andale Mono,Lucida Console,Monaco,fixed,monospace; color: rgb(0, 0, 0); background-color: rgb(238, 238, 238); font-size: 12px; line-height: 14px; width: 95%; height: 150px;"&gt;&lt;code&gt;create procedure procparam1 @param1 int, @param2 int&lt;br /&gt;as&lt;br /&gt;select @param1, @param2&lt;br /&gt;go&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;create procedure procparam2 @param1 int&lt;br /&gt;as&lt;br /&gt;declare @var1 int&lt;br /&gt;begin&lt;br /&gt;select @var1 = 10&lt;br /&gt;execute procparam1 @param1=@param1,@param2=@var1&lt;br /&gt;&lt;br /&gt;execute procparam1 @param1,@var1&lt;br /&gt;&lt;br /&gt;execute procparam1 @param1=1,@param2=2&lt;br /&gt;&lt;br /&gt;execute procparam1 1,2&lt;br /&gt;end&lt;br /&gt;go&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Generated PL/SQL&lt;br /&gt;&lt;pre style="border: 1px dashed rgb(153, 153, 153); padding: 5px; overflow: auto; font-family: Andale Mono,Lucida Console,Monaco,fixed,monospace; color: rgb(0, 0, 0); background-color: rgb(238, 238, 238); font-size: 12px; line-height: 14px; width: 95%; height: 150px;"&gt;&lt;code&gt;CREATE OR REPLACE PROCEDURE procparam2&lt;br /&gt;(&lt;br /&gt;v_param1 IN NUMBER DEFAULT NULL ,&lt;br /&gt;cv_1 IN OUT SYS_REFCURSOR,&lt;br /&gt;cv_2 IN OUT SYS_REFCURSOR,&lt;br /&gt;cv_3 IN OUT SYS_REFCURSOR,&lt;br /&gt;cv_4 IN OUT SYS_REFCURSOR&lt;br /&gt;)&lt;br /&gt;AS&lt;br /&gt;v_var1 NUMBER(10,0);&lt;br /&gt;BEGIN&lt;br /&gt;&lt;br /&gt;BEGIN&lt;br /&gt;v_var1 := 10;&lt;br /&gt;&lt;br /&gt;procparam1(v_param1v_param1 =&amp;gt; v_param1,&lt;br /&gt;       v_param2v_param2 =&amp;gt; v_var1,&lt;br /&gt;       cv_1 =&amp;gt; cv_1);&lt;br /&gt;&lt;br /&gt;procparam1(v_param1,&lt;br /&gt;       v_var1,&lt;br /&gt;       cv_1 =&amp;gt; cv_2);&lt;br /&gt;&lt;br /&gt;procparam1(v_param1v_param1 =&amp;gt; 1,&lt;br /&gt;       v_param2v_param2 =&amp;gt; 2,&lt;br /&gt;       cv_1 =&amp;gt; cv_3);&lt;br /&gt;&lt;br /&gt;procparam1(1,&lt;br /&gt;       2,&lt;br /&gt;       cv_1 =&amp;gt; cv_4);&lt;br /&gt;&lt;br /&gt;END;&lt;br /&gt;END;&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;Note the  v_param1v_param1 .&lt;br /&gt;&lt;br /&gt;A real fix will be included in SQL Dev 1.5.1, but if you cant wait heres a hack.&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Close SQL Developer&lt;/li&gt;&lt;li&gt;Backup your \sqldeveloper\extensions\ oracle.sqldeveloper.migration.translation.sqlserver.jar&lt;/li&gt;&lt;li&gt;Extract \sqldeveloper\extensions\oracle.sqldeveloper.migration.translation.sqlserver.jar:templates\tsql.stg&lt;/li&gt;&lt;li&gt;Including its directory structure to C:\&lt;/li&gt;&lt;li&gt;Edit the "templates\tsql.stg" file&lt;/li&gt;&lt;li&gt;Use the "first" method around the paramName, so only 1 paramName is used&lt;/li&gt;&lt;/ul&gt;&lt;pre   style="border: 1px dashed rgb(153, 153, 153); padding: 5px; overflow: auto; color: rgb(0, 0, 0); background-color: rgb(238, 238, 238); line-height: 14px; width: 95%;font-family:Andale Mono,Lucida Console,Monaco,fixed,monospace;font-size:12px;"&gt;&lt;code&gt;TSQL_executeProcedureParam(paramName, paramValue) ::=&amp;lt;&amp;lt;&lt;br /&gt;&amp;lt;if(paramName)&amp;gt;&amp;lt;first(paramName)&amp;gt; =\&amp;gt; &amp;lt;paramValue&amp;gt;&lt;br /&gt;&amp;lt;else&amp;gt;&amp;lt;paramValue&amp;gt;&lt;br /&gt;&amp;lt;endif&amp;gt;&lt;br /&gt;&amp;gt;&amp;gt;&lt;span style="font-family:Georgia,serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;ul&gt;&lt;li&gt;Delete the exising templates\tsql.stg from the jar file, and add the modified one back in, including directory structure, so the jar file has a templates\tsql.stg&lt;/li&gt;&lt;li&gt;Restart SQL Developer and convert again.&lt;/li&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7984768457924132022-7574318977551108154?l=dermotoneill.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7984768457924132022/posts/default/7574318977551108154'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7984768457924132022/posts/default/7574318977551108154'/><link rel='alternate' type='text/html' href='http://dermotoneill.blogspot.com/2008/05/parameters-of-procedure-call.html' title='Parameters Of A Procedure Call'/><author><name>Dermot O'Neill</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-7984768457924132022.post-8421450341901090421</id><published>2008-05-20T05:07:00.000-07:00</published><updated>2008-12-10T15:37:05.204-08:00</updated><title type='text'>Sybase Offline Capture Scripts on Windows</title><content type='html'>&lt;span style="font-weight:bold;"&gt;**Update: This is now fixed in SQL Developer 1.5.1**&lt;/span&gt;&lt;br /&gt;Sybase Offline Capture Scripts on Windows are incorrect. Some files needs to replaced for them to work, the text of which can be found below.&lt;br /&gt;&lt;br /&gt;You should then be able to perform an Offline Capture successfully.&lt;br /&gt;&lt;br /&gt;SYBASE 15&lt;br /&gt;SYB15_OFFLINE_CAPTURE.BAT username password databasename servername&lt;br /&gt;For Example&lt;br /&gt;&lt;pre&gt;SYB15_OFFLINE_CAPTURE.BAT sa "" pubs2 the4400.ie.oracle.com&lt;/pre&gt;&lt;br /&gt;SYBASE 12&lt;br /&gt;SYB12_OFFLINE_CAPTURE.BAT username password databasename servername&lt;br /&gt;For Example&lt;br /&gt;&lt;pre&gt;SYB12_OFFLINE_CAPTURE.BAT sa "" pubs2 the4401.ie.oracle.com&lt;/pre&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Some Tips&lt;/span&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;"" represents an empty string for no password.&lt;/li&gt;&lt;li&gt;Sybase BCP, ISQL should be first on your PATH if you have SQL Server installed as well.&lt;/li&gt;&lt;li style="text-align: center;"&gt;Example: &lt;span style="font-family:arial;"&gt;SET PATH=D:\SybaseClient\OCS-15_0\bin;%PATH%&lt;/span&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;The Servername must be defined in your sql.ini file for BCP to work.&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_H4TtZUn_Tz8/SDLBJPYbwTI/AAAAAAAACG4/f8tN7KH2Vks/s1600-h/sybase_server.png"&gt;&lt;img style="cursor: pointer;" src="http://4.bp.blogspot.com/_H4TtZUn_Tz8/SDLBJPYbwTI/AAAAAAAACG4/f8tN7KH2Vks/s320/sybase_server.png" alt="" id="BLOGGER_PHOTO_ID_5202432884058341682" border="0" /&gt;&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;SYBASE 15 (ASE15)&lt;/span&gt;&lt;br /&gt;Replace the following files&lt;br /&gt;&lt;ul&gt;&lt;li&gt;SYB15_OFFLINE_CAPTURE.BAT&lt;/li&gt;&lt;li&gt;SYB15_BCP_SCRIPT.BAT &lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;SYB15_OFFLINE_CAPTURE.BAT&lt;br /&gt;&lt;pre style="border: 1px dashed rgb(153, 153, 153); padding: 5px; overflow: auto; font-family: Andale Mono,Lucida Console,Monaco,fixed,monospace; color: rgb(0, 0, 0); background-color: rgb(238, 238, 238); font-size: 12px; line-height: 14px; width: 95%; height: 100px;"&gt;&lt;code&gt;@echo off&lt;br /&gt;&lt;br /&gt;rem ** SET THE VALUE FOR THE OFFLINE_CAPTURE_COLUMN_DELIMITER&lt;br /&gt;rem ** echoed through bcp to COLUMN.TXT&lt;br /&gt;set OFFLINE_CAPTURE_COLUMN_DELIMITER="&amp;lt;EOC&amp;gt;"&lt;br /&gt;&lt;br /&gt;rem ** SET THE VALUE FOR THE OFFLINE_CAPTURE_ROW_DELIMITER&lt;br /&gt;rem ** echoed through bcp to ROW.TXT&lt;br /&gt;set OFFLINE_CAPTURE_ROW_DELIMITER="&amp;lt;EOR&amp;gt;"&lt;br /&gt;&lt;br /&gt;rem ** SET THE SCRIPT VERSION ENVIRONMENT VARIABLE&lt;br /&gt;set OMWB_SCRIPT_VERSION=15&lt;br /&gt;&lt;br /&gt;rem ** SET THE VALUE FOR THE OMWB FILE ENVIRONMENT VARIABLE&lt;br /&gt;set OMWB_SCRIPT_FILE=%3\%3_INFO.TXT&lt;br /&gt;&lt;br /&gt;rem ** DISPLAY THE HELP PAGE IF THE USER REQUESTS IT&lt;br /&gt;&lt;br /&gt;if "%1"=="-h"   goto help&lt;br /&gt;if "%1"=="help" goto help&lt;br /&gt;if "%1"=="?"    goto help&lt;br /&gt;if "%1"=="-?"   goto help&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;rem *** DISPLAY THE SCRIPT VERSION IF THE USER REQUESTS IT&lt;br /&gt;&lt;br /&gt;if "%1"=="-ver" goto version&lt;br /&gt;if "%1"=="version" goto version&lt;br /&gt;&lt;br /&gt;rem *** CHECK THAT THREE PARAMETERS HAVE BEEN ENTERED&lt;br /&gt;rem *** THE PASSWORD CAN BE "", SO WE DON't DO THE SAME CHECK FOR THAT&lt;br /&gt;&lt;br /&gt;if "%1"=="" goto input_error&lt;br /&gt;if "%3"=="" goto input_error&lt;br /&gt;if "%4"=="" goto input_error&lt;br /&gt;&lt;br /&gt;rem *** START THE EXECUTION OF THE SCRIPT INSTRUCTIONS&lt;br /&gt;&lt;br /&gt;goto start&lt;br /&gt;&lt;br /&gt;:start&lt;br /&gt;&lt;br /&gt;rem ** CREATE THE OUTPUT DIRECTORIES&lt;br /&gt;&lt;br /&gt;mkdir master&lt;br /&gt;mkdir %3&lt;br /&gt;&lt;br /&gt;rem *** CALL THE BCP SCRIPT TO CREATE THE METADATA FILES&lt;br /&gt;&lt;br /&gt;call SYB15_BCP_SCRIPT.BAT %1 %2 %3 %4 %OFFLINE_CAPTURE_COLUMN_DELIMITER% %OFFLINE_CAPTURE_ROW_DELIMITER%&lt;br /&gt;&lt;br /&gt;rem *** CHECK THAT ALL OF THE OUTPUT FILES HAVE BEEN CREATED&lt;br /&gt;&lt;br /&gt;goto checkoutput&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;:help&lt;br /&gt;echo -----------------------------------------------------------------------&lt;br /&gt;echo ---------------------  Oracle Migration Workbench ---------------------&lt;br /&gt;echo ---------------------         Release %OMWB_SCRIPT_VERSION%       ---------------------&lt;br /&gt;echo -----------------------------------------------------------------------&lt;br /&gt;echo ---- This script will generate delimited flat files containing     ----&lt;br /&gt;echo ---- schema metadata from the database you wish to migrate. This   ----&lt;br /&gt;echo ---- script will envoke the Bulk Copy Program (BCP) that should be ----&lt;br /&gt;echo ---- part of your Sybase install base.                         ----&lt;br /&gt;echo ---- Please ensure that your path points to the version of BCP     ----&lt;br /&gt;echo ---- that is installed with the Sybase from which you wish     ----&lt;br /&gt;echo ---- to migrate. Your current path setting is listed below:        ----&lt;br /&gt;echo ----&lt;br /&gt;PATH&lt;br /&gt;echo ----&lt;br /&gt;echo ----&lt;br /&gt;echo ---- To run this script, enter the following command at the prompt ----&lt;br /&gt;echo ----&lt;br /&gt;echo ---- OMWB_OFFLINE_CAPTURE login_id password database_name server_name&lt;br /&gt;echo ---- where,&lt;br /&gt;echo ---- dba_login_id is a login id which has been granted db_datareader&lt;br /&gt;echo ---- and view definition on database_name&lt;br /&gt;echo ---- password is the password for the login id&lt;br /&gt;echo ---- database_name is the name of the database you wish to capture&lt;br /&gt;echo ---- server_name is the name of the server on which the database resides&lt;br /&gt;echo ---- For example,&lt;br /&gt;echo ----      OMWB_OFFLINE_CAPTURE sa sapwd employeeDB DEPT1_SERVER&lt;br /&gt;echo ----&lt;br /&gt;echo -----------------------------------------------------------------------&lt;br /&gt;goto exit&lt;br /&gt;&lt;br /&gt;:input_error&lt;br /&gt;echo ---- ** Error executing the script&lt;br /&gt;echo ----&lt;br /&gt;echo ---- To run this script, enter the following command at the prompt ----&lt;br /&gt;echo ----&lt;br /&gt;echo ---- OMWB_OFFLINE_CAPTURE login_id password database_name server_name&lt;br /&gt;echo ---- where,&lt;br /&gt;echo ---- login_id is a login id which has been granted db_datareader&lt;br /&gt;echo ---- and view definition on database_name&lt;br /&gt;echo ---- password is the password for the login id&lt;br /&gt;echo ---- database_name is the name of the database you wish to capture&lt;br /&gt;echo ---- server_name is the name of the server on which the database resides&lt;br /&gt;echo ---- For example,&lt;br /&gt;echo ----      OMWB_OFFLINE_CAPTURE sa sapwd employeeDB DEPT1_SERVER&lt;br /&gt;echo ----&lt;br /&gt;echo -----------------------------------------------------------------------&lt;br /&gt;goto exit&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;:version&lt;br /&gt;echo -----------------------------------------------------------------------&lt;br /&gt;echo ---- This is the Oracle Migration Workbench offline capture script&lt;br /&gt;echo ---- version %OMWB_SCRIPT_VERSION% for Sybase 15&lt;br /&gt;echo -----------------------------------------------------------------------&lt;br /&gt;goto exit&lt;br /&gt;&lt;br /&gt;:omwbfile&lt;br /&gt;echo OMWB REPORT FOR %3                            &amp;gt;  %OMWB_SCRIPT_FILE%&lt;br /&gt;echo ____________________________________________  &amp;gt;&amp;gt; %OMWB_SCRIPT_FILE%&lt;br /&gt;echo * SCRIPT EXECUTION DATE AND TIME:             &amp;gt;&amp;gt; %OMWB_SCRIPT_FILE%&lt;br /&gt;date /t                                            &amp;gt;&amp;gt; %OMWB_SCRIPT_FILE%&lt;br /&gt;time /t                                            &amp;gt;&amp;gt; %OMWB_SCRIPT_FILE%&lt;br /&gt;echo -                                             &amp;gt;&amp;gt; %OMWB_SCRIPT_FILE%&lt;br /&gt;echo SYSTEM PROPERTIES                             &amp;gt;&amp;gt; %OMWB_SCRIPT_FILE%&lt;br /&gt;echo _______________________                       &amp;gt;&amp;gt; %OMWB_SCRIPT_FILE%&lt;br /&gt;echo * PLATFORM VERSION:                           &amp;gt;&amp;gt; %OMWB_SCRIPT_FILE%&lt;br /&gt;ver                                                &amp;gt;&amp;gt; %OMWB_SCRIPT_FILE%&lt;br /&gt;echo -                                             &amp;gt;&amp;gt; %OMWB_SCRIPT_FILE%&lt;br /&gt;echo * PLATFORM CODEPAGE:                          &amp;gt;&amp;gt; %OMWB_SCRIPT_FILE%&lt;br /&gt;mode con codepage /sta                             &amp;gt;&amp;gt; %OMWB_SCRIPT_FILE%&lt;br /&gt;echo -                                             &amp;gt;&amp;gt; %OMWB_SCRIPT_FILE%&lt;br /&gt;echo -                                             &amp;gt;&amp;gt; %OMWB_SCRIPT_FILE%&lt;br /&gt;echo -                                             &amp;gt;&amp;gt; %OMWB_SCRIPT_FILE%&lt;br /&gt;echo SOURCE DATABASE SERVER PROPERTIES             &amp;gt;&amp;gt; %OMWB_SCRIPT_FILE%&lt;br /&gt;echo __________________________________            &amp;gt;&amp;gt; %OMWB_SCRIPT_FILE%&lt;br /&gt;echo * BCP VERSION:                                &amp;gt;&amp;gt; %OMWB_SCRIPT_FILE%&lt;br /&gt;bcp -v                                             &amp;gt;&amp;gt; %OMWB_SCRIPT_FILE%&lt;br /&gt;echo -                                             &amp;gt;&amp;gt; %OMWB_SCRIPT_FILE%&lt;br /&gt;echo * DATABSE SERVER COLLATION AND VERSION:       &amp;gt;&amp;gt; %OMWB_SCRIPT_FILE%&lt;br /&gt;isql -U%1 -P%2 -S%4 -i%3  -i properties.sql        &amp;gt;&amp;gt; %OMWB_SCRIPT_FILE%&lt;br /&gt;echo -                                             &amp;gt;&amp;gt; %OMWB_SCRIPT_FILE%&lt;br /&gt;echo -                                             &amp;gt;&amp;gt; %OMWB_SCRIPT_FILE%&lt;br /&gt;echo -                                             &amp;gt;&amp;gt; %OMWB_SCRIPT_FILE%&lt;br /&gt;echo DIRECTORY LISTING for %3                      &amp;gt;&amp;gt; %OMWB_SCRIPT_FILE%&lt;br /&gt;echo __________________________________            &amp;gt;&amp;gt; %OMWB_SCRIPT_FILE%&lt;br /&gt;dir %3                                             &amp;gt;&amp;gt; %OMWB_SCRIPT_FILE%&lt;br /&gt;echo -                                             &amp;gt;&amp;gt; %OMWB_SCRIPT_FILE%&lt;br /&gt;echo -                                             &amp;gt;&amp;gt; %OMWB_SCRIPT_FILE%&lt;br /&gt;echo -                                             &amp;gt;&amp;gt; %OMWB_SCRIPT_FILE%&lt;br /&gt;echo DIRECTORY LISTING FOR MASTER                  &amp;gt;&amp;gt; %OMWB_SCRIPT_FILE%&lt;br /&gt;echo _______________________________               &amp;gt;&amp;gt; %OMWB_SCRIPT_FILE%&lt;br /&gt;dir master                                         &amp;gt;&amp;gt; %OMWB_SCRIPT_FILE%&lt;br /&gt;echo -                                             &amp;gt;&amp;gt; %OMWB_SCRIPT_FILE%&lt;br /&gt;echo -                                             &amp;gt;&amp;gt; %OMWB_SCRIPT_FILE%&lt;br /&gt;echo -                                             &amp;gt;&amp;gt; %OMWB_SCRIPT_FILE%&lt;br /&gt;echo ATTRIBUTES OF SCRIPT:                         &amp;gt;&amp;gt; %OMWB_SCRIPT_FILE%&lt;br /&gt;echo _______________________                       &amp;gt;&amp;gt; %OMWB_SCRIPT_FILE%&lt;br /&gt;attrib SYB15_OFFLINE_CAPTURE.bat                    &amp;gt;&amp;gt; %OMWB_SCRIPT_FILE%&lt;br /&gt;echo -                                             &amp;gt;&amp;gt; %OMWB_SCRIPT_FILE%&lt;br /&gt;echo -                                             &amp;gt;&amp;gt; %OMWB_SCRIPT_FILE%&lt;br /&gt;echo -                                             &amp;gt;&amp;gt; %OMWB_SCRIPT_FILE%&lt;br /&gt;echo CONTENTS OF EXECUTED SCRIPT                   &amp;gt;&amp;gt; %OMWB_SCRIPT_FILE%&lt;br /&gt;echo ____________________________________          &amp;gt;&amp;gt; %OMWB_SCRIPT_FILE%&lt;br /&gt;type SYB15_OFFLINE_CAPTURE.BAT                      &amp;gt;&amp;gt; %OMWB_SCRIPT_FILE%&lt;br /&gt;echo -                                             &amp;gt;&amp;gt; %OMWB_SCRIPT_FILE%&lt;br /&gt;echo -                                             &amp;gt;&amp;gt; %OMWB_SCRIPT_FILE%&lt;br /&gt;echo -                                             &amp;gt;&amp;gt; %OMWB_SCRIPT_FILE%&lt;br /&gt;echo CONTENTS OF BCP SCRIPT                        &amp;gt;&amp;gt; %OMWB_SCRIPT_FILE%&lt;br /&gt;echo ____________________________________          &amp;gt;&amp;gt; %OMWB_SCRIPT_FILE%&lt;br /&gt;type SYB15_BCP_SCRIPT.BAT                           &amp;gt;&amp;gt; %OMWB_SCRIPT_FILE%&lt;br /&gt;echo -                                             &amp;gt;&amp;gt; %OMWB_SCRIPT_FILE%&lt;br /&gt;echo -                                             &amp;gt;&amp;gt; %OMWB_SCRIPT_FILE%&lt;br /&gt;echo -                                             &amp;gt;&amp;gt; %OMWB_SCRIPT_FILE%&lt;br /&gt;&lt;br /&gt;echo ** END REPORT FOR %3                          &amp;gt;&amp;gt; %OMWB_SCRIPT_FILE%&lt;br /&gt;&lt;br /&gt;rem *** DISPLAY THE FINAL INSTRUCTIONS TO THE USER&lt;br /&gt;goto finalinstructions&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;:checkoutput&lt;br /&gt;&lt;br /&gt;rem *** CHECK THAT ALL DATABASE META FILES HAVE BEEN CREATED&lt;br /&gt;if not exist %3\SYB12_SYSUSERS.dat          echo ** ERROR %3\SYB12_SYSUSERS.dat has not been created. Please check the screen output and .err files to detect the problem. Execute the script again when the problem is fixed or contact your Oracle representative if the problem persists.&lt;br /&gt;if not exist %3\SYB12_SYSOBJECTS.dat        echo ** ERROR %3\SYB12_SYSOBJECTS.dat has not been created. Please check the screen output and .err files to detect the problem. Execute the script again when the problem is fixed or contact your Oracle representative if the problem persists.&lt;br /&gt;if not exist %3\SYB12_SYSTYPES.dat            echo ** ERROR %3\SYB12_SYSTYPES.dat has not been created. Please check the screen output and .err files to detect the problem. Execute the script again when the problem is fixed or contact your Oracle representative if the problem persists.&lt;br /&gt;if not exist %3\SYB12_SYSCOLUMNS.dat        echo ** ERROR %3\SYB12_SYSCOLUMNS.dat has not been created. Please check the screen output and .err files to detect the problem. Execute the script again when the problem is fixed or contact your Oracle representative if the problem persists.&lt;br /&gt;if not exist %3\SYB12_SYSCOMMENTS.dat        echo ** ERROR %3\SYB12_SYSCOMMENTS.dat has not been created. Please check the screen output and .err files to detect the problem. Execute the script again when the problem is fixed or contact your Oracle representative if the problem persists.&lt;br /&gt;if not exist master\SYB12_SYSDATABASES.dat  echo ** ERROR master\SYB12_SYSDATABASES.dat has not been created. Please check the screen output and .err files to detect the problem. Execute the script again when the problem is fixed or contact your Oracle representative if the problem persists.&lt;br /&gt;&lt;br /&gt;rem *** CHECK THAT ALL MASTER META FILES HAVE BEEN CREATED&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;rem ** UPDATE THE OMWB FILE - THIS HOLDS SCRIPT AND PERTINENT SOURCE DATABASE SERVER INFO&lt;br /&gt;&lt;br /&gt;goto omwbfile&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;:finalinstructions&lt;br /&gt;echo **************************************************************************&lt;br /&gt;echo ** The offline capture script has completed execution.                  &lt;br /&gt;echo ** Please review the screen output and .err files (if any) in the output&lt;br /&gt;echo ** directories for any irregularities. You may need to execute the&lt;br /&gt;echo ** script again to resolve any irregularities.               &lt;br /&gt;echo **                                                            &lt;br /&gt;echo ** Finally, please archive the directory containing the sybase15.ocp file.&lt;br /&gt;echo ** This contains master and %3 directories (preserve the&lt;br /&gt;echo ** directory structure in the archive) the ROW.TXT, the COLUMN.TXT, and the&lt;br /&gt;echo ** sybase15.ocp file. Return the archive file to&lt;br /&gt;echo ** your Oracle representative.                                 &lt;br /&gt;echo **************************************************************************&lt;br /&gt;goto exit&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;:exit&lt;br /&gt;rem ** REMOVE THE SCRIPT VERSION ENVIRONMENT VARIABLE&lt;br /&gt;set OMWB_SCRIPT_VERSION=&lt;br /&gt;rem ** REMOVE THE VALUE FOR THE OMWB FILE ENVIRONMENT VARIABLE&lt;br /&gt;set OMWB_SCRIPT_FILE=&lt;br /&gt;rem ** REMOVE THE VALUE FOR THE END OF ROW DELIMITER ENVIRONMENT VARIABLE&lt;br /&gt;set OFFLINE_CAPTURE_ROW_DELIMITER=&lt;br /&gt;rem ** REMOVE THE VALUE FOR THE END OF COLUMN ENVIRONMENT VARIABLE&lt;br /&gt;set OFFLINE_CAPTURE_COLUMN_DELIMITER=&lt;br /&gt;&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;SYB15_BCP_SCRIPT.BAT&lt;br /&gt;&lt;pre style="border: 1px dashed rgb(153, 153, 153); padding: 5px; overflow: auto; font-family: Andale Mono,Lucida Console,Monaco,fixed,monospace; color: rgb(0, 0, 0); background-color: rgb(238, 238, 238); font-size: 12px; line-height: 14px; width: 95%; height: 100px;"&gt;&lt;code&gt;rem  %1 DBA login id&lt;br /&gt;rem  %2 password&lt;br /&gt;rem  %3 database name&lt;br /&gt;rem  %4 database server name&lt;br /&gt;rem  %5 end or column delimiter&lt;br /&gt;rem  %6 end of row delimiter&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;rem export the required system tables in the master database&lt;br /&gt;bcp sysdatabases out master\SYB12_SYSDATABASES.dat -c  -t "\t&amp;lt;EOC&amp;gt;\t" -r "\t&amp;lt;EOC&amp;gt;\t&amp;lt;EOR&amp;gt;\n" -U%1 -P%2 -S%4&lt;br /&gt;&lt;br /&gt;rem export the required system tables in the database to be migrated&lt;br /&gt;&lt;br /&gt;bcp %3.dbo.sysusers out %3\SYB12_SYSUSERS.dat -c -t "\t&amp;lt;EOC&amp;gt;\t" -r "\t&amp;lt;EOC&amp;gt;\t&amp;lt;EOR&amp;gt;\n" -U%1 -P%2 -S%4&lt;br /&gt;bcp %3.dbo.sysobjects out %3\SYB12_SYSOBJECTS.dat -c -t "\t&amp;lt;EOC&amp;gt;\t" -r "\t&amp;lt;EOC&amp;gt;\t&amp;lt;EOR&amp;gt;\n" -U%1 -P%2 -S%4&lt;br /&gt;bcp %3.dbo.systypes out %3\SYB12_SYSTYPES.dat -c -t "\t&amp;lt;EOC&amp;gt;\t" -r "\t&amp;lt;EOC&amp;gt;\t&amp;lt;EOR&amp;gt;\n" -U%1 -P%2 -S%4&lt;br /&gt;bcp %3.dbo.syscolumns out %3\SYB12_SYSCOLUMNS.dat -c -t "\t&amp;lt;EOC&amp;gt;\t" -r "\t&amp;lt;EOC&amp;gt;\t&amp;lt;EOR&amp;gt;\n"  -U%1 -P%2 -S%4&lt;br /&gt;bcp %3.dbo.syscomments out %3\SYB12_SYSCOMMENTS.dat -c -t "\t&amp;lt;EOC&amp;gt;\t" -r "\t&amp;lt;EOC&amp;gt;\t&amp;lt;EOR&amp;gt;\n"  -U%1 -P%2 -S%4&lt;br /&gt;isql -U%1 -P%2 -D%3 -S%4 -b -i get_indexes.sql -o %3\SYB12_SYSINDEXES.dat&lt;br /&gt;isql -U%1 -P%2 -D%3 -S%4 -b -w200 -i get_constraints.sql -o %3\SYB12_SYSCONSTRAINTS.dat&lt;br /&gt;&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;For &lt;span style="font-weight: bold;"&gt;SYBASE 12&lt;/span&gt;&lt;br /&gt;Only 1 SYB12_BCP_SCRIPT.BAT needs to be updated with the following&lt;br /&gt;&lt;br /&gt;SYB12_BCP_SCRIPT.BAT&lt;br /&gt;&lt;pre style="border: 1px dashed rgb(153, 153, 153); padding: 5px; overflow: auto; font-family: Andale Mono,Lucida Console,Monaco,fixed,monospace; color: rgb(0, 0, 0); background-color: rgb(238, 238, 238); font-size: 12px; line-height: 14px; width: 95%; height: 100px;"&gt;&lt;code&gt;rem  %1 DBA login id&lt;br /&gt;rem  %2 password&lt;br /&gt;rem  %3 database name&lt;br /&gt;rem  %4 database server name&lt;br /&gt;rem  %5 end or column delimiter&lt;br /&gt;rem  %6 end of row delimiter&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;rem export the required system tables in the master database&lt;br /&gt;bcp sysdatabases out master\SYB12_SYSDATABASES.dat -c  -t "\t&amp;lt;EOC&amp;gt;\t" -r "\t&amp;lt;EOC&amp;gt;\t&amp;lt;EOR&amp;gt;\n" -U%1 -P%2 -S%4&lt;br /&gt;&lt;br /&gt;rem export the required system tables in the database to be migrated&lt;br /&gt;&lt;br /&gt;bcp %3.dbo.sysusers out %3\SYB12_SYSUSERS.dat -c -t "\t&amp;lt;EOC&amp;gt;\t" -r "\t&amp;lt;EOC&amp;gt;\t&amp;lt;EOR&amp;gt;\n" -U%1 -P%2 -S%4&lt;br /&gt;bcp %3.dbo.sysobjects out %3\SYB12_SYSOBJECTS.dat -c -t "\t&amp;lt;EOC&amp;gt;\t" -r "\t&amp;lt;EOC&amp;gt;\t&amp;lt;EOR&amp;gt;\n" -U%1 -P%2 -S%4&lt;br /&gt;bcp %3.dbo.systypes out %3\SYB12_SYSTYPES.dat -c -t "\t&amp;lt;EOC&amp;gt;\t" -r "\t&amp;lt;EOC&amp;gt;\t&amp;lt;EOR&amp;gt;\n" -U%1 -P%2 -S%4&lt;br /&gt;bcp %3.dbo.syscolumns out %3\SYB12_SYSCOLUMNS.dat -c -t "\t&amp;lt;EOC&amp;gt;\t" -r "\t&amp;lt;EOC&amp;gt;\t&amp;lt;EOR&amp;gt;\n"  -U%1 -P%2 -S%4&lt;br /&gt;bcp %3.dbo.syscomments out %3\SYB12_SYSCOMMENTS.dat -c -t "\t&amp;lt;EOC&amp;gt;\t" -r "\t&amp;lt;EOC&amp;gt;\t&amp;lt;EOR&amp;gt;\n"  -U%1 -P%2 -S%4&lt;br /&gt;isql -U%1 -P%2 -D%3 -S%4 -b -i get_indexes.sql -o %3\SYB12_SYSINDEXES.dat&lt;br /&gt;isql -U%1 -P%2 -D%3 -S%4 -b -w200 -i get_constraints.sql -o %3\SYB12_SYSCONSTRAINTS.dat&lt;br /&gt;&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7984768457924132022-8421450341901090421?l=dermotoneill.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7984768457924132022/posts/default/8421450341901090421'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7984768457924132022/posts/default/8421450341901090421'/><link rel='alternate' type='text/html' href='http://dermotoneill.blogspot.com/2008/05/sybase-offline-capture-scripts-on.html' title='Sybase Offline Capture Scripts on Windows'/><author><name>Dermot O'Neill</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_H4TtZUn_Tz8/SDLBJPYbwTI/AAAAAAAACG4/f8tN7KH2Vks/s72-c/sybase_server.png' height='72' width='72'/></entry><entry><id>tag:blogger.com,1999:blog-7984768457924132022.post-5848270302917990602</id><published>2008-05-15T10:23:00.000-07:00</published><updated>2008-12-10T15:37:05.528-08:00</updated><title type='text'>Manage Tablespaces</title><content type='html'>In the old OMWB we had a "Discover Tablespaces" feature, so that you could assign tables to existing tablespaces in your Oracle database, before generating your Database.&lt;br /&gt;&lt;br /&gt;In SQL Developer you can do this in 3 ways.&lt;br /&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Change the generation script so that you specify a different default tablespace for the new schema and all its tables.&lt;/li&gt;&lt;li&gt;Change a tables tablespace once in Oracle. Right click the table and choose Storage &gt; Move Tablespace&lt;/li&gt;&lt;li&gt;Write a script to automatically assign tables to different tablespaces depending on some criteria.&lt;/li&gt;&lt;/ol&gt;The first two options are show in this screen shot&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_H4TtZUn_Tz8/SCxyNPYbwSI/AAAAAAAACGw/qSsdxjZanMw/s1600-h/tablespaces.jpg"&gt;&lt;img style="cursor: pointer;" src="http://2.bp.blogspot.com/_H4TtZUn_Tz8/SCxyNPYbwSI/AAAAAAAACGw/qSsdxjZanMw/s320/tablespaces.jpg" alt="" id="BLOGGER_PHOTO_ID_5200657241498960162" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;But the third way may be the most useful.&lt;br /&gt;If you wanted to have seperate tablespaces depending on the size of the tables you could run the following scripts on your Sybase/SQL Server database. The output of which can be run against your migrated Oracle database to move the tables to their new tablespaces. The best thing about this approach is you can do this before migrating the data, so that moving tablespaces is trivial.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;SQL Server&lt;/span&gt;&lt;br /&gt;&lt;pre style="border: 1px dashed rgb(153, 153, 153); padding: 5px; overflow: auto; font-family: Andale Mono,Lucida Console,Monaco,fixed,monospace; color: rgb(0, 0, 0); background-color: rgb(238, 238, 238); font-size: 12px; line-height: 14px; width: 100%;"&gt;&lt;code&gt;SELECT CASE&lt;br /&gt;       WHEN num_rows &amp;gt;=100 THEN&lt;br /&gt;         'ALTER TABLE ' + TABLE_NAME +' MOVE TABLESPACE '+' BIGTABLESPACE ;'&lt;br /&gt;       WHEN num_rows &amp;lt;100 AND num_rows &amp;gt;=50 THEN&lt;br /&gt;         'ALTER TABLE ' + TABLE_NAME +' MOVE TABLESPACE '+' MEDIUMTABLESPACE ;'&lt;br /&gt;       WHEN num_rows &amp;lt;50  THEN&lt;br /&gt;          'ALTER TABLE ' + TABLE_NAME +' MOVE TABLESPACE '+' SMALLTABLESPACE ;' END  SCRIPT&lt;br /&gt;FROM (SELECT&lt;br /&gt;Table_Name = so.name ,&lt;br /&gt;NUM_ROWS = MAX(si.rows)&lt;br /&gt;FROM&lt;br /&gt;sysobjects so,&lt;br /&gt;sysindexes si&lt;br /&gt;WHERE&lt;br /&gt;so.xtype = 'U'&lt;br /&gt;AND&lt;br /&gt;si.id = OBJECT_ID(so.name)&lt;br /&gt;GROUP BY&lt;br /&gt;so.name ) ALL_TABLES&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Sybase&lt;/span&gt;&lt;pre style="border: 1px dashed rgb(153, 153, 153); padding: 5px; overflow: auto; font-family: Andale Mono,Lucida Console,Monaco,fixed,monospace; color: rgb(0, 0, 0); background-color: rgb(238, 238, 238); font-size: 12px; line-height: 14px; width: 100%;"&gt;&lt;code&gt;drop table TableRowCount&lt;br /&gt;go&lt;br /&gt;&lt;br /&gt;drop procedure populateTableRowCount&lt;br /&gt;go&lt;br /&gt;&lt;br /&gt;CREATE TABLE TableRowCount(table_name varchar(200),num_rows int)&lt;br /&gt;go&lt;br /&gt;&lt;br /&gt;create procedure populateTableRowCount as&lt;br /&gt;begin&lt;br /&gt;declare @tableName varchar(200)&lt;br /&gt;declare @rowNum int&lt;br /&gt;declare name_cursor cursor&lt;br /&gt;for select name from sysobjects where type ='U' and name != 'TableRowCount'&lt;br /&gt;for read only&lt;br /&gt;CREATE TABLE #countSize(rowNum int)&lt;br /&gt;open name_cursor&lt;br /&gt;fetch name_cursor into @tableName&lt;br /&gt;while @@sqlstatus = 0 -- ie no errors and we successfully fetched a row&lt;br /&gt;begin&lt;br /&gt;execute( 'insert into #countSize  select count(*) rowNum from ' + @tableName)&lt;br /&gt;select  @rowNum = max(rowNum) from #countSize&lt;br /&gt;delete from #countSize&lt;br /&gt;insert into TableRowCount values(@tableName,@rowNum)&lt;br /&gt;fetch next from name_cursor into @tableName&lt;br /&gt;end&lt;br /&gt;close name_cursor&lt;br /&gt;deallocate cursor name_cursor&lt;br /&gt;end&lt;br /&gt;go&lt;br /&gt;&lt;br /&gt;exec  populateTableRowCount&lt;br /&gt;go&lt;br /&gt;&lt;br /&gt;SELECT CASE&lt;br /&gt;        WHEN num_rows &amp;gt;=100 THEN&lt;br /&gt;          'ALTER TABLE ' + table_name +' MOVE TABLESPACE '+' BIGTABLESPACE ;'&lt;br /&gt;        WHEN num_rows &amp;lt;100 AND num_rows &amp;gt;=50 THEN&lt;br /&gt;          'ALTER TABLE ' + table_name +' MOVE TABLESPACE '+' MEDIUMTABLESPACE ;'&lt;br /&gt;        WHEN num_rows &amp;lt;50  THEN&lt;br /&gt;           'ALTER TABLE ' + table_name +' MOVE TABLESPACE '+' SMALLTABLESPACE ;' END  SCRIPT&lt;br /&gt;FROM TableRowCount&lt;br /&gt;go&lt;br /&gt;&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Oracle&lt;/span&gt; :  If you are already on Oracle and the data is present in your Oracle tables.&lt;br /&gt;&lt;br /&gt;&lt;pre style="border: 1px dashed rgb(153, 153, 153); padding: 5px; overflow: auto; font-family: Andale Mono,Lucida Console,Monaco,fixed,monospace; color: rgb(0, 0, 0); background-color: rgb(238, 238, 238); font-size: 12px; line-height: 14px; width: 100%;"&gt;&lt;code&gt;SELECT CASE&lt;br /&gt;       WHEN num_rows &amp;gt;=100 THEN&lt;br /&gt;         'ALTER TABLE ' || TABLE_NAME ||' MOVE TABLESPACE '||' BIGTABLESPACE ;'&lt;br /&gt;       WHEN num_rows &amp;lt;100 AND num_rows &amp;gt;=50 THEN&lt;br /&gt;         'ALTER TABLE ' || TABLE_NAME ||' MOVE TABLESPACE '||' MEDIUMTABLESPACE ;'&lt;br /&gt;       WHEN num_rows &amp;lt;50  THEN&lt;br /&gt;          'ALTER TABLE ' || TABLE_NAME ||' MOVE TABLESPACE '||' SMALLTABLESPACE ;' END  SCRIPT&lt;br /&gt;FROM ALL_TABLES&lt;br /&gt;WHERE lower(owner) ='ownername'&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;The above scripts should generate another script like&lt;br /&gt;&lt;pre style="border: 1px dashed rgb(153, 153, 153); padding: 5px; overflow: auto; font-family: Andale Mono,Lucida Console,Monaco,fixed,monospace; color: rgb(0, 0, 0); background-color: rgb(238, 238, 238); font-size: 12px; line-height: 14px; width: 100%;"&gt;&lt;code&gt;SCRIPT&lt;br /&gt;ALTER TABLE au_pix MOVE TABLESPACE  SMALLTABLESPACE ;&lt;br /&gt;ALTER TABLE authors MOVE TABLESPACE  SMALLTABLESPACE ;&lt;br /&gt;ALTER TABLE blurbs MOVE TABLESPACE  SMALLTABLESPACE ;&lt;br /&gt;ALTER TABLE discounts MOVE TABLESPACE  SMALLTABLESPACE ;&lt;br /&gt;ALTER TABLE publishers MOVE TABLESPACE  SMALLTABLESPACE ;&lt;br /&gt;ALTER TABLE roysched MOVE TABLESPACE  MEDIUMTABLESPACE ;&lt;br /&gt;ALTER TABLE sales MOVE TABLESPACE  SMALLTABLESPACE ;&lt;br /&gt;ALTER TABLE salesdetail MOVE TABLESPACE  BIGTABLESPACE ;&lt;br /&gt;ALTER TABLE skill MOVE TABLESPACE  SMALLTABLESPACE ;&lt;br /&gt;ALTER TABLE skill_detail MOVE TABLESPACE  SMALLTABLESPACE ;&lt;br /&gt;ALTER TABLE stores MOVE TABLESPACE  SMALLTABLESPACE ;&lt;br /&gt;ALTER TABLE table_emp MOVE TABLESPACE  SMALLTABLESPACE ;&lt;br /&gt;ALTER TABLE titleauthor MOVE TABLESPACE  SMALLTABLESPACE ;&lt;br /&gt;ALTER TABLE titles MOVE TABLESPACE  SMALLTABLESPACE ;&lt;br /&gt;&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Which when run in Oracle will move the tables to the correct tablespace. The above results are from Sybase pubs2 example database&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7984768457924132022-5848270302917990602?l=dermotoneill.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7984768457924132022/posts/default/5848270302917990602'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7984768457924132022/posts/default/5848270302917990602'/><link rel='alternate' type='text/html' href='http://dermotoneill.blogspot.com/2008/05/manage-tablespaces.html' title='Manage Tablespaces'/><author><name>Dermot O'Neill</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_H4TtZUn_Tz8/SCxyNPYbwSI/AAAAAAAACGw/qSsdxjZanMw/s72-c/tablespaces.jpg' height='72' width='72'/></entry><entry><id>tag:blogger.com,1999:blog-7984768457924132022.post-246806551251241536</id><published>2008-05-15T05:33:00.000-07:00</published><updated>2008-12-10T15:37:05.635-08:00</updated><title type='text'>Offline Blob Data Move</title><content type='html'>&lt;span style="font-weight:bold;"&gt;**Update: This is now set "on" by default in the preferences of SQL Developer 1.5.1**&lt;/span&gt;&lt;br /&gt;In SQL Developer 1.5 we have a nifty solution for moving BLOBs (Images in SQL Server and Sybase) to Oracle offline.&lt;br /&gt;&lt;br /&gt;The problem in the past was SQL Server and Sybase BCP tool dumps out binary values in HEX.&lt;br /&gt;HEX cant be loaded easily into a BLOB in Oracle using SQL*Loader, there are some limitations to the size of the BLOB.&lt;br /&gt;&lt;br /&gt;In the past we had a manual solution to create an extra CLOB column to load the HEX  as a string/clob to . Then we had a procedure which was run after the datamove to convert the HEX to RAW piece by piece and insert it into the BLOB column.  This is automated now but you have to set  a preference first.&lt;br /&gt;&lt;br /&gt;Select "Generate Stored Procedure to Migration Blobs Offline". In 1.5 by efault its off. Ill change this for 1.5.1 .&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_H4TtZUn_Tz8/SCwvKfYbwRI/AAAAAAAACGo/5R8geUNYLLI/s1600-h/GenOptions.png"&gt;&lt;img style="cursor: pointer;" src="http://3.bp.blogspot.com/_H4TtZUn_Tz8/SCwvKfYbwRI/AAAAAAAACGo/5R8geUNYLLI/s320/GenOptions.png" alt="" id="BLOGGER_PHOTO_ID_5200583526975258898" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Now when you move your data offline, BLOBS will be handled automatically.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7984768457924132022-246806551251241536?l=dermotoneill.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7984768457924132022/posts/default/246806551251241536'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7984768457924132022/posts/default/246806551251241536'/><link rel='alternate' type='text/html' href='http://dermotoneill.blogspot.com/2008/05/offline-blob-data-move.html' title='Offline Blob Data Move'/><author><name>Dermot O'Neill</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_H4TtZUn_Tz8/SCwvKfYbwRI/AAAAAAAACGo/5R8geUNYLLI/s72-c/GenOptions.png' height='72' width='72'/></entry><entry><id>tag:blogger.com,1999:blog-7984768457924132022.post-5150190252776761743</id><published>2008-05-15T03:16:00.000-07:00</published><updated>2008-05-15T03:24:54.085-07:00</updated><title type='text'>Search &amp; Replace SQL within the Repository</title><content type='html'>Sometimes you'd like to go a do  a quick string search and replace of SQL for your captured triggers, procedures, functions or views.&lt;br /&gt;The DDL for these objects is held within different migration repository tables.  You can create the following view within your migration repository and use it to update the underlying migration repository.&lt;br /&gt;&lt;br /&gt;&lt;pre style="border: 1px dashed rgb(153, 153, 153); padding: 5px; overflow: auto; font-family: Andale Mono,Lucida Console,Monaco,fixed,monospace; color: rgb(0, 0, 0); background-color: rgb(238, 238, 238); font-size: 12px; line-height: 14px; width: 100%;"&gt;&lt;code&gt;CREATE OR REPLACE VIEW MGV_ALL_CAPTURED_SQL AS&lt;br /&gt;WITH&lt;br /&gt;captured_schema AS&lt;br /&gt;(SELECT SCHEMA_ID&lt;br /&gt;   FROM mgv_all_schema&lt;br /&gt;  WHERE connection_id IN&lt;br /&gt;  (SELECT ID FROM md_connections WHERE NVL(type,'Captured') != 'CONVERTED')),&lt;br /&gt;captured_connections AS&lt;br /&gt;(SELECT ID FROM md_connections WHERE NVL(type,'Captured') != 'CONVERTED') ,&lt;br /&gt;captured_view_trigger AS&lt;br /&gt;(SELECT v.trigger_id vt&lt;br /&gt;   FROM mgv_all_view_triggers v&lt;br /&gt;  WHERE v.connection_id IN&lt;br /&gt;  (SELECT * FROM captured_connections)) ,&lt;br /&gt;captured_table_trigger AS&lt;br /&gt;(SELECT t.trigger_id tt&lt;br /&gt;   FROM mgv_all_table_triggers t&lt;br /&gt;  WHERE t.connection_id IN&lt;br /&gt;  (SELECT * FROM captured_connections))&lt;br /&gt;SELECT ID,'md_stored_programs' ObjType, Name objectName, native_sql&lt;br /&gt; FROM md_stored_programs,&lt;br /&gt;captured_schema&lt;br /&gt;WHERE language = 'MSTSQL'&lt;br /&gt;  AND SCHEMA_ID_FK = captured_schema.schema_id&lt;br /&gt;UNION ALL&lt;br /&gt;SELECT ID,'md_views' ObjType, view_Name objectName, native_sql&lt;br /&gt; FROM md_views,&lt;br /&gt;captured_schema&lt;br /&gt;WHERE language = 'MSTSQL'&lt;br /&gt;  AND SCHEMA_ID_FK = captured_schema.schema_id&lt;br /&gt;UNION ALL&lt;br /&gt;SELECT ID,'md_triggers' ObjType, trigger_Name objectName, native_sql&lt;br /&gt; FROM md_triggers&lt;br /&gt;WHERE language = 'MSTSQL'&lt;br /&gt;  AND (md_triggers.id in (select vt from captured_view_trigger union select tt from captured_table_trigger  ));&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;This view lists the procedures,function,views and triggers in the captured model.&lt;br /&gt;Using it we can update those objects SQL.&lt;br /&gt;&lt;br /&gt;&lt;pre style="border: 1px dashed rgb(153, 153, 153); padding: 5px; overflow: auto; font-family: Andale Mono,Lucida Console,Monaco,fixed,monospace; color: rgb(0, 0, 0); background-color: rgb(238, 238, 238); font-size: 12px; line-height: 14px; width: 100%;"&gt;&lt;code&gt;update md_views&lt;br /&gt;set native_sql = replace(native_sql, 'noexpand', 'noexpand nolock')&lt;br /&gt;where id in ( select id from mgv_all_captured_sql where native_sql like '%noexpand%') ;&lt;br /&gt;&lt;br /&gt;update md_stored_programs&lt;br /&gt;set native_sql = replace(native_sql, 'noexpand', 'noexpand nolock')&lt;br /&gt;where id in ( select id from mgv_all_captured_sql where native_sql like '%noexpand%') ;&lt;br /&gt;&lt;br /&gt;update md_triggers&lt;br /&gt;set native_sql = replace(native_sql, 'noexpand', 'noexpand nolock')&lt;br /&gt;where id in ( select id from mgv_all_captured_sql where native_sql like '%noexpand%');&lt;br /&gt;&lt;br /&gt;commit;&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;In the above example I'm replacing all occurances of "noexpand" with "noexpand nolock". This is a bug in 1.5 (fixed for 1.5.1.) where the Microsoft documentation of noexpand is not complete. I needed to add "nolock" after noexpand for the translator to recognize the syntax.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7984768457924132022-5150190252776761743?l=dermotoneill.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7984768457924132022/posts/default/5150190252776761743'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7984768457924132022/posts/default/5150190252776761743'/><link rel='alternate' type='text/html' href='http://dermotoneill.blogspot.com/2008/05/search-replace-sql-within-repository.html' title='Search &amp; Replace SQL within the Repository'/><author><name>Dermot O'Neill</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-7984768457924132022.post-6885671688350503939</id><published>2008-05-13T04:28:00.000-07:00</published><updated>2008-06-20T04:41:36.228-07:00</updated><title type='text'>Quick Start to Migrating your  SQL Server or Sybase  Database</title><content type='html'>&lt;span style="font-weight: bold;"&gt;** A better guide for SQL Developer 1.5.1 can be found &lt;/span&gt;&lt;a style="font-weight: bold;" href="http://dermotoneill.blogspot.com/2008/06/sql-developer-migration-workbench-151_11.html"&gt;here&lt;/a&gt;&lt;span style="font-weight: bold;"&gt; **&lt;/span&gt;&lt;br /&gt;Ill outline the steps I would use to migrate a SQL Server or Sybase database to Oracle.&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Download the latest version of &lt;a href="http://www.oracle.com/technology/software/products/sql/index.html"&gt;SQL Developer&lt;/a&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Download &lt;a href="http://sourceforge.net/project/showfiles.php?group_id=33291"&gt;JTDS 1.2&lt;/a&gt;&lt;/li&gt;&lt;li&gt;Download and Install &lt;a href="http://www.oracle.com/technology/software/products/database/xe/index.html"&gt;Oracle XE&lt;/a&gt; if you dont have access to an exiting Oracle database.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;UnZip SQL Developer into its own directory (for example "SQLDev")&lt;/li&gt;&lt;li style="text-align: left; font-style: italic;"&gt;Don't use an existing ORACLE_HOME or ORACLE directory&lt;/li&gt;&lt;li&gt;Extract the JTDS jar file (jtds-1.2.jar) to a handy directory (SQLDev is fine)&lt;/li&gt;&lt;li&gt;Create the &lt;a href="http://dermotoneill.blogspot.com/2008/05/protocol-violation-capturing-issues.html"&gt;sqldeveloper.cmd&lt;/a&gt; file just to make double sure&lt;/li&gt;&lt;li&gt;Double click the sqldeveloper.cmd file to launch SQL Developer&lt;/li&gt;&lt;li&gt;Setup the jtds driver with SQL Developer&lt;/li&gt;&lt;li style="text-align: left;"&gt;&lt;span style="font-style: italic;"&gt;Tools&gt; Preferences &gt; Database &gt; Third Party JDBC Drivers. Add the JTDS jar file&lt;/span&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Create a connection to &lt;a href="http://www.oracle.com/technology/tech/migration/workbench/viewlets/sqlserverconnlauncher.html"&gt;SQL Server/Sybase&lt;/a&gt;&lt;/li&gt;&lt;li&gt;Create a connection to your Oracle database&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Create a new schema for  the migration repository (MIGREP)&lt;/li&gt;&lt;li style="text-align: left; font-style: italic;"&gt;GRANT DBA TO MIGREP IDENTIFIED BY MIGREP&lt;/li&gt;&lt;li style="text-align: left;"&gt;Create a connection to your migration repository schema (MIGREP)&lt;/li&gt;&lt;li style="text-align: left;"&gt;Associate the migration repository with this schema&lt;/li&gt;&lt;li style="text-align: left;"&gt;&lt;span style="font-style: italic;"&gt;Right Click the migration repository connection (MIGREP), Migration Repository &gt; Associate Migration Repository&lt;/span&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Browse the SQL Server/Sybase database&lt;/li&gt;&lt;li&gt;Setup the "Is Quoted Identifier On" &lt;a href="http://dermotoneill.blogspot.com/2008/04/sql-dev-15-migration-tip.html"&gt;preference&lt;/a&gt;&lt;/li&gt;&lt;li&gt;Setup the &lt;a href="http://dermotoneill.blogspot.com/2008/05/sql-server-datetime-to-oracle-date.html"&gt;DATETIME to DATE format mask&lt;/a&gt; if required&lt;/li&gt;&lt;li&gt;Setup the &lt;a href="http://dermotoneill.blogspot.com/2008/05/offline-blob-data-move.html"&gt;Offline BLOB data move preference&lt;/a&gt; if required&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Capture the SQL Server/Sybase database (&lt;span style="font-style: italic;"&gt;dont use Quick Migrate!&lt;/span&gt;) .&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-style: italic;"&gt;Note there is an &lt;/span&gt;&lt;a style="font-style: italic;" href="http://www.oracle.com/technology/tech/migration/workbench/viewlets/oflauncher.html"&gt;offline capture&lt;/a&gt;&lt;span style="font-style: italic;"&gt; available as well if you cannot directly connect to your SQL Server/Sybase database&lt;/span&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Save the Captured Dialog Text (&lt;span style="font-style: italic;"&gt;Handy to have a list of captured number or objects&lt;/span&gt;)&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Identify any Capture Issues and Resolve (there shouldn't be any!)&lt;/li&gt;&lt;li&gt;Browse the Captured Model&lt;/li&gt;&lt;li&gt;Convert the Captured Model to the Oracle Model&lt;/li&gt;&lt;li&gt;Save the Converted Dialog Text (&lt;span style="font-style: italic;"&gt;Handy to have a list of converted number of objects&lt;/span&gt;)&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Save the Migration Log &lt;/li&gt;&lt;li&gt;Identify any Convert Issues and &lt;a href="http://dermotoneill.blogspot.com/2008/04/what-to-do-if-proceduretriggerview.html"&gt;Resolve&lt;/a&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;"Generate" the Migration scripts&lt;/li&gt;&lt;li&gt;Run the Scripts using the SQL Worksheet to create your Oracle database.&lt;/li&gt;&lt;li&gt;Save the Result of the Generation Script&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Identify and Generation Issues and Resolve them in your Oracle database.&lt;/li&gt;&lt;li&gt;Verify that all the objects in your SQL Server/Sybase database are present and valid in your Oracle database&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Data Move for small dataset  (&lt;100mb),&gt;&lt;/li&gt;&lt;li&gt;Data Move for large dataset (&gt;100mb) , use the &lt;a href="http://www.oracle.com/technology/tech/migration/workbench/viewlets/ofdm.html"&gt;offline datamove&lt;/a&gt;&lt;/li&gt;&lt;li&gt;Test, Verify and Tune your database&lt;/li&gt;&lt;/ul&gt;Heres a &lt;a href="http://www.oracle.com/technology/tech/migration/workbench/viewlets/sqlserver.html"&gt;viewlet&lt;/a&gt; made using SQL Dev 1.2.1 migrating a SQL Server database.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7984768457924132022-6885671688350503939?l=dermotoneill.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7984768457924132022/posts/default/6885671688350503939'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7984768457924132022/posts/default/6885671688350503939'/><link rel='alternate' type='text/html' href='http://dermotoneill.blogspot.com/2008/05/migrate-sql-server-or-sybase-quick.html' title='Quick Start to Migrating your  SQL Server or Sybase  Database'/><author><name>Dermot O'Neill</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-7984768457924132022.post-2947927100111483800</id><published>2008-05-07T06:25:00.000-07:00</published><updated>2008-06-12T08:23:00.423-07:00</updated><title type='text'>Protocol Violation / Capturing Issues</title><content type='html'>&lt;span style="font-weight: bold;"&gt;**Update:This is now fixed in SQL Developer 1.5.1**&lt;/span&gt;&lt;br /&gt;Some SQL Developer Migration Workbench users are experiencing issues capturing.&lt;br /&gt;The migration log may have a Protocol Violation exception reported.&lt;br /&gt;&lt;br /&gt;There seems to be an issue with some ORACLE_HOME versions installed on the same PC as SQL Developer.&lt;br /&gt;To ensure that the SQL Developer Migration Workbench uses the shipped JDBC drivers and nothing from the existing ORACLE_HOME use this little script.&lt;br /&gt;&lt;br /&gt;The workaround is to tell SQL Developer to ignore the ORACLE_HOME so that it has to reference the shipped JDBC drivers.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;1) Close SQL Developer&lt;br /&gt;2) Create a sqldeveloper.cmd file in the SQL Developer root directory&lt;br /&gt;3) With the following contents&lt;br /&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;SET ORACLE_HOME=%CD%&lt;br /&gt;start sqldeveloper.exe&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;4) Run sqldeveloper.cmd&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;We are looking into what causes this issue, but for the moment the above is the workaround.&lt;br /&gt;This solution was originally suggested on the otn forums&lt;br /&gt;http://forums.oracle.com/forums/thread.jspa?messageID=2058411�&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7984768457924132022-2947927100111483800?l=dermotoneill.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7984768457924132022/posts/default/2947927100111483800'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7984768457924132022/posts/default/2947927100111483800'/><link rel='alternate' type='text/html' href='http://dermotoneill.blogspot.com/2008/05/protocol-violation-capturing-issues.html' title='Protocol Violation / Capturing Issues'/><author><name>Dermot O'Neill</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-7984768457924132022.post-3612862537600328018</id><published>2008-05-07T02:22:00.000-07:00</published><updated>2008-06-11T09:52:53.111-07:00</updated><title type='text'>Sybase Identity Columns Bug / Workaround</title><content type='html'>&lt;span style="font-weight:bold;"&gt;**Update:This is now fixed in SQL Developer 1.5.1.**&lt;/span&gt;&lt;br /&gt;Bug Alert! Identity Columns are not converted correctly for Sybase in SQL Developer 1.5.&lt;br /&gt;Heres how it should be done manually till we get it fixed.&lt;br /&gt;&lt;br /&gt;Replace  columname and tablename  with the identity column details.&lt;br /&gt;&lt;br /&gt;&lt;pre style="border: 1px dashed rgb(153, 153, 153); padding: 5px; overflow: auto; font-family: Andale Mono,Lucida Console,Monaco,fixed,monospace; color: rgb(0, 0, 0); background-color: rgb(238, 238, 238); font-size: 12px; line-height: 14px; width: 100%;"&gt;&lt;code&gt;CREATE SEQUENCE  &amp;lt;tablename&amp;gt;_&amp;lt;columnname&amp;gt;_SEQ&lt;br /&gt; MINVALUE 1 MAXVALUE 999999999999999999999999 INCREMENT BY 1  NOCYCLE ;&lt;br /&gt;&lt;br /&gt;CREATE OR REPLACE TRIGGER &amp;lt;tablename&amp;gt;_&amp;lt;columnname&amp;gt;_TRG BEFORE INSERT OR UPDATE ON &amp;lt;tablename&amp;gt;&lt;br /&gt;FOR EACH ROW&lt;br /&gt;DECLARE&lt;br /&gt;v_newVal NUMBER(12) := 0;&lt;br /&gt;v_incval NUMBER(12) := 0;&lt;br /&gt;BEGIN&lt;br /&gt; IF INSERTING AND :new.&amp;lt;columnname&amp;gt; IS NULL THEN&lt;br /&gt;   SELECT  &amp;lt;tablename&amp;gt;_&amp;lt;columnname&amp;gt;_SEQ.NEXTVAL INTO v_newVal FROM DUAL;&lt;br /&gt;   -- If this is the first time this table have been inserted into (sequence == 1)&lt;br /&gt;   IF v_newVal = 1 THEN&lt;br /&gt;     --get the max indentity value from the table&lt;br /&gt;     SELECT NVL(max(&amp;lt;columnname&amp;gt;),0) INTO v_newVal FROM &amp;lt;tablename&amp;gt;;&lt;br /&gt;     v_newVal := v_newVal + 1;&lt;br /&gt;     --set the sequence to that value&lt;br /&gt;     LOOP&lt;br /&gt;          EXIT WHEN v_incval&amp;gt;=v_newVal;&lt;br /&gt;          SELECT &amp;lt;tablename&amp;gt;_&amp;lt;columnname&amp;gt;_SEQ.nextval INTO v_incval FROM dual;&lt;br /&gt;     END LOOP;&lt;br /&gt;   END IF;&lt;br /&gt;   -- save this to emulate @@identity&lt;br /&gt;  sybase_utilities.identity := v_newVal;&lt;br /&gt;  -- assign the value from the sequence to emulate the identity column&lt;br /&gt;  :new.&amp;lt;columnname&amp;gt; := v_newVal;&lt;br /&gt; END IF;&lt;br /&gt;END;&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;We should have this automated in the next release.&lt;br /&gt;&lt;br /&gt;Note I used this great tool to format the code in this blog&lt;br /&gt;http://formatmysourcecode.blogspot.com/&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7984768457924132022-3612862537600328018?l=dermotoneill.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7984768457924132022/posts/default/3612862537600328018'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7984768457924132022/posts/default/3612862537600328018'/><link rel='alternate' type='text/html' href='http://dermotoneill.blogspot.com/2008/05/sybase-identity-columns-bug-workaround.html' title='Sybase Identity Columns Bug / Workaround'/><author><name>Dermot O'Neill</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-7984768457924132022.post-8177501375869162150</id><published>2008-05-06T06:18:00.000-07:00</published><updated>2008-12-10T15:37:05.850-08:00</updated><title type='text'>SQL Server DATETIME TO  Oracle DATE</title><content type='html'>&lt;span style="font-weight:bold;"&gt;**Update:There is a better, more consistent solution in SQL Developer 1.5.1**&lt;/span&gt;&lt;br /&gt;Offline Datamove involves using SQL Server/Sybase BCP tool to dump out the data in the tables into dat files. Then Oracles SQL*Loader is used to load the data into Oracle.&lt;br /&gt;This is the recommended approach when dealing with large datasets, as BCP and SQL*Loader are designed for datamove.&lt;br /&gt;Also SQL Developer will create the scripts for you, so you don't have to manually create them.&lt;br /&gt;&lt;br /&gt;One issue that has cropped up is moving DATETIME values to DATE.&lt;br /&gt;SQL Server/ Sybase DATETIME has millisecond precision. Oracle has the TIMESTAMP datatype to hold millisecond values. But sometimes you just want to convert from DATETIME to DATE and ignore the milliseconds as they are not important.&lt;br /&gt;&lt;br /&gt;To do this you can specify in the date format mask to ignore any values after the second value. Use dots '.' to do this job.&lt;br /&gt;Date Mask :yyyy-mm-dd HH24:mi:ss......&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_H4TtZUn_Tz8/SCBdyuO55vI/AAAAAAAACGc/0jJ1D8IJ9Nc/s1600-h/pref.png"&gt;&lt;img style="cursor: pointer;" src="http://2.bp.blogspot.com/_H4TtZUn_Tz8/SCBdyuO55vI/AAAAAAAACGc/0jJ1D8IJ9Nc/s320/pref.png" alt="" id="BLOGGER_PHOTO_ID_5197257095970940658" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The SQL*Loader scripts will include this format mask around each of the DATETIME column values being loaded.&lt;br /&gt;&lt;br /&gt;If you dont specify in the format mask to ignore the millisecond values , SQL*Loader will not recognize the DATETIME values in the dat files.&lt;br /&gt;&lt;br /&gt;Note: The old OMWB used to create a view in the source database todo this, but this solution is allot neater.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7984768457924132022-8177501375869162150?l=dermotoneill.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7984768457924132022/posts/default/8177501375869162150'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7984768457924132022/posts/default/8177501375869162150'/><link rel='alternate' type='text/html' href='http://dermotoneill.blogspot.com/2008/05/sql-server-datetime-to-oracle-date.html' title='SQL Server DATETIME TO  Oracle DATE'/><author><name>Dermot O'Neill</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_H4TtZUn_Tz8/SCBdyuO55vI/AAAAAAAACGc/0jJ1D8IJ9Nc/s72-c/pref.png' height='72' width='72'/></entry><entry><id>tag:blogger.com,1999:blog-7984768457924132022.post-5540367772923134996</id><published>2008-04-30T03:55:00.000-07:00</published><updated>2008-05-07T05:25:04.030-07:00</updated><title type='text'>Dynamic SQL</title><content type='html'>Dynamic SQL can be tricky to translate. Imagine the following T-SQL&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;EXECUTE("SELECT TOP 10 " + @selectList + "FROM table1,"+@newTableName + " WHERE "+@condition1);&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Gets Translated to &lt;br /&gt;&lt;pre&gt;&lt;br /&gt;BEGIN&lt;br /&gt;   EXECUTE IMMEDIATE 'SELECT TOP 10 ' || v_selectList || 'FROM table1,' || v_newTableName || ' WHERE ' || v_condition1;&lt;br /&gt;END;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Our translator is designed to recognize and translate valid T-SQL. But the SQL within the strings that make up the execute statement is not complete, therefore its not valid SQL that the translator can work with. How should it translate "SELECT TOP 10" ?&lt;br /&gt;&lt;br /&gt;As a whole the Execute statement is valid, but in the eyes of the translator it cant do much with it. So the translator does not translate dynamic SQL. This has to be manually performed. &lt;br /&gt;But there is help!&lt;br /&gt;&lt;br /&gt;Take the Dynamic SQL String and create a valid, complete SQL Statement from it.&lt;br /&gt;I added in "dummy" values to make up for the missing pieces.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;SELECT TOP 10 dummycol/*@selectList*/ FROM table1 , dummytable/*@newTableName*/ WHERE dummycondition = true/*@condition1*/&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Pop it in the Translation Scratch Editor and translate.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;SELECT dummycol&lt;br /&gt;  /*@selectList*/FROM table1 ,&lt;br /&gt;       dummytable&lt;br /&gt;   /*@newTableName*/WHERE dummycodition = TRUE/*@condition1*/ AND ROWNUM &lt;= 10;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;I would used q'# .... #' to define the string.&lt;br /&gt;http://download.oracle.com/docs/cd/B28359_01/server.111/b28286/sql_elements003.htm#i11223&lt;br /&gt;This just allows me to use single quotes within string literal, so I don't have to escape each one. In this example its not required.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;BEGIN&lt;br /&gt;   EXECUTE IMMEDIATE 'SELECT'||v_selectList ||'FROM table1 ,'|| v_newTableName || 'WHERE '||v_condition1 || ' AND ROWNUM &lt;= 10';&lt;br /&gt;END;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;This is a small example so you may be quicker just translating the Dynamic SQL by hand. The process gets handy when you have a larger Dynamic SQL Statement.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7984768457924132022-5540367772923134996?l=dermotoneill.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7984768457924132022/posts/default/5540367772923134996'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7984768457924132022/posts/default/5540367772923134996'/><link rel='alternate' type='text/html' href='http://dermotoneill.blogspot.com/2008/04/dynamic-sql.html' title='Dynamic SQL'/><author><name>Dermot O'Neill</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-7984768457924132022.post-5229962835472998889</id><published>2008-04-23T06:51:00.000-07:00</published><updated>2008-04-23T07:03:51.382-07:00</updated><title type='text'>What to do if a procedure/trigger/view fails to convert</title><content type='html'>Sometimes a procedure, function, trigger or view will fail to convert. An error will popup in the migration log "Failed to convert  blah blah".  The case maybe that the object is hundreds of lines long but one line is causing the translator to fail.&lt;br /&gt;&lt;br /&gt;Heres how I go about identifying that problematic clause so you can continue the migration.&lt;br /&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Copy the ddl into the Translation Scratch Editor (Migrations&gt; Translation Scratch Editor)(TSE)&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Select the correct translator from the  TSE toolbar.&lt;/li&gt;&lt;li&gt;Translate it&lt;/li&gt;&lt;li&gt;If it translates , then you can use the converted PL/SQL as the starting point. Paste it into your converted model, report the bug and continue with your migration.&lt;/li&gt;&lt;li&gt;If it fails, then I comment out half of the statements (still leaving valid T-SQL, dont cut words or statements in half :) )&lt;/li&gt;&lt;li&gt;Keep commenting out parts of the objects ddl until you it translates and you have comented out a particular statement or clause. You can then paste the generated PL/SQL into your converted model, log a bug and continue your migration.&lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;Often there is 1 style of syntax that the translator doesnt recognize, but because the same developer wrote many of the procedures, the same syntax occurs again and again. Once you can recognize what the issue is, you can modify the captured model suitably and then report a bug so that it can be automated  in the next release.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7984768457924132022-5229962835472998889?l=dermotoneill.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7984768457924132022/posts/default/5229962835472998889'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7984768457924132022/posts/default/5229962835472998889'/><link rel='alternate' type='text/html' href='http://dermotoneill.blogspot.com/2008/04/what-to-do-if-proceduretriggerview.html' title='What to do if a procedure/trigger/view fails to convert'/><author><name>Dermot O'Neill</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-7984768457924132022.post-2765770274833115924</id><published>2008-04-23T05:41:00.000-07:00</published><updated>2008-12-10T15:37:06.093-08:00</updated><title type='text'>SQL Dev 1.5 Migration Tip</title><content type='html'>Sybase and SQL Server have an option to called "is quoted identifier on".&lt;br /&gt;When ON, double quotes can be used to reference identifiers (tables,columns,....).&lt;br /&gt;When OFF, double quotes means string literals ("Hello World").&lt;br /&gt;&lt;br /&gt;In the past this caused no end of problems when translating to PL/SQL , as our translator had to guess if a double quote was referencing a identifier or a string.&lt;br /&gt;For Example what does this mean ?&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;SELECT "col1" from table1&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Is "col1" a column in table1 or is it string? In PL/SQL strings are defined using single quotes and identifiers are convert so that they are case insensitive (without double quotes).&lt;br /&gt;&lt;br /&gt;Pre 1.5 the translator would look at the context the double quotes where used and make a best guess.&lt;br /&gt;&lt;br /&gt;In 1.5 we changed this so that the translator can be more accurate.&lt;br /&gt;There is a new preference&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_H4TtZUn_Tz8/SA8wIOO55uI/AAAAAAAACFc/aOOKIMKizDQ/s1600-h/identifier_preference.png"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer;" src="http://3.bp.blogspot.com/_H4TtZUn_Tz8/SA8wIOO55uI/AAAAAAAACFc/aOOKIMKizDQ/s320/identifier_preference.png" alt="" id="BLOGGER_PHOTO_ID_5192421813199169250" border="0" /&gt;&lt;/a&gt; By Default (like the SQL Server and Sybase) it is on. So double quotes are recognized in T-SQL as identifiers.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;If the database your migrating  uses double quotes as strings, then unclick this option before converting or attempting a quick migrate.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;You will run into convert issues if this option is not set correctly.  I have added a note to the doc but as this is a bit of a gotcha in 1.5 I thought Id blog it.&lt;br /&gt;&lt;br /&gt;Note, that Alias can still be defined using double quotes and the translator recognizes them correctly.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Ref:&lt;br /&gt;&lt;tt&gt;&lt;i&gt;http://msdn2.microsoft.com/en-us/library/aa259228(SQL.80).aspx&lt;br /&gt;&lt;/i&gt;&lt;/tt&gt;&lt;tt&gt;&lt;i&gt;http://manuals.sybase.com/onlinebooks/group-as/asg1250e/refman/@Generic__BookT&lt;/i&gt;&lt;i&gt;extView/25659;pt=26021&lt;/i&gt;&lt;/tt&gt;&lt;br /&gt;&lt;tt&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/tt&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7984768457924132022-2765770274833115924?l=dermotoneill.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7984768457924132022/posts/default/2765770274833115924'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7984768457924132022/posts/default/2765770274833115924'/><link rel='alternate' type='text/html' href='http://dermotoneill.blogspot.com/2008/04/sql-dev-15-migration-tip.html' title='SQL Dev 1.5 Migration Tip'/><author><name>Dermot O'Neill</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_H4TtZUn_Tz8/SA8wIOO55uI/AAAAAAAACFc/aOOKIMKizDQ/s72-c/identifier_preference.png' height='72' width='72'/></entry></feed>
