项目背景
19c cdb的rac搭建完成,但是有个应用系统需要开个pdb 因为业务的原因,归档太多,需要在rac上开启第2个CDB,单独开个pdb,不开归档。
所以一套cdb开启归档,一套不开归档。
我这里实在原来搭建好的rac基础上继续添加一个cdb
RAC搭建参考 http://blog.itpub.net/70004783/viewspace-2791938/
dg搭建参考 http://blog.itpub.net/70004783/viewspace-2794470/
ORACLE19C RAC+DG 配置 http://blog.itpub.net/70004783/viewspace-2794573/
在节点rac1上操作,规划创建数据库为hap, 确保俩主机的内存够
在节点rac2上查看
[oracle@rac2:/home/oracle]$export ORACLE_SID=hap2 [oracle@rac2:/home/oracle]$sqlplus / as sysdba SQL*Plus: Release 19.0.0.0.0 - Production on Fri Feb 18 15:05:38 2022 Version 19.3.0.0.0 Copyright (c) 1982, 2019, Oracle. All rights reserved. Connected to: Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production Version 19.3.0.0.0 SQL> show pdbs; CON_ID CON_NAME OPEN MODE RESTRICTED ---------- ------------------------------ ---------- ---------- 2 PDB$SEED READ ONLY NO SQL> select name from v$database; NAME --------- HAP SQL>
在新的cdb中创建新的pdb
SQL> create pluggable database hap_pdb1 admin user hap_pdb1 identified by hap_pdb1 create_file_dest='+DATADG'; Pluggable database created. SQL> show pdbs; CON_ID CON_NAME OPEN MODE RESTRICTED ---------- ------------------------------ ---------- ---------- 2 PDB$SEED READ ONLY NO 3 HAP_PDB1 MOUNTED SQL> alter pluggable database HAP_PDB1 open; Pluggable database altered.
查看监听,也有服务hap_pdb1
[oracle@rac2:/home/oracle]$lsnrctl status LSNRCTL for Linux: Version 19.0.0.0.0 - Production on 18-FEB-2022 15:12:05 Copyright (c) 1991, 2019, Oracle. All rights reserved. Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521)) STATUS of the LISTENER ------------------------ Alias LISTENER Version TNSLSNR for Linux: Version 19.0.0.0.0 - Production Start Date 18-FEB-2022 09:28:33 Uptime 0 days 5 hr. 43 min. 31 sec Trace Level off Security ON: Local OS Authentication SNMP OFF Listener Parameter File /u01/app/19c/grid/network/admin/listener.ora Listener Log File /u01/app/grid/diag/tnslsnr/rac2/listener/alert/log.xml Listening Endpoints Summary... (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=LISTENER))) (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=10.8.98.104)(PORT=1521))) (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=10.8.98.106)(PORT=1521))) Services Summary... Service "+ASM" has 1 instance(s). Instance "+ASM2", status READY, has 1 handler(s) for this service... Service "+ASM_DATADG" has 1 instance(s). Instance "+ASM2", status READY, has 1 handler(s) for this service... Service "+ASM_FRADG" has 1 instance(s). Instance "+ASM2", status READY, has 1 handler(s) for this service... Service "+ASM_MGMTDG" has 1 instance(s). Instance "+ASM2", status READY, has 1 handler(s) for this service... Service "+ASM_OCRDG" has 1 instance(s). Instance "+ASM2", status READY, has 1 handler(s) for this service... Service "86b637b62fdf7a65e053f706e80a27ca" has 2 instance(s). Instance "hap2", status READY, has 1 handler(s) for this service... Instance "prod2", status READY, has 1 handler(s) for this service... Service "ccc9b4b0a1183cdae0536862080a56c6" has 1 instance(s). Instance "prod2", status READY, has 1 handler(s) for this service... Service "d8468fe7d6a24dd5e0536862080a82f8" has 1 instance(s). Instance "hap2", status READY, has 1 handler(s) for this service... Service "hap" has 1 instance(s). Instance "hap2", status READY, has 1 handler(s) for this service... Service "hapXDB" has 1 instance(s). Instance "hap2", status READY, has 1 handler(s) for this service... Service "hap_pdb1" has 1 instance(s). Instance "hap2", status READY, has 1 handler(s) for this service... Service "pdb" has 1 instance(s). Instance "prod2", status READY, has 1 handler(s) for this service... Service "prod" has 1 instance(s). Instance "prod2", status UNKNOWN, has 1 handler(s) for this service... Service "prodXDB" has 1 instance(s). Instance "prod2", status READY, has 1 handler(s) for this service... Service "prodpri" has 1 instance(s). Instance "prod2", status READY, has 1 handler(s) for this service... The command completed successfully [oracle@rac2:/home/oracle]$
这样就创建完成了。