[实验]Data Guard 环境下修改数据库字符集
2009-04-20 13:39
381 查看
环境:
VMWARE
OS:CentOS 5.3
Primary:Oracle 10.2.0.1.0
Standby:Oracle 10.2.0.1.0
下面的操作均在Primary上,不会影响到Standby DB,备库需要单独操作。
数据库更改字符集:
源字符集 目标字符集
WE8ISO8859P1 --> AL32UTF8
AL16UTF16 --> AL16UTF16
<方法一>:由于目标字符集不是源字符集的超集,所以导致失败
Startup nomount;
Alter database mount exclusive;
Alter system enable restricted session;
Alter system set job_queue_processes=0;**
Alter database open;
Alter database character set AL32UTF8;
在最后一步报错,内容为目标字符集不是源字符集的超集
过程:
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup nomount;
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
SQL> Alter database mount exclusive;
Database altered.
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;
Alter database character set AL32UTF8
*
ERROR at line 1:
ORA-12712: new character set must be a superset of old character set
SQL> host
[oracle@Primary ~]$ oerr ora 12712
12712, 00000, "new character set must be a superset of old character set"
// *Cause: When you ALTER DATABASE ... CHARACTER SET, the new
// character set must be a superset of the old character set.
// For example, WE8ISO8859P1 is not a superset of the WE8DEC.
// *Action: Specify a superset character set.
<方法二>:成功,但此方法非常危险,可能会造成数据库崩溃
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
成功更改!
VMWARE
OS:CentOS 5.3
Primary:Oracle 10.2.0.1.0
Standby:Oracle 10.2.0.1.0
下面的操作均在Primary上,不会影响到Standby DB,备库需要单独操作。
数据库更改字符集:
源字符集 目标字符集
WE8ISO8859P1 --> AL32UTF8
AL16UTF16 --> AL16UTF16
<方法一>:由于目标字符集不是源字符集的超集,所以导致失败
Startup nomount;
Alter database mount exclusive;
Alter system enable restricted session;
Alter system set job_queue_processes=0;**
Alter database open;
Alter database character set AL32UTF8;
在最后一步报错,内容为目标字符集不是源字符集的超集
过程:
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup nomount;
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
SQL> Alter database mount exclusive;
Database altered.
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;
Alter database character set AL32UTF8
*
ERROR at line 1:
ORA-12712: new character set must be a superset of old character set
SQL> host
[oracle@Primary ~]$ oerr ora 12712
12712, 00000, "new character set must be a superset of old character set"
// *Cause: When you ALTER DATABASE ... CHARACTER SET, the new
// character set must be a superset of the old character set.
// For example, WE8ISO8859P1 is not a superset of the WE8DEC.
// *Action: Specify a superset character set.
<方法二>:成功,但此方法非常危险,可能会造成数据库崩溃
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
成功更改!
相关文章推荐
- Data Guard 环境修改主备库IP地址
- 使用internal_convert修改oracle 10g 数据库字符集
- 修改Oracle 10g数据库字符集
- 修改数据库字符集,字段字符集(mysql)
- Oracle Data Guard 环境下的数据库升级方法
- 修改mysql默认字符集的方法(插入数据库数据乱码)
- mysql修改数据库编码(数据库字符集)和表的字符编码的方法
- 修改Mysql中数据库的字符集
- 修改数据库字符集以及导入数据
- 【Oracle XE系列之一】Windows 7 64位安装Oracle XE(32位)数据库(REG_XE报错、字符集、修改8080端口等)
- sql2005 数据库的字符集修改
- Oracle 客户端注册表字符集修改,解决数据库导入时乱码
- 10g中如何修改数据库字符集-4
- 修改数据库用户名--CMD环境执行有效
- linux下mysql的默认字符集修改和默认数据库引擎的修改
- 修改shell环境字符集(locale)
- Oracle修改数据库字符集
- 网络数据库编程实验一JDBC数据库编程环境配置
- mysql修改默认的环境的字符集为utf-8
- 将数据库结构修改提交到生产环境下数据库