如何在rc.local中加载自己写的环境变量文件!

zuoluo2003 2006-05-16 02:57:07
在redhatAS下安装了oracle10g和oracleAS10g分别设置了自己的环境变量:.as_profile,.db_profile,我想在开机时自动加载.db_profile然后执行lsnrctl和dbstart使oracledatabase10g自动启动,请问如何在/etc/rc.d/rc.local中加载自己写的.db_profile,谢谢!
注:.db_profile中定义了$ORACLE_HOME,$ORACHE_BASE,$ORACLE_SID等环境变量!

source /home/oracle/.db_profile 或 su - oracle -c "source /home/oracle/.db_profile "
su - oracle -c "/opt/oracle/product/10.1.0/bin/lsnrctl start"
su - oracle -c "/opt/oracle/product/10.1.0/bin/dbstart"
以上的写法好像都不行。lsnrctl执行不了,因为环境变量没有加载。
...全文
270 回复 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复

19,619

社区成员

发帖
与我相关
我的任务
社区描述
系统使用、管理、维护问题。可以是Ubuntu, Fedora, Unix等等
社区管理员
  • 系统维护与使用区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