Oracle 12C RAC CDB資料庫部署
Oracle 中的12C新特性-容器資料庫
---12.1.0.2_GI_RAC_Create_CDB_Blog
一、 安裝前的準備
安裝兩個節點的 12.1.0.2 GI/RAC ,建立 CDB 資料庫。
1. 關閉 SELINUX
vim /etc/selinux/config * Change the SELINUX value to "SELINUX=disabled". 另外,關閉OS iptable等服務 service NetworkManager stop service iptables stop chkconfig NetworkManager off chkconfig iptables off
2. 網路IP配置(HOSTS檔案)
cat /etc/hosts # vastdata11 192.168.56.11 vastdata11.us.oracle.com vastdata11 192.168.56.21 vastdata11-vip.us.oracle.com vastdata11-vip 10.0.0.2 vastdata11-priv1.us.oracle.com vastdata11-priv1 10.0.0.3 vastdata11-priv2.us.oracle.com vastdata11-priv2 # vastdata12 192.168.56.12 vastdata12.us.oracle.com vastdata12 192.168.56.22 vastdata12-vip.us.oracle.com vastdata12-vip 10.0.0.4 vastdata12-priv1.us.oracle.com vastdata12-priv1 10.0.0.5 vastdata12-priv2.us.oracle.com vastdata12-priv2 # rac-scan 192.168.56.33 vastdata-scan.us.oracle.com vastdata-scan 192.168.56.34 vastdata-scan.us.oracle.com vastdata-scan 192.168.56.35 vastdata-scan.us.oracle.com vastdata-scan
3. 安裝OS系統RPM包
Oracle Linux 6 and Red Hat Linux 6 需要安裝下面系統RPM包, 其他OS版本請參考線上文件: http://docs.oracle.com/database/121/CWLIN/prelinux.htm#CEGCECCC
配置YUM源
cd /etc/yum.repos.d/ cat yum.repo [oel6] name=OEL6.5 baseurl=file:///media/OL6.5\ x86_64\ Disc\ 1\ 20131125 gpgcheck=0 enabled=1
安裝RPM包
yum install binutils compat-libcap1 compat-libstdc++-33 iptraf gcc gcc-c++ glibc-devel glibc elfutils-libelf-devel compat-libcap1 compat-libstdc++-33 libaio-devel ksh libgcc libstdc libstdc++ libstdc++-devel libaio libaio-devel make sysstat unixODBC unixODBC-devel -y yum install binutils-2.20.51.0.2-5.11.el6 compat-libcap1-1.10-1 compat-libstdc++-33-3.2.3-69.el6 compat-libstdc++-33-3.2.3-69.el6.i686 gcc-4.4.4-13.el6 gcc-c++-4.4.4-13.el6 glibc-2.12-1.7.el6 glibc-2.12-1.7.el6 glibc-devel-2.12-1.7.el6 glibc-devel-2.12-1.7.el6.i686 ksh libgcc-4.4.4-13.el6 libgcc-4.4.4-13.el6 libstdc++-4.4.4-13.el6 libstdc++-4.4.4-13.el6.i686 libstdc++-devel-4.4.4-13.el6 libstdc++-devel-4.4.4-13.el6.i686 libaio-0.3.107-10.el6 libaio-0.3.107-10.el6.i686 libaio-devel-0.3.107-10.el6 libaio-devel-0.3.107-10.el6.i686 libXext-1.1 libXext-1.1 libXtst-1.0.99.2 libXtst-1.0.99.2 libX11-1.3 libX11-1.3 libXau-1.0.5 libXau-1.0.5 libxcb-1.5 libxcb-1.5 libXi-1.3 libXi-1.3 make-3.81-19.el6 sysstat-9.0.4-11.el6 nfs-utils-1.2.3-15.0.1 -y
4. Ulimit 資源設定
設定/etc/security/limits.conf,詳細參考線上文件:
http://docs.oracle.com/database/121/LADBI/usr_grps.htm#LADBI7674
oracle soft nproc 2047 oracle hard nproc 16384 oracle soft nofile 1024 oracle hard nofile 65536 oracle soft stack 10240 oracle hard stack 10240 grid soft nproc 2047 grid hard nproc 16384 grid soft nofile 1024 grid hard nofile 65536 grid soft stack 10240 grid hard stack 10240
5. 新增使用者組
groupadd -g 54321 oinstall groupadd -g 54322 dba groupadd -g 54328 asmadmin groupadd -g 54325 asmdba useradd -u 54322 -g oinstall -G asmadmin,asmdba grid useradd -u 54321 -g oinstall -G dba,asmdba oracle echo "oracle" | passwd --stdin oracle echo "grid" | passwd --stdin grid
6. 建立目錄結構
--建立 GRID_BASE mkdir -p /u01/app/grid --建立 GRID_HOME mkdir -p /u01/12.1.0/grid chown -R grid:oinstall /u01 chmod -R 775 /u01/ chmod -R 775 /u01/12.1.0/grid --建立 ORACLE_BASE mkdir -p /u01/app/oracle chown oracle:oinstall /u01/app/oracle chmod -R 775 /u01/
7. 配置oracle、grid使用者環境變數
GRID環境變數 export TMP=/tmp export TMPDIR=$TMP export ORACLE_HOSTNAME=vastdata11.us.oracle.com export ORACLE_SID=+ASM1 export ORACLE_BASE=/u01/app/grid export ORACLE_HOME=/u01/12.1.0/grid export NLS_DATE_FORMAT="yy-mm-dd hh24:mi:ss" export PATH=$ORACLE_HOME/bin:/usr/sbin:$PATH export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib export CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib export NLS_LANG=AMERICAN_AMERICA.ZHS16GBK umask 022 ------------------------------------------------------------------------------- ORACLE環境變數 export TMP=/tmp export TMPDIR=$TMP export ORACLE_HOSTNAME=vastdata11.us.oracle.com export ORACLE_BASE=/u01/app/oracle export ORACLE_HOME=$ORACLE_BASE/product/12.1.0/db_1 export ORACLE_UNQNAME=PROD export ORACLE_SID=PROD1 export PATH=$ORACLE_HOME/bin:/usr/sbin:$PATH export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib export CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib export NLS_DATE_FORMAT="yyyy-mm-dd hh24:mi:ss" export NLS_LANG=AMERICAN_AMERICA.ZHS16GBK umask 022
8. private- 配置私網
vim /etc/sysconfig/network-scripts/ifcfg-eth2 DEVICE=eth2 IPADDR=10.0.0.2 NETMASK=255.255.255.0 TYPE=Ethernet NM_CONTROLLED=yes USERCTL=no BOOTPROTO=none ONBOOT=yes
9. 繫結網路卡-Bond
1) 載入bond功能
modprobe --first-time bonding lsmod | grep bonding
2) 配置網路卡檔案
vim /etc/sysconfig/network-scripts/ifcfg-bond0 DEVICE=bond0 TYPE=Bond IPADDR=192.168.56.11 NETMASK=255.255.255.0 USERCTL=no BOOTPROTO=none ONBOOT=yes BONDING_MASTER=yes BONDING_OPTS="mode=0 miimon=100" vim /etc/sysconfig/network-scripts/ifcfg-eth0 DEVICE=eth0 USERCTL=no ONBOOT=yes MASTER=bond0 SLAVE=yes BOOTPROTO=none vim /etc/sysconfig/network-scripts/ifcfg-eth1 DEVICE=eth1 USERCTL=no ONBOOT=yes MASTER=bond0 SLAVE=yes BOOTPROTO=none vim /etc/modprobe.d/dist.conf alias bond0 bonding options bonding miimon=100 mode=0
3) 重啟網路卡服務
service network restart cat /proc/net/bonding/bond0 ifconfig
10. 配置解析伺服器
1) 主域名解析伺服器
yum install bind bind-chroot -y cp -p /etc/named.conf /etc/named.conf.bak vim /etc/named.conf // // named.conf // // Provided by Red Hat bind package to configure the ISC BIND named(8) DNS // server as a caching only nameserver (as a localhost DNS resolver only). // // See /usr/share/doc/bind*/sample/ for example named configuration files. // options { listen-on port 53 { any; }; directory "/var/named"; allow-query { any; }; allow-query-cache { any; }; recursion no; }; zone "." IN { type hint; file "named.ca"; }; zone "us.oracle.com" IN { type master; file "us.oracle.com.zone"; }; zone "56.168.192.in-addr.arpa" IN { type master; file "192.168.56.local"; }; cd /var/named/ cp -p named.localhost us.oracle.com.zone cp -p us.oracle.com.zone 192.168.56.local vim /var/named/us.oracle.com.zone $TTL 1D @ IN SOA vastdata11.us.oracle.com. root.us.oracle.com. ( 0 ; serial 1D ; refresh 1H ; retry 1W ; expire 3H ) ; minimum NS dns.us.oracle.com. vastdata11 A 192.168.56.11 vastdata12 A 192.168.56.12 vastdata-scan A 192.168.56.33 vastdata-scan A 192.168.56.34 vastdata-scan A 192.168.56.35 dns A 192.168.56.44 vastdata11-vip A 192.168.56.21 vastdata12-vip A 192.168.56.22 vastdata11-priv1 A 10.0.0.2 vastdata11-priv2 A 10.0.0.3 vastdata12-priv1 A 10.0.0.4 vastdata12-priv2 A 10.0.0.5 vim /var/named/192.168.56.local $TTL 1D @ IN SOA vastdata11.us.oracle.com. root.us.oracle.com. ( 0 ; serial 1D ; refresh 1H ; retry 1W ; expire 3H ) ; minimum IN NS dns.us.oracle.com. 11 IN PTR vastdata11.us.oracle.com. 12 IN PTR vastdata12.us.oracle.com. 33 IN PTR vastdata-scan.us.oracle.com. 34 IN PTR vastdata-scan.us.oracle.com. 35 IN PTR vastdata-scan.us.oracle.com. 44 IN PTR dns 21 IN PTR vastdata11-vip.us.oracle.com. 22 IN PTR vastdata12-vip.us.oracle.com. service network restart service named restart chkconfig named on chkconfig named --list ----------------------------------------------- nslookup vastdata-scan.us.oracle.com
2) 從域名解析伺服器
cd /etc/ vim named.conf options { directory "/var/named"; allow-query { any; }; recursion no; }; zone "us.oracle.com" IN { type slave; file "slave/us.oracle.com.zone"; masters { 192.168.56.11; }; allow-transfer { none; }; }; zone "56.168.192.in-addr.arpa" IN { type slave; file "slave/192.168.56.rev"; masters { 192.168.56.11; }; }; CLIENT DNS配置 vim /etc/resolv.conf nameserver 192.168.56.11 service named restart nslookup vastdata-scan.us.oracle.com
11. 配置 ASM Disk
第一種:使用 udev 第二種:使用 asmlib ------------------------------------------------------------------------------- --首先OS層面配置disk fdisk /dev/sdb --配置後的disk資訊: ls -l /dev/sd* --標記新加捲組 vim 1.sh for i in b c d ; do echo "KERNEL==\"sd*\", BUS==\"scsi\", PROGRAM==\"/sbin/scsi_id --whitelisted --replace-whitespace --device=/dev/\$name\", RESULT==\"`/sbin/scsi_id --whitelisted --replace-whitespace --device=/dev/sd$i`\", NAME=\"asm-disk$i\", OWNER=\"grid\", GROUP=\"asmadmin\", MODE=\"0660\"" >> /etc/udev/rules.d/99-oracle-asmdevices.rules done chmod +x 1.sh ./1.sh cat /etc/udev/rules.d/99-oracle-asmdevices.rules start_udev ls -al /dev/asm-disk*
12. 配置互信
(root、grid、oracle,這三個使用者都需要配置互信,以及與自己配置互信)
ssh-keygen -t rsa cd /root/.ssh/ cat id_rsa.pub >> authorized_keys service sshd restart
13. 時間同步功能
在主DNS伺服器重啟後則變成active,否則就是觀望者(observer)
關閉兩臺機器的時間同步功能:
rm -rf /etc/ntp.conf rm -rf /etc/sysconfig/ntpd
14. CVU 檢查
執行 CVU 檢查系統配置是否滿足條件,在執行 CVU 之前需要手動配置 SSH
./runcluvfy.sh stage -pre crsinst -n vastdata11,vastdata12 -fixup -verbose
二、 安裝配置叢集 GRID
1. 執行OUI
1) 執行 runInstaller
export DISPLAY=192.168.56.1:1.0 xhost +
2) 選擇安裝叢集
3) 配置標準叢集
4) 高階安裝
5) 選擇語言
6) 配置叢集名和 SCAN
7) 選擇節點資訊
8) 配置測試 SSH
9)
配置網路卡
10) 選擇標準 ASM 儲存
11) 建立 diskgroup
12) ASM Password
13) 配置失敗隔離
14) 配置 EM
15) 配置 OS group
16) 配置GI安裝目錄和資料目錄,以及oraInventory目錄
17) 選擇 root 指令碼自動執行,如果不選擇,那麼按照 12c 之前的方法手動執行 root.sh
18) 前提檢查
執行修復指令碼
再次檢查
忽略可ignore的warning
19) 總結
20) 開始安裝,提示自動執行 root.sh 指令碼
21) 繼續配置叢集
2. 資源狀態
[grid@vastdata11 ~]$ crsctl stat res -t -------------------------------------------------------------------------------- Name Target State Server State details -------------------------------------------------------------------------------- Local Resources -------------------------------------------------------------------------------- ora.DATA.dg ONLINE ONLINE vastdata11 STABLE ONLINE ONLINE vastdata12 STABLE ora.LISTENER.lsnr ONLINE ONLINE vastdata11 STABLE ONLINE ONLINE vastdata12 STABLE ora.asm ONLINE ONLINE vastdata11 Started,STABLE ONLINE ONLINE vastdata12 Started,STABLE ora.net1.network ONLINE ONLINE vastdata11 STABLE ONLINE ONLINE vastdata12 STABLE ora.ons ONLINE ONLINE vastdata11 STABLE ONLINE ONLINE vastdata12 STABLE -------------------------------------------------------------------------------- Cluster Resources -------------------------------------------------------------------------------- ora.LISTENER_SCAN1.lsnr 1 ONLINE ONLINE vastdata12 STABLE ora.LISTENER_SCAN2.lsnr 1 ONLINE ONLINE vastdata11 STABLE ora.LISTENER_SCAN3.lsnr 1 ONLINE ONLINE vastdata11 STABLE ora.MGMTLSNR 1 ONLINE ONLINE vastdata11 169.254.62.144 10.0. 0.2 10.0.0.2,STABLE ora.cvu 1 ONLINE ONLINE vastdata11 STABLE ora.mgmtdb 1 ONLINE ONLINE vastdata11 Open,STABLE ora.oc4j 1 ONLINE ONLINE vastdata11 STABLE ora.scan1.vip 1 ONLINE ONLINE vastdata12 STABLE ora.scan2.vip 1 ONLINE ONLINE vastdata11 STABLE ora.scan3.vip 1 ONLINE ONLINE vastdata11 STABLE ora.vastdata11.vip 1 ONLINE ONLINE vastdata11 STABLE ora.vastdata12.vip 1 ONLINE ONLINE vastdata12 STABLE -------------------------------------------------------------------------------- [grid@vastdata11 ~]$ crsctl stat res -t -init -------------------------------------------------------------------------------- Name Target State Server State details -------------------------------------------------------------------------------- Cluster Resources -------------------------------------------------------------------------------- ora.asm 1 ONLINE ONLINE vastdata11 Started,STABLE ora.cluster_interconnect.haip 1 ONLINE ONLINE vastdata11 STABLE ora.crf 1 ONLINE ONLINE vastdata11 STABLE ora.crsd 1 ONLINE ONLINE vastdata11 STABLE ora.cssd 1 ONLINE ONLINE vastdata11 STABLE ora.cssdmonitor 1 ONLINE ONLINE vastdata11 STABLE ora.ctssd 1 ONLINE ONLINE vastdata11 ACTIVE:0,STABLE ora.diskmon 1 OFFLINE OFFLINE STABLE ora.drivers.acfs 1 ONLINE ONLINE vastdata11 STABLE ora.evmd 1 ONLINE ONLINE vastdata11 STABLE ora.gipcd 1 ONLINE ONLINE vastdata11 STABLE ora.gpnpd 1 ONLINE ONLINE vastdata11 STABLE ora.mdnsd 1 ONLINE ONLINE vastdata11 STABLE ora.storage 1 ONLINE ONLINE vastdata11 STABLE -------------------------------------------------------------------------------- [grid@vastdata12 ~]$ crsctl stat res -t -------------------------------------------------------------------------------- Name Target State Server State details -------------------------------------------------------------------------------- Local Resources -------------------------------------------------------------------------------- ora.DATA.dg ONLINE ONLINE vastdata11 STABLE ONLINE ONLINE vastdata12 STABLE ora.LISTENER.lsnr ONLINE ONLINE vastdata11 STABLE ONLINE ONLINE vastdata12 STABLE ora.asm ONLINE ONLINE vastdata11 Started,STABLE ONLINE ONLINE vastdata12 Started,STABLE ora.net1.network ONLINE ONLINE vastdata11 STABLE ONLINE ONLINE vastdata12 STABLE ora.ons ONLINE ONLINE vastdata11 STABLE ONLINE ONLINE vastdata12 STABLE -------------------------------------------------------------------------------- Cluster Resources -------------------------------------------------------------------------------- ora.LISTENER_SCAN1.lsnr 1 ONLINE ONLINE vastdata12 STABLE ora.LISTENER_SCAN2.lsnr 1 ONLINE ONLINE vastdata11 STABLE ora.LISTENER_SCAN3.lsnr 1 ONLINE ONLINE vastdata11 STABLE ora.MGMTLSNR 1 ONLINE ONLINE vastdata11 169.254.62.144 10.0. 0.2 10.0.0.2,STABLE ora.cvu 1 ONLINE ONLINE vastdata11 STABLE ora.mgmtdb 1 ONLINE ONLINE vastdata11 Open,STABLE ora.oc4j 1 ONLINE ONLINE vastdata11 STABLE ora.scan1.vip 1 ONLINE ONLINE vastdata12 STABLE ora.scan2.vip 1 ONLINE ONLINE vastdata11 STABLE ora.scan3.vip 1 ONLINE ONLINE vastdata11 STABLE ora.vastdata11.vip 1 ONLINE ONLINE vastdata11 STABLE ora.vastdata12.vip 1 ONLINE ONLINE vastdata12 STABLE -------------------------------------------------------------------------------- [grid@vastdata12 ~]$ crsctl stat res -t -init -------------------------------------------------------------------------------- Name Target State Server State details -------------------------------------------------------------------------------- Cluster Resources -------------------------------------------------------------------------------- ora.asm 1 ONLINE ONLINE vastdata12 Started,STABLE ora.cluster_interconnect.haip 1 ONLINE ONLINE vastdata12 STABLE ora.crf 1 ONLINE ONLINE vastdata12 STABLE ora.crsd 1 ONLINE ONLINE vastdata12 STABLE ora.cssd 1 ONLINE ONLINE vastdata12 STABLE ora.cssdmonitor 1 ONLINE ONLINE vastdata12 STABLE ora.ctssd 1 ONLINE ONLINE vastdata12 ACTIVE:0,STABLE ora.diskmon 1 OFFLINE OFFLINE STABLE ora.drivers.acfs 1 ONLINE ONLINE vastdata12 STABLE ora.evmd 1 ONLINE ONLINE vastdata12 STABLE ora.gipcd 1 ONLINE ONLINE vastdata12 STABLE ora.gpnpd 1 ONLINE ONLINE vastdata12 STABLE ora.mdnsd 1 ONLINE ONLINE vastdata12 STABLE ora.storage 1 ONLINE ONLINE vastdata12 STABLE --------------------------------------------------------------------------------
三、 安裝/建立 Database
1. 執行 OUI/runInstaller
1)
執行 runInstaller
2) 忽略 update 配置
3) 只安裝軟體
4) 選擇安裝 RAC 資料庫
5) 選擇 RAC 節點
6) 選擇語言
7) 選擇版本
8) 選擇 ORACLE_HOME
9) 配置 OS 組
10) 前提檢查
11) 總結
12) 開始安裝,並執行root.sh指令碼
2. ASMCA建立磁碟組
3. DBCA 建庫(CDB)
1)
執行 dbca
2) 建立資料庫
3) 高階安裝
4) 選擇資料庫型別是 RAC 型別, 配置型別是 Admin-Managed
5) 設定資料庫名,並且選擇建立 Container database
6) 選擇節點
7) OEM 和 CVU 配置
8) 密碼設定
9) 選擇 ASM 儲存
10) 在 CDB 資料庫型別中, 預設所有元件都選擇
11) 其他配置選項
12) 記憶體和字符集配置
13) 建立選項
14) 前提檢查
15) 總結
16) 開始安裝
4. 資源檢查
[grid@vastdata12 ~]$ crsctl stat res -t -------------------------------------------------------------------------------- Name Target State Server State details -------------------------------------------------------------------------------- Local Resources -------------------------------------------------------------------------------- ora.DATA.dg ONLINE ONLINE vastdata11 STABLE ONLINE ONLINE vastdata12 STABLE ora.FRA.dg ONLINE ONLINE vastdata11 STABLE ONLINE ONLINE vastdata12 STABLE ora.LISTENER.lsnr ONLINE ONLINE vastdata11 STABLE ONLINE ONLINE vastdata12 STABLE ora.asm ONLINE ONLINE vastdata11 Started,STABLE ONLINE ONLINE vastdata12 Started,STABLE ora.net1.network ONLINE ONLINE vastdata11 STABLE ONLINE ONLINE vastdata12 STABLE ora.ons ONLINE ONLINE vastdata11 STABLE ONLINE ONLINE vastdata12 STABLE -------------------------------------------------------------------------------- Cluster Resources -------------------------------------------------------------------------------- ora.LISTENER_SCAN1.lsnr 1 ONLINE ONLINE vastdata12 STABLE ora.LISTENER_SCAN2.lsnr 1 ONLINE ONLINE vastdata11 STABLE ora.LISTENER_SCAN3.lsnr 1 ONLINE ONLINE vastdata11 STABLE ora.MGMTLSNR 1 ONLINE OFFLINE 169.254.67.242 10.0. 0.4,STABLE ora.cdb.db 1 ONLINE ONLINE vastdata11 Open,STABLE 2 ONLINE ONLINE vastdata12 Open,STABLE ora.cvu 1 ONLINE ONLINE vastdata11 STABLE ora.mgmtdb 1 ONLINE OFFLINE STABLE ora.oc4j 1 ONLINE ONLINE vastdata11 STABLE ora.scan1.vip 1 ONLINE ONLINE vastdata12 STABLE ora.scan2.vip 1 ONLINE ONLINE vastdata11 STABLE ora.scan3.vip 1 ONLINE ONLINE vastdata11 STABLE ora.vastdata11.vip 1 ONLINE ONLINE vastdata11 STABLE ora.vastdata12.vip 1 ONLINE ONLINE vastdata12 STABLE -------------------------------------------------------------------------------- [grid@vastdata12 ~]$ crsctl stat res -t -init -------------------------------------------------------------------------------- Name Target State Server State details -------------------------------------------------------------------------------- Cluster Resources -------------------------------------------------------------------------------- ora.asm 1 ONLINE ONLINE vastdata12 Started,STABLE ora.cluster_interconnect.haip 1 ONLINE ONLINE vastdata12 STABLE ora.crf 1 ONLINE ONLINE vastdata12 STABLE ora.crsd 1 ONLINE ONLINE vastdata12 STABLE ora.cssd 1 ONLINE ONLINE vastdata12 STABLE ora.cssdmonitor 1 ONLINE ONLINE vastdata12 STABLE ora.ctssd 1 ONLINE ONLINE vastdata12 ACTIVE:0,STABLE ora.diskmon 1 OFFLINE OFFLINE STABLE ora.drivers.acfs 1 ONLINE ONLINE vastdata12 STABLE ora.evmd 1 ONLINE ONLINE vastdata12 STABLE ora.gipcd 1 ONLINE ONLINE vastdata12 STABLE ora.gpnpd 1 ONLINE ONLINE vastdata12 STABLE ora.mdnsd 1 ONLINE ONLINE vastdata12 STABLE ora.storage 1 ONLINE ONLINE vastdata12 STABLE --------------------------------------------------------------------------------
5. PDB 啟動/連線
1) 連線到 CDB
[oracle@vastdata11 ~]$ export ORACLE_SID=cdb1 [oracle@vastdata11 ~]$ sqlplus / as sysdba SQL*Plus: Release 12.1.0.2.0 Production on Wed May 15 06:49:24 2019 Copyright (c) 1982, 2014, Oracle. All rights reserved. Connected to: Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP, Advanced Analytics and Real Application Testing options SQL> SELECT NAME, CDB, CON_ID FROM V$DATABASE; NAME CDB CON_ID ------------------ ------ ---------- CDB YES 0 SQL> select name,cdb,con_id from v$database; NAME CDB CON_ID ------------------ ------ ---------- CDB YES 0 SQL> SELECT SYS_CONTEXT ('USERENV', 'CON_NAME') FROM DUAL; SYS_CONTEXT('USERENV','CON_NAME') -------------------------------------------------------------------------------- CDB$ROOT SQL> select sys_context('userenv','con_name') from dual; SYS_CONTEXT('USERENV','CON_NAME') -------------------------------------------------------------------------------- CDB$ROOT
2) 啟動PDB,並從cdb switchover到pdb
SQL> alter pluggable database pdb open; alter pluggable database pdb open * ERROR at line 1: ORA-65019: pluggable database PDB already open SQL> alter session set container=pdb; Session altered.
3) 檢視PDB資訊
SQL> col name format a15 SQL> set linesize 160 SQL> col pdb_name format a15 SQL> select con_id, dbid, guid, name , open_mode from v$pdbs; CON_ID DBID GUID NAME OPEN_MODE ---------- ---------- -------------------------------- --------------- -------------------- 3 3454107755 88EB774565FA4F12E0530B38A8C09990 PDB READ WRITE
至此,本次12C-CDB容器資料庫部署完成。
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/69902483/viewspace-2646457/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Oracle 12C RMAN Duplicating the Whole RAC CDB to local RAC CDBOracle
- 【資料庫升級】Oracle指令碼升級12c CDB to 19c CDB資料庫Oracle指令碼
- ORACLE 12C RAC資料庫的啟停Oracle資料庫
- 怎樣遷移一個已存在的 12c 之前版本的資料庫(非 CDB)到 12c CDB 的資料庫資料庫
- Oracle 12C RMAN transport tablespace from PDB of RAC CDB to remote PDBOracleREM
- 12c RAC 和 CDB/PDB 學習
- Oracle 12c no-CDB轉換為CDBOracle
- Oracle 12c 手動建立CDB和非CDBOracle
- oracle 12c rac 詳細部署教程(一)Oracle
- oracle 12c rac 詳細部署教程(二)Oracle
- oracle 12c non-cdb升級成cdb模式Oracle模式
- Oracle 12c CDB&PDBs管理Oracle
- Oracle 12c 手動建立CDBOracle
- ORACLE 12C RAC 部署應用包準備Oracle
- RAC環境中的資料庫部署技術——RAC部署和效能資料庫
- Oracle 12c 多租戶專題|CDB後設資料內幕Oracle
- Oracle 12c資料庫安裝Oracle資料庫
- Oracle 12c nocdb轉換成cdbOracle
- Oracle 12c RMAN Duplicating the Whole CDBOracle
- ORACLE 12C新特性——CDB與PDBOracle
- Oracle 12c 使用RMAN搭建物理備庫(RAC to RAC)Oracle
- Oracle 12c 建立與刪除CDB、PDBsOracle
- Oracle 12C RMAN Duplicating the PDB to remote CDBOracleREM
- Oracle 12c CDB&PDB 基本維護Oracle
- oracle rac資料庫的安裝Oracle資料庫
- Oracle 資料庫 升級為 RACOracle資料庫
- vgant 安裝oracle資料庫racOracle資料庫
- 【12C】Oracle 12c 可插拔資料庫之資料泵功能體驗Oracle資料庫
- Oracle 12c RAC: MGMTDBOracle
- ORACLE資料庫10G部署Oracle資料庫
- Oracle資料庫部署實施流程Oracle資料庫
- Oracle 12c資料庫升級實戰Oracle資料庫
- Oracle Database 12c可插拔資料庫案例OracleDatabase資料庫
- Oracle 12c 使用Non-CDB來建立PDBOracle
- Oracle 12c - 普通資料庫與容器資料庫不能相互轉化Oracle資料庫
- Oracle資料庫(RAC)巡檢報告Oracle資料庫
- 【BUILD_ORACLE】Oracle 19c RAC搭建(六)建立RAC資料庫UIOracle資料庫
- 詳談Oracle12c新特點容器資料庫&可插拔資料庫(CDB&PDB)Oracle資料庫