SlideShare a Scribd company logo
¡ÒáÓ˹´ÀÒÉÒä·Âº¹ oracle
 ÇÔ¸ÕµÃǨÊͺÀÒÉÒ
select * from v$NLS_PARAMETERS;
 select * from nls_database_parameters where parameter ='NLS_CHARACTERSET';
select * from v$nls_parameters where PARAMETER like '%CHARACTERSET%';
select * from nls_session_parameters;
alter session set nls_date_format = 'yyyy/mm/dd hh24:mi:ss';
select distinct CLIENT_CHARSET from V$SESSION_CONNECT_INFO where
sid=sys_context('userenv','sid');

SQL> select * from v$nls_parameters where parameter='NLS_CHARACTERSET';

PARAMETER            VALUE
-------------------- --------------------
NLS_CHARACTERSET     TH8TISASCII

µÃǨÊͺµÒÃÒ§
SQL>   select distinct OWNER, TABLE_NAME from DBA_TAB_COLUMNS where DATA_TYPE in
('NCHAR','NVARCHAR2', 'NCLOB');
SQL>SPOOL nlsnew.log
SQL>SHUTDOWN IMMEDIATE;
SQL>STARTUP MOUNT;
SQL> alter system enable restricted session;
SQL> alter system set job_queue_processes=0;
SQL> alter system set aq_tm_processes=0;
SQL> alter database open;
SQL> alter database amrims character set TH8TISASCII;
SQL> alter database amrims national character set UTF8;
SQL> shutdown immediate;
SQL> startup;


ÇÔ¸Õ¡ÒÃÁմѧ¹Õé
1 SQL Plus --> connect sys/sys_password as sysdba
2 update props$
set value$ = 'TH8TISASCII'
where name = 'NLS_CHARACTERSET';
3 stop database (º¹ windows ä» stop ·Õè service)
4 start database (º¹ windows ä» start ·Õè service) >Åͧ·´Êͺ´Ù (µÑÇÍÂèÒ§à»ç¹¢Í§
10g äÁè¹èÒµèÒ§¡Ñ¹)

--syntax
--ALTER DATABASE [<db_name>] CHARACTER SET <new_character_set>;
--ALTER DATABASE [<db_name>] NATIONAL CHARACTER SET <new_NCHAR_character_set>;
/*SQL> SHUTDOWN IMMEDIATE;   -- or NORMAL
   -- <do a full backup>
SQL> STARTUP MOUNT;
SQL> ALTER SYSTEM ENABLE RESTRICTED SESSION;
SQL> ALTER SYSTEM SET JOB_QUEUE_PROCESSES=0;
SQL> ALTER DATABASE OPEN;
SQL> ALTER DATABASE CHARACTER SET <new_character_set_name>;
SQL> SHUTDOWN IMMEDIATE;   -- or NORMAL
SQL> STARTUP;
*/
ÇÔ¸Õ·Ó·Õèä´é¼ÅÁÒ¡·ÕèÊØ´
--Set NLS_CHARACTERSET
sqlplus / as sysdba;
SHUTDWON IMMEDIATE;
STARTUP MOUNT;
ALTER SYSTEM ENABLE RESTRICTED SESSION;
ALTER DATABASE OPEN;
ALTER DATABASE CHARACTER SET INTERNAL_USE TH8TISASCII; --this work
--ËÃ×Í   ALTER DATABASE CHARACTER SET TH8TISASCII; --ãªéä´é㹡óշÕè set
language ·ÕèÁÕ¢¹Ò´¹éÍ¡ÇèÒÁÒÂѧ¢¹Ò´ãËè
SHUTDWON IMMEDIATE;
STARTUP;

 --Set NLS_CHARACTERSET, NLS_NCHAR_CHARACTERSET
sqlplus / as sysdba;
SHUTDWON IMMEDIATE;
STARTUP MOUNT;
ALTER SYSTEM ENABLE RESTRICTED SESSION;
ALTER DATABASE OPEN ;
UPDATE props$ SET value$='TH8TISASCII' WHERE name IN ('NLS_CHARACTERSET',
'NLS_NCHAR_CHARACTERSET');
commit;
SHUTDWON IMMEDIATE;
STARTUP;

