select&nb..."/>
您好,登錄后才能下訂單哦!
今天用PLSQL的時(shí)候通過EXCEL導(dǎo)入數(shù)據(jù),發(fā)現(xiàn)中文均顯示為?
確認(rèn)是數(shù)據(jù)庫字符集沒有設(shè)置正常:對比正常的數(shù)據(jù)庫發(fā)現(xiàn)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
網(wǎng)上提供的方式是直接update這個(gè)列的值,但update以后
SQL> update props$ set value$='AL32UTF8' where name='NLS_CHARACTERSET';
查看一下當(dāng)前數(shù)據(jù)庫的字符集信息,雖然視圖顯示修改成功了。但
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
進(jìn)行DDL等操作的時(shí)候會(huì)出現(xiàn)ORA-06553: PLS-553 的錯(cuò)誤提示:
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
可以判斷是字符集沖突導(dǎo)致的,查看
ALTER DATABASE CHARACTER SET ZHS16GBK; ALTER DATABASE CHARACTER SET INTERNAL_USE ZHS16GBK;
修改的時(shí)候還遇到一個(gè)錯(cuò)誤提示:
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
確認(rèn)修改成功后,重啟數(shù)據(jù)庫。注意如果是生產(chǎn)環(huán)境重啟前也要關(guān)閉工作計(jì)劃。
show parameter job_queue_processes; show parameter aq_tm_processes; alter database set job_queue_processes=0;
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。