修改資料庫字符集(轉)
在Redhat上安裝Oracle10g沒有設定字符集,採用的是作業系統預設字符集:US7ASCII,將字符集修改為:ZHS16GBK。由於過程不可逆,首先需要備份資料庫。 1.資料庫全備 2.查詢當前字符集 SQL> select * from nls_database_parameters where parameter='NLS_CHARACTERSET'; PARAMETER VALUE ---------------------------------------- ---------------------------------------- NLS_CHARACTERSET US7ASCII 3.關閉資料庫 SQL> shutdown immediate Database closed. Database dismounted. ORACLE instance shut down. 4.啟動資料庫到mount狀態 SQL> startup mount ORACLE instance started. Total System Global Area 205520896 bytes Fixed Size 1266608 bytes Variable Size 100666448 bytes Database Buffers 100663296 bytes Redo Buffers 2924544 bytes Database mounted. 5.限制session SQL> alter system enable restricted session; System altered. 6.查詢相關引數並修改 SQL> show parameter job_queue_processes; NAME TYPE VALUE ------------------------------------ ----------- ------------------------------ job_queue_processes integer 10 SQL> show parameter aq_tm_processes; NAME TYPE VALUE ------------------------------------ ----------- ------------------------------ aq_tm_processes integer 0 SQL> alter system set job_queue_processes=0; System altered. 7.開啟資料庫 SQL> alter database open; Database altered. 8.修改字符集 SQL> alter database character set ZHS16GBK; alter database character set ZHS16GBK * ERROR at line 1: ORA-12712: new character set must be a superset of old character set 出現錯誤提示,新字符集必須是老字符集的超集,也就原來字符集是新字符集的子集,可以再Oracle官方文件上查詢字符集包含關係。下面使用Oracle內部命令internal_use,跳過超集檢查,生產環境不建議使用此方法。 SQL> alter database character set internal_use ZHS16GBK; Database altered. 9.查詢當前字符集 SQL> select * from nls_database_parameters where parameter='NLS_CHARACTERSET'; PARAMETER VALUE ---------------------------------------- ---------------------------------------- NLS_CHARACTERSET ZHS16GBK 10.關閉資料庫 SQL> shutdown immediate Database closed. Database dismounted. ORACLE instance shut down. 11.啟動資料庫到mount狀態 SQL> startup mount ORACLE instance started. Total System Global Area 205520896 bytes Fixed Size 1266608 bytes Variable Size 100666448 bytes Database Buffers 100663296 bytes Redo Buffers 2924544 bytes Database mounted. 12.將相關引數改回原來值 SQL> alter system set job_queue_processes=10; System altered.
13.SQL> ALTER SYSTEM DISABLE RESTRICTED SESSION;
System altered. 14.開啟資料庫 SQL> alter database open; Database altered.
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/23757700/viewspace-723204/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 修改資料庫字符集資料庫
- 修改Oracle資料庫字符集Oracle資料庫
- 修改Oracle資料庫字符集(zt)Oracle資料庫
- 怎樣修改資料庫字符集資料庫
- 修改oracle9i資料庫字符集的方法(轉)Oracle資料庫
- 「Oracle」資料庫字符集編碼修改Oracle資料庫
- ORA-12899 修改資料庫字符集資料庫
- Oracle修改資料字符集Oracle
- MySQL修改字符集(mysqldump轉換全庫)MySql
- 如何在10g中修改資料庫字符集資料庫
- 巧妙轉換ORACLE資料庫字符集Oracle資料庫
- oracle資料庫字符集的轉換Oracle資料庫
- 資料庫字符集的選擇(轉)資料庫
- 轉載如何修改oracle資料庫字符集_及如何繞過超集報錯Oracle資料庫
- psycopg2 修改資料庫客戶端字符集資料庫客戶端
- Oracle資料庫字符集問題解析(轉)Oracle資料庫
- ORACLE 修改資料庫的字符集編碼為UTF-8Oracle資料庫
- 資料庫字符集修改函式function nls_charset_id_name資料庫函式Function
- (轉載)Oracle資料庫字符集問題解析Oracle資料庫
- linux下mysql的預設字符集修改和預設資料庫引擎的修改LinuxMySql資料庫
- 資料庫修改資料資料庫
- Oracle 11g rac資料庫字符集轉換Oracle資料庫
- [轉載]Oracle資料庫字符集問題解析3Oracle資料庫
- [轉載]Oracle資料庫字符集問題解析2Oracle資料庫
- [轉載]Oracle資料庫字符集問題解析1Oracle資料庫
- 修改資料庫資料庫
- oracle資料庫字符集資訊Oracle資料庫
- 關於資料庫字符集資料庫
- 【轉】修改Oracle字符集(character set)Oracle
- 手工修改Oracle資料庫DBNAME-轉載Oracle資料庫
- oracle國家字符集與資料庫字符集Oracle資料庫
- 在不同字符集的資料庫之間匯入資料的方法(轉)資料庫
- [20130106]整和資料庫--修改字符集.txt資料庫
- oracle資料庫的字符集更改Oracle資料庫
- 檢視oracle資料庫字符集Oracle資料庫
- Oracle資料庫字符集介紹Oracle資料庫
- Oracle資料庫字符集問題Oracle資料庫
- Oracle資料庫字符集淺析Oracle資料庫