ËÃ×ÍÇÔ¸Õ¡ÒÃÃÇÁ·Ñé§ÊͧÍÂèÒ§à¢éÒ´éÇ¡ѹà»ç¹ statement à´ÕÂÇ
--Set NLS_CHARACTERSET   áÅÐ Set NLS_CHARACTERSET, NLS_NCHAR_CHARACTERSET
sqlplus / as sysdba;
SHUTDWON IMMEDIATE;
STARTUP MOUNT;
ALTER SYSTEM ENABLE RESTRICTED SESSION;
ALTER DATABASE OPEN;
ALTER DATABASE CHARACTER SET INTERNAL_USE TH8TISASCII; --this work
UPDATE props$ SET value$='TH8TISASCII' WHERE name IN ('NLS_CHARACTERSET',
'NLS_NCHAR_CHARACTERSET');
commit;
SHUTDWON IMMEDIATE;
STARTUP;

More Related Content

What's hot

Oracle ORA Errors
Oracle ORA ErrorsOracle ORA Errors
Oracle ORA Errors
Manish Mudhliyar
 
Sydney Oracle Meetup - execution plans
Sydney Oracle Meetup - execution plansSydney Oracle Meetup - execution plans
Sydney Oracle Meetup - execution planspaulguerin
 
Database administration commands
Database administration commands Database administration commands
Database administration commands
Varsha Ajith
 
Solr integration in Magento Enterprise
Solr integration in Magento EnterpriseSolr integration in Magento Enterprise
Solr integration in Magento EnterpriseTobias Zander
 
MySQL Stored Procedures: Building High Performance Web Applications
MySQL Stored Procedures: Building High Performance Web ApplicationsMySQL Stored Procedures: Building High Performance Web Applications
MySQL Stored Procedures: Building High Performance Web Applications
OSSCube
 
DBA Commands and Concepts That Every Developer Should Know
DBA Commands and Concepts That Every Developer Should KnowDBA Commands and Concepts That Every Developer Should Know
DBA Commands and Concepts That Every Developer Should Know
Alex Zaballa
 
Pontos para criar_instancia_data guard_11g
Pontos para criar_instancia_data guard_11gPontos para criar_instancia_data guard_11g
Pontos para criar_instancia_data guard_11gLeandro Santos
 
WordPress Configuration tips
WordPress Configuration tipsWordPress Configuration tips
WordPress Configuration tips
Masharul Pamir
 
MySQL server security
MySQL server securityMySQL server security
MySQL server security
Damien Seguy
 
Conexcion java mysql
Conexcion java mysqlConexcion java mysql
Conexcion java mysql
jbersosa
 
dcs plus Catalogue 2015
dcs plus Catalogue 2015dcs plus Catalogue 2015
dcs plus Catalogue 2015
dcs plus
 
12c Mini Lesson - Inline PLSQL from SQL
12c Mini Lesson - Inline PLSQL from SQL12c Mini Lesson - Inline PLSQL from SQL
12c Mini Lesson - Inline PLSQL from SQL
Connor McDonald
 
11 Things About 11gr2
11 Things About 11gr211 Things About 11gr2
11 Things About 11gr2afa reg
 
Configure the dbase using em in oracle 11g
Configure the dbase using em in oracle 11gConfigure the dbase using em in oracle 11g
Configure the dbase using em in oracle 11g
Girija Muscut
 

What's hot (18)

Oracle ORA Errors
Oracle ORA ErrorsOracle ORA Errors
Oracle ORA Errors
 
Sydney Oracle Meetup - execution plans
Sydney Oracle Meetup - execution plansSydney Oracle Meetup - execution plans
Sydney Oracle Meetup - execution plans
 
Database administration commands
Database administration commands Database administration commands
Database administration commands
 
Solr integration in Magento Enterprise
Solr integration in Magento EnterpriseSolr integration in Magento Enterprise
Solr integration in Magento Enterprise
 
MySQL Stored Procedures: Building High Performance Web Applications
MySQL Stored Procedures: Building High Performance Web ApplicationsMySQL Stored Procedures: Building High Performance Web Applications
MySQL Stored Procedures: Building High Performance Web Applications
 
