Vous êtes sur la page 1sur 5

CSSCAN Installation

1) What is Csscan (Database Character Set Scanner) ?

Csscan is a SCAN tool that allows you to see the impact of a characterset change.

2) What versions of Csscan exist for 9i?

Csscan 1.2 is the latest available version for 8i and 9i. Please do install version 1.2.

In 8i and 9i Csscan is not depending on a patchset:

Csscan 1.2 for 9.2 works for every 9.2.0.X patchset

3) How to install the latest version of Csscan for 8i and 9i?

3a) Download the latest version of the character set scanner from Oracle Technet
To do this, go to: http://www.oracle.com/technetwork/topics/index-085942.html and download the file
for your version and platform.
For Windows x86-64 (not Itanium) you can use the windows 32 bit Csscan update.

3b) Extract the zip / tar.gz file into a temporary folder.

Sometimes downloaded files have an tar.tar extension, this is due the way some browsers handle these
files, simply rename (for example) csscan_12_aix5l_920.tar.tar to csscan_12_aix5l_920.tar.gz

From the temporary folder copy the following files:

* csscan or csscan.exe to $ORACLE_HOME/bin/csscan or %ORACLE_HOME%\bin\csscan.exe
* analyze_histgrm.sql ,analyze_rule.sql, analyze_source.sql and csminst.sql to
$ORACLE_HOME/rdbms/admin or %ORACLE_HOME%\rdbms\admin . Overwrite existing files, the
update may have more scripts then found in your ORACLE_HOME.

3c) Installing the Csscan Csmig Schema

Csscan stores internal data in the database when running, the schema for the csscan tables is called
CSMIG and is created using the csminst.sql script found in $ORACLE_HOME/rdbms/admin.

When running csscan from a client make sure to run the Csminst.sql from the client home and not from
the database home.

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 csminst.sql script to use this tablespace.

Modify the following statement in csminst.sql to assign your preferred tablespace to CSMIG :
alter user csmig default tablespace SYSTEM
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.

Make a backup/copy of Csminst.sql and edit Csminst.sql and then run Csminst.sql using these
commands using sqlplus of the server Oracle_Home (or when using a client, using the same base version
for the client as the server):

cd $ORACLE_HOME/rdbms/admin
set oracle_sid=<your SID>
sqlplus /nolog
SQL>conn / as sysdba
SQL>spool csminst.log
The password for the CSMIG user will be asked when running the csminst.sql script, this can be

Check the csminst.log for errors.

The CSMIG user can also be locked afterwards, the actual csmig login is not used by Csscan
SQL>conn / as sysdba
SQL> alter user csmig account lock;

4) Checking that Csscan is working properly:

Set the oracle_sid and then run Csscan



For 9i: if the user is in the OS dba group then enter "/ as sysdba" (without the qoutes) as username at
the prompt, hit enter at the password. Otherwise provide the sysdba password.

This is just a "dummy" run to check if csscan is working, the output should be similar to below.
The csscan version information is made BOLD:


LOG=instchkc CAPTURE=N PROCESS=1 ARRAY=1024000

Character Set Scanner v1.2 : Release - Production on Tue Oct 28 14:36:08 2008

Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.

Username: / as sysdba
Connected to:
Oracle9i Enterprise Edition Release - Production
With the Partitioning, Oracle Label Security, OLAP and Oracle Data Mining options
JServer Release - Production

Enumerating table to scan...


Creating Database Scan Summary Report...

Creating Individual Exception Report...

Scanner terminated successfully.

If you see a) the "Character Set Scanner v1.2" version banner and b) the "Scanner terminated
successfully." message then simply delete the generated instchkc.txt and instchkc.out and Csscan is now
ready for usage.

In Csscan documentation and help screens you see often to connect with Csscan as "system".
Please use "/ as sysdba" (9i) or "internal" (in 8i) instead, do not use "system" or "Csmig".

If you get the error "Character set migrate utility schema not compatible." then
a) you are starting the old executable check the reported Csscan version, please do overwrite all old files
with the files from the newer version from technet.
b) check your PATH , you are not starting Csscan from this ORACLE_HOME
c) you have not runned the csminst.sql from the newer version from technet or from the correct home.
d) you did not run csminst.sql "as sysdba" but as system -> Note 232242.1 Character set migration
utility schema not installed / ORA-942 during csminst.sql

