1、查看csscan相关参数
HQ-CICUTESTDB-01:cicutedb>csscan help=y
Character Set Scanner v2.1 : Release 10.2.0.3.0 - Production on Tue Jun 17 03:26:22 2014
Copyright (c) 1982, 2007, Oracle. All rights reserved.
You can let Scanner prompt you for parameters by entering the CSSCAN
command followed by your username/password:
Example: CSSCAN SYSTEM/MANAGER
Or, you can control how Scanner runs by entering the CSSCAN command
followed by various parameters. To specify parameters, you use keywords:
Example: CSSCAN SYSTEM/MANAGER FULL=y TOCHAR=utf8 ARRAY=1024000 PROCESS=3
Keyword Default Prompt Description
---------- ------- ------ -------------------------------------------------
USERID yes username/password
FULL N yes scan entire database
USER yes owner of tables to be scanned
TABLE yes list of tables to scan
COLUMN yes list of columns to scan
EXCLUDE list of tables to exclude from scan
TOCHAR yes new database character set name
FROMCHAR current database character set name
TONCHAR new national character set name
FROMNCHAR current national character set name
ARRAY 1024000 yes size of array fetch buffer
PROCESS 1 yes number of concurrent scan process
MAXBLOCKS split table if block size exceed MAXBLOCKS
CAPTURE N capture convertible data
SUPPRESS maximum number of exceptions logged for each table
FEEDBACK report progress every N rows
BOUNDARIES list of column size boundaries for summary report
LASTRPT N generate report of the last database scan
LOG scan base file name of report files
PARFILE parameter file name
PRESERVE N preserve existing scan results
LCSD N no enable language and character set detection
LCSDDATA LOSSY no define the scope of the detection
HELP N show help screen (this screen)
QUERY N select clause to scan subset of tables or columns
---------- ------- ------ -------------------------------------------------
Scanner terminated successfully.
2、运行csscan
[oracle@HQ-CICUTESTDB-01 ~]$ csscan userid="'"sys/oracle as sysdba"'" full=y fromchar=AL32UTF8 tochar=UTF8 log=cssan_check process=4 array=1024000
。。。省略
. process 1 scanning SYS.WRH$_ACTIVE_SESSION_HISTORY[AAAlypAADAAABPBAAA]
. process 2 scanning SYS.WRH$_SERVICE_WAIT_CLASS[AAAlu4AADAAAIKRAAA]
. process 3 scanning SYS.WRH$_SGASTAT[AAAltDAADAAAIRBAAA]
. process 4 scanning SYS.WRH$_ACTIVE_SESSION_HISTORY[AAAlq2AADAAAMxxAAA]
Creating Database Scan Summary Report...
Creating Individual Exception Report...
Scanner terminated successfully.
执行完毕后,会在当前目录下生成以参数log指定命名的三个文件,分别是:cssan_check.err cssan_check.out cssan_check.txt
HQ-CICUTESTDB-01:cicutedb>more cssan_check.txtDatabase Scan Summary ReportTime Started : 2014-06-17 04:03:30Time Completed: 2014-06-17 04:06:53
Process ID Time Started Time Completed---------- -------------------- --------------------1 2014-06-17 04:03:32 2014-06-17 04:06:512 2014-06-17 04:03:32 2014-06-17 04:06:513 2014-06-17 04:03:32 2014-06-17 04:06:514 2014-06-17 04:03:32 2014-06-17 04:06:51---------- -------------------- --------------------
[Database Size]Tablespace Used Free Total Expansion------------------------- --------------- --------------- --------------- ---------------SYSTEM 598.19M 401.81M 1,000.00M 1.00KUNDOTBS1 489.00M 3,511.00M 4,000.00M .00KSYSAUX 408.13M 391.88M 800.00M .00K。。。TBLSPACE_CLAIM 127.63M 1,872.38M 2,000.00M .00KTBLSPACE_CSMIG 9.19M 90.81M 100.00M .00K------------------------- --------------- --------------- --------------- ---------------Total 23,331.38M 44,568.63M 67,900.00M 1.00K
The size of the largest CLOB is 1625114 bytes
[Database Scan Parameters]Parameter Value------------------------------ ------------------------------------------------CSSCAN Version v2.1Instance Name cicutedbDatabase Version 10.2.0.4.0Scan type Full databaseScan CHAR data? YESDatabase character set AL32UTF8FROMCHAR AL32UTF8TOCHAR UTF8Scan NCHAR data? NOArray fetch buffer size 1024000Number of processes 4Capture convertible data? NO------------------------------ ------------------------------------------------
[Scan Summary]Some character type data in the data dictionary are not convertible to the new character setSome character type application data are not convertible to the new character set
[Data Dictionary Conversion Summary]Datatype Changeless Convertible Truncation Lossy--------------------- ---------------- ---------------- ---------------- ----------------VARCHAR2 4,864,310 0 0 58CHAR 1,104 0 0 0LONG 232,188 0 0 0CLOB 39,382 0 0 0VARRAY 22,432 0 0 0--------------------- ---------------- ---------------- ---------------- ----------------Total 5,159,416 0 0 58Total in percentage 99.999% 0.000% 0.000% 0.001%
The data dictionary can not be safely migrated using the CSALTER script
[Application Data Conversion Summary]Datatype Changeless Convertible Truncation Lossy--------------------- ---------------- ---------------- ---------------- ----------------VARCHAR2 1,714,396,614 0 0 73,068CHAR 154,597 0 0 0LONG 0 0 0 0CLOB 41,562 0 0 0VARRAY 1,575 0 0 0--------------------- ---------------- ---------------- ---------------- ----------------Total 1,714,594,348 0 0 73,068Total in percentage 99.996% 0.000% 0.000% 0.004%
[Distribution of Convertible, Truncated and Lossy Data by Table]USER.TABLE Convertible Truncation Lossy-------------------------------------------------- ---------------- ---------------- ----------------SYS.SOURCE$ 0 0 5SYS.WRH$_SQLSTAT 0 0 53UKPRODRES.GCADJUSTMENTCHARGE 0 0 10UKPRODRES.GCADJUSTMENTFEE 0 0 34UKPRODRES.GCADJUSTMENTITEM 0 0 32。。。。。。
[Distribution of Convertible, Truncated and Lossy Data by Column]USER.TABLE|COLUMN Convertible Truncation Lossy-------------------------------------------------- ---------------- ---------------- ----------------SYS.SOURCE$|SOURCE 0 0 5SYS.WRH$_SQLSTAT|ACTION 0 0 53UKPRODRES.GCADJUSTMENTCHARGE|PAYEE 0 0 10UKPRODRES.GCADJUSTMENTFEE|PAYEE 0 0 34。。。。。。
[Indexes to be Rebuilt]USER.INDEX on USER.TABLE(COLUMN)-----------------------------------------------------------------------------------------UKPRODRES.IDX_GCREGISTPOLICY_INSUREDNAME on UKPRODRES.GCREGISTPOLICY(INSUREDNAME)UKPRODRES.IND_GSCLIMAIN_CLIENTCNAME on UKPRODRES.GSCLIENTMAIN(CLIENTCNAME)。。。。。。UKPRODRES.IND_GUPROPOSALMAIN_INSUREDNAME on UKPRODRES.GUPROPOSALMAIN(INSUREDNAME)-----------------------------------------------------------------------------------------
The .txt file shows:
|
HQ-CICUTESTDB-01:cicutedb>more cssan_check.err Database Scan Individual Exception Report [Database Scan Parameters] Parameter Value ------------------------------ ------------------------------------------------ CSSCAN Version v2.1 Instance Name cicutedb Database Version 10.2.0.4.0 Scan type Full database Scan CHAR data? YES Database character set AL32UTF8 FROMCHAR AL32UTF8 TOCHAR UTF8 Scan NCHAR data? NO Array fetch buffer size 1024000 Number of processes 4 Capture convertible data? NO ------------------------------ ------------------------------------------------ [Data Dictionary individual exceptions] User : SYS Table : SOURCE$ Column: SOURCE Type : VARCHAR2(4000) Number of Exceptions : 5 Max Post Conversion Data Size: 4000 ROWID Exception Type Size Cell Data(first 30 bytes) ------------------ ------------------ ----- ------------------------------ AAAABIAABAAAR2VAB+ lossy conversion raise_application_error(-20002 AAAABIAABAAAR2VAB7 lossy conversion raise_application_error(-20001 AAAABIAABAAAR2VACO lossy conversion raise_application_error(-20003 AAAABIAABAAAR2VACb lossy conversion raise_application_error(-20003 AAAABIAABAAAR2VACv lossy conversion raise_application_error(-20004 ------------------ ------------------ ----- ------------------------------ User : SYS Table : WRH$_SQLSTAT Column: ACTION Type : VARCHAR2(64) Number of Exceptions : 53 Max Post Conversion Data Size: 39 ROWID Exception Type Size Cell Data(first 30 bytes) ------------------ ------------------ ----- ------------------------------ AAAlrOAADAAAIU+AAF lossy conversion SQL 窗口 - 新建 AAAlrOAADAAAJXNAAS lossy conversion SQL 窗口 - 新建 。。。。。。 AAAlvJAADAAAJ0wAAN lossy conversion SQL 窗口 - 新建 ------------------ ------------------ ----- ------------------------------ [Application data individual exceptions] User : UKPRODRES Table : GPREMINDERHISTORY Column: RECEIVERNAME Type : VARCHAR2(1000) Number of Exceptions : 1 Max Post Conversion Data Size: 71 。。。。。。 |
In the .err this is listed:
For each affected column it lists:
To use a (full) export/import into a database with the new characterset all data needs to be "changeless and convertible".
In order to use a full export/import without any data loss you need to see in the charcheck.txt file under [Scan Summary] this message::
You cannot use Csalter (10g and up) or "Alter Database Character Set" (8i/9i) if you see this as [Scan Summary].
To use "Alter Database Character Set" the Csscan output needs to be changeless for all CHAR VARCHAR2, CLOB and LONG data (Data Dictionary and Application Data).
In order to use "Alter Database Character Set" you need to see in the charcheck.txt file under [Scan Summary] this message::
A 'clean' Csscan run must have been completed prior to running "Alter Database Character Set". A 'clean' scan means that there is no convertible, truncation or lossy data in the database.
To use Csalter the Csscan output needs to be
* changeless for all CHAR VARCHAR2, and LONG data (Data Dictionary and Application Data)
* changeless for all Application Data CLOB
* changeless and/or convertible for all Data Dictionary CLOB
And in order to run Csalter you need to see in the charcheck.txt file under [Scan Summary] this message:
and under [Data Dictionary Conversion Summary] this message:
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/25465866/viewspace-1184874/ ,如需转载,请注明出处,否则将追究法律责任。