1.将用于克隆的PDB至于只读状态:startup open read only
SQL> select con_id,name,open_mode from v$pdbs; CON_ID NAME OPEN_MODE ---------- ------------------------------ ---------- 2 PDB$SEED READ ONLY 3 PDB1 MOUNTED 4 P4 MOUNTED SQL> alter session set container=pdb1; SQL> alter database open read only;
2.登陆CDB
SQL> connect /as sysdba SQL> create pluggable database pdb2 from pdb1 file_name_convert=(‘pdb1‘,‘pdb2‘); SQL> alter session set container=pdb2; SQL> startup SQL> select con_id,name,open_mode from v$pdbs; CON_ID NAME OPEN_MODE ---------- ------------------------------ ---------- 2 PDB$SEED READ ONLY 3 PDB1 READ ONLY 4 P4 MOUNTED 5 PDB2 READ WRITE SQL>
3.打开原来的PDB
SQL> alter session set container=pdb1; SQL> shutdown SQL> startup
时间: 2024-12-13 14:05:02