linux 7 enable,linux 7 enable autostarting of oracle database 19c tips

66b52468c121889b900d4956032f1009.png

8种机械键盘轴体对比

本人程序员,要买一个写代码的键盘,请问红轴和茶轴怎么选?

Linux 7 enable Autostarting of Oracle Database 19c Tips

Reference

Create the dbora scripts

Add the dbora script

/etc/init.d/dbora

#! /bin/sh -x

#

# chkconfig: 2345 80 05

# description: start and stop Oracle Database Enterprise Edition on Oracle Linux 5 and 6

#

# In /etc/oratab, change the autostart field from N to Y for any

# databases that you want autostarted.

#

# Create this file as /etc/init.d/dbora and execute:

# chmod 750 /etc/init.d/dbora

# chkconfig --add dbora

# chkconfig dbora on

# Note: Change the value of ORACLE_HOME to specify the correct Oracle home

# directory for your installation.

# ORACLE_HOME=/u01/app/oracle/product/11.1.0/db_1

ORACLE_HOME=/u01/app/oracle/product/19.0.0/dbhome_1

#

# Note: Change the value of ORACLE to the login name of the oracle owner

ORACLE=oracle

PATH=${PATH}:$ORACLE_HOME/bin

HOST=`hostname`

PLATFORM=`uname`

export ORACLE_HOME PATH

case $1 in

'status')

echo -n $"Oracle Process: "

su $ORACLE -c "ps -ef | grep pmon | grep -v grep; ps -ef | grep -i listener | grep -v grep;" &

;;

'start')

echo -n $"Starting Oracle: "

su $ORACLE -c "$ORACLE_HOME/bin/dbstart $ORACLE_HOME" &

;;

'stop')

echo -n $"Shutting down Oracle: "

su $ORACLE -c "$ORACLE_HOME/bin/dbshut $ORACLE_HOME" &

;;

'restart')

echo -n $"Shutting down Oracle: "

su $ORACLE -c "$ORACLE_HOME/bin/dbshut $ORACLE_HOME" &

sleep 5

echo -n $"Starting Oracle: "

su $ORACLE -c "$ORACLE_HOME/bin/dbstart $ORACLE_HOME" &

;;

*)

echo "usage: $0 {start|stop|restart}"

exit

;;

esac

exit

[[email protected] /]# vi /etc/init.d/dbora

[[email protected] /]# ls -l /etc/init.d/dbora

-rw-r--r--. 1 root root 1345 Aug 20 10:40 /etc/init.d/dbora

[[email protected] /]# chmod 750 /etc/init.d/dbora

[[email protected] /]#

Config Linux to autostart/stop the service

Linux 7:

[[email protected] /]# systemctl enable dbora

dbora.service is not a native service, redirecting to /sbin/chkconfig.

Executing /sbin/chkconfig dbora on

[[email protected] /]# /sbin/chkconfig dbora on

[[email protected] /]#

Edit /etc/oratab

[[email protected] log]# cat /etc/oratab

#

# This file is used by ORACLE utilities. It is created by root.sh

# and updated by either Database Configuration Assistant while creating

# a database or ASM Configuration Assistant while creating ASM instance.

# A colon, ':', is used as the field terminator. A new line terminates

# the entry. Lines beginning with a pound sign, '#', are comments.

#

# Entries are of the form:

# $ORACLE_SID:$ORACLE_HOME::

#

# The first and second fields are the system identifier and home

# directory of the database respectively. The third field indicates

# to the dbstart utility that the database should , "Y", or should not,

# "N", be brought up at system boot time.

#

# Multiple entries with the same $ORACLE_SID are not allowed.

#

#

#orcl:/u01/app/oracle/product/19.0.0/dbhome_1:N

orcl:/u01/app/oracle/product/19.0.0/dbhome_1:Y

[[email protected] log]#

Test:

[[email protected] ~]# service dbora start

Warning: dbora.service changed on disk. Run 'systemctl daemon-reload' to reload units.

+ ORACLE_HOME=/u01/app/oracle/product/19.0.0/dbhome_1

+ ORACLE=oracle

+ PATH=/sbin:/usr/sbin:/bin:/usr/bin:/u01/app/oracle/product/19.0.0/dbhome_1/bin

++ hostname

+ HOST=orl7

++ uname

+ PLATFORM=Linux

+ exportORACLE_HOME PATH

+ case $1 in

+ echo -n 'Starting Oracle: '

Starting Oracle: + exit

+ su oracle -c '/u01/app/oracle/product/19.0.0/dbhome_1/bin/dbstart /u01/app/oracle/product/19.0.0/dbhome_1'

[[email protected] ~]# Processing Database instance "orcl": log file /u01/app/oracle/product/19.0.0/dbhome_1/rdbms/log/startup.log

[[email protected] ~]#

[[email protected] ~]# service dbora status

+ ORACLE_HOME=/u01/app/oracle/product/19.0.0/dbhome_1

+ ORACLE=oracle

+ PATH=/sbin:/usr/sbin:/bin:/usr/bin:/u01/app/oracle/product/19.0.0/dbhome_1/bin

++ hostname

+ HOST=orl7

++ uname

+ PLATFORM=Linux

+ exportORACLE_HOME PATH

+ case $1 in

+ echo -n 'Oracle Process: '

Oracle Process: + exit

+ su oracle -c 'ps -ef | grep pmon | grep -v grep; ps -ef | grep -i listener | grep -v grep;'

[[email protected] ~]# oracle 6160 1 0 11:01 ? 00:00:00 ora_pmon_orcl

oracle 4403 1 0 10:49 ? 00:00:00 /u01/app/oracle/product/19.0.0/dbhome_1/bin/tnslsnr LISTENER -inherit

[[email protected] ~]#

[[email protected] ~]# service dbora stop

+ ORACLE_HOME=/u01/app/oracle/product/19.0.0/dbhome_1

+ ORACLE=oracle

+ PATH=/sbin:/usr/sbin:/bin:/usr/bin:/u01/app/oracle/product/19.0.0/dbhome_1/bin

++ hostname

+ HOST=orl7

++ uname

+ PLATFORM=Linux

+ exportORACLE_HOME PATH

+ case $1 in

+ echo -n 'Shutting down Oracle: '

Shutting down Oracle: + exit

[[email protected] ~]# + su oracle -c '/u01/app/oracle/product/19.0.0/dbhome_1/bin/dbshut /u01/app/oracle/product/19.0.0/dbhome_1'

Processing Database instance "orcl": log file /u01/app/oracle/product/19.0.0/dbhome_1/rdbms/log/shutdown.log

[[email protected] ~]#

Starting Oracle Database Multitenant PDBs 12c/18c/19c

Run the following pl/sql with SYSDBA

create or replace trigger sys.after_startup

after startup on database

begin

execute immediate 'alter pluggable database all open';

end after_startup;

/

# sqlplus / as sysdba

SQL*Plus: Release 19.0.0.0.0 - Production on Tue Aug 20 11:06:45 2019

Version 19.3.0.0.0

Copyright (c) 1982, 2019, Oracle. All rights reserved.

Connected to:

Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production

Version 19.3.0.0.0

create or replace trigger sys.after_startup

after startup on database

begin

execute immediate 'alter pluggable database all open';

end after_startup;

6 /

Trigger created.

[email protected]>

Have a good work&life! 2019/08 via LinHong

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值