Running Oracle’s CSSCAN utility as sysdba

If you need to run Oracle’s CSSCAN utility to check a database prior to converting to a new character set, you may have problems getting it to run “as sysdba”. There are a number of articles on the web that explain how to do this, and most of the explanations don’t work.

Oracle.com says that you should use:

CSSCAN /AS SYSDBA FULL=Y

This gives the error:

LRM-00108: invalid positional parameter value 'SYSDBA'                         
failed to process command line parameters                                      

Scanner terminated unsuccessfully.

Others recommend:

csscan "SYS/[password] as sysdba" full=y tochar=AL32UTF8 array=1024000 process=16

Which results in:

LRM-00108: invalid positional parameter value 'as'                                                  
failed to process command line parameters                                                           

Scanner terminated unsuccessfully.

Various other guides on the web also fail to work. Trying to run csscan as “SYSTEM”, as suggested by Tech Republic and Oracle UK, you get the error:

CSS-00113: user system is not allowed to access data dictionary

Trying to run csscan as “SYS”, as suggested by Oracle Forums, results in the error:

ORA-28009: connection as SYS should be as SYSDBA or SYSOPER

ORACLE-BASE shows a method for running csscan in a Windows environment:

C:\>CSSCAN \"sys/password@db10g AS SYSDBA\" FULL=Y

This might work in Windows, on a Linux server you get:

CSS-00110: failed to parse userid
Scanner terminated unsuccessfully.

Here’s how you do it. Log in as a user with DBA rights and do the following:

> csscan full=y tochar=AL32UTF8 array=1024000 process=16

Character Set Scanner v2.1 : Release 10.2.0.0.0 - Production on Sat Apr 10 18:41:37 2010

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

Username: sys/[password] as sysdba

That should run the database character scanner on your database. If you get the error:

CSS-00107: Character set migration utility schema not installed       

Scanner terminated unsuccessfully.

… then go back and install the character set migration utility schema, then try running csscan again. You can install the character set migration utility schema with:

> cd $ORACLE_HOME/rdbms/admin
> sqlplus /nolog                                         

SQL*Plus: Release 10.2.0.2.0 - Production on Sat Apr 10 18:40:04 2010

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

SP2-0640: Not connected
18:40:04 nolog> connect / as sysdba
Connected.                         

Session altered.

Elapsed: 00:00:00.00
18:40:08 sys> @csminst.sql

If you get this error you can ignore it:

grant READ on directory log_file_dir to system                                                             
                        *                                                                                  
ERROR at line 1:                                                                                           
ORA-22930: directory does not exist    

Hope you find this useful.

4 thoughts on “Running Oracle’s CSSCAN utility as sysdba

  1. Very Very helpful. Trying to handle the login was giving me 10 kinds of problems, and I was following the same (bad) series of advice steps you were. Thanks very much for the solution!

  2. To be able to run the CSSCAN as SYSDBA you can do something like:

    csscan “‘sys/oracle as sysdba'” full=y tochar=AL32UTF8 array=1024000 process=16

    The key is using a combination of double and single quotes.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.