首页 > 数据库 >实现oracle 19c pdb在cdb重启后,自动开启相应pdb

实现oracle 19c pdb在cdb重启后,自动开启相应pdb

时间:2022-11-02 21:38:23浏览次数:43  
标签:name cdb ---------- SQL oracle pdb NAME

文档课题:实现oracle 19c pdb在cdb重启后,自动开启相应pdb.
[oracle@dbserver ~]$ sql / as sysdba

SQLcl: Release 19.1 Production on Wed Nov 02 14:26:19 2022

Copyright (c) 1982, 2022, Oracle. All rights reserved.

Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.12.0.0.0


SQL> show pdbs

CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
2 PDB$SEED READ ONLY NO
3 ORCLPDB MOUNTED

SQL> alter pluggable database orclpdb open;

Pluggable database altered.

说明:如上所示,每次cdb开启后,对应的pdb在均mounted阶段,都需要重新open pdb.
如何解决这个问题呢?以下便是解决此问题操作过程.
SQL> select con_name,state from cdb_pdb_saved_states;
no rows selected
SQL> alter pluggable database all save state;

Pluggable database altered.
注意:若是集群环境,每个节点都要保存状态.
SQL> col con_name for a15
SQL> select con_name,state from cdb_pdb_saved_states;

CON_NAME STATE
--------------- --------------
ORCLPDB OPEN
SQL> col INSTANCE_NAME for a15
SQL> select instance_name,con_name,state from cdb_pdb_saved_states order by 1,2;

INSTANCE_NAME CON_NAME STATE
--------------- --------------- --------------
orclcdb ORCLPDB OPEN

SQL> select name from v$database;

NAME
---------
ORCLCDB
重启数据库确认.
SQL> startup force;

Total System Global Area 2415918600 bytes
Fixed Size 9137672 bytes
Variable Size 989855744 bytes
Database Buffers 1409286144 bytes
Redo Buffers 7639040 bytes
Database mounted.
Database opened.
SQL> show pdbs;

CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
2 PDB$SEED READ ONLY NO
3 ORCLPDB READ WRITE NO
说明:如上所示,cdb重启后对应的pdb自动read write.

标签:name,cdb,----------,SQL,oracle,pdb,NAME
From: https://blog.51cto.com/u_12991611/5818335

相关文章

  • oracle_fdw安装部署(yum方式)
    环境:OS:Centos7PGDB:13.8Oralce:11.2.0.4 1.安装oralce瘦客户端参考链接(root账号下安装部署)https://www.cnblogs.com/hxlasky/p/16616404.htmlroot账号和postgres......
  • 【数据库数据恢复】HP-UX环境下误删除ORACLE数据库的数据恢复案例
    数据库恢复环境:联通海南分部信息平台,HP-UX小型机;ORACLE数据库,卷文件系统为VxFS。​数据库故障&分析:工程师误RM掉了重要ORACLE数据库,丢失了所有的数据表、UNDO、LOG等。......
  • MySQL 切换 Oracle 问题整理
    MySQL通常小写,Oracle默认大写,查询过程中需加双引号行转列。例:将字符串1,2,3转为数组。涉及中文乱码问题,需用TO_CHARSELECT ( SELECT listagg(TO_CHAR("ro......
  • Oracle中查询表结构的六种方法
    首发微信公众号:SQL数据库运维原文链接:https://mp.weixin.qq.com/s?__biz=MzI1NTQyNzg3MQ==&mid=2247485212&idx=1&sn=450e9e94fa709b5eeff0de371c62072b&chksm=ea37536cdd......
  • oracle_fdw安装部署(yum方式)
    环境:OS:Centos7DB:13.8 1.安装oralce客户端参考链接(root账号下安装部署)https://www.cnblogs.com/hxlasky/p/16616404.html 2.安装oracle_fdw我这里采用yum方式进......
  • oracle查索引大小
    文档课题:oracle查索引大小.数据库:oracle11.2.0.464位以下为实际操作过程.SQL>createtableemp_init(2idnumber(12),3namevarchar2(20),4age......
  • Oracle 数据库忘记sys与system管理员密码重置操作方法
    首先打开cmd执行123orapwdfile=C:\app\PWDorcl.orapassword=orclorclC:\app\PWDorcl.ora是你要存放的路径文件Password=orclorcl是你要改的密码......
  • Oracle生成日期维度
    一、创建一张表用于保存日期维度数据日期维度表createtablet_date(sys_datenumberprimarykeynotnull,--系统日期yearnumbernotnull,--年份......
  • vSAN 架构下搭建 Oracle RAC
    规划​OracleRAC-A:16核心、16G内存、600G系统盘、80G、80G、500G​OracleRAC-B:16核心、16G内存、600G系统盘、80G、80G、500G创建虚拟机存储策略在vCenterServer中找到......
  • oracle 层次查询
    HierarchicalQueries语法connectby[nocycle]condition[startwithcondition]startwithconditionconnectby[nocycle]conditionconditionstartwith指定......