ORACLE 12C Boot Auto-start monitoring, CDB, PDB

Source: Internet
Author: User
Tags chmod

Linux DB instance monitoring boot boot settings
August 1, 2018 Zhanky

Test introduction
System version: Oracle Linux 7.2 x64
DB 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

First, set monitoring and CDB boot
Invoke Oracle's own Dbstart and LSNRCT boot by using rc.local to run the script automatically. But calling Dbstart needs to be allowed in Oratab
1, modify the Oratab

[[email protected] ~]# vi /etc/oratab [[email protected] ~]# 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:<N|Y>:## 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 the Oracle Linux 7.2 default rc.local is not execute right, you need to perform chmod to increase your
Dbstart default to start all libraries with Parameters y in Oratab

[[email protected] ~]# vi /etc/rc.d/rc.local [[email protected] ~]# 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##用oracle用户登录,运行lsnrctl start 脚本启用监听。su - oracle -c "/u01/app/oracle/product/12.2.0/db_1/bin/lsnrctl start"##用oracle用户登录,运行dbstart启动数据库su - oracle -c "/u01/app/oracle/product/12.2.0/db_1/bin/dbstart"[[email protected] ~]# chmod +x /etc/rc.d/rc.local

Second, set the PDB to start automatically
By using a trigger to Qidong the PDB, the following trigger in the ALTER pluggable DATABASE all open represents the start of all PDB,
If you only need

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

Third, test verification, restart the database server can be.

ORACLE 12C Boot Auto-start monitoring, CDB, PDB

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.