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;

相关推荐
mahuifa1 个月前
C++(Qt)软件调试---符号转换工具cv2pdb (24)
c++·qt·pdb·cv2pdb
醉颜凉4 个月前
页面间对象传递的几种方法
java·面试·cookie·request·session·application
Commas.KM4 个月前
【JS|第25期】探索HTTP POST请求:请求体的演变与应用
开发语言·javascript·http·json·application·form-data·application/xml
亚林瓜子4 个月前
SpringBoot启动初始化配置之ApplicationRunner
java·spring boot·后端·application
小小工匠4 个月前
Spring Boot - 通过ServletRequestHandledEvent事件实现接口请求的性能监控
spring boot·application
qq_340040885 个月前
org.springframework.context.ApplicationContext发送消息
context·application·发送消息
放羊的牧码6 个月前
MacOS - 启动台(LaunchPad)缺少应用软件图标
macos·app·图标·application·launchpad·启动台缺少应用软件图标·消失 不见
G皮T10 个月前
【大数据】Flink 之部署篇
大数据·flink·部署·session·application·per-job
小明java问道之路1 年前
已解决org.springframework.context.ApplicationContextException异常的正确解决方法,亲测有效!!!
java·bug·异常处理·context·exception·error·application
qiuchangyong1 年前
安卓下Application和Activity的Context获取
android·context·application·activity·hashcode