您好,登录后才能下订单哦!
oracle 12c non-cdb升级成cdb模式
相同主机下,有一个non-cdb数据库,再创建一个cdb的实例。
SQL> select name,cdb from v$database;
NAME CDB
--------------------------- ---------
EID NO
1 row selected.
关闭数据库并以read only模式打开
16:50:58 SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
16:51:39 SQL> startup open read only;
ORACLE instance started.
Total System Global Area 1426063360 bytes
Fixed Size 8620704 bytes
Variable Size 486540640 bytes
Database Buffers 922746880 bytes
Redo Buffers 8155136 bytes
Database mounted.
Database opened.
SQL> select name,open_mode,cdb from v$database;
NAME OPEN_MODE CDB
--------------------------- ------------------------------------------------------------ ---------
EID READ ONLY NO
1 row selected.
生成xml格式的数据库描述文件
SQL> BEGIN
2 DBMS_PDB.DESCRIBE(pdb_descr_file => '/home/oracle/EID.xml');
3 END;
4 /
PL/SQL procedure successfully completed.
关闭数据库
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
连接到cdb数据库
SQL> CREATE PLUGGABLE DATABASE mpdb01 USING '/home/oracle/EID.xml'
2 COPY
3 FILE_NAME_CONVERT = ('/u02/app/oracle/oradata/EID/', '/u02/app/oracle/oradata/mcdb/mpdb01/');
Pluggable database created.
SQL> show pdbs
CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
2 PDB$SEED READ ONLY NO
3 MPDB01 MOUNTED
SQL> alter session set container=MPDB01;
Session altered.
执行如下命令。注意该命令会清空shared pool,所以生产环境要注意。
sql> @$ORACLE_HOME/rdbms/admin/noncdb_to_pdb.sql
SQL> alter pluggable database MPDB01 open;
Pluggable database altered.
免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。