您好,登錄后才能下訂單哦!
今天用PLSQL的時候通過EXCEL導入數據,發現中文均顯示為?
確認是數據庫字符集沒有設置正常:對比正常的數據庫發現NLS_CHARACTERSET為ZHS16GBK
SQL> select name,value$ from props$ where name like 'NLS%'; NAME VALUE$ ------------------------------ ---------------------------------------- NLS_LANGUAGE AMERICAN NLS_TERRITORY AMERICA NLS_CURRENCY $ NLS_ISO_CURRENCY AMERICA NLS_NUMERIC_CHARACTERS ., NLS_CHARACTERSET ZHS16GBK NLS_CALENDAR GREGORIAN NLS_DATE_FORMAT DD-MON-RR NLS_DATE_LANGUAGE AMERICAN NLS_SORT BINARY NLS_TIME_FORMAT HH.MI.SSXFF AM NAME VALUE$ ------------------------------ ---------------------------------------- NLS_TIMESTAMP_FORMAT DD-MON-RR HH.MI.SSXFF AM NLS_TIME_TZ_FORMAT HH.MI.SSXFF AM TZR NLS_TIMESTAMP_TZ_FORMAT DD-MON-RR HH.MI.SSXFF AM TZR NLS_DUAL_CURRENCY $ NLS_COMP BINARY NLS_LENGTH_SEMANTICS BYTE NLS_NCHAR_CONV_EXCP FALSE NLS_NCHAR_CHARACTERSET AL16UTF16 NLS_RDBMS_VERSION 10.2.0.4.0
網上提供的方式是直接update這個列的值,但update以后
SQL> update props$ set value$='AL32UTF8' where name='NLS_CHARACTERSET';
查看一下當前數據庫的字符集信息,雖然視圖顯示修改成功了。但
SQL> col value for a40 SQL> Select * from NLS_DATABASE_PARAMETERS; PARAMETER VALUE ------------------------------ ---------------------------------------- NLS_LANGUAGE AMERICAN NLS_TERRITORY AMERICA NLS_CURRENCY $ NLS_ISO_CURRENCY AMERICA NLS_NUMERIC_CHARACTERS ., NLS_CHARACTERSET AL32UTF8 NLS_CALENDAR GREGORIAN NLS_DATE_FORMAT DD-MON-RR NLS_DATE_LANGUAGE AMERICAN NLS_SORT BINARY NLS_TIME_FORMAT HH.MI.SSXFF AM PARAMETER VALUE ------------------------------ ---------------------------------------- NLS_TIMESTAMP_FORMAT DD-MON-RR HH.MI.SSXFF AM NLS_TIME_TZ_FORMAT HH.MI.SSXFF AM TZR NLS_TIMESTAMP_TZ_FORMAT DD-MON-RR HH.MI.SSXFF AM TZR NLS_DUAL_CURRENCY $ NLS_COMP BINARY NLS_LENGTH_SEMANTICS BYTE NLS_NCHAR_CONV_EXCP FALSE NLS_NCHAR_CHARACTERSET AL16UTF16 NLS_RDBMS_VERSION 11.2.0.1.0
進行DDL等操作的時候會出現ORA-06553: PLS-553 的錯誤提示:
CM-CFG-5029 Content Manager is unable to determine whether the content store is initialized. ORA-06552: PL/SQL: Compilation unit analysis terminated ORA-06553: PLS-553: character set name is not recognized
可以判斷是字符集沖突導致的,查看
ALTER DATABASE CHARACTER SET ZHS16GBK; ALTER DATABASE CHARACTER SET INTERNAL_USE ZHS16GBK;
修改的時候還遇到一個錯誤提示:
ERROR at line 1: ORA-12719: operation requires database is in RESTRICTED mode [oracle@021Y-SH-BKAP ~]$ oerr ora 12719 12719, 00000, "operation requires database is in RESTRICTED mode" // *Cause: This command can only be run when the database is in RESTRICTED mode // *Action: Ensure that the system is in RESTRICTED mode
解決方式:
SHUTDOWN IMMEDIATE; STARTUP MOUNT EXCLUSIVE; ALTER SYSTEM ENABLE RESTRICTED SESSION
確認修改成功后,重啟數據庫。注意如果是生產環境重啟前也要關閉工作計劃。
show parameter job_queue_processes; show parameter aq_tm_processes; alter database set job_queue_processes=0;
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。