執行csscan出現loading shared libraries錯誤

東北胖子發表於2016-03-12

在一個11.2.0.2 for Linux X86-64環境中,執行csscan工具報錯。

 

 

錯誤資訊為:

[oracle@dbserver2 ~]$ cd $ORACLE_HOME/bin
[oracle@dbserver2 bin]$ csscan help=y
csscan: error while loading shared libraries: libclntsh.so.11.1: cannot open shared object file: No such file or directory

檢查metalink,在文件ID 742070.1中提到,導致這個問題的原因是沒有正確的設定LD_LIBRARY_PATH環境變數,將$ORACLE_HOME/lib新增到這個環境變數中可以避免錯誤的產生:

[oracle@dbserver2 bin]$ env|grep LD_LIB
LD_LIBRARY_PATH=/etc/emc/rsa/cst/lib
[oracle@dbserver2 bin]$ export LD_LIBRARY_PATH=$ORACLE_HOME/lib:$LD_LIBRARY_PATH
[oracle@dbserver2 bin]$ csscan help=y

Character Set Scanner v2.2 : Release 11.2.0.2.0 - Production on Mon Jun 6 17:46:04 2011

Copyright (c) 1982, 2009, Oracle and/or its affiliates.  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 AS SYSDBA\"                         

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 AS SYSDBA\" 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.

採用這個方法確實解決了問題。不過奇怪的問題是,另外一臺伺服器採用相同方式安裝的資料庫,並不存在這個問題,而且這臺伺服器上的LD_LIBRARY_PATH的設定與出現問題的伺服器完全一致:

[oracle@dbserver1 ~]$ cd $ORACLE_HOME/bin
[oracle@dbserver1 bin]$ csscan help=y

Character Set Scanner v2.2 : Release 11.2.0.2.0 - Production on Mon Sep 5 17:47:18 2011

Copyright (c) 1982, 2009, Oracle and/or its affiliates.  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 AS SYSDBA\"                         

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 AS SYSDBA\" 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.
[oracle@dbserver1 bin]$ env|grep LD_LIB
LD_LIBRARY_PATH=/etc/emc/rsa/cst/lib

雖然metalink給出的解決方法確實有效,但是導致這個問題的原因和可能是多個方面的,至少文件沒有給出為什麼同樣配置同樣版本的兩個資料庫,在一個上沒有問題,而另一個上執行就出現錯誤。

 

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

相關文章