SQL> select name, value$ from sys.props$ where name like 'NLS%';
SQL> select userenv('language') from dual;
USERENV('LANGUAGE')
----------------------------------------------------
AMERICAN_AMERICA.ZHS16GBK
----------------------------------------------------
AMERICAN_AMERICA.ZHS16GBK
[oracle@localhost hx]$ echo $NLS_LANG
可以用update 命令修改数据库的字符集,但是注意:修改字符集可能会对原有数据造成破坏,修改之前一定要先备份数据库
update props$ set value$='ZHS16GBK' where name='NLS_CHARACTERSET'
强行修改oracle数据库当前字符集。以sysdba的身份登录oracle
create database character set ZHS16GBK
* create database character set ZHS16GBK
ERROR at line 1:
ORA-01031: insufficient privileges
不用理会这个错误,用imp 装入数据。数据装完后,重启动oracle 数据,select * from V$NLS_PARAMETERS 此时,你会发现,数据库字符集又回到原来的字符集。
create database character set ZHS16GBK
* create database character set ZHS16GBK
ERROR at line 1:
ORA-01031: insufficient privileges
不用理会这个错误,用imp 装入数据。数据装完后,重启动oracle 数据,select * from V$NLS_PARAMETERS 此时,你会发现,数据库字符集又回到原来的字符集。
修改字符集
alter database character set internal_use AL32UTF8;
alter database character set internal_use AL32UTF8;
SQL> alter database character set internal_use AL32UTF8;
alter database character set internal_use AL32UTF8
*
ERROR at line 1:
ORA-12719: operation requires database is in RESTRICTED mode
SQL> alter system enable restricted session;
System altered.
SQL> alter database character set internal_use AL32UTF8;
Database altered.
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/20976446/viewspace-717023/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/20976446/viewspace-717023/