Thursday, 28 November 2019

Oracle Database characterset conversion "AL32UTF8".

I had to know about character set of one database and I want to Share and note here so I will post here how to see and change.

To check the current Character Set:

SQL> SELECT value$ FROM sys.props$ WHERE name = 'NLS_CHARACTERSET' ;

VALUE$
-------------------------------------------------------------------
AL32UTF8

SQL>SHUT IMMEDIATE

SQL> STARTUP MOUNT

SQL> ALTER SYSTEM ENABLE RESTRICTED SESSION; <-- be="" can="" connected.="" no="" one="" p="">
System altered.

SQL> ALTER DATABASE OPEN; <-- be="" change="" character="" database="" must="" opened.="" p="" set="" to="" your="">
Database altered.

SQL> ALTER DATABASE CHARACTER SET US7ASCII;

Database altered.

SQL> ALTER SYSTEM DISABLE RESTRICTED SESSION; <-- open="" p="" system="" to="" users.="" your="">
System altered.

You can face error in this case:

SQL> SELECT value$ FROM sys.props$ WHERE name = 'NLS_CHARACTERSET' ;

VALUE$
--------------------------------------------------------------------
WE8ISO8859P1

SQL> ALTER DATABASE CHARACTER SET US7ASCII;
ALTER DATABASE CHARACTER SET US7ASCII
*
ERROR at line 1:
ORA-12712: new character set must be a superset of old character set

WE8ISO8859P1 -- Is a superset so you cannot change for US7ASCII.

No comments:

Post a Comment