今天安装了oracle11g数据库,安装完毕后发现数据的字符集不是常用的utf8,所以决定修改:
下面是修改的过程,记录一下:
SQL> select userenv('language') from dual;
USERENV('LANGUAGE')
----------------------------------------------------
AMERICAN_AMERICA.WE8MSWIN1252
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup mount;
ORACLE instance started.
Total System Global Area 688959488 bytes
Fixed Size 2216544 bytes
Variable Size 440405408 bytes
Database Buffers 239075328 bytes
Redo Buffers 7262208 bytes
Database mounted.
SQL> alter session set sql_trace=true;
Session altered.
SQL> alter system enable restricted session;
System altered.
SQL> alter system set job_queue_processes=0;
System altered.
SQL> alter system set aq_tm_processes=0;
System altered.
SQL> alter database open;
Database altered.
SQL> alter database character set utf-8;
alter database character set utf-8
*
ERROR at line 1:
ORA-00933: SQL command not properly ended
SQL> alter database character set internal_use utf8;
Database altered.
SQL> update props$ set value$='utf8' where name='nls_nchar_characterset';
0 rows updated.
SQL> shutdown immediate;
ORA-01097: cannot shutdown while in a transaction - commit or rollback first
SQL> commit;
Commit complete.
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup;
ORACLE instance started.
Total System Global Area 688959488 bytes
Fixed Size 2216544 bytes
Variable Size 440405408 bytes
Database Buffers 239075328 bytes
Redo Buffers 7262208 bytes
Database mounted.
Database opened.
SQL> select userenv('language') from dual;
USERENV('LANGUAGE')
----------------------------------------------------
AMERICAN_AMERICA.UTF8
SQL>
阅读(1180) | 评论(0) | 转发(0) |