Nls

153 views

Published on

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
153
On SlideShare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
2
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Nls

  1. 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 wheresid=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.logSQL>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 sysdba2 update props$set value$ = TH8TISASCIIwhere 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 NORMALSQL> STARTUP;*/ÇÔ¸Õ·Ó·Õèä´é¼ÅÁÒ¡·ÕèÊØ´--Set NLS_CHARACTERSETsqlplus / 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; --ãªéä´é㹡óշÕè setlanguage ·ÕèÁÕ¢¹Ò´¹éÍ¡ÇèÒÁÒÂѧ¢¹Ò´ãËè
  2. 2. SHUTDWON IMMEDIATE;STARTUP; --Set NLS_CHARACTERSET, NLS_NCHAR_CHARACTERSETsqlplus / 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_CHARACTERSETsqlplus / as sysdba;SHUTDWON IMMEDIATE;STARTUP MOUNT;ALTER SYSTEM ENABLE RESTRICTED SESSION;ALTER DATABASE OPEN;ALTER DATABASE CHARACTER SET INTERNAL_USE TH8TISASCII; --this workUPDATE props$ SET value$=TH8TISASCII WHERE name IN (NLS_CHARACTERSET,NLS_NCHAR_CHARACTERSET);commit;SHUTDWON IMMEDIATE;STARTUP;

×