Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the features of Oracle 12c R2 version Application Containers

2025-01-29 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

The purpose of this article is to share with you about the features of Oracle 12c R2 version Application Containers. The editor thinks it is very practical, so I share it with you. I hope you can get something after reading this article. Let's take a look at it with the editor.

In the Oracle Database 12c R2 release, Oracle brings a new Application Containers feature that enhances the existing multi-tenancy functionality by creating a container called Application root in the CDB root container, similar to CDB root, in which multiple Application PDBs dependent on Application root can be created.

"Application"

There is another concept under the Application Container feature, named "Application", we can understand "Application" as a region, "Application" can only be created in Application root, in which you can create tables, views, functions and other public objects, and then you can use the sync synchronization command in Application PDBs to achieve the sharing of public objects within "Application" to Application PDBs.

In this article, we will start to introduce you to Application Container features through the creation of "Application Root/PDBs" and "Application". In the second article, we will show you the common objects (Application Common Objects) in "Application" and give you a more intuitive understanding through experiments.

The creation of Application root

Application root is similar to a normal PDB creation statement, in which the "as application container" clause needs to be specified.

First, let's set up db_create_file_dest.

Create an Application root named qdatacon1

Such an Application root named qdatacon1 has been created successfully. You can check whether the Application rootdba_pdbs.application_root field is YES through the view dba_pdbs.application_root field.

Open QDatacon1

Note that when using the Application Containers feature, you need to use the OMF management method of the data file. Although you can still successfully create Application root and Application PDBs without using OMF management, when the tablespace is included in "Application", when you synchronize "Application" in Application PDBs, you will report an ORA-01537 error and cannot synchronize the tablespace in "Application" to Application PDBs.

The basic management of Application root is basically no different from that of ordinary PDB, including the cloning/unplug/plugin of Application root. But we should pay attention to the use of as application container.

Of course, if you want to unplug the Application root and insert it into the CDB as a normal PDB, remove the

The as application container clause is fine.

The creation of Application PDBs

When the Application PDB is created, it must be connected to the corresponding Application root instead of the CDB root. When connecting to the Application root, you only need to create a normal PDB without the need for additional clauses. The created PDB is both the Application PDB in the corresponding Application root.

Switch to Application root to create Application PDB:qdcpdb1, switch to CDB

When displayed through show pdbs in CDB$root, the Application PDB you can see is no different from a normal PDB.

You can use the cdb_pdbs view to see which Application root Application PDB belongs to.

When the Applicatoin PDB is created successfully, you can use the sync command to synchronize it with the Application defined in the Application root.

Alter pluggable database application all sync

Applications

At the beginning of the article, it is mentioned that "Application" can be understood as an area, while "Application" can only be created and managed in Application root.

Perhaps the most commonly used maintenance commands for "Application" are install, patch, upgrade, and uninstall, which are briefly described below.

Install an Application

When you use alter pluggable database with a begin install clause, you start an installation of "Application", which can be understood as the beginning of an area. When the installation is completed, use the sync command in Application PDB to synchronize the corresponding "Application" will be automatically installed in this PDB.

So we started a "Application" of qdcon1_reg1, using the end install command to close the qdcon1_reg1

You can view the installed Application through the dba_applications view

After the Application installation is complete, you can use the sync command in the Application PDB under the Application root to synchronize, as follows:

Check the dba_applications view to confirm that qdcon1_reg1 is installed

You can see that the qdcon1_reg1 has been installed, and after the installation, the public objects in the qdcon1_reg1 will be shared to the corresponding Application PDB in a specific way

The table tdata has been shared into qdcpdb1.

In Application root, you can use the dba_app_pdb_status view to see which Application PDB Application is installed into.

Patch an Application

In the summary above, when we close "Application" with the end install clause, if we want to create an object in "Application" again (table/view/packages/sequence, etc.), and alter an object that already exists in "Application", we can use the patch clause to patch the existing "Application".

The following example starts a patch and creates a table within application to add and change the table structure of the existing table:

Delete tables in Application

Delete failed

End patch

View patch information

Synchronize qdcon1 _ reg1 in qdcpdb1

The table structure of tdata is completed synchronously with the texte table.

Upgrade an Application

We can use patch to repair "Application", but the repair operation is limited to add / change, etc., and cannot delete public objects that already exist in "Application". If we want to delete public objects, we can use the UPGRADE clause to upgrade the existing "Application". In the process of upgrading, Oracle will first automatically create a Clone version of Application root, after the Clone version is created. Application PDBs will point to the Clone version of Application root, "Application" will continue to perform the upgrade operation, after the upgrade is completed, the Clone version of Application root will continue to be retained, and services will be provided to the Application PDB that is not synchronized with "Application". The Application PDB after synchronizing "Application" will point to the upgraded Application root.

Upgrading an existing qdcon1_reg1:F1956732192_4_1 is the clone version of qdatacon1

Delete the tdata table and create a new table tmeta:

End the upgrade and view the version information

Synchronize qdcon1 _ reg1 in qdcpdb1

The tdata is deleted / the creation of the tmeata is synchronized to the qdcpdb1.

Uninstall an Application

When "Application" is uninstalled, the "Application" will not be deleted from the data dictionary. It will be marked as UNINSTALL so that "Application" cannot perform operations such as upgrade/patch/uninstall. When the uninstall command is issued, all objects contained in the "Application" need to be deleted.

Uninstall also produces a clone version of Application root.

Delete objects and end uninstall

Because the objects are not all deleted, end uninstall fails, so let's continue with drop users and tablespaces:

Check the qdcon1_reg1 status of the uninstall

View public objects in qdcpdb1

Table texte is in extended data-linked mode, and the data is stored in the qdata_tbs of Application root. Because qdata_tbs has been deleted, there is an error in querying Times in qdcpdb1, while tmeta is in metadata-linked mode, and the data is stored locally, so you can query it when it is not synchronized.

Synchronize qdcon1 _ reg1

Synchronization complete.

These are the features of Oracle 12c R2 version Application Containers. The editor believes that there are some knowledge points that we may see or use in our daily work. I hope you can learn more from this article. For more details, please follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report