步驟:
sqlplus /nolog
SQL> conn / as sysdba --需要使用SYSDBA帳戶
Connected.
SQL> startup mount
ORA-01081: cannot start already-running ORACLE - shut it down first
SQL> shutdown immediate; --停止資料庫
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup mount --啟動資料庫到 mount 狀态
ORACLE instance started.
Total System Global Area 1686925312 bytes
Fixed Size 2176368 bytes
Variable Size 989858448 bytes
Database Buffers 687865856 bytes
Redo Buffers 7024640 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> set linesize 120; --INTERNAL_USE 參數可以忽略超集檢查
SQL> ALTER DATABASE character set INTERNAL_USE AL32UTF8; --修改字元集
Database altered.
SQL> shutdown immediate; --再次關閉資料庫
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> STARTUP --啟動資料庫
ORACLE instance started.
Total System Global Area 1686925312 bytes
Fixed Size 2176368 bytes
Variable Size 989858448 bytes
Database Buffers 687865856 bytes
Redo Buffers 7024640 bytes
Database mounted.
Database opened.
SQL> select * from v$nls_parameters where parameter = 'NLS_CHARACTERSET';
PARAMETER
VALUE
NLS_CHARACTERSET
AL32UTF8
SQL>