oracle的字符集檢查工具CSSCAN(三)

楊奇龍發表於2011-03-14
oracle 提供了兩個關於字符集檢查的工具,一個csscan,一個是lcsscan(Language and Character Set File Scanner)
一 Database Character Set Scanner(csscan)
剛開始使用csscan時會遇到 CSS-00107錯誤,
CSS-00107: Character set migration utility schema not installed
原因可以從提示得到:未安裝CSSCAN.
所以先安裝csscan
以sys 身份執行如下語句:
sys@ORACL> @D:\oracle\product\11.1.0\db_1\RDBMS\ADMIN\csminst.sql
授權成功。
授權成功。
使用者已刪除。
Please create password for user CSMIG:
輸入 csmig_passwd 的值:  yang
原值    1: create user csmig identified by &csmig_passwd
新值    1: create user csmig identified by yang
使用者已建立。
授權成功。
授權成功。
........
授權成功。
授權成功。
使用者已更改。
已建立0行。
已更新 1 行。
同義詞已建立。
......
檢視已建立。
提交完成。
2)使用 csscan工具對資料庫進行檢查。被檢測資料庫是ZHS16GBK,要匯入到AL32UTF8中的資料庫中,檢查是否有在資料遷移過程中是否有錯誤。
C:\Users\aaaa>csscan \"system/yang as sysdba \" user=yang tochar=al32utf8 array=104000 process=2
Character Set Scanner v2.2 : Release 11.1.0.6.0 - Production on 星期一 3月 14 12:19:06 2011
Copyright (c) 1982, 2007, Oracle.  All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
Enumerating tables to scan...
. process 1 scanning YANG.TEST[AAARWYAAGAAAAAJAAA]
. process 2 scanning YANG.TEST[AAARWYAAGAAAH+JAAA]
. process 1 scanning YANG.TEST[AAARWYAAEAAAAGJAAA]
. process 2 scanning YANG.TEST_CHAR[AAARjpAAGAAAABhAAA]
. process 1 scanning YANG.FIXED[AAARfqAAGAAAABRAAA]
. process 2 scanning YANG.TEST_BYTE[AAARjoAAGAAAABZAAA]
. process 2 scanning YANG.A[AAARbbAAEAAAAKBAAA]
. process 2 scanning YANG.DEPT[AAARZ8AAEAAADpJAAA]
. process 1 scanning YANG.FIXED_CHAR[AAARfGAAGAAAABBAAA]
. process 2 scanning YANG.TCHAR[AAARbhAAEAAADoJAAA]
Creating Database Scan Summary Report...
Creating Individual Exception Report...
Scanner terminated successfully.
檢視生成的日誌檔案:如果不指定具體的log 檔案,預設會在執行命令的當前目錄下產生scan.out  scan.txt scan.err,這裡我們比較關注scan.err 因為它裡面包含
字符集轉換出錯的資料。
Database Scan Individual Exception Report
[Database Scan Parameters]
Parameter                      Value                                           
------------------------------ ------------------------------------------------
CSSCAN Version                 v2.1                                            
Instance Name                  oracl                                           
Database Version               11.1.0.6.0                                      
Scan type                      User tables                                     
User name                      yang                                            
Scan CHAR data?                YES                                             
Database character set         ZHS16GBK                                        
FROMCHAR                       ZHS16GBK                                        
TOCHAR                         al32utf8                                        
Scan NCHAR data?               NO                                              
Array fetch buffer size        104000                                          
Number of processes            2                                               
Capture convertible data?      NO                                              
------------------------------ ------------------------------------------------
[Data Dictionary individual exceptions]
[Application data individual exceptions]
User  : YANG
Table : FIXED  ---轉換出錯的表
Column: VAL2   ---轉換出錯的欄位。
Type  : CHAR(15)
Number of Exceptions         : 499    --行數。   
Max Post Conversion Data Size: 21        
ROWID              Exception Type      Size Cell Data(first 30 bytes)     
------------------ ------------------ ----- ------------------------------
AAARfqAAGAAAABVAA+ exceed column size   21 阿里雲端計算公司                
AAARfqAAGAAAABVAA/ exceed column size    21 阿里雲端計算公司                
AAARfqAAGAAAABVAA0 exceed column size    21 阿里雲端計算公司                
AAARfqAAGAAAABVAA1 exceed column size    21 阿里雲端計算公司                
AAARfqAAGAAAABVAA2 exceed column size    21 阿里雲端計算公司                
AAARfqAAGAAAABVAA3 exceed column size    21 阿里雲端計算公司                
AAARfqAAGAAAABVAA4 exceed column size    21 阿里雲端計算公司                
AAARfqAAGAAAABVAA5 exceed column size    21 阿里雲端計算公司                  
               。。。。。。。。                 
AAARfqAAGAAAABVABj exceed column size    21 阿里雲端計算公司                
AAARfqAAGAAAABVABk exceed column size    21 阿里雲端計算公司                
AAARfqAAGAAAABVABl exceed column size    21 阿里雲端計算公司                
AAARfqAAGAAAABVABm exceed column size   21 阿里雲端計算公司                
AAARfqAAGAAAABVABn exceed column size    21 阿里雲端計算公司                
AAARfqAAGAAAABVABo exceed column size    21 阿里雲端計算公司                
AAARfqAAGAAAABVABp exceed column size    21 阿里雲端計算公司                  


來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/22664653/viewspace-689375/,如需轉載,請註明出處,否則將追究法律責任。

相關文章