With a simple command,
csscan system/test full=y tochar=WE8MSWIN1252 ARRAY=1024000 process=4
you can run csscan in order to check all character data in the database and tests for the effects and problems of changing the character set encoding.
As csscan runs in the foreground (by default), so if you exits the terminal from which you run csscan, csscan also stops there. This is quite a pain task whenever you run csscan to another remote computer via ssh or any terminal software as you can't ensure network connectivity. So if network goes your terminal terminates and csscan terminates as well.
In order to solve the problem unix nohup tool is a great rid of our pain. With help of nohup we can run the process in the background and send the output to a text file; thus exiting the terminal remains the process running in the backend. After hours/days we can check the process whether it completed or not.
To run csscan in the background issue following command,
$nohup csscan system/a full=y tochar=WE8MSWIN1252 ARRAY=1024000 process=4 &
Note that at the end you have to append an ampersand to send the process in the background.
Later we can check the status of our csscan by,
$ps -ef |grep csscan
to be sure whether scanning is completed or not.
As we know in order to character set scanning process we need to scan full database. And sys is the most powerful user. So to access everything always run csscan as "sys as sysdba." Oracle also recommends to run csscan as a sys user. Thus running csscan as a sys user you might face difficulties. Like ,
[oracle@dbsoft ~]$ csscan sys/a as sysdba full=y tochar=WE8MSWIN1252 ARRAY=1024000 process=4
LRM-00108: invalid positional parameter value 'as'
failed to process command line parameters
Scanner terminated unsuccessfully.
[oracle@dbsoft ~]$ csscan userid="sys/a as sysdba" full=y tochar=WE8MSWIN1252 ARRAY=1024000 process=4
[1] 8042
LRM-00112: multiple values not allowed for parameter 'userid'
[oracle@dbsoft ~]$ csscan sys/a full=y tochar=WE8MSWIN1252 ARRAY=1024000 process=4
Character Set Scanner v2.1 : Release 10.2.0.0.0 - Production on Sat Mar 7 18:03:59 2009
Copyright (c) 1982, 2005, Oracle. All rights reserved.
ORA-28009: connection as SYS should be as SYSDBA or SYSOPER
Scanner terminated unsuccessfully.
Though you can avoid the lastest erro by following http://arjudba.blogspot.com/2008/05/ora-28009-connection-as-sys-should-be.html that is by setting O7_DICTIONARY_ACCESSIBILITY=TRUE but this is not recommended.
So the issue stands how to run csscan as "sys as sysdba" and the process need to run the background. To do this below is the steps.
Step 01: Run csscan with nohup but only without any userid parameter(username+password).
$ nohup csscan <All options except username/password go here<
For example:
$nohup csscan full=y tochar=WE8MSWIN1252 ARRAY=1024000 process=4
Note that at the end there is no ampersand.
Step 02: Press Enter button from keyboard.
Step 03: At this steps all terminal output is being redirected to nohup.out and so, you can't see it, but your terminal is waiting for a username and password input.
So give the password of sys and connect as sysdba.
Like enter following words,
sys/a as sysdba
where the password of user sys is a.
Step 04: Press Enter button from keyboard.
Step 05: At this stage, csscan should be running, in the foreground, and all terminal
output is redirecting to nohup.out.
You still see your shell prompt is there but it takes no keyword. Just
press ctrl+z
Step 06: In the shell prompt type,
bg
You have done it. Now your csscan will run in the background and you may quit your current window or disconnect network or log off the terminal. Process will keep running and you will get the output of terminal in the file nohup.out. Check the status of the process by,
$ps -ef |grep csscan
Note: Make sure that you type the "bg" at the shell after the ctrl+z. If you don't do that process will remain suspended and will not do anything.
From my terminal here is the sample screenshot.
[oracle@dbsoft ~]$ nohup csscan full=y tochar=WE8MSWIN1252 ARRAY=1024000 process=4
nohup: appending output to `nohup.out'
sys/a as sysdba
bg
After this I press the cross button to close window.
In a new session I login and I got my progress inside nohup.out.
[oracle@dbsoft ~]$ cat nohup.out
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
Enumerating tables to scan...
. process 2 scanning MAXIMSG.SUBSCRIBERS_CARDS[AAAM6NAAGAAAXwJAAA]
. process 1 scanning MAXIMSG.FIRST_LEG_ACC[AAAM4IAAGAAAD+JAAA]
Remember the alternative. Also you can do above tasks by simply using escape characters with your options like below.
$nohup $ORACLE_HOME/bin/csscan userid=\'sys/a as sysdba\' full=y tochar=WE8MSWIN1252 ARRAY=1024000 process=4 &
Enjoy the post. Keep reading my blog.
Related Documents
CSSCAN fails with CSS-00151: failed to enumerate user tables CSS-00120
CSSCAN fails with error while loading shared libraries: libclntsh.so.10.1
CSSCAN fails with CSS-00107: Character set migration utility schema not installed
ORA-00904: "CNVTYPE" CSS-08888: failed to update conversion type
CSSCAN fails with ORA-00600, CSS-00152, CSS-00120
this works:
ReplyDeleteecho|csscan \'sys/yourSysPsw as sysdba\' FULL=Y FROMCHAR=US7ASCII TOCHAR=AL32UTF8 LOG=csscan_log CAPTURE=Y PROCESS=6 &