{"id":1065,"date":"2014-09-10T22:13:46","date_gmt":"2014-09-10T16:43:46","guid":{"rendered":"http:\/\/www.allerin.com\/blog\/?p=1065"},"modified":"2016-05-12T15:14:35","modified_gmt":"2016-05-12T09:44:35","slug":"oracle-charset-issues-with-unicode-data-storage-in-rails","status":"publish","type":"post","link":"https:\/\/www.allerin.com\/blog\/oracle-charset-issues-with-unicode-data-storage-in-rails\/","title":{"rendered":"Oracle charset &#8211; Issues with Unicode data storage in Rails"},"content":{"rendered":"<p>Working with Oracle database supported application, which we want to internationalize, and then\u00a0 \u2018charset\u2019 is crucial factor to provide Unicode storage ability.<\/p>\n<p>If we are going to internationalize a new project then we can start by creating a Unicode supported database.<\/p>\n<p>For example, we can select AL32UTF8 charset while creating the database.<\/p>\n<p>If we are going to support internationalization on an existing database then, we need to change the charset of database.<\/p>\n<p>There are two ways of changing charset of a database.<\/p>\n<p>Either you can directly alter the charset of existing database or by performing full import export.<\/p>\n<p>First you need to know the current charset of database<\/p>\n<p>&lt;pre&gt;<\/p>\n<p>SELECT value$ FROM sys.props$ WHERE name = \u2018NLS_CHARACTERSET\u2019 ;<\/p>\n<p>&lt;\/pre&gt;<\/p>\n<p>This query will tell you current charset of your database.<\/p>\n<p>Other Oracle database NLS parameters can be known by following query<\/p>\n<p>&lt;pre&gt;<\/p>\n<p>SELECT * FROM NLS_DATABASE_PARAMETERS;<\/p>\n<p>&lt;\/pre&gt;<\/p>\n<p>To alter charset of database directly, the target charset should be a strict superset of current database charset.<\/p>\n<p>You can alter charset with following steps:<\/p>\n<p>1.\u00a0 Shut down the database, using either a SHUTDOWN IMMEDIATE or a SHUTDOWN NORMAL statement.<\/p>\n<p>2.\u00a0 Do a full backup of the database, because the CSALTER script cannot be rolled back.<\/p>\n<p>3.\u00a0 Start up the database.<\/p>\n<p>4.\u00a0 Run the Database Character Set Scanner utility.<\/p>\n<p>&lt;pre&gt;<\/p>\n<p>CSSCAN \/AS SYSDBA FULL=Y&#8230;<\/p>\n<p>&lt;\/pre&gt;<\/p>\n<p>5.\u00a0 Run the CSALTER script.<\/p>\n<p>&lt;pre&gt;<\/p>\n<p>@@CSALTER.PLB<\/p>\n<p>SHUTDOWN IMMEDIATE; &#8212; or SHUTDOWN NORMAL;<\/p>\n<p>STARTUP;<\/p>\n<p>&lt;\/pre&gt;<\/p>\n<p>The other way is quite safer and recommended.<\/p>\n<p>Following are the steps to export and import data in oracle 11g R2:<\/p>\n<p>To export database:<\/p>\n<p>1.\u00a0 Start SqlDeveloper.<\/p>\n<p>2.\u00a0 Create connections for source and destination. (Note: Use system user)<\/p>\n<p>3.\u00a0 From View menu select DBA. DBA pane will appear.<\/p>\n<p>4.\u00a0 Now in DBA pane, add connections.<\/p>\n<p>5.\u00a0 Click and expand the source connection, then right-click on &#8216;Data Pump&#8217;, and then click on &#8216;Data Pump Export Wizard.&#8217; Export Wizard will start.<\/p>\n<p>6.\u00a0 In &#8216;Data Pump Export Wizard,&#8217; select Schema option in Types to be Exported in &#8216;Data Pump&#8217; and click on &#8216;Next.&#8217;<\/p>\n<p>7.\u00a0 Select(double click) a schema that you want to export and click &#8216;Next.&#8217;<\/p>\n<p>8.\u00a0 Skip the step Filter and click &#8216;Next.&#8217;<\/p>\n<p>9.\u00a0 Now, click on &#8216;More,&#8217; now select Type as &#8216;ALL OBJECTS&#8217; and click on &#8216;Lookup.&#8217; All the objects are displayed.<\/p>\n<p>10. From the interface select and add objects to include for export and click &#8216;Next.&#8217; To include all objects just click on down double-arrow button.<\/p>\n<p>11. Specify the name for log file or just leave the default and click &#8216;Next.&#8217;<\/p>\n<p>12. In &#8216;Choose Output Files&#8217; section, specify the File Names (For example exportdata.dmp), choose an appropriate option if file already exists, and click &#8216;Next.&#8217;<\/p>\n<p>13. Now leave the default settings and click &#8216;Next.&#8217;<\/p>\n<p>14. In &#8216;Summary&#8217; section, verify whether the desired schema is included, and finally click &#8216;Finish.&#8217; You will see this job and its status in &#8216;Data Pump&#8217; &gt; &#8216;Export Jobs&#8217; of DBA pane.<\/p>\n<p>15. Now, copy this file from the source machine to the destination machine.<\/p>\n<p>For importing database:<\/p>\n<p>1.\u00a0 Start SqlDeveloper and open &#8216;Data Pump Import Wizard.&#8217;<\/p>\n<p>2.\u00a0 In Wizard, select Connection where you want to import(destination system).<\/p>\n<p>3.\u00a0 Select Schema and specify file Name. In this case, file is exportdata.dmp and then click &#8216;Next.&#8217;<\/p>\n<p>4.\u00a0 Now, include the schema that you want to import from &#8216;Available Source Schemas&#8217; to &#8216;Selected Source Schemas&#8217; and click &#8216;Next.&#8217;<\/p>\n<p>5.\u00a0 Skip Remapping step by clicking &#8216;Next.&#8217;<\/p>\n<p>6.\u00a0 In Options step, select appropriate options for &#8216;Action On Table&#8217; if Table Exists and click &#8216;Next.&#8217;<\/p>\n<p>7.\u00a0 Click &#8216;Next&#8217; and finally Click &#8216;Finish.&#8217;<\/p>\n<p>Your database will be imported as per selected options and schemas.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Working with Oracle database supported application, which we want to internationalize, and then\u00a0 \u2018charset\u2019 is crucial factor to provide Unicode storage ability. If we are going to internationalize a new&#8230;<\/p>\n","protected":false},"author":9192191,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":"","_links_to":"","_links_to_target":""},"categories":[3],"tags":[],"class_list":["post-1065","post","type-post","status-publish","format-standard","hentry","category-technology"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v25.5 (Yoast SEO v27.6) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Oracle charset - Issues with Unicode data storage in Rails<\/title>\n<meta name=\"description\" content=\"Here we talk about different scenarios and use cases of Oracle charset - Issues with Unicode data storage in Rails and ruby on rails\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.allerin.com\/blog\/oracle-charset-issues-with-unicode-data-storage-in-rails\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Oracle charset - Issues with Unicode data storage in Rails\" \/>\n<meta property=\"og:description\" content=\"Working with Oracle database supported application, which we want to internationalize, and then\u00a0 \u2018charset\u2019 is crucial factor to provide Unicode storage\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.allerin.com\/blog\/oracle-charset-issues-with-unicode-data-storage-in-rails\/\" \/>\n<meta property=\"og:site_name\" content=\"Artificial Intelligence, ROBOTICS, AUTOMATION\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/allerintech\" \/>\n<meta property=\"article:published_time\" content=\"2014-09-10T16:43:46+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2016-05-12T09:44:35+00:00\" \/>\n<meta name=\"author\" content=\"Temp User\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Temp User\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.allerin.com\\\/blog\\\/oracle-charset-issues-with-unicode-data-storage-in-rails\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.allerin.com\\\/blog\\\/oracle-charset-issues-with-unicode-data-storage-in-rails\\\/\"},\"author\":{\"name\":\"Temp User\",\"@id\":\"https:\\\/\\\/www.allerin.com\\\/blog\\\/#\\\/schema\\\/person\\\/1800305fd7a4b1da6e13bbb42425cf27\"},\"headline\":\"Oracle charset &#8211; Issues with Unicode data storage in Rails\",\"datePublished\":\"2014-09-10T16:43:46+00:00\",\"dateModified\":\"2016-05-12T09:44:35+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.allerin.com\\\/blog\\\/oracle-charset-issues-with-unicode-data-storage-in-rails\\\/\"},\"wordCount\":605,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/www.allerin.com\\\/blog\\\/#organization\"},\"articleSection\":[\"Technology\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.allerin.com\\\/blog\\\/oracle-charset-issues-with-unicode-data-storage-in-rails\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.allerin.com\\\/blog\\\/oracle-charset-issues-with-unicode-data-storage-in-rails\\\/\",\"url\":\"https:\\\/\\\/www.allerin.com\\\/blog\\\/oracle-charset-issues-with-unicode-data-storage-in-rails\\\/\",\"name\":\"Oracle charset - Issues with Unicode data storage in Rails\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.allerin.com\\\/blog\\\/#website\"},\"datePublished\":\"2014-09-10T16:43:46+00:00\",\"dateModified\":\"2016-05-12T09:44:35+00:00\",\"description\":\"Here we talk about different scenarios and use cases of Oracle charset - Issues with Unicode data storage in Rails and ruby on rails\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.allerin.com\\\/blog\\\/oracle-charset-issues-with-unicode-data-storage-in-rails\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.allerin.com\\\/blog\\\/oracle-charset-issues-with-unicode-data-storage-in-rails\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.allerin.com\\\/blog\\\/oracle-charset-issues-with-unicode-data-storage-in-rails\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.allerin.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Oracle charset &#8211; Issues with Unicode data storage in Rails\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.allerin.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.allerin.com\\\/blog\\\/\",\"name\":\"Artificial Intelligence, ROBOTICS, AUTOMATION\",\"description\":\"Empowering Futures: Innovating with AI and Machine Learning\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.allerin.com\\\/blog\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.allerin.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.allerin.com\\\/blog\\\/#organization\",\"name\":\"Allerin\",\"url\":\"https:\\\/\\\/www.allerin.com\\\/blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.allerin.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.allerin.com\\\/blog\\\/wp-content\\\/uploads\\\/2016\\\/06\\\/logo-fire.png\",\"contentUrl\":\"https:\\\/\\\/www.allerin.com\\\/blog\\\/wp-content\\\/uploads\\\/2016\\\/06\\\/logo-fire.png\",\"width\":1000,\"height\":1000,\"caption\":\"Allerin\"},\"image\":{\"@id\":\"https:\\\/\\\/www.allerin.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/allerintech\",\"https:\\\/\\\/www.linkedin.com\\\/company\\\/allerintech\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.allerin.com\\\/blog\\\/#\\\/schema\\\/person\\\/1800305fd7a4b1da6e13bbb42425cf27\",\"name\":\"Temp User\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/194a42e22f3078426d730e84e0c45af551304b674cd9cf8b99a0e26d09b974e8?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/194a42e22f3078426d730e84e0c45af551304b674cd9cf8b99a0e26d09b974e8?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/194a42e22f3078426d730e84e0c45af551304b674cd9cf8b99a0e26d09b974e8?s=96&d=mm&r=g\",\"caption\":\"Temp User\"},\"url\":\"https:\\\/\\\/www.allerin.com\\\/blog\\\/author\\\/tempuser\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Oracle charset - Issues with Unicode data storage in Rails","description":"Here we talk about different scenarios and use cases of Oracle charset - Issues with Unicode data storage in Rails and ruby on rails","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.allerin.com\/blog\/oracle-charset-issues-with-unicode-data-storage-in-rails\/","og_locale":"en_US","og_type":"article","og_title":"Oracle charset - Issues with Unicode data storage in Rails","og_description":"Working with Oracle database supported application, which we want to internationalize, and then\u00a0 \u2018charset\u2019 is crucial factor to provide Unicode storage","og_url":"https:\/\/www.allerin.com\/blog\/oracle-charset-issues-with-unicode-data-storage-in-rails\/","og_site_name":"Artificial Intelligence, ROBOTICS, AUTOMATION","article_publisher":"https:\/\/www.facebook.com\/allerintech","article_published_time":"2014-09-10T16:43:46+00:00","article_modified_time":"2016-05-12T09:44:35+00:00","author":"Temp User","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Temp User","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.allerin.com\/blog\/oracle-charset-issues-with-unicode-data-storage-in-rails\/#article","isPartOf":{"@id":"https:\/\/www.allerin.com\/blog\/oracle-charset-issues-with-unicode-data-storage-in-rails\/"},"author":{"name":"Temp User","@id":"https:\/\/www.allerin.com\/blog\/#\/schema\/person\/1800305fd7a4b1da6e13bbb42425cf27"},"headline":"Oracle charset &#8211; Issues with Unicode data storage in Rails","datePublished":"2014-09-10T16:43:46+00:00","dateModified":"2016-05-12T09:44:35+00:00","mainEntityOfPage":{"@id":"https:\/\/www.allerin.com\/blog\/oracle-charset-issues-with-unicode-data-storage-in-rails\/"},"wordCount":605,"commentCount":0,"publisher":{"@id":"https:\/\/www.allerin.com\/blog\/#organization"},"articleSection":["Technology"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.allerin.com\/blog\/oracle-charset-issues-with-unicode-data-storage-in-rails\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.allerin.com\/blog\/oracle-charset-issues-with-unicode-data-storage-in-rails\/","url":"https:\/\/www.allerin.com\/blog\/oracle-charset-issues-with-unicode-data-storage-in-rails\/","name":"Oracle charset - Issues with Unicode data storage in Rails","isPartOf":{"@id":"https:\/\/www.allerin.com\/blog\/#website"},"datePublished":"2014-09-10T16:43:46+00:00","dateModified":"2016-05-12T09:44:35+00:00","description":"Here we talk about different scenarios and use cases of Oracle charset - Issues with Unicode data storage in Rails and ruby on rails","breadcrumb":{"@id":"https:\/\/www.allerin.com\/blog\/oracle-charset-issues-with-unicode-data-storage-in-rails\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.allerin.com\/blog\/oracle-charset-issues-with-unicode-data-storage-in-rails\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.allerin.com\/blog\/oracle-charset-issues-with-unicode-data-storage-in-rails\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.allerin.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Oracle charset &#8211; Issues with Unicode data storage in Rails"}]},{"@type":"WebSite","@id":"https:\/\/www.allerin.com\/blog\/#website","url":"https:\/\/www.allerin.com\/blog\/","name":"Artificial Intelligence, ROBOTICS, AUTOMATION","description":"Empowering Futures: Innovating with AI and Machine Learning","publisher":{"@id":"https:\/\/www.allerin.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.allerin.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.allerin.com\/blog\/#organization","name":"Allerin","url":"https:\/\/www.allerin.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.allerin.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.allerin.com\/blog\/wp-content\/uploads\/2016\/06\/logo-fire.png","contentUrl":"https:\/\/www.allerin.com\/blog\/wp-content\/uploads\/2016\/06\/logo-fire.png","width":1000,"height":1000,"caption":"Allerin"},"image":{"@id":"https:\/\/www.allerin.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/allerintech","https:\/\/www.linkedin.com\/company\/allerintech"]},{"@type":"Person","@id":"https:\/\/www.allerin.com\/blog\/#\/schema\/person\/1800305fd7a4b1da6e13bbb42425cf27","name":"Temp User","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/194a42e22f3078426d730e84e0c45af551304b674cd9cf8b99a0e26d09b974e8?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/194a42e22f3078426d730e84e0c45af551304b674cd9cf8b99a0e26d09b974e8?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/194a42e22f3078426d730e84e0c45af551304b674cd9cf8b99a0e26d09b974e8?s=96&d=mm&r=g","caption":"Temp User"},"url":"https:\/\/www.allerin.com\/blog\/author\/tempuser\/"}]}},"_links":{"self":[{"href":"https:\/\/www.allerin.com\/blog\/wp-json\/wp\/v2\/posts\/1065","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.allerin.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.allerin.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.allerin.com\/blog\/wp-json\/wp\/v2\/users\/9192191"}],"replies":[{"embeddable":true,"href":"https:\/\/www.allerin.com\/blog\/wp-json\/wp\/v2\/comments?post=1065"}],"version-history":[{"count":1,"href":"https:\/\/www.allerin.com\/blog\/wp-json\/wp\/v2\/posts\/1065\/revisions"}],"predecessor-version":[{"id":1066,"href":"https:\/\/www.allerin.com\/blog\/wp-json\/wp\/v2\/posts\/1065\/revisions\/1066"}],"wp:attachment":[{"href":"https:\/\/www.allerin.com\/blog\/wp-json\/wp\/v2\/media?parent=1065"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.allerin.com\/blog\/wp-json\/wp\/v2\/categories?post=1065"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.allerin.com\/blog\/wp-json\/wp\/v2\/tags?post=1065"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}