DBA Commands and Concepts That Every Developer Should Know
DBA Commands and Concepts That Every Developer Should KnowDBA Commands and Concepts That Every Developer Should Know
DBA Commands and Concepts That Every Developer Should Know
 
Pontos para criar_instancia_data guard_11g
Pontos para criar_instancia_data guard_11gPontos para criar_instancia_data guard_11g
Pontos para criar_instancia_data guard_11g
 
Stored procedure
Stored procedureStored procedure
Stored procedure
 
WordPress Configuration tips
WordPress Configuration tipsWordPress Configuration tips
WordPress Configuration tips
 
MySQL server security
MySQL server securityMySQL server security
MySQL server security
 
Conexcion java mysql
Conexcion java mysqlConexcion java mysql
Conexcion java mysql
 
dcs plus Catalogue 2015
dcs plus Catalogue 2015dcs plus Catalogue 2015
dcs plus Catalogue 2015
 
12c Mini Lesson - Inline PLSQL from SQL
12c Mini Lesson - Inline PLSQL from SQL12c Mini Lesson - Inline PLSQL from SQL
12c Mini Lesson - Inline PLSQL from SQL
 
Stored procedures
Stored proceduresStored procedures
Stored procedures
 
C99
C99C99
C99
 
11 Things About 11gr2
11 Things About 11gr211 Things About 11gr2
11 Things About 11gr2
 
Configure the dbase using em in oracle 11g
Configure the dbase using em in oracle 11gConfigure the dbase using em in oracle 11g
Configure the dbase using em in oracle 11g
 
Stored procedure with cursor
Stored procedure with cursorStored procedure with cursor
Stored procedure with cursor
 

Viewers also liked

Tips For Success
Tips For SuccessTips For Success
Tips For Success
CBT College
 
Chen test paper20abcdeftfdfd
Chen test paper20abcdeftfdfdChen test paper20abcdeftfdfd
Chen test paper20abcdeftfdfdtechweb08
 
Assignment 2 unit_4_script
Assignment 2 unit_4_scriptAssignment 2 unit_4_script
Assignment 2 unit_4_scriptChris_m3c2
 
Workshop i ed 3.1 (student guide vol 2)
Workshop i ed 3.1 (student guide vol 2)Workshop i ed 3.1 (student guide vol 2)
Workshop i ed 3.1 (student guide vol 2)gavin shaw
 
MS Sql Server: Introduction To Datamining Suing Sql Server
MS Sql Server: Introduction To Datamining Suing Sql ServerMS Sql Server: Introduction To Datamining Suing Sql Server
MS Sql Server: Introduction To Datamining Suing Sql Server
DataminingTools Inc
 
Los valores en nuestra identidad
Los valores en nuestra identidadLos valores en nuestra identidad
Los valores en nuestra identidad
Victor Cabral
 

Viewers also liked (7)

Tips For Success
Tips For SuccessTips For Success
Tips For Success
 
Chen test paper20abcdeftfdfd
Chen test paper20abcdeftfdfdChen test paper20abcdeftfdfd
Chen test paper20abcdeftfdfd
 
Assignment 2 unit_4_script
Assignment 2 unit_4_scriptAssignment 2 unit_4_script
Assignment 2 unit_4_script
 
Workshop i ed 3.1 (student guide vol 2)
Workshop i ed 3.1 (student guide vol 2)Workshop i ed 3.1 (student guide vol 2)
Workshop i ed 3.1 (student guide vol 2)
 
MS Sql Server: Introduction To Datamining Suing Sql Server
MS Sql Server: Introduction To Datamining Suing Sql ServerMS Sql Server: Introduction To Datamining Suing Sql Server
MS Sql Server: Introduction To Datamining Suing Sql Server
 
Los valores en nuestra identidad
Los valores en nuestra identidadLos valores en nuestra identidad
Los valores en nuestra identidad
 
Ef Technology Profile
Ef Technology ProfileEf Technology Profile
Ef Technology Profile
 

Similar to Nls

12c database migration from ASM storage to NON-ASM storage
12c database migration from ASM storage to NON-ASM storage12c database migration from ASM storage to NON-ASM storage
12c database migration from ASM storage to NON-ASM storage
Monowar Mukul
 
