当前位置: 首页 > news >正文

Oracle 运维篇+应用容器数据库的install、upgrade、patch、uninstall

★ 知识点
※ DEFAULT_SHARING参数的取值

  • METADATA: 元数据链接共享数据库对象的元数据,但其数据对于每个容器是唯一的。这些数据库对象被称为元数据链接的应用程序公共对象。此设置为默认设置。
  • DATA: 数据链接共享数据库对象,其数据对于应用程序容器中的所有容器都是相同的。它的数据只存储在应用程序根目录中。这些数据库对象称为数据链接应用程序公共对象.
  • EXTENDED DATA: 扩展数据链接共享数据库对象,其在应用程序根目录中的数据对于应用程序容器中的所有容器都是相同的。但是,应用程序容器中的每个应用程序PDB都可以存储该应用程序PDB独有的数据。对于这种类型的数据库对象,数据存储在应用程序根目录中,也可选地存储在每个应用程序PDB中。这些数据库对象被称为扩展数据链接应用程序公共对象.
  • NONE: 不共享数据库对象

✔ 安装
alter session set container=APP1_ROOT;
alter system set default_sharing='METADATA' scope=both;
alter pluggable database application app1_root begin install '1';
drop   user zzt_pub cascade;
create user zzt_pub identified by zzt;
grant  dba,unlimited tablespace to zzt_pub;
create table zzt_pub.t(id int,name varchar2(9));
alter pluggable database application app1_root end install '1';
insert into  zzt_pub.t values(1,'a');
commit;
--将应用容器中的Application Release同步到应用PDB中
alter session set container=APP1_pdb1;
alter pluggable database application all sync;
select * from zzt_pub.t;
alter session set container=APP1_pdb2;
alter pluggable database application all sync;
select * from zzt_pub.t;
alter session set container=APP1_ROOT;
select * from zzt_pub.t;


✔ 升级
--版本 1 to 2
alter session set container=app1_root;
alter system set default_sharing='METADATA' scope=both;
alter pluggable database application app1_root begin upgrade '1' to '2';
alter table zzt_pub.t add(ver int);
update zzt_pub.t set ver=1;
commit;
alter pluggable database application app1_root end upgrade to '2';
--版本 2 to 3
alter session set container=app1_root;
alter system set default_sharing='METADATA' scope=both;
alter pluggable database application app1_root begin upgrade '2' to '3';
alter table zzt_pub.t add(country varchar2(9));
update zzt_pub.t set country='china';
commit;
alter pluggable database application app1_root end upgrade to '3';
--将应用容器中的版本同步到应用pdb中
alter session set container=app1_root;
select * from zzt_pub.t;
alter session set container=app1_pdb1;
alter pluggable database application app1_root sync to '2';
select * from zzt_pub.t;
alter session set container=app1_pdb2;
alter pluggable database application app1_root sync to '3';
select * from zzt_pub.t;


✔ 打补丁
--给2打补丁
alter session set container=APP1_ROOT;
alter system set default_sharing='METADATA' scope=both;
alter pluggable database application app1_root begin patch 222 minimum version '2';
update zzt_pub.t set ver=2;
commit;
alter pluggable database application app1_root end patch 222;
--给3打补丁
alter session set container=APP1_ROOT;
alter system set default_sharing='METADATA' scope=both;
alter pluggable database application app1_root begin patch 333 minimum version '3';
update zzt_pub.t set ver=3;
commit;
alter pluggable database application app1_root end patch 333;
--同步
alter session set container=app1_root;
select * from zzt_pub.t;
alter session set container=app1_pdb1;
alter pluggable database application app1_root sync to patch 222;
select * from zzt_pub.t;
alter session set container=app1_pdb2;
alter pluggable database application app1_root sync to patch 333;
select * from zzt_pub.t;


✔ 卸载
alter session set container=app1_root;
alter system set default_sharing='METADATA' scope=both;
alter pluggable database application app1_root begin uninstall;
drop  user zzt_pub cascade;
alter pluggable database application app1_root end uninstall;
--同步
alter session set container=app1_pdb1;
alter pluggable database application app1_root sync;
alter session set container=app1_pdb2;
alter pluggable database application app1_root sync;
--删除application root
alter session set container=cdb$root;
alter  pluggable database APP1_ROOT close;
drop   pluggable database APP1_PDB1 including datafiles;
drop   pluggable database APP1_PDB2 including datafiles;
drop   pluggable database APP1_ROOT including datafiles;
--查验application root clone是否被删除
alter session set container=cdb$root;
show pdbs;

http://www.lryc.cn/news/199460.html

相关文章:

  • Affinity Publisher for Mac/Windows最新中文下载 排版神器
  • Mac文件对比同步工具 Beyond Compare 4.4.7
  • 技巧 | 如何解决 OBS 系统声音无法捕获问题 | Mac
  • 从头开始机器学习:逻辑回归
  • 插入排序 算法
  • “揭秘!如何通过京东商品详情接口轻松获取海量精准商品信息!“
  • 已经有多人中招,不要被AI换脸技术骗了!
  • solidworks 2024新功能之--保存为低版本 硕迪科技
  • MySQL --- 聚合查询 和 联合查询
  • Note——torch.size() umr_maximum() array.max() itertools.product()
  • python学习笔记6-DefaultDict
  • Redis 底层对 String 的 3 个优化
  • 简约艺术签名小程序源码/流量主小程序源码/字节跳动抖音小程序
  • Ubuntu(kylin)挂载iso文件和配置apt本地源
  • wps表格求标准差怎么算?
  • 安达发|制造企业生产排产现状和APS系统的解决方案
  • Qt判断一个点在多边形内还是外(支持凸边形和凹变形)
  • MySQL导入数据库出现 Got error 168 from storage engine错误
  • 使用 VS Code 作为 VC6 的编辑器
  • Peter算法小课堂—蠕动区间
  • Vant和ElementPlus在vue的hash模式的路由下路由离开拦截使用Dialog和MessageBox失效
  • 上海市通过区块链技术攻关 构建数字经济可信安全技术底座
  • Java 面试题
  • layui 表格 展开
  • [尚硅谷React笔记]——第4章 React ajax
  • Richard Stallman 正在与癌症作战
  • MathType7.4最新免费版(公式编辑器)下载安装包附安装教程
  • 如何支持h.265视频
  • vue 放大镜(简易)
  • 【计算机网络】第一章——概述