AIX crontab is not executed and the shell is connected to the database with garbled characters

1. It is normal for AIX to execute the shell alone, but it does not execute when it is placed in crontab

Reason: There is no environment variable when crontab is executed, add the current user.profile environment variable in the shell script

 

 

2, shell even database garbled

Reason: The encoding of the client and the oracle server is inconsistent.

Check the oracle server code first

select userenv('language') from dual;

结果:SIMPLIFIED CHINESE_CHINA.ZHS16GBK

Write the code in front of the sqlplus of the AIX shell script

export NLS_LANG=AMERICAN_AMERICA.ZHS16GBK

 

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326450880&siteId=291194637