SQL Tracing
SQL TracingSQL Tracing
SQL Tracing
Hemant K Chitale
 
DBA Brasil 1.0 - DBA Commands and Concepts That Every Developer Should Know
DBA Brasil 1.0 - DBA Commands and Concepts That Every Developer Should KnowDBA Brasil 1.0 - DBA Commands and Concepts That Every Developer Should Know
DBA Brasil 1.0 - DBA Commands and Concepts That Every Developer Should Know
Alex Zaballa
 
DBA Brasil 1.0 - DBA Commands and Concepts That Every Developer Should Know
DBA Brasil 1.0 - DBA Commands and Concepts That Every Developer Should KnowDBA Brasil 1.0 - DBA Commands and Concepts That Every Developer Should Know
DBA Brasil 1.0 - DBA Commands and Concepts That Every Developer Should Know
Alex Zaballa
 
DBA Brasil 1.0 - DBA Commands and Concepts That Every Developer Should Know
DBA Brasil 1.0 - DBA Commands and Concepts That Every Developer Should KnowDBA Brasil 1.0 - DBA Commands and Concepts That Every Developer Should Know
DBA Brasil 1.0 - DBA Commands and Concepts That Every Developer Should Know
Alex Zaballa
 
plsql les06
 plsql les06 plsql les06
plsql les06
sasa_eldoby
 
Flashback (Practical Test)
Flashback (Practical Test)Flashback (Practical Test)
Flashback (Practical Test)Anar Godjaev
 
Wait Events 10g
Wait Events 10gWait Events 10g
Wait Events 10gsagai
 
07 Using Oracle-Supported Package in Application Development
07 Using Oracle-Supported Package in Application Development07 Using Oracle-Supported Package in Application Development
07 Using Oracle-Supported Package in Application Development
rehaniltifat
 
OTN TOUR 2016 - DBA Commands and Concepts That Every Developer Should Know
OTN TOUR 2016 - DBA Commands and Concepts That Every Developer Should KnowOTN TOUR 2016 - DBA Commands and Concepts That Every Developer Should Know
OTN TOUR 2016 - DBA Commands and Concepts That Every Developer Should Know
Alex Zaballa
 
OTN TOUR 2016 - DBA Commands and Concepts That Every Developer Should Know
OTN TOUR 2016 - DBA Commands and Concepts That Every Developer Should KnowOTN TOUR 2016 - DBA Commands and Concepts That Every Developer Should Know
OTN TOUR 2016 - DBA Commands and Concepts That Every Developer Should Know
Alex Zaballa
 
12c db upgrade from 11.2.0.4
12c db upgrade from 11.2.0.412c db upgrade from 11.2.0.4
12c db upgrade from 11.2.0.4
uzzal basak
 
Quick reference for cql
Quick reference for cqlQuick reference for cql
Quick reference for cql
Rajkumar Asohan, PMP
 
Basic Knowledge on MySql Replication
Basic Knowledge on MySql ReplicationBasic Knowledge on MySql Replication
Basic Knowledge on MySql Replication
Tasawr Interactive
 
Intro ProxySQL
Intro ProxySQLIntro ProxySQL
Intro ProxySQL
I Goo Lee
 
MySQL8.0_performance_schema.pptx
MySQL8.0_performance_schema.pptxMySQL8.0_performance_schema.pptx
MySQL8.0_performance_schema.pptx
NeoClova
 
Oracle audit and reporting in one hour or less
Oracle audit and reporting in one hour or lessOracle audit and reporting in one hour or less
Oracle audit and reporting in one hour or less
Leon Rzhemovskiy
 
Oracle SQL Tuning
Oracle SQL TuningOracle SQL Tuning
Oracle SQL Tuning
Alex Zaballa
 

Similar to Nls (20)

12c database migration from ASM storage to NON-ASM storage
12c database migration from ASM storage to NON-ASM storage12c database migration from ASM storage to NON-ASM storage
12c database migration from ASM storage to NON-ASM storage
 
SQL Tracing
SQL TracingSQL Tracing
SQL Tracing
 
