实验目标:rac环境修改数据库字符集. SQL>select userenv('language') from dual; USERENV('LANGUAGE') -------------------------------------------------------------------------------- AMERICAN_AMERICA.WE8MSWIN1252 SQL>alter system set cluster_database=false scope=spfile sid='pacs1'; (说明:此参数需修改,否则后面操作会报错) Systemaltered. SQL>exit Disconnectedfrom Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bitProduction With thePartitioning, Real Application Clusters, Automatic Storage Management, OLAP, DataMining and Real Application Testing options [oracle@hisdb1~]$ srvctl stop database -d pacs 启动数据库(节点1执行) [oracle@hisdb1~]$ sqlplus / as sysdba SQL*Plus:Release 11.2.0.4.0 Production on Sun Aug 7 10:55:25 2022 Copyright(c) 1982, 2013, Oracle. All rights reserved. Connectedto an idle instance. SQL>startup nomount; ORACLEinstance started. TotalSystem Global Area 2956300288 bytes FixedSize 2256912 bytes VariableSize 687869936 bytes DatabaseBuffers 2248146944 bytes RedoBuffers 18026496 bytes SQL>alter database mount exclusive; Databasealtered. SQL>alter system enable restricted session; Systemaltered. SQL>alter system set job_queue_processes=0; Systemaltered. SQL>alter database open; Databasealtered. SQL>alter system enable restricted session; Systemaltered. SQL>alter database character set internal_use al32utf8; Databasealtered. SQL>alter system set cluster_database=true scope=spfile sid='pacs1'; (说明:此处需将cluster_database修改回true,否则后面启动数据库会报错) Systemaltered. SQL>shutdown immediate; Databaseclosed. Databasedismounted. ORACLEinstance shut down. SQL>exit Disconnectedfrom Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bitProduction With thePartitioning, Real Application Clusters, Automatic Storage Management, OLAP, DataMining and Real Application Testing options [oracle@hisdb1~]$ srvctl start database -d pacs [oracle@hisdb1~]$ sqlplus / as sysdba SQL*Plus:Release 11.2.0.4.0 Production on Sun Aug 7 11:00:14 2022 Copyright(c) 1982, 2013, Oracle. All rightsreserved. Connectedto: OracleDatabase 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production With thePartitioning, Real Application Clusters, Automatic Storage Management, OLAP, Data Miningand Real Application Testing options SQL>select userenv('language') from dual; USERENV('LANGUAGE') ---------------------------------------------------- AMERICAN_AMERICA.AL32UTF8 说明:节点2查询后字符集也变为al32utf8.非必要情况不要修改数据库字符集,以免造成其它未知异常. 一次新安装好的数据库,因为字符集未满足要求,经验丰富的DBA都建议删除后重新创建数据库. 非rac环境也可用该方法修改数据库字符集,不过cluster_database参数不用做处理.
|