ORACLE12C開機(jī)自動(dòng)啟動(dòng)監(jiān)聽、CDB、PDB-創(chuàng)新互聯(lián)

linux下數(shù)據(jù)庫(kù)實(shí)例監(jiān)聽開機(jī)自啟動(dòng)設(shè)置
2018年8月1日 zhanky

創(chuàng)新互聯(lián)公司專注于郊區(qū)網(wǎng)站建設(shè)服務(wù)及定制,我們擁有豐富的企業(yè)做網(wǎng)站經(jīng)驗(yàn)。 熱誠(chéng)為您提供郊區(qū)營(yíng)銷型網(wǎng)站建設(shè),郊區(qū)網(wǎng)站制作、郊區(qū)網(wǎng)頁(yè)設(shè)計(jì)、郊區(qū)網(wǎng)站官網(wǎng)定制、小程序開發(fā)服務(wù),打造郊區(qū)網(wǎng)絡(luò)公司原創(chuàng)品牌,更為您提供郊區(qū)網(wǎng)站排名全網(wǎng)營(yíng)銷落地服務(wù)。

測(cè)試介紹
系統(tǒng)版本:Oracle linux 7.2 x64
數(shù)據(jù)庫(kù)版本:Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production
實(shí)例名:orcl CDP:orcl PDB:orcl1、orcl2
ORACLE_HOME:/u01/app/oracle/product/12.2.0/db_1

一、設(shè)置監(jiān)聽和CDB開機(jī)自啟
通過使用rc.local開機(jī)自動(dòng)運(yùn)行腳本,調(diào)用Oracle自帶的dbstart和lsnrct啟動(dòng)。但調(diào)用dbstart需要在oratab中允許
1、修改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:<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、編輯rc.local
因?yàn)镺racle linux 7.2默認(rèn)rc.local是沒有執(zhí)行權(quán)限,需執(zhí)行chmod自己增加
dbstart默認(rèn)將oratab中參數(shù)為Y的所有庫(kù)啟動(dòng)

[root@zhanky ~]# vi /etc/rc.d/rc.local 
[root@zhanky ~]# cat /etc/rc.d/rc.local 
!/bin/bash
THIS FILE IS ADDED FOR COMPATIBILITY PURPOSES

It is highly advisable to create own systemd services or udev rules
to run scripts during boot instead of using this file.

In contrast to previous versions due to parallel execution during boot
this script will NOT be run after all other services.

Please note that you must run 'chmod +x /etc/rc.d/rc.local' to ensure
that this script will be executed during boot.

touch /var/lock/subsys/local
##用oracle用戶登錄,運(yùn)行l(wèi)snrctl start 腳本啟用監(jiān)聽。
su - oracle -c "/u01/app/oracle/product/12.2.0/db_1/bin/lsnrctl start"
##用oracle用戶登錄,運(yùn)行dbstart啟動(dòng)數(shù)據(jù)庫(kù)
su - oracle -c "/u01/app/oracle/product/12.2.0/db_1/bin/dbstart"
[root@zhanky ~]# chmod +x /etc/rc.d/rc.local

二、設(shè)置PDB自動(dòng)啟動(dòng)
通過觸發(fā)器來啟東PDB,下列觸發(fā)器中ALTER PLUGGABLE DATABASE ALL OPEN代表將所有PDB啟動(dòng),
如果只需

CREATE OR REPLACE TRIGGER open_pdbs
AFTER STARTUP ON DATABASE
BEGIN
EXECUTE IMMEDIATE 'ALTER PLUGGABLE DATABASE ALL OPEN';
END open_pdbs;
/

三、測(cè)試驗(yàn)證,重啟數(shù)據(jù)庫(kù)服務(wù)器即可。

另外有需要云服務(wù)器可以了解下創(chuàng)新互聯(lián)cdcxhl.cn,海內(nèi)外云服務(wù)器15元起步,三天無(wú)理由+7*72小時(shí)售后在線,公司持有idc許可證,提供“云服務(wù)器、裸金屬服務(wù)器、高防服務(wù)器、香港服務(wù)器、美國(guó)服務(wù)器、虛擬主機(jī)、免備案服務(wù)器”等云主機(jī)租用服務(wù)以及企業(yè)上云的綜合解決方案,具有“安全穩(wěn)定、簡(jiǎn)單易用、服務(wù)可用性高、性價(jià)比高”等特點(diǎn)與優(yōu)勢(shì),專為企業(yè)上云打造定制,能夠滿足用戶豐富、多元化的應(yīng)用場(chǎng)景需求。

名稱欄目:ORACLE12C開機(jī)自動(dòng)啟動(dòng)監(jiān)聽、CDB、PDB-創(chuàng)新互聯(lián)
當(dāng)前地址:http://bm7419.com/article26/dsdsjg.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供App設(shè)計(jì)、ChatGPT、網(wǎng)站維護(hù)企業(yè)網(wǎng)站制作域名注冊(cè)、面包屑導(dǎo)航

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來源: 創(chuàng)新互聯(lián)

網(wǎng)站優(yōu)化排名