DBA Brasil 1.0 - DBA Commands and Concepts That Every Developer Should Know
DBA Brasil 1.0 - DBA Commands and Concepts That Every Developer Should KnowDBA Brasil 1.0 - DBA Commands and Concepts That Every Developer Should Know
DBA Brasil 1.0 - DBA Commands and Concepts That Every Developer Should Know
 
DBA Brasil 1.0 - DBA Commands and Concepts That Every Developer Should Know
DBA Brasil 1.0 - DBA Commands and Concepts That Every Developer Should KnowDBA Brasil 1.0 - DBA Commands and Concepts That Every Developer Should Know
DBA Brasil 1.0 - DBA Commands and Concepts That Every Developer Should Know
 
DBA Brasil 1.0 - DBA Commands and Concepts That Every Developer Should Know
DBA Brasil 1.0 - DBA Commands and Concepts That Every Developer Should KnowDBA Brasil 1.0 - DBA Commands and Concepts That Every Developer Should Know
DBA Brasil 1.0 - DBA Commands and Concepts That Every Developer Should Know
 
plsql les06
 plsql les06 plsql les06
plsql les06
 
Flashback (Practical Test)
Flashback (Practical Test)Flashback (Practical Test)
Flashback (Practical Test)
 
Wait Events 10g
Wait Events 10gWait Events 10g
Wait Events 10g
 
07 Using Oracle-Supported Package in Application Development
07 Using Oracle-Supported Package in Application Development07 Using Oracle-Supported Package in Application Development
07 Using Oracle-Supported Package in Application Development
 
Oracle
OracleOracle
Oracle
 
OTN TOUR 2016 - DBA Commands and Concepts That Every Developer Should Know
OTN TOUR 2016 - DBA Commands and Concepts That Every Developer Should KnowOTN TOUR 2016 - DBA Commands and Concepts That Every Developer Should Know
OTN TOUR 2016 - DBA Commands and Concepts That Every Developer Should Know
 
OTN TOUR 2016 - DBA Commands and Concepts That Every Developer Should Know
OTN TOUR 2016 - DBA Commands and Concepts That Every Developer Should KnowOTN TOUR 2016 - DBA Commands and Concepts That Every Developer Should Know
OTN TOUR 2016 - DBA Commands and Concepts That Every Developer Should Know
 
12c db upgrade from 11.2.0.4
12c db upgrade from 11.2.0.412c db upgrade from 11.2.0.4
12c db upgrade from 11.2.0.4
 
les04.pdf
les04.pdfles04.pdf
les04.pdf
 
Quick reference for cql
Quick reference for cqlQuick reference for cql
Quick reference for cql
 
Basic Knowledge on MySql Replication
Basic Knowledge on MySql ReplicationBasic Knowledge on MySql Replication
Basic Knowledge on MySql Replication
 
Intro ProxySQL
Intro ProxySQLIntro ProxySQL
Intro ProxySQL
 
MySQL8.0_performance_schema.pptx
MySQL8.0_performance_schema.pptxMySQL8.0_performance_schema.pptx
MySQL8.0_performance_schema.pptx
 
Oracle audit and reporting in one hour or less
Oracle audit and reporting in one hour or lessOracle audit and reporting in one hour or less
Oracle audit and reporting in one hour or less
 
Oracle SQL Tuning
Oracle SQL TuningOracle SQL Tuning
Oracle SQL Tuning
 

