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

How to clone non-CDB database in ORACLE

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

Share

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

This article mainly explains "how to clone a non-CDB database in ORACLE". Interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn how to clone a non-CDB database in ORACLE.

There are three ways to create a pluggable database from an existing non-CDB database:

1. Use the DBMS_PDB package to generate metadata, and then use the SQL command CREATE PLUGGABLE DATABASE to create a pluggable database

Note: when converting a non-CDB database to a pluggable database using the DBMS_PDB package, the non-CDB database must be created using ORACLE 12C or later

two。 Data pump (using transportable tablespace function)

3.GOLDENGATE replication software

This article uses the first method:

Step one:

You should first switch non-CDB databases to read-only mode

SQL > startup mount

SQL > alter database open read only

BEGIN

DBMS_PDB.DESCRIBE (pdb_descr_file= >'/ u02ActionActionoracleUnixmlUniple ncdb.xml')

END

/

SQL > shutdown immediate

Step 2:

To connect to the CDB database and check that the non-CDB database is compatible with the CDB that will hold it, run the following

SET SERVEROUTPUT ON

DECLARE

Hold_var boolean

Begin

Hold_var: = DBMS_PDB.CHECK_PLUG_COMPATIBILITY ('/ data/ncpdb.xml','TESTA')

If hold_var then

Dbms_output.put_line ('YES')

Else

Dbms_output.put_line ('NO')

End if

End

/

If there is no compatibility problem between the two databases, this code displays YES, otherwise it is NO.

By querying the contents of the PDB_PLUG_IN_VIOLATIONS view, you can learn more about the reasons for the incompatibility between the two databases.

Using the following SQL command, you can create a pluggable database through a non-CDB.

CREATE PLUGGABLE DATABASE TESTA

USING'/ u02swap _ database _ ncpdb.xml'

COPY

FILE_NAME_CONVERT = ('/ data/app/oracle/oradata/testa/datafile/','+DATA/TESTDB/TESTA/DATAFILE/')

Pluggable database created

Step 3:

Use SYS users to connect to the newly created pluggable database:

$sqlplus sys/oracle@'testdb1:1521/testa' as sysdba

SQL > @? / rdbms/admin/noncdb_to_pdb.sql

And then open it.

SQL > startup

That's it.

At this point, I believe you have a deeper understanding of "how to clone a non-CDB database in ORACLE". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

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