Creating and Removing Application Containers

苗承
2023-12-01

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.

 类似资料:

相关阅读

相关文章

相关问答