中文字幕av专区_日韩电影在线播放_精品国产精品久久一区免费式_av在线免费观看网站

溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務條款》

ORACLE 12C 開機自動啟動監聽、CDB、PDB

發布時間:2020-07-02 16:38:36 來源:網絡 閱讀:5325 作者:湛康穎 欄目:關系型數據庫

linux下數據庫實例監聽開機自啟動設置
2018年8月1日 zhanky

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

一、設置監聽和CDB開機自啟
通過使用rc.local開機自動運行腳本,調用Oracle自帶的dbstart和lsnrct啟動。但調用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
因為Oracle linux 7.2默認rc.local是沒有執行權限,需執行chmod自己增加
dbstart默認將oratab中參數為Y的所有庫啟動

[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用戶登錄,運行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"
[root@zhanky ~]# chmod +x /etc/rc.d/rc.local

二、設置PDB自動啟動
通過觸發器來啟東PDB,下列觸發器中ALTER PLUGGABLE DATABASE ALL OPEN代表將所有PDB啟動,
如果只需

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

三、測試驗證,重啟數據庫服務器即可。

向AI問一下細節

免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。

AI

七台河市| 海安县| 清涧县| 博乐市| 黄梅县| 凤庆县| 班玛县| 太原市| 舟曲县| 类乌齐县| 澄城县| 隆德县| 革吉县| 阳西县| 临安市| 延安市| 亳州市| 武定县| 荣昌县| 涞源县| 恩平市| 阿克苏市| 成武县| 绥江县| 霍州市| 岳阳市| 遵义市| 柞水县| 卢湾区| 来安县| 黄梅县| 十堰市| 教育| 德惠市| 玉龙| 油尖旺区| 新昌县| 法库县| 北宁市| 兰州市| 台湾省|