Creating and Removing Application Containers

The application PDBs and application root can share application common objects.

There are three types of application common objects:

  1. Metadata-linked application common objects store the metadata for specific objects, such as tables, so that the containers that share the application common object have the same structure but different data.
  2. Data-linked application common objects are defined once in the application root and shared as read-only objects in the context of hosted application PDBs.
  3. Extended data-linked application common objects store shared data in the application root but also allow application PDBs to store data appended to that object. The appended data is local data that is unique to each application PDB.
  1. Creating/Unplugging/Drop an Application Container

这里的application container即application root, 它的创建方法同创建普通PDB,只是语法上多了AS APPLICATION CONTAINER子句,可以通过以下方法创建:

Using the CDB seed

Cloning an existing PDB or non-CDB

Relocating a PDB

Plugging in an unplugged PDB

Note:

  1. You must decide on a unique application container name for each application container. Each application container name must be unique with regards to all of the containers in a single CDB, and each application container name must be unique within the scope of all the CDBs whose instances are reached through a specific listener.
  2. Unplug a application container方法与unplug pdb完全一样
  3. Drop a application container方法与drop pdb完全一样

Migrating Existing Applications to an Application Container

You can migrate an application to an application container by creating an application container using an existing PDB. You must complete additional tasks when you are migrating an existing application to an application container. The PDBs that you plug in must contain the application’s database objects, including their data, and you must run procedures in the DBMS_PDB package to associate database objects with the application. Also, when application common users, roles, or profiles exist in the application root, you must run procedures in the DBMS_PDB package to associate them with the application.

CREATE PLUGGABLE DATABASE salesact AS APPLICATION CONTAINER ADMIN USER salesadm IDENTIFIED BY password;

  1. Creating/Unplugging/Drop Application Seeds

一般是在创建application root后再进行install,install后再创建seed

You can use an application seed to provision an application container with application PDBs that have the application root’s applications installed. Typically, the application container’s applications are installed in the application root before the application seed is created. After the application seed is created, it is synchronized with the application root so that the applications are installed in the application seed. When that is complete, any PDBs created using the application seed have the applications installed.

When an application in the application root is upgraded or patched, the application seed must be synchronized with the application root to apply these changes.

When you create an application seed using the AS SEED clause, you do not specify its name. The application seed name is always application_container_name$SEED

创建application seed有以下三种方式:

  1. 使用CDB SEED来创建application seed是要sync的
  2. 使用application pdb创建application seed不需要sync
  3. 使用application root创建application seed不用sync, 但要执行pdb_to_apppdb.sql脚本

If the application seed was created from an application root, then switch container to the application seed, and run the pdb_to_apppdb.sql script to convert the application root to an application PDB.

  1. 下面为使用CDB seed创建application seed过程:

CREATE PLUGGABLE DATABASE AS SEED ADMIN USER actseedadm IDENTIFIED BY password;

ALTER PLUGGABLE DATABASE salesact$SEED OPEN;

ALTER SESSION SET CONTAINER=salesact$SEED;

ALTER PLUGGABLE DATABASE APPLICATION ALL SYNC;

ALTER PLUGGABLE DATABASE CLOSE IMMEDIATE;

ALTER PLUGGABLE DATABASE OPEN READ ONLY;

  1. 下面为使用application pdb创建application seed过程:

The application seed was created from an application PDB. Therefore, the application seed includes the applications installed in the application root and the application common objects that are part of those applications.

CREATE PLUGGABLE DATABASE AS SEED FROM salesapppdb;

ALTER PLUGGABLE DATABASE salesact$SEED OPEN;

ALTER PLUGGABLE DATABASE CLOSE IMMEDIATE;

ALTER PLUGGABLE DATABASE OPEN READ ONLY;

  1. 下面为使用application root创建application seed过程:

CREATE PLUGGABLE DATABASE AS SEED FROM salesact;

ALTER PLUGGABLE DATABASE salesact$SEED OPEN;

ALTER SESSION SET CONTAINER=salesact$SEED;

@$ORACLE_HOME/rdbms/admin/pdb_to_apppdb.sql

ALTER PLUGGABLE DATABASE CLOSE IMMEDIATE;

ALTER PLUGGABLE DATABASE OPEN READ ONLY;

Unplog/drop application seed与一般PDB无区别

ALTER PLUGGABLE DATABASE salesact$SEED UNPLUG INTO '/oracle/data/saleact$SEED.xml';

DROP PLUGGABLE DATABASE salesact$SEED KEEP DATAFILES;

DROP PLUGGABLE DATABASE saleact$SEED INCLUDING DATAFILES;

  1. Creating/Unplugging/Drop Application PDB

与普通PDB一样,只是多加了sync的步骤

Use an ALTER PLUGGABLE DATABASE statement with the SYNC clause to synchronize the application PDB.

Synchronizing with the application PDB instantiates one or more of the application root’s applications in the application PDB.

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值