Home » RDBMS Server » Server Administration » Changing the Character Set After Database Creation
Changing the Character Set After Database Creation [message #52351] Tue, 16 July 2002 23:38 Go to next message
Ronald
Messages: 15
Registered: October 2001
Junior Member
Hi,

i just installed a new server in spain.
but with the wrong caracter set i it possible to change the caracterset in to the right one
without reinstalling.
can i do this by just using this command
ALTER DATABASE CHARACTER SET WE8ISO8859P1
the version of oracle is 7.3.4

Thanks a lot

Regards

Ronald
Junior DBA
Re: Changing the Character Set After Database Creation [message #52353 is a reply to message #52351] Wed, 17 July 2002 03:55 Go to previous messageGo to next message
ctg
Messages: 146
Registered: July 2002
Senior Member
once you create a database, you can NOT change the character set. You need to create a new database with the correct character set.
Re: Changing the Character Set After Database Creation [message #52375 is a reply to message #52351] Thu, 18 July 2002 05:41 Go to previous messageGo to next message
Sanjay
Messages: 236
Registered: July 2000
Senior Member
It looks like you can, but there are some limits. Here is what I got from the Oracle Doc CD. Check the CD for details (chapter 3)

In some cases, you may wish to change the existing database character set. For instance, you may find that the number of languages that need to be supported in your database have increased. In most cases, you will need to do a full export/import to properly convert all data to the new character set. However, if, and only if, the new character set is a strict superset of the current character set, it is possible to use the ALTER DATABASE CHARACTER SET statement to expedite the change in the database character set.

The target character set is a strict superset if and only if each and every codepoint in the source character set is available in the target character set, with the same corresponding codepoint value. For instance, the following migration scenarios can take advantage of the ALTER DATABASE CHARACTER SET statement because US7ASCII is a strict subset of WE8ISO8859P1, ZHS16GBK, and UTF8:

Attempting to change the database character set to a character set that is not a strict superset can result in data loss and data corruption. To ensure data integrity, whenever migrating to a new character set that is not a strict superset, you must use export/import. It is essential to do a full backup of the database before using the ALTER DATABASE [[NATIONAL]] CHARACTER SET statement, since the command cannot be rolled back. The syntax is:

ALTER DATABASE [[<db_name>]] CHARACTER SET <new_character_set>;
ALTER DATABASE [[<db_name>]] NATIONAL CHARACTER SET <new_NCHAR_character_set>;

The database name is optional. The character set name should be specified without quotes, for example:

ALTER DATABASE CHARACTER SET WE8ISO8859P1;
Re: Changing the Character Set After Database Creation [message #55134 is a reply to message #52375] Mon, 06 January 2003 15:21 Go to previous message
Titi Ala'ilima
Messages: 1
Registered: January 2003
Junior Member
We have unicode data stored in an ostensibly US7ASCII database. The client thinks it's passing US7ASCII, and it renders fine to the end-user. The trick is when transferring to our new db server, which is explicitly unicode. The metadata of the export files from the old db says its ASCII data, so it converts to Unicode and data is lost. If everything realized it was Unicode in the first place, no translation would take place and the data would move smoothly. So, would altering the old db's charset preserve the unicode data that is stored in the ASCII varchars and CLOBs?
Previous Topic: Facing problem in installing Oracle 8 Personal
Next Topic: Temporary tablespaces
Goto Forum:
  


Current Time: Fri Sep 20 05:31:55 CDT 2024