切換oracle用戶
[root@train ~]# su - oracle
Last login: Thu Apr 16 13:35:35 CST 2020 on pts/1
登錄到oracle
[oracle@train ~]$ sqlplus / as sysdba
SQL*Plus: Release 12.2.0.1.0 Production on Fri Apr 17 09:48:42 2020
Copyright (c) 1982, 2016, Oracle. All rights reserved.
Connected to an idle instance.
將oracle關閉
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
進入mount模式
SQL> startup mount
ORACLE instance started.
Total System Global Area 1543503872 bytes
Fixed Size 8621040 bytes
Variable Size 989856784 bytes
Database Buffers 536870912 bytes
Redo Buffers 8155136 bytes
Database mounted.
Database opened.
啓用受限會話
SQL> ALTER SYSTEM ENABLE RESTRICTED SESSION;
System altered.
設置作業隊列進程爲0(當設置爲0的時候任何方式創建的job都無法執行)
SQL> ALTER SYSTEM SET JOB_QUEUE_PROCESSES=0;
System altered.
設置Qnnn進程和QMNC進程爲0(爲了防止修改字符集時還有其他任務執行)
SQL> ALTER SYSTEM SET AQ_TM_PROCESSES=0;
System altered.
SQL> alter database open;
Database altered.
SQL> ALTER DATABASE CHARACTER SET ZHS16GBK;
Database altered.
SQL> ALTER DATABASE character set INTERNAL_USE ZHS16GBK;
Database altered.
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup
ORACLE instance started.
Total System Global Area 1543503872 bytes
Fixed Size 8621040 bytes
Variable Size 989856784 bytes
Database Buffers 536870912 bytes
Redo Buffers 8155136 bytes
Database mounted.
Database opened.
查看修改結果
SQL> select * from v$nls_parameters;