Linux环境下数据库字符集更改GB18030

1、以管理员身份进入数据库
export ORACLE_SID=orcl (ora-12162 TNS:net service name is incorrectly specified 错误解决)
$sqlplus / as sysdba

2、修改字符集
SHUTDOWN IMMEDIATE;
STARTUP MOUNT;
ALTER SYSTEM ENABLE RESTRICTED SESSION;
ALTER SYSTEM SET JOB_QUEUE_PROCESSES=0;
ALTER SYSTEM SET AQ_TM_PROCESSES=0;
ALTER DATABASE OPEN;
ALTER DATABASE character set INTERNAL_USE ZHS32GB18030;
SHUTDOWN; 重新启动数据库
STARTUP;

3、设置环境变量
Linux: export NLS_LANG=‘SIMPLIFIED CHINESE_CHINA.ZHS32GB18030’

你可能感兴趣的:(linux命令,数据库)