隐藏ps -ef命令中看到的密码(Hide the password that from the " ps -ef " command)
2010-04-13 12:03
716 查看
在UNIX下我常常要执行Oracle的命令,如sqlplus/sqlldr, 这些命令都需要登录到数据才行,这时我们就要用到连接的user和password,如果我们直接用sqlplus来连的话,user和passoword都可以用
ps -ef | grep sqlplus
看到,出于安全的考虑,这个是很不好的,下面的方法可以很好地解决sqlplus 和sqlldr 这两个命令登录的问题。
1. SQLPLUS
sqlplus /nolog > $LOG_FILE << ENDSQL
connect $DB_USER/$DB_PASS@$TNSNAME;
@sql/xxx.sql $parameter_1 $parameter_2;
ENDSQL
if [ `grep "ERROR" $LOG_FILE | wc -l` -ne 0 ]
then
# Error Handling
endif
2. SQLLDR
sql loader的写有一点特别:
set APP_USER=something
set APP_PASS=somepass
set APP_SID=sid
#put the connection parameter at the end.
sqlldr control=contril.ctl data=data.dat << END_OF_SQLLDR
$APP_USER/$APP_PASS@APP_SID
END_OF_SQLLDR
ps -ef | grep sqlplus
看到,出于安全的考虑,这个是很不好的,下面的方法可以很好地解决sqlplus 和sqlldr 这两个命令登录的问题。
1. SQLPLUS
sqlplus /nolog > $LOG_FILE << ENDSQL
connect $DB_USER/$DB_PASS@$TNSNAME;
@sql/xxx.sql $parameter_1 $parameter_2;
ENDSQL
if [ `grep "ERROR" $LOG_FILE | wc -l` -ne 0 ]
then
# Error Handling
endif
2. SQLLDR
sql loader的写有一点特别:
set APP_USER=something
set APP_PASS=somepass
set APP_SID=sid
#put the connection parameter at the end.
sqlldr control=contril.ctl data=data.dat << END_OF_SQLLDR
$APP_USER/$APP_PASS@APP_SID
END_OF_SQLLDR
相关文章推荐
- Could not load the "null" image referenced from a nib in the bundle with identifier ""
- "围观"设计模式(23)--行为型之命令模式(Command Pattern)
- Exception in thread "main" java.sql.SQLException: Connections could not be acquired from the underly
- Exception in thread "main" java.sql.SQLException: Connections could not be acquired from the underly
- linux下tar命令遇到error:"Error exit delayed from previous errors"
- Could not load the "" image referenced from a nib in the bundle with identifier XXXXX
- Dissecting The Nutch Crawler - Command "inject": net.nutch.db.WebDBInjector
- Dissecting The Nutch Crawler -Command "fetch": net.nutch.fetcher.Fetcher
- 错误解决:[A potentially dangerous Request.Form value was detected from the client (warning="卡Ć.
- android "numberPassword" 不隐藏
- ReactNative.createElement is deprecated. Use React.createElement from the "react" package instead.
- Service部署到服务器后出现"The test form is only available for requests from the local machine"解决方法
- WCF error "No end point listening at net.pipe://server name:port/service name that could accept the message
- linux下tar命令遇到error:"Error exit delayed from previous errors"的问题
- dbca silent responseFile Not all required options provided for the command "createDatabase".Please r
- firebug 解决 "The resource from this URL is not text"
- A function that corrects the "ActionDay" fields from market quotes which is delivered by CTP.
- Fixing "The following VMware kernal modules have been found on your system that were not installed by the VMware installer."
- Dissecting The Nutch Crawler -Command "generate": net.nutch.tools.FetchListTool
- The reference to entity "password" must end with the ';' delimiter.的原因跟解决方法