Nls

  • 1. ¡ÒáÓ˹´ÀÒÉÒä·Âº¹ oracle ÇÔ¸ÕµÃǨÊͺÀÒÉÒ select * from v$NLS_PARAMETERS; select * from nls_database_parameters where parameter ='NLS_CHARACTERSET'; select * from v$nls_parameters where PARAMETER like '%CHARACTERSET%'; select * from nls_session_parameters; alter session set nls_date_format = 'yyyy/mm/dd hh24:mi:ss'; select distinct CLIENT_CHARSET from V$SESSION_CONNECT_INFO where sid=sys_context('userenv','sid'); SQL> select * from v$nls_parameters where parameter='NLS_CHARACTERSET'; PARAMETER VALUE -------------------- -------------------- NLS_CHARACTERSET TH8TISASCII µÃǨÊͺµÒÃÒ§ SQL> select distinct OWNER, TABLE_NAME from DBA_TAB_COLUMNS where DATA_TYPE in ('NCHAR','NVARCHAR2', 'NCLOB'); SQL>SPOOL nlsnew.log SQL>SHUTDOWN IMMEDIATE; SQL>STARTUP MOUNT; SQL> alter system enable restricted session; SQL> alter system set job_queue_processes=0; SQL> alter system set aq_tm_processes=0; SQL> alter database open; SQL> alter database amrims character set TH8TISASCII; SQL> alter database amrims national character set UTF8; SQL> shutdown immediate; SQL> startup; ÇÔ¸Õ¡ÒÃÁմѧ¹Õé 1 SQL Plus --> connect sys/sys_password as sysdba 2 update props$ set value$ = 'TH8TISASCII' where name = 'NLS_CHARACTERSET'; 3 stop database (º¹ windows ä» stop ·Õè service) 4 start database (º¹ windows ä» start ·Õè service) >Åͧ·´Êͺ´Ù (µÑÇÍÂèÒ§à»ç¹¢Í§ 10g äÁè¹èÒµèÒ§¡Ñ¹) --syntax --ALTER DATABASE [<db_name>] CHARACTER SET <new_character_set>; --ALTER DATABASE [<db_name>] NATIONAL CHARACTER SET <new_NCHAR_character_set>; /*SQL> SHUTDOWN IMMEDIATE; -- or NORMAL -- <do a full backup> SQL> STARTUP MOUNT; SQL> ALTER SYSTEM ENABLE RESTRICTED SESSION; SQL> ALTER SYSTEM SET JOB_QUEUE_PROCESSES=0; SQL> ALTER DATABASE OPEN; SQL> ALTER DATABASE CHARACTER SET <new_character_set_name>; SQL> SHUTDOWN IMMEDIATE; -- or NORMAL SQL> STARTUP; */ ÇÔ¸Õ·Ó·Õèä´é¼ÅÁÒ¡·ÕèÊØ´ --Set NLS_CHARACTERSET sqlplus / as sysdba; SHUTDWON IMMEDIATE; STARTUP MOUNT; ALTER SYSTEM ENABLE RESTRICTED SESSION; ALTER DATABASE OPEN; ALTER DATABASE CHARACTER SET INTERNAL_USE TH8TISASCII; --this work --ËÃ×Í ALTER DATABASE CHARACTER SET TH8TISASCII; --ãªéä´é㹡óշÕè set language ·ÕèÁÕ¢¹Ò´¹éÍ¡ÇèÒÁÒÂѧ¢¹Ò´ãËè
  • 2. SHUTDWON IMMEDIATE; STARTUP; --Set NLS_CHARACTERSET, NLS_NCHAR_CHARACTERSET sqlplus / as sysdba; SHUTDWON IMMEDIATE; STARTUP MOUNT; ALTER SYSTEM ENABLE RESTRICTED SESSION; ALTER DATABASE OPEN ; UPDATE props$ SET value$='TH8TISASCII' WHERE name IN ('NLS_CHARACTERSET', 'NLS_NCHAR_CHARACTERSET'); commit; SHUTDWON IMMEDIATE; STARTUP; ËÃ×ÍÇÔ¸Õ¡ÒÃÃÇÁ·Ñé§ÊͧÍÂèÒ§à¢éÒ´éÇ¡ѹà»ç¹ statement à´ÕÂÇ --Set NLS_CHARACTERSET áÅÐ Set NLS_CHARACTERSET, NLS_NCHAR_CHARACTERSET sqlplus / as sysdba; SHUTDWON IMMEDIATE; STARTUP MOUNT; ALTER SYSTEM ENABLE RESTRICTED SESSION; ALTER DATABASE OPEN; ALTER DATABASE CHARACTER SET INTERNAL_USE TH8TISASCII; --this work UPDATE props$ SET value$='TH8TISASCII' WHERE name IN ('NLS_CHARACTERSET', 'NLS_NCHAR_CHARACTERSET'); commit; SHUTDWON IMMEDIATE; STARTUP;