試驗(yàn)環(huán)境:
試驗(yàn)環(huán)境 | 軟件版本 |
---|---|
操作系統(tǒng) | CentOS 7 |
ogg安裝目錄 | /home/oracle/ggs |
數(shù)據(jù)庫 | oracle |
- 使用 oracle 用戶登陸 CentOS
- 在 /home/oracle 目錄創(chuàng)建 info.txt 文件
注:請(qǐng)根據(jù)實(shí)際環(huán)境更改目錄浅悉,文件應(yīng)與ogg目錄同級(jí)
// 創(chuàng)建 info.txt 文件
[oracle@custom04 ~]$ touch info.txt
// 編輯 info.txt 文件
[oracle@custom04 ~]$ nano info.txt
[oracle@custom04 ~]$ chmod +x info.txt
添加配置:
sh date
start mgr
- 在 /home/oracle 目錄創(chuàng)建 startmgr.sh 文件
// 創(chuàng)建 info.txt 文件
[oracle@custom04 ~]$ touch startmgr.sh
// 編輯 info.txt 文件
[oracle@custom04 ~]$ nano startmgr.sh
[oracle@custom04 ~]$ chmod +x startmgr.sh
添加配置:
/home/oracle/ggs/ggsci paramfile /home/oracle/info.txt >> /home/oracle/ggstartoutput.txt
- 切換到 root 用戶覆致,編輯 /home/etc/rc.local 文件
[root@custom04 etc]# nano rc.local
添加配置:
su - oracle -c "/home/oracle/startmgr.sh"
- 測(cè)試
停止 mgr 進(jìn)程
用root用戶執(zhí)行:su - oracle -c "/home/oracle/startmgr.sh"
查看 mgr 進(jìn)程是否啟動(dòng)