oracle 12c non-cdb升级成cdb模式 相同主机下,有一个non-cdb数据库,再创建一个cdb的实例。 sql> select name,cdb
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.
--结束END--
本文标题: oracle 12c non-cdb升级成cdb模式
本文链接: https://lsjlt.com/news/47078.html(转载时请注明来源链接)
有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341
2024-10-23
2024-10-22
2024-10-22
2024-10-22
2024-10-22
2024-10-22
2024-10-22
2024-10-22
2024-10-22
2024-10-22
回答
回答
回答
回答
回答
回答
回答
回答
回答
回答
0