SQL> select * fromnls_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 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-RRHH.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.4.0 已选择20行。 SQL> shutdown immediate; 数据库已经关闭。 已经卸载数据库。 ORACLE 例程已经关闭。 SQL> startup mount; ORACLE 例程已经启动。 Total System Global Area 2538741760 bytes Fixed Size 2283904 bytes Variable Size 637535872 bytes Database Buffers 1879048192 bytes Redo Buffers 19873792 bytes 数据库装载完毕。 SQL> ALTER DATABASE CHARACTER SETZHS16GBK; ALTER DATABASE CHARACTER SET ZHS16GBK * 第 1 行出现错误: ORA-12712: 新字符集必须为旧字符集的超集 SQL> ALTER DATABASE character set INTERNAL_USEZHS16GBK; ALTER DATABASE character set INTERNAL_USEZHS16GBK * 第 1 行出现错误: ORA-12719: 操作要求数据库处于 RESTRICTED 模式下 SQL> ALTER SYSTEM ENABLE RESTRICTEDSESSION; 系统已更改。 SQL> ALTER DATABASE character setINTERNAL_USE ZHS16GBK; ALTER DATABASE character set INTERNAL_USEZHS16GBK * 第 1 行出现错误: ORA-00604: 递归 SQL 级别 1 出现错误 ORA-01109: 数据库未打开 SQL> alter database open; 数据库已更改。 SQL> ALTER DATABASE character setINTERNAL_USE ZHS16GBK; 数据库已更改。 SQL> select * from v$nls_parameters; PARAMETER VALUE ----------------------------------------------------------------------------------------------------------------------- NLS_LANGUAGE SIMPLIFIED CHINESE NLS_TERRITORY CHINA NLS_CURRENCY ¥ NLS_ISO_CURRENCY CHINA NLS_NUMERIC_CHARACTERS ., NLS_CALENDAR GREGORIAN NLS_DATE_FORMAT DD-MON-RR NLS_DATE_LANGUAGE SIMPLIFIED CHINESE NLS_CHARACTERSET ZHS16GBK NLS_SORT BINARY NLS_TIME_FORMAT HH.MI.SSXFF AM 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_NCHAR_CHARACTERSET AL16UTF16 NLS_COMP BINARY NLS_LENGTH_SEMANTICS BYTE NLS_NCHAR_CONV_EXCP FALSE 已选择19行。 SQL> select userenv('language') fromdual; USERENV('LANGUAGE') ---------------------------------------------------- SIMPLIFIED CHINESE_CHINA.ZHS16GBK
|