Here is how to change the DB characterset
SELECT * FROM V$NLS_PARAMETERS WHERE PARAMETER LIKE '%CHARACTERSET%';
or
select * from nls_database_parameters;
SHUTDOWN IMMEDIATE;
STARTUP RESTRICT;
ALTER DATABASE CHARACTER SET INTERNAL_USE AL32UTF8;
ALTER DATABASE CHARACTER SET AL32UTF8;
SHUTDOWN IMMEDIATE;
STARTUP;
SELECT * FROM V$NLS_PARAMETERS WHERE PARAMETER LIKE '%CHARACTERSET%';
*********************************************************************
some times you might need to change ncharset of database.. follow steps below
Select property_value from database_properties
where upper(property_name) = 'NLS_NCHAR_CHARACTERSET';
SHUTDOWN IMMEDIATE
STARTUP MOUNT
ALTER SYSTEM ENABLE RESTRICTED SESSION;
ALTER DATABASE OPEN;
ALTER DATABASE NATIONAL CHARACTER SET UTF8;
SHUTDOWN IMMEDIATE
STARTUP
It is always not better choice to use 'ALTER DATABASE' command to change the character set.
Make sure to take a full backup before doing this
SELECT * FROM V$NLS_PARAMETERS WHERE PARAMETER LIKE '%CHARACTERSET%';
select * from V$nls_parameters where parameter in ('NLS_CHARACTERSET', 'NLS_NCHAR_CHARACTERSET');
or
select * from nls_database_parameters;
SHUTDOWN IMMEDIATE;
STARTUP RESTRICT;
ALTER DATABASE CHARACTER SET INTERNAL_USE AL32UTF8;
ALTER DATABASE CHARACTER SET AL32UTF8;
SHUTDOWN IMMEDIATE;
STARTUP;
SELECT * FROM V$NLS_PARAMETERS WHERE PARAMETER LIKE '%CHARACTERSET%';
For RAC
You need to stop the database.
Start in single instance
alter system set cluster_database= false scope=spfile;
shut immediate;
startup restrict;
and follow above steps and change cluster_database=true once done and start db using srvctl normally
*********************************************************************
some times you might need to change ncharset of database.. follow steps below
Select property_value from database_properties
where upper(property_name) = 'NLS_NCHAR_CHARACTERSET';
SHUTDOWN IMMEDIATE
STARTUP MOUNT
ALTER SYSTEM ENABLE RESTRICTED SESSION;
ALTER DATABASE OPEN;
ALTER DATABASE NATIONAL CHARACTER SET UTF8;
SHUTDOWN IMMEDIATE
STARTUP
It is always not better choice to use 'ALTER DATABASE' command to change the character set.
Make sure to take a full backup before doing this
No comments:
Post a Comment