Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

ORACLE 12C boot auto start monitor, CDB, PDB

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

Database instance listens to boot self-startup settings under linux

August 1, 2018 zhanky

Test introduction

System version: Oracle linux 7.2x64

Database version: Oracle Database 12c Enterprise Edition Release 12.2.0.1.0-64bit Production

Instance name: orcl CDP:orcl PDB:orcl1, orcl2

ORACLE_HOME:/u01/app/oracle/product/12.2.0/db_1

1. Set up monitoring and CDB self-booting

By using rc.local boot to automatically run the script, call Oracle's own dbstart and lsnrct to start. But calling dbstart needs to be allowed in oratab

1. Modify oratab

[root@zhanky] # vi / etc/oratab [root@zhanky] # 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.##

2. Edit rc.local

Because Oracle linux 7.2Defaults that rc.local does not have the permission to execute, you need to add chmod by yourself.

Dbstart starts all libraries with parameter Y in oratab by default.

[root@zhanky ~] # vi / etc/rc.d/rc.local [root@zhanky ~] # cat / etc/rc.d/rc.local! / bin/bashTHIS FILE IS ADDED FOR COMPATIBILITY PURPOSESIt is highly advisable to create own systemd services or udev rulesto run scripts during boot instead of using this file.In contrast to previous versions due to parallel execution during bootthis script will NOT be run after all other services.Please note that you must run 'chmod + x / etc/rc.d/rc.local' to ensurethat this script will be executed during boot.touch / var/lock/subsys/local## logs in with the oracle user Run the lsnrctl start script to enable listening. Su-oracle-c "/ u01/app/oracle/product/12.2.0/db_1/bin/lsnrctl start" # # Log in as an oracle user, run dbstart to start the database su-oracle-c "/ u01/app/oracle/product/12.2.0/db_1/bin/dbstart" [root@zhanky ~] # chmod + x / etc/rc.d/rc.local

2. Set PDB to start automatically

Use triggers to start East PDB. In the following triggers, ALTER PLUGGABLE DATABASE ALL OPEN represents all PDB starts

If all you need is

CREATE OR REPLACE TRIGGER open_pdbsAFTER STARTUP ON DATABASEBEGINEXECUTE IMMEDIATE 'ALTER PLUGGABLE DATABASE ALL OPEN';END open_pdbs;/

Third, test and verify, restart the database server.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report