2016年8月9日 星期二

[ORACLE] 在RAC環境下變更資料庫端的CHARACTER(字符集)

說明:
1. 從AL32UTF8轉換為ZHT16BIG5
2. NODE01的INSTANCE為orcl1(主要操作主機,重點在alter system set cluster_database=false scope=spfile sid='orcl1';)
3. NODE01的INSTANCE為orcl1
4. NODE02的INSTANCE為orcl2
5. 別用srvctl語法下上DB

在NODE01上
[oracle@racnode01 ~]$ sqlplus / as sysdba

SQL> select userenv('language') from dual;
          USERENV('LANGUAGE')
          ----------------------------------------------------
          AMERICAN_AMERICA.AL32UTF8

SQL> select instance_name from v$instance;
          INSTANCE_NAME
          ----------------
          orcl1

SQL> alter system set cluster_database=false scope=spfile sid='orcl1';

SQL> shutdown immediate;

在NODE02上
[oracle@racnode02 ~]$ sqlplus / as sysdba

SQL> select instance_name from v$instance;
          INSTANCE_NAME
          ----------------
          orcl2

SQL> shutdown immediate;

在NODE01上
SQL> startup nomount;

SQL> Alter database mount exclusive;

SQL> Alter system enable restricted session;

SQL> ALTER SYSTEM SET JOB_QUEUE_PROCESSES=0;

SQL> Alter database open;

SQL> ALTER DATABASE CHARACTER SET INTERNAL_USE ZHT16BIG5;

SQL> alter system set cluster_database=true scope=spfile sid='orcl1';

SQL> shutdown immediate;

SQL> startup;

SQL> select userenv('language') from dual;
         USERENV('LANGUAGE')
         ----------------------------------------------------
         AMERICAN_AMERICA.ZHT16BIG5

在NODE02上
SQL> startup;

SQL> select userenv('language') from dual;
          USERENV('LANGUAGE')
          ----------------------------------------------------
         AMERICAN_AMERICA.ZHT16BIG5

沒有留言:

張貼留言