CentOS Data Guard数据库更改字符集备库需要单独操作
创始人
2024-06-23 10:01:23
0

在向大家详细介绍CentOS Data Guard 之前,首先让大家了解下CentOS Data Guard ,然后全面介绍CentOS Data Guard ,希望对大家有用。[实验]CentOS Data Guard环境下修改数据库字符集 环境.

  1. VMWARE  
  2. OS:CentOS 5.3  
  3. Primary:Oracle 10.2.0.1.0  
  4. Standby:Oracle 10.2.0.1.0 

CentOS Data Guard下面的操作均在Primary上,不会影响到Standby DB,备库需要单独操作。数据库更改字符集:源字符集CentOS Data Guard目标字符集WE8ISO8859P1 --> AL32UTF8AL16UTF16 --> AL16UTF16

<方法一>:由于目标CentOS Data Guard字符集不是源字符集的超集,所以导致失败

  1.   Startup nomount;  
  2.   Alter database mount exclusive;  
  3.   Alter system enable restricted session;  
  4.   Alter system set job_queue_processes=0;**  
  5.   Alter database open;  
  6.   Alter database character set AL32UTF8; 


在***一步报错,内容为目标字符集不是源字符集的超集过程:

  1. SQL> shutdown immediate;  
  2. Database closed.  
  3. Database dismounted.  
  4. ORACLE instance shut down.  
  5. SQL> startup nomount;  
  6. ORA-32004: obsolete and/or deprecated parameter(s) specified  
  7. ORACLE instance started.  
  1. Total System Global Area  272629760 bytes  
  2. Fixed Size                  1218920 bytes  
  3. Variable Size              92276376 bytes  
  4. Database Buffers          176160768 bytes  
  5. Redo Buffers                2973696 bytes  
  6. SQL> Alter database mount exclusive;  
  1. Database altered.  
  2. SQL> Alter system enable restricted session;  
  3. System altered.  
  4. SQL> Alter system set job_queue_processes=0;  
  5. System altered.  
  6. SQL> Alter database open;  
  7. Database altered.  
  8. SQL> Alter database character set AL32UTF8;  
  9. Alter database character set AL32UTF8  
  10. ERROR at line 1:  
  11. ORA-12712: new character set must be a superset of old character set  
  1. SQL> host  
  2. [oracle@Primary ~]$ oerr ora 12712  
  3. 12712, 00000, "new character set must be a superset of old character set"  
  4. // *Cause: When you ALTER DATABASE ... CHARACTER SET, the new  
  5. //         character set must be a superset of the old character set.  
  6. //         For example, WE8ISO8859P1 is not a superset of the WE8DEC.  
  7. // *Action: Specify a superset character set.  

 CentOS Data Guard<方法二>:成功,但此方法非常危险,可能会造成数据库崩溃
SQL> show user;
USER is "SYS"
SQL> select status from v$instance; 
STATUS
OPEN
SQL> update props$ set value$ = 'AL32UTF8' where name = 'NLS_CHARACTERSET';
 
1 row updated.SQL> update props$ set value$ = 'AL16UTF16' where name = 'NLS_NCHAR_CHARACTERSET';1 row updated.SQL> commit;Commit complete.
 
SQL> exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
/home/oracle>sqlplus / as sysdba;
 
SQL*Plus: Release 10.2.0.1.0 - Production on Wed Apr 15 17:15:47 2009
Copyright (c) 1982, 2005, Oracle.  All rights reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
 
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup mount;
ORA-32004: obsolete and/or deprecated parameter(s) specified
ORACLE instance started.
 
Total System Global Area  272629760 bytes
Fixed Size                  1218920 bytes
Variable Size              92276376 bytes
Database Buffers          176160768 bytes
Redo Buffers                2973696 bytes
Database mounted.
SQL> alter system enable restricted session;
 
System altered.
 
SQL> alter system set job_queue_processes=0;
 
System altered.
 
SQL> alter database open;
 
Database altered.
 
SQL> alter database character set AL32UTF8;
 
Database altered.
 
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> exit
/home/oracle>sqlplus / as sysdba;
 
SQL*Plus: Release 10.2.0.1.0 - Production on Wed Apr 15 17:21:15 2009
 
Copyright (c) 1982, 2005, Oracle.  All rights reserved.
 
Connected to an idle instance.
 
SQL> startup
ORA-32004: obsolete and/or deprecated parameter(s) specified
ORACLE instance started.
 
Total System Global Area  272629760 bytes
Fixed Size                  1218920 bytes
Variable Size              92276376 bytes
Database Buffers          176160768 bytes
Redo Buffers                2973696 bytes
Database mounted.
Database opened.
 
SQL>select * from v$nls_parameters;
1 NLS_LANGUAGE SIMPLIFIED CHINESE
2 NLS_TERRITORY CHINA
3 NLS_CURRENCY ?
4 NLS_ISO_CURRENCY CHINA
5 NLS_NUMERIC_CHARACTERS .,
6 NLS_CALENDAR GREGORIAN
7 NLS_DATE_FORMAT DD-MON-RR
8 NLS_DATE_LANGUAGE SIMPLIFIED CHINESE
9 NLS_CHARACTERSET WE8ISO8859P1
10 NLS_SORT BINARY
11 NLS_TIME_FORMAT HH.MI.SSXFF AM
12 NLS_TIMESTAMP_FORMAT DD-MON-RR HH.MI.SSXFF AM
13 NLS_TIME_TZ_FORMAT HH.MI.SSXFF AM TZR
14 NLS_TIMESTAMP_TZ_FORMAT DD-MON-RR HH.MI.SSXFF AM TZR
15 NLS_DUAL_CURRENCY ?
16 NLS_NCHAR_CHARACTERSET AL16UTF16
17 NLS_COMP BINARY
18 NLS_LENGTH_SEMANTICS BYTE
19 NLS_NCHAR_CONV_EXCP FALSE
CentOS Data Guard成功更改!

【编辑推荐】

  1. CentOS plproxy查询安装pgsql编译源码
  2. CentOS VNC试验用的工控机不支持鼠标
  3. CentOS gcc安装问题的解决方法
  4. CentOS系统是Linux常见版本之一
  5. CentOS PPPOE安装配置客户端软件和前提条件

相关内容

热门资讯

如何允许远程连接到MySQL数... [[277004]]【51CTO.com快译】默认情况下,MySQL服务器仅侦听来自localhos...
如何利用交换机和端口设置来管理... 在网络管理中,总是有些人让管理员头疼。下面我们就将介绍一下一个网管员利用交换机以及端口设置等来进行D...
施耐德电气数据中心整体解决方案... 近日,全球能效管理专家施耐德电气正式启动大型体验活动“能效中国行——2012卡车巡展”,作为该活动的...
Windows恶意软件20年“... 在Windows的早期年代,病毒游走于系统之间,偶尔删除文件(但被删除的文件几乎都是可恢复的),并弹...
20个非常棒的扁平设计免费资源 Apple设备的平面图标PSD免费平板UI 平板UI套件24平图标Freen平板UI套件PSD径向平...
德国电信门户网站可实时显示全球... 德国电信周三推出一个门户网站,直观地实时提供其安装在全球各地的传感器网络检测到的网络攻击状况。该网站...
着眼MAC地址,解救无法享受D... 在安装了DHCP服务器的局域网环境中,每一台工作站在上网之前,都要先从DHCP服务器那里享受到地址动...
为啥国人偏爱 Mybatis,... 关于 SQL 和 ORM 的争论,永远都不会终止,我也一直在思考这个问题。昨天又跟群里的小伙伴进行...