Oracle 12c修改字符集的方法(解決數(shù)據(jù)導入后中文亂碼及ORA-12899錯誤)
之前在Windows上安裝的Oracle,現(xiàn)在遷移到Linux上,把dmp文件導入Linux的時候發(fā)現(xiàn)字段的注釋和存儲過程中的中文是問號?,而且導入的時候還會報ORA-12899錯誤。其實這些都是字符集問題。
1、查詢當前字符集
select * from nls_database_parameters where parameter='NLS_CHARACTERSET';
如果不是ZHS16GBK說明確實是字符集問題。
2、關閉數(shù)據(jù)庫
SQL> shutdown immediate Database closed. Database dismounted. ORACLE instance shut down.
3、啟動數(shù)據(jù)庫到mount狀態(tài)
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.
4、限制session
SQL> alter system enable restricted session; System altered.
5、禁用作業(yè)調度進程,確保無進程調用數(shù)據(jù)庫
先查詢之前的值
SQL> show parameter job_queue_processes;

把參數(shù)置為0
SQL> alter system set job_queue_processes=0; System altered.
6、打開數(shù)據(jù)庫
alter database open;
7、修改字符集
SQL> alter database character set internal_use ZHS16GBK; Database altered.
8、查詢當前字符集
SQL> select * from nls_database_parameters where parameter='NLS_CHARACTERSET'; PARAMETER VALUE ---------------------------------------- ---------------------------------------- NLS_CHARACTERSET ZHS16GBK
9、重復2關閉數(shù)據(jù)庫和3啟動數(shù)據(jù)庫到mount狀態(tài)并將作業(yè)調度進程參數(shù)調回之前的值
SQL> shutdown immediate Database closed. Database dismounted. ORACLE instance shut down. 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. SQL> alter system set job_queue_processes=110; System altered.
10、恢復session
SQL> ALTER SYSTEM DISABLE RESTRICTED SESSION; System altered.
11、打開數(shù)據(jù)庫
SQL> alter database open; Database altered.
到此這篇關于Oracle 12c修改字符集的方法(解決數(shù)據(jù)導入后中文亂碼及ORA-12899錯誤)的文章就介紹到這了,更多相關Oracle 12c修改字符集內容請搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關文章希望大家以后多多支持腳本之家!
相關文章
Oracle動態(tài)視圖v$active_session_history實戰(zhàn)示例
這篇文章主要為大家介紹了Oracle動態(tài)視圖v$active_session_history實戰(zhàn)示例詳解,有需要的朋友可以借鑒參考下,希望能夠有所幫助,祝大家多多進步,早日升職加薪2023-03-03
MSSQL與Oracle數(shù)據(jù)庫事務隔離級別與鎖機制對比
事務隔離級別是并發(fā)控制的整體解決方案,其實際上是綜合利用各種類型的鎖和行版本控制,來解決并發(fā)問題。鎖是數(shù)據(jù)庫并發(fā)控制的內部機制,是基礎。對用戶來說,只有當事務隔離級別無法解決一些并發(fā)問題和需求時,才有必要在語句中手動設置鎖。2014-08-08
Oracle中 關于數(shù)據(jù)庫存儲過程和存儲函數(shù)的使用
本篇文章,小編將為大家介紹,在Oracle中 關于數(shù)據(jù)庫存儲過程和存儲函數(shù)的使用,有需要的朋友可以參考一下2013-04-04

