Creating Application Seeds
You can create application seeds in several different ways, including using
the PDB seed, cloning an existing PDB, and plugging in an unplugged PDB by using the
CREATE PLUGGABLE DATABASE
statement.
About Creating an Application Seed
To create a new application seed in an application container, use the CREATE PLUGGABLE DATABASE
statement with the AS SEED
clause.
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 seed creation. 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.
An application container can have zero or one application seeds. When you create an application seed using the AS SEED
clause of CREATE PLUGGABLE DATABASE
, you do not specify its name. The application seed name is always application_container_name$SEED
, where application_container_name
is the name of the application seed’s application container. For example, an application seed in the salesact
application container must be named salesact$SEED
.
When you create a new application seed, you must specify an administrator for the application container in the CREATE PLUGGABLE DATABASE
statement. The statement creates the administrator as a local user in the application container and grants the PDB_DBA
role locally to the administrator.
See Also:
-
Oracle Database SQL Language Reference for syntax and semantics of the
AS SEED
clause
Preparing for an Application Seed
Prerequisites must be met before creating an application seed.
Ensure that the following prerequisites are met before creating an application seed:
-
The CDB must exist.
See "Creating a CDB: Basic Steps".
-
The CDB must be in read/write mode.
-
The application container to which the application seed will belong must be in read/write mode.
-
The current user must be a common user whose current container is the application root to which the application seed will belong.
-
The current user must have the
CREATE PLUGGABLE DATABASE
system privilege. -
For the application seed to include the application for the application container, the application must be installed in the application root.
Creating an Application Seed
You create an application seed by including the AS SEED
clause in the CREATE PLUGGABLE DATABASE
statement.
An application seed in an application container is similar to the seed in a CDB. An application seed enables you to create application PDBs that meet the requirements of an application container quickly and easily.
Example 14-8 Creating an Application Seed from the PDB seed
This example assumes the following factors:
-
The application seed is being created in an application container named
salesact
. -
Storage limits are not required for the application seed. Therefore, the
STORAGE
clause is not required. -
The application seed does not require a default tablespace.
-
The
PATH_PREFIX
clause is not required. -
The
FILE_NAME_CONVERT
clause and theCREATE_FILE_DEST
clause are not required.Either Oracle Managed Files is enabled for the CDB, or the
PDB_FILE_NAME_CONVERT
initialization parameter is set. The files associated with the PDB seed will be copied to a new location based on the Oracle Managed Files configuration or the initialization parameter setting. -
There is no file with the same name as the new temp file that will be created in the target location. Therefore, the
TEMPFILE REUSE
clause is not required. -
No predefined Oracle roles need to be granted to the
PDB_DBA
role.
The following statement creates the application seed from the PDB seed, opens the application seed, switches containers to the application seed, synchronizes the application seed with the applications in the application root, closes the application seed, and then opens the application seed in open read-only mode:
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;
Because the application container name is salesact
, the application seed name is salesact$SEED
.
A local user with the name of the specified local administrator is created and granted the PDB_DBA
common role locally in the application seed. If this user was not granted administrator privileges during application seed creation, then use the SYS
and SYSTEM
common users to administer to the application seed.
The application seed was synchronized with the application root when it was created. Therefore, the application seed includes the applications installed in the application root and the application common objects that are part of those applications. When a new application PDB is created using the application seed, the application PDB also includes the installed applications and application common objects.
Example 14-9 Creating an Application Seed From an Application PDB
This example assumes the following factors:
-
The application seed is being created in an application container named
salesact
. -
The application seed is being created in an application PDB in the application container named
salesapppdb
. -
Storage limits are not required for the application seed. Therefore, the
STORAGE
clause is not required. -
The application seed does not require a default tablespace.
-
The
PATH_PREFIX
clause is not required. -
The
FILE_NAME_CONVERT
clause and theCREATE_FILE_DEST
clause are not required.Either Oracle Managed Files is enabled for the CDB, or the
PDB_FILE_NAME_CONVERT
initialization parameter is set. The files associated with the application root will be copied to a new location based on the Oracle Managed Files configuration or the initialization parameter setting. -
There is no file with the same name as the new temp file that will be created in the target location. Therefore, the
TEMPFILE REUSE
clause is not required.
Given the preceding factors, the following statement creates the application seed from the application root, opens the application seed, closes the application seed, and opens the application seed in open read-only mode:
CREATE PLUGGABLE DATABASE AS SEED FROM salesapppdb;
ALTER PLUGGABLE DATABASE salesact$SEED OPEN;
ALTER PLUGGABLE DATABASE CLOSE IMMEDIATE;
ALTER PLUGGABLE DATABASE OPEN READ ONLY;
Because the application container name is salesact
, the application seed name is salesact$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. When a new application PDB is created using the application seed, the application PDB also includes the installed applications and application common objects.
Example 14-10 Creating an Application Seed From an Application Root
This example assumes the following factors:
-
The application seed is being created in an application container named
salesact
. The application seed is cloned from the root of the application container. -
Storage limits are not required for the application seed. Therefore, the
STORAGE
clause is not required. -
The application seed does not require a default tablespace.
-
The
PATH_PREFIX
clause is not required. -
The
FILE_NAME_CONVERT
clause and theCREATE_FILE_DEST
clause are not required.Either Oracle Managed Files is enabled for the CDB, or the
PDB_FILE_NAME_CONVERT
initialization parameter is set. The files associated with the application root will be copied to a new location based on the Oracle Managed Files configuration or the initialization parameter setting. -
There is no file with the same name as the new temp file that will be created in the target location. Therefore, the
TEMPFILE REUSE
clause is not required.
Given the preceding factors, the following statement creates the application seed from the application root, opens the application seed, switches containers to the application seed, runs the pdb_to_apppdb.sql
script to convert the application root to an application PDB, closes the application seed, and opens the application seed in open read-only mode:
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;
Because the application container name is salesact
, the application seed name is salesact$SEED
.
The application seed was created from the application root. Therefore, the application seed includes the applications installed in the application root and the application common objects that are part of those applications. When a new application PDB is created using the application seed, the application PDB also includes the installed applications and application common objects.