oracle引用css报错,在oracle 10.2.0.4上配置字符集扫描工具Csscan(一)

字符集扫描工具Csscancsscan的全称是Character Set Scanner。顾名思义,此工具是用来对字符集进行扫描,来获取当转换字符集时可能发生的数据丢失。

The Csscan tool analyzes the code points in the database and verifies that they are known in the source the database characterset and known in the target database characterset.

一、安装Csscan

oracle软件安装好会自带Csscan工具, 存放路径位于$ORACLE_HOME/bin/csscan 。

Csscan工具需要用到CSMIG用户,可以通过执行 $ORACLE_HOME/rdbms/admin下的脚本csminst.sql来生成CSMIG用户和相关数据字典对象。

1、修改csminst.sql脚本

CSMIG默认的表空间是SYSTEM,可以通过修改脚本中的内容来指定表空间:

The default tablespace is SYSTEM, if you plan to run csscan against a big database then we advice to create a separate tablespace and change the $ORACLE_HOME/rdbms/admin/csminst.sql script to use this tablespace.

Modify the following statement in csminst.sql to assign your preferred tablespace to CSMIG instead of SYSTEM:

alter user csmig default tablespace SYSTEM

/

下面的授权并不需要,在11.2 和10.2.0.5版本的Csminst.sqlw会被删除掉。可以手工把它删掉,或者忽略相关的"ORA-22930 directory does not exist" 报错。

The amount of space needed depends mainly on the amount of exceptions found ( convertible and/or lossy data) and is impossible to predict upfront. It's useful to use on the first run of csscan a tablespace that is limited in size to avoid any disk space issues.

The Csminst.sql file is doing two grants to SYSTEM

grant READ on directory log_file_dir to system

/

grant READ on directory data_file_dir to system

/

2、执行csminst.sql脚本

下面执行脚本csminst.sql来生成CSMIG用户和相关数据字典对象,执行之前最好先备份一份:

[oracle@HQ-CICUTESTDB-01 admin]$ echo $ORACLE_SID

cicutedb

[oracle@HQ-CICUTESTDB-01 admin]$ sqlplus / as sysdba

SQL*Plus: Release 10.2.0.4.0 - Production on Mon Jun 16 10:55:40 2014

Copyright (c) 1982, 2007, Oracle.  All Rights Reserved.

Connected to:

Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production

With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> set TERMOUT ON

SQL> set ECHO ON

SQL> spool csminst.log

SQL> @?/rdbms/admin/csminst.sql

Csscan实际使用中不会登录csmig用户,可以把csmig锁定:

The password for the CSMIG user will be asked when running the csminst.sql script, this can be anything and we suggest to lock the CSMIG account . The actual csmig login is not used by Csscan.

SQL> conn / as sysdba

SQL> alter user csmig account lock;

最后检查安装日志:

Check the csminst.log for errors.

3、验证csscan是否能正常使用

使用如下命令来验证:

[oracle@HQ-CICUTESTDB-01 admin]$ csscan TABLE='(SYS.SQL_VERSION$)' FROMCHAR=US7ASCII TOCHAR=US7ASCII LOG=instchkc CAPTURE=N PROCESS=1 ARRAY=1024000

Character Set Scanner v2.1 : Release 10.2.0.3.0 - Production on Mon Jun 16 10:59:33 2014

Copyright (c) 1982, 2007, Oracle.  All rights reserved.

Username: xiezq

Password:

Connected to:

Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production

With the Partitioning, OLAP, Data Mining and Real Application Testing options

Enumerating table to scan...

. process 1 scanning SYS.SQL_VERSION$[AAAAIEAABAAAA/5AAA]

Creating Database Scan Summary Report...

Creating Individual Exception Report...

Scanner terminated successfully.

当看到“Scanner terminated successfully.”时,表明csscan已安装成功。

参考Oracle Support:Installing and configuring Csscan in 10g and 11g (Database Character Set Scanner) (Doc ID 745809.1)

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Oracle 数据库中字符集的更改是一个复杂的过程,需要谨慎处理以避免数据丢失或损坏。以下是一个大致的步骤流程: 1. 停止数据库,并以管理员身份登录到操作系统上。 2. 备份数据库,在备份完成后,将备份文件复制到一个安全的位置。 3. 检查当前数据库中的字符集,以确定更改为哪种字符集,并创建一个新的字符集。 4. 使用 Oracle 提供的 Database Migration Assistant for Unicode 工具,检查并解决数据库中的字符集问题。 5. 在解决了字符集问题之后,使用 Oracle 提供的 CSSCAN 工具扫描数据库中的所有数据,以确保没有任何数据丢失或损坏的风险。 6. 创建一个新的字符集的数据库,并将数据库参数设置为适合新字符集的值。 7. 使用 Oracle 提供的 Data Pump 工具,将原有的字符集的数据库中的数据导出到一个文件中。 8. 使用 Oracle 提供的 Data Pump 工具,将导出的数据文件中的数据导入到新的字符集的数据库中。 9. 调整新数据库中的对象,例如表、索引、视图等,以适应新的字符集。 10. 测试新的数据库,确保所有数据都已成功转换,并且应用程序可以正常访问新的数据库。 需要注意的是,这只是一个大致的步骤流程,具体的操作步骤可能会因为不同的环境和需求而有所不同。在进行这个过程之前,建议先仔细阅读 Oracle 文档,并咨询专业的数据库管理员或顾问的意见。同时,在进行字符集更改之前,应该充分备份数据,并进行必要的测试和验证。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值