天天看点

CentOS 设置 ogg mgr 开机自启

试验环境:

试验环境 软件版本
操作系统 CentOS 7
ogg安装目录 /home/oracle/ggs
数据库 oracle
  • 使用 oracle 用户登陆 CentOS
  • 在 /home/oracle 目录创建 info.txt 文件

    注:请根据实际环境更改目录,文件应与ogg目录同级

// 创建 info.txt 文件
[[email protected] ~]$ touch info.txt
// 编辑 info.txt 文件
[[email protected] ~]$ nano info.txt
[[email protected] ~]$ chmod +x info.txt
           

添加配置:

sh date

start mgr

  • 在 /home/oracle 目录创建 startmgr.sh 文件
// 创建 info.txt 文件
[[email protected] ~]$ touch startmgr.sh
// 编辑 info.txt 文件
[[email protected] ~]$ nano startmgr.sh
[[email protected] ~]$ chmod +x startmgr.sh
           

添加配置:

/home/oracle/ggs/ggsci paramfile /home/oracle/info.txt >> /home/oracle/ggstartoutput.txt
  • 切换到 root 用户,编辑 /home/etc/rc.local 文件
[[email protected] etc]# nano rc.local
           

添加配置:

su - oracle -c “/home/oracle/startmgr.sh”
  • 测试

停止 mgr 进程

用root用户执行:su - oracle -c “/home/oracle/startmgr.sh”

查看 mgr 进程是否启动

继续阅读