5) Once Csscan is working properly.

To know what the output of Csscan means please see Note 444701.1 Csscan output explained
Once you have read Note 444701.1 and if you where referred to this note from a other note then please
simply continue in the referring note.
Otherwise have a look at Note 225912.1 Changing the Database Character Set ( NLS_CHARACTERSET )
6) Things good to know:
* Csscan will NOT update any user data, it's a SCAN tool.
* Csscan should always be runned on the SOURCE database, even if you plan to use exp/imp or
expdp/impdp to do the actual change.
* Csscan will NOT change the database (national) characterset, but it does provides information if it's ok
to do the change.
* Your database does not need to be in restricted mode to run Csscan, you can run Csscan against a live,
open database.
* Csscan will do a fetch of ALL data in CHAR, VARCHAR2, LONG and CLOB datatypes in your system. This
may impact your system performance. The lower the "PROCESS" parameter the less impact but the
longer it will take. You can compare each Csscan process with a session doing full table scans.
* the Csscan ARRAY parameter determinates the amount of data is fetched in one time, see the docset
for more information. It may be useful to set this higher when using a remote client for the csscan
* You CANNOT run more then one Csscan at the same time on a database (this includes RAC).
* You CANNOT run Csscan version 1.2 against a 10g or higher system.
* You can run Csscan from a client, but this needs to be the same base version as the database home.
* If you do not need to run Csscan anymore you can safely drop the Csmig user and it's objects.

7) Known issues:

* CAPTURE=Y sometimes does not work in csscan 1.2 (and lower) - Bug 3721136

When specifying CAPTURE=Y Csscan should log all "Convertible" application rows in the .err file under
the [Application data individual exceptions] header. The section can be empty however, even when
specifying CAPTURE=Y.
This happens when there is ONLY "Convertible" for application data. Note that Csscan does capture the
convertible, it's only not logged in the .err file.
In general this is not a big issue, solving "Convertible" is typically done by exporting the whole table
(which are logged in the .txt file).
In case you need to row'ids of each table it's possible to generate a list with this SQL:
conn / as sysdba
set pages 50000
Spool convusercol.txt
select distinct z.owner_name || '.' || z.table_name || '(' ||
z.column_name || ') - ' || z.column_type || ' - ' || z.error_type ||
' - [' || z.data_rowid || ']' UserColumns
from csmig.csmv$errors z where z.owner_name not in
order by UserColumns
spool off;

* Note 289844.1 csscan receives error "kgrdec2r not located in orageneric8.dll"


* Csscan (any version) for 817 reports when FROMCHAR and TOCHAR are the same sometimes
incorrectly "lossy" for LONG datatypes see Bug 3043474 for more info

ARE LARGE (8i only)

This is seen as errors like (example) " process 2 scanning
PERFSTAT.STATS$SQL_SUMMARY[AAAFhnAAKAAABZ4AAA]failed to allocate memory size
of 819000" when running csscan. No solution exist, the only workaround is to use a 9i client on an other
Operating system (windows is fine), update this client with CSSCAN 1.2 and run Csscan from there.
* Note 1105724.1 Csscan gives some incorrect lossy for BIG5 charactersets (ZHT16MSWIN950 ,

* If you see errors while csscan is running like

ORA-01031: insufficient privileges
failed to scan table SYS.<some sys object>

combined with

ORA-01455: converting column overflows integer datatype

failed to get table information
failed to scan table (tid=6, oid=393924)
then you are most likely using a non-sysdba connection for a FULL=Y scan.

* if you see only

ORA-01455: converting column overflows integer datatype
failed to get table information
failed to scan table (tid=6, oid=393924)

Then most likely the table is dropped during the csscan run: Note 245285.1 CSSCAN fails with error
"failed to scan table". A less likely reason is Bug 2737842 fixed in Csscan 2.0 where you will see this error
if you have rows from following select:
SQL> select obj# , property from sys.col$ where property > 2147483647;

* If csscan gives while creating the Database Scan Summary Report

Creating Database Scan Summary Report...

ORA-1455: converting column overflows integer datatype

failed to report overall summary
failed to create scan report

Scanner terminated successfully.

This is Bug 4414296 fixed in,,