Oracle NON-CDB转换为PDB几种方式

举报
Lucifer三思而后行 发表于 2021/10/28 11:13:38 2021/10/28
【摘要】 **参考MOS文档:How to Convert Non-CDB to PDB - Step by Step Example (Doc ID 2288024.1)    **将非CDB转换为PDB的方法:If Source/Non-CDB is 11.2.0.3/11.2.0.4:1) FULL-TTS2) Datapump Export/ImportIf Source/Non-CDB is...

**参考MOS文档:How to Convert Non-CDB to PDB - Step by Step Example (Doc ID 2288024.1)    **

将非CDB转换为PDB的方法:

If Source/Non-CDB is 11.2.0.3/11.2.0.4:

1) FULL-TTS
2) Datapump Export/Import

If Source/Non-CDB is already a 12c version:

1) FULL-TTS
2) DBMS_PDB.DESCRIBE
3) Datapump Export/Import

最简单通用的方法就是通过数据泵将源库NON-CDB导入到目标库CDB的PDB中。

Using FULL-TTS:

以下是使用FULL-TTS方法将非CDB转换为PDB的完整步骤:

Source: Non-CDB 12c database or 11g database
Target: 12c PDB database in the Container (CDB) database

1. Verify whether the Platforms are supported for transport?
2. Verify whether the Platforms differ by endian format? (for conversion)
3. Verify the National and Database Character Set.
4. Create an empty PDB in the Target CDB
5. Pre-create the 'Source Database Users' in the Target PDB or use REMAP_SCHEMA.
6. Make the user-defined and application tablespaces to READ-ONLY in Source.
7. Perform the FULL-TTS Export in Source.
8. Transport the FULL-TTS Dumpfile to the PDB Target location.
9. Transport the Datafiles to the PDB Target location. If endianness are different, Conversion of datafiles to Target Platform Endian is necessary.
10. Perform the FULL-TTS Import in Target.
11. When the FULL-TTS Import is complete, the tablespaces are automatically put into READ WRITE mode in Target.
12. Open the Source Tablespaces to READ WRITE upon successful completion of import. (this step can be after Step 9 as well)

_For detailed steps on FULL-TTS, please follow the below documents.  _

a) Oracle Database Administrator Guide - Moving a Non-CDB to PDB in the target CDB
b) FULL-TTS WHITEPAPER FROM OTN

Using DBMS_PDB.DESCRIBE:

以下是使用“ DBMS_PDB.DESCRIBE”方法将12c非CDB转换为PDB的完整步骤:

1) Shutdown the 12c non-cdb database gracefully (shutdown immediate)
2) Now Open the 12c non-cdb database in Read-Only Mode
3) In the 12c non-CDB database, execute the "DBMS_PDB.DESCRIBE" package, which will create an XML file containing the description about the non-cdb database datafiles.
4) Shutdown the 12c non-cdb database
5) Connect to the target root CDB and check the compatibility of the 12c non-cdb database using "DBMS_PDB.CHECK_PLUG_COMPATIBILITY" package
6) If this package returns FALSE/NO, then check for violations in "PDB_PLUG_IN_VIOLATIONS" view and correct the errors and warnings.
7) If the above package returns TRUE/YES, then plug the 12c non-cdb as a PDB to the target cdb using the "CREATE PLUGGABLE DATABASE USING <xml>" command
8) Now switch or connect to the pdb using "ALTER SESSION SET CONTAINER=pdbname" and execute "$ORACLE_HOME/rdbms/admin/noncdb_to_pdb.sql" script
9) Now open the PDB in read write mode using "ALTER PLUGGABLE DATABASE pdbname OPEN" command.
10) Now, the non-CDB has been converted to a PDB. 
--如果要插入的数据库曾经是11g或已升级到12c,则需要应用必备补丁程序#20298413并重置使用以下查询返回的所有用户的密码
set linesize 120
col name for a15
col password for a20
col spare4 for a40
select u.name, u.password, u.spare4, a.syspriv, decode(bitand(u.spare1, 128), 128, 1, 0) from adminauth$ a, user$ u where a.user# > 0 and u.user# = a.user# and a.syspriv != 0;
【版权声明】本文为华为云社区用户原创内容,转载时必须标注文章的来源(华为云社区)、文章链接、文章作者等基本信息, 否则作者和本社区有权追究责任。如果您发现本社区中有涉嫌抄袭的内容,欢迎发送邮件进行举报,并提供相关证据,一经查实,本社区将立刻删除涉嫌侵权内容,举报邮箱: cloudbbs@huaweicloud.com
  • 点赞
  • 收藏
  • 关注作者

评论(0

0/1000
抱歉,系统识别当前为高风险访问,暂不支持该操作

全部回复

上滑加载中

设置昵称

在此一键设置昵称,即可参与社区互动!

*长度不超过10个汉字或20个英文字符,设置后3个月内不可修改。

*长度不超过10个汉字或20个英文字符,设置后3个月内不可修改。