<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Convert varchar2 columns to nvarchar2 in Data Management Questions</title>
    <link>https://community.esri.com/t5/data-management-questions/convert-varchar2-columns-to-nvarchar2/m-p/117862#M6709</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;SDE is version 10, SP2.&amp;nbsp; We're using SDEBINARY for our geometry storage type.&amp;nbsp; ArcGIS is version 10, SP3.&amp;nbsp; Our building permitting application has an SDEListener application which reads GIS data at runtime. That SDEListener is built by our vendor with a requirement for NVARCHAR2 text columns.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Your solution sounds complicated, but doable.&amp;nbsp; I'm assuming to do it properly I will have to compress back to state 0, to ensure I have no records in the add/delete tables.&amp;nbsp; It also won't be very quick.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Is there a way to fix the fragmentation caused by an in-situ conversion?&amp;nbsp; I have very little time to do this, and writing a script to simply convert every column on every feature class would be faster for me, based on my lack of experience with your suggestion.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regardless, thanks.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;What version of ArcSDE are you using?&amp;nbsp; Which service pack has been applied?&amp;nbsp; What geometry &lt;BR /&gt;storage type are you using?&lt;BR /&gt; &lt;BR /&gt;What version of ArcGIS are you using?&amp;nbsp; Which Service Pack?&lt;BR /&gt; &lt;BR /&gt;What application requires NVARCHAR2 columns? (Last I heard, Oracle recommended *against* &lt;BR /&gt;using NVARCHAR2 if most of the characters are ACSII7.)&lt;BR /&gt; &lt;BR /&gt;Doing a this sort of conversion in-situ is going to fracture your table, causing lots of fragmentation.&lt;BR /&gt;The best way to implement the change is to copy the table contents with a "CREATE TABLE backup&lt;BR /&gt;AS SELECT * FROM original", TRUNCATE the original, drop the indexes, do ALTERs until the schema &lt;BR /&gt;is correct, then INSERT via a SELECT and rebuild indexes.&amp;nbsp; You'll probably want to add a proper &lt;BR /&gt;foreign key based on the old OBJECTID while you're at it.&amp;nbsp; In a perfect world, you'd reorder the &lt;BR /&gt;rows to defragment the features spatially at the same time (via an ORDER BY during INSERT), but &lt;BR /&gt;that depends on geometry storage. &lt;BR /&gt; &lt;BR /&gt;- V&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 27 Dec 2011 13:51:23 GMT</pubDate>
    <dc:creator>ShawnHolyoak</dc:creator>
    <dc:date>2011-12-27T13:51:23Z</dc:date>
    <item>
      <title>Convert varchar2 columns to nvarchar2</title>
      <link>https://community.esri.com/t5/data-management-questions/convert-varchar2-columns-to-nvarchar2/m-p/117859#M6706</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Is there a simple way to convert existing varchar2 columns in Oracle to nvarchar2?&amp;nbsp; The application we're using requires nvarchar2 columns, but of course, all of our data was created when the DEFAULTS keyword set the string column type to varchar2.&amp;nbsp; Manually it takes forever, and I didn't want to have to write an add in to do the conversion if I don't have to.&amp;nbsp; Am I missing something simple?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Dec 2011 09:45:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/convert-varchar2-columns-to-nvarchar2/m-p/117859#M6706</guid>
      <dc:creator>ShawnHolyoak</dc:creator>
      <dc:date>2011-12-22T09:45:10Z</dc:date>
    </item>
    <item>
      <title>Re: Convert varchar2 columns to nvarchar2</title>
      <link>https://community.esri.com/t5/data-management-questions/convert-varchar2-columns-to-nvarchar2/m-p/117860#M6707</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Should mention that I can't just export and import the feature classes, as our application programmers used ObjectId as the uniqueid.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 25 Dec 2011 15:28:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/convert-varchar2-columns-to-nvarchar2/m-p/117860#M6707</guid>
      <dc:creator>ShawnHolyoak</dc:creator>
      <dc:date>2011-12-25T15:28:57Z</dc:date>
    </item>
    <item>
      <title>Re: Convert varchar2 columns to nvarchar2</title>
      <link>https://community.esri.com/t5/data-management-questions/convert-varchar2-columns-to-nvarchar2/m-p/117861#M6708</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;What version of ArcSDE are you using?&amp;nbsp; Which service pack has been applied?&amp;nbsp; What geometry &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;storage type are you using?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;What version of ArcGIS are you using?&amp;nbsp; Which Service Pack?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;What application requires NVARCHAR2 columns? (Last I heard, Oracle recommended *against* &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;using NVARCHAR2 if most of the characters are ACSII7.)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Doing a this sort of conversion in-situ is going to fracture your table, causing lots of fragmentation.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The best way to implement the change is to copy the table contents with a "CREATE TABLE backup&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;AS SELECT * FROM original", TRUNCATE the original, drop the indexes, do ALTERs until the schema &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;is correct, then INSERT via a SELECT and rebuild indexes.&amp;nbsp; You'll probably want to add a proper &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;foreign key based on the old OBJECTID while you're at it.&amp;nbsp; In a perfect world, you'd reorder the &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;rows to defragment the features spatially at the same time (via an ORDER BY during INSERT), but &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;that depends on geometry storage. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;- V&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Dec 2011 11:08:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/convert-varchar2-columns-to-nvarchar2/m-p/117861#M6708</guid>
      <dc:creator>VinceAngelo</dc:creator>
      <dc:date>2011-12-27T11:08:19Z</dc:date>
    </item>
    <item>
      <title>Re: Convert varchar2 columns to nvarchar2</title>
      <link>https://community.esri.com/t5/data-management-questions/convert-varchar2-columns-to-nvarchar2/m-p/117862#M6709</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;SDE is version 10, SP2.&amp;nbsp; We're using SDEBINARY for our geometry storage type.&amp;nbsp; ArcGIS is version 10, SP3.&amp;nbsp; Our building permitting application has an SDEListener application which reads GIS data at runtime. That SDEListener is built by our vendor with a requirement for NVARCHAR2 text columns.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Your solution sounds complicated, but doable.&amp;nbsp; I'm assuming to do it properly I will have to compress back to state 0, to ensure I have no records in the add/delete tables.&amp;nbsp; It also won't be very quick.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Is there a way to fix the fragmentation caused by an in-situ conversion?&amp;nbsp; I have very little time to do this, and writing a script to simply convert every column on every feature class would be faster for me, based on my lack of experience with your suggestion.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regardless, thanks.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;What version of ArcSDE are you using?&amp;nbsp; Which service pack has been applied?&amp;nbsp; What geometry &lt;BR /&gt;storage type are you using?&lt;BR /&gt; &lt;BR /&gt;What version of ArcGIS are you using?&amp;nbsp; Which Service Pack?&lt;BR /&gt; &lt;BR /&gt;What application requires NVARCHAR2 columns? (Last I heard, Oracle recommended *against* &lt;BR /&gt;using NVARCHAR2 if most of the characters are ACSII7.)&lt;BR /&gt; &lt;BR /&gt;Doing a this sort of conversion in-situ is going to fracture your table, causing lots of fragmentation.&lt;BR /&gt;The best way to implement the change is to copy the table contents with a "CREATE TABLE backup&lt;BR /&gt;AS SELECT * FROM original", TRUNCATE the original, drop the indexes, do ALTERs until the schema &lt;BR /&gt;is correct, then INSERT via a SELECT and rebuild indexes.&amp;nbsp; You'll probably want to add a proper &lt;BR /&gt;foreign key based on the old OBJECTID while you're at it.&amp;nbsp; In a perfect world, you'd reorder the &lt;BR /&gt;rows to defragment the features spatially at the same time (via an ORDER BY during INSERT), but &lt;BR /&gt;that depends on geometry storage. &lt;BR /&gt; &lt;BR /&gt;- V&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Dec 2011 13:51:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/convert-varchar2-columns-to-nvarchar2/m-p/117862#M6709</guid>
      <dc:creator>ShawnHolyoak</dc:creator>
      <dc:date>2011-12-27T13:51:23Z</dc:date>
    </item>
    <item>
      <title>Re: Convert varchar2 columns to nvarchar2</title>
      <link>https://community.esri.com/t5/data-management-questions/convert-varchar2-columns-to-nvarchar2/m-p/117863#M6710</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;SDEBINARY storage isn't really supported on Oracle 10g due to issues with LONG RAW deprecation,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;and isn't *possible* with 11g (Oracle support for 10g ended in the first half of 2011).&amp;nbsp; ST_GEOMETRY&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;is generally faster than SDELOB storage (due to elimination of the F table).&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;There is no way to defragment tables fractured by in-situ conversion (without truncating and repopulating&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;them, of course).&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Doing the job right is going to take longer than doing it quick, but it should save time in the long run&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;as the time savings on each query result adds up.&amp;nbsp; At a minimum, you should start planning for an&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;11g/ST_GEOMETRY/ArcGIS 10.1 upgrade.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;- V&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Dec 2011 17:27:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/convert-varchar2-columns-to-nvarchar2/m-p/117863#M6710</guid>
      <dc:creator>VinceAngelo</dc:creator>
      <dc:date>2011-12-27T17:27:03Z</dc:date>
    </item>
    <item>
      <title>Re: Convert varchar2 columns to nvarchar2</title>
      <link>https://community.esri.com/t5/data-management-questions/convert-varchar2-columns-to-nvarchar2/m-p/117864#M6711</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks for your answers.&amp;nbsp; We are in the planning phase of moving to ST_GEOMETRY, for various reasons.&amp;nbsp; We'll now add another.&amp;nbsp; I guess I'll also start planning the upgrade for each feature class.&amp;nbsp; My DBA has confirmed he can do the truncate/alter/insert without problem.&amp;nbsp; We now just need to prepare our permitting system to use a real unique id, and identify a method of maintaining that unique id.&amp;nbsp; Thanks again.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;SDEBINARY storage isn't really supported on Oracle 10g due to issues with LONG RAW deprecation,&lt;BR /&gt;and isn't *possible* with 11g (Oracle support for 10g ended in the first half of 2011).&amp;nbsp; ST_GEOMETRY&lt;BR /&gt;is generally faster than SDELOB storage (due to elimination of the F table).&lt;BR /&gt; &lt;BR /&gt;There is no way to defragment tables fractured by in-situ conversion (without truncating and repopulating&lt;BR /&gt;them, of course).&lt;BR /&gt; &lt;BR /&gt;Doing the job right is going to take longer than doing it quick, but it should save time in the long run&lt;BR /&gt;as the time savings on each query result adds up.&amp;nbsp; At a minimum, you should start planning for an&lt;BR /&gt;11g/ST_GEOMETRY/ArcGIS 10.1 upgrade.&lt;BR /&gt; &lt;BR /&gt;- V&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Dec 2011 18:35:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/convert-varchar2-columns-to-nvarchar2/m-p/117864#M6711</guid>
      <dc:creator>ShawnHolyoak</dc:creator>
      <dc:date>2011-12-27T18:35:31Z</dc:date>
    </item>
    <item>
      <title>Re: Convert varchar2 columns to nvarchar2</title>
      <link>https://community.esri.com/t5/data-management-questions/convert-varchar2-columns-to-nvarchar2/m-p/117865#M6712</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;You can use a variant of the method ArcSDE uses to maintain OBJECTID rowid columns to&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;maintain your independent IDs. ArcSDE shifted from a simple sequence because of the&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;performance cost during bulk insert, but if you're not doing much bulk assignment, then&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;a simple sequence may be the way to go.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;- V&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Note: If you use the TRUNCATE/ALTER/INSERT procedure, you'll need to run an 'sdetable&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;-o describe' as the owner on each table to correct the internal SDE.COLUMN_INFO type&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;codes.&amp;nbsp; You'll also want to prototype this with a trivial layer, to make sure ArcGIS doesn't &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;object to the type change.&amp;nbsp; This is especially true for versioned tables.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Dec 2011 19:01:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/convert-varchar2-columns-to-nvarchar2/m-p/117865#M6712</guid>
      <dc:creator>VinceAngelo</dc:creator>
      <dc:date>2011-12-27T19:01:45Z</dc:date>
    </item>
    <item>
      <title>Re: Convert varchar2 columns to nvarchar2</title>
      <link>https://community.esri.com/t5/data-management-questions/convert-varchar2-columns-to-nvarchar2/m-p/117866#M6713</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;We are planning on using sequences, as they're so simple.&amp;nbsp; Thanks for the warning on needing to run the 'describe'; I would have missed that.&amp;nbsp; I've run into another concern, though, and that's related to archiving.&amp;nbsp; What happens when I truncate and insert?&amp;nbsp; Will those be interpreted as changes to the data by the archiving triggers/procedures?&amp;nbsp; I know there's no way through the ArcGIS software to turn off and turn back on archiving without creating new archive classes, which won't work for us.&amp;nbsp; Is there a way to disable the triggers/procedures that make archiving function temporarily, or is that proprietary/wrapped code we don't have access to?&amp;nbsp; If I can't disable archiving and continue to use the same archive classes, what options do I have for altering the column types for my archived feature classes?&amp;nbsp; Thanks.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;You can use a variant of the method ArcSDE uses to maintain OBJECTID rowid columns to&lt;BR /&gt;maintain your independent IDs. ArcSDE shifted from a simple sequence because of the&lt;BR /&gt;performance cost during bulk insert, but if you're not doing much bulk assignment, then&lt;BR /&gt;a simple sequence may be the way to go.&lt;BR /&gt; &lt;BR /&gt;- V&lt;BR /&gt; &lt;BR /&gt;Note: If you use the TRUNCATE/ALTER/INSERT procedure, you'll need to run an 'sdetable&lt;BR /&gt;-o describe' as the owner on each table to correct the internal SDE.COLUMN_INFO type&lt;BR /&gt;codes.&amp;nbsp; You'll also want to prototype this with a trivial layer, to make sure ArcGIS doesn't &lt;BR /&gt;object to the type change.&amp;nbsp; This is especially true for versioned tables.&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Jan 2012 13:57:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/convert-varchar2-columns-to-nvarchar2/m-p/117866#M6713</guid>
      <dc:creator>ShawnHolyoak</dc:creator>
      <dc:date>2012-01-13T13:57:24Z</dc:date>
    </item>
    <item>
      <title>Re: Convert varchar2 columns to nvarchar2</title>
      <link>https://community.esri.com/t5/data-management-questions/convert-varchar2-columns-to-nvarchar2/m-p/117867#M6714</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;We are planning on using sequences, as they're so simple.&amp;nbsp; Thanks for the warning on needing to run the 'describe'; I would have missed that.&amp;nbsp; I've run into another concern, though, and that's related to archiving.&amp;nbsp; What happens when I truncate and insert?&amp;nbsp; Will those be interpreted as changes to the data by the archiving triggers/procedures?&amp;nbsp; I know there's no way through the ArcGIS software to turn off and turn back on archiving without creating new archive classes, which won't work for us.&amp;nbsp; Is there a way to disable the triggers/procedures that make archiving function temporarily, or is that proprietary/wrapped code we don't have access to?&amp;nbsp; If I can't disable archiving and continue to use the same archive classes, what options do I have for altering the column types for my archived feature classes?&amp;nbsp; Thanks.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Basically, according to ESRI, I have no options.&amp;nbsp; The archived feature classes will register the truncate and insert as modifications to every row in the table, and will add those to the archived feature classes.&amp;nbsp; ESRI really needs to fix archiving.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Feb 2012 18:13:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/convert-varchar2-columns-to-nvarchar2/m-p/117867#M6714</guid>
      <dc:creator>ShawnHolyoak</dc:creator>
      <dc:date>2012-02-07T18:13:39Z</dc:date>
    </item>
  </channel>
</rss>

