Database Reference
In-Depth Information
CON_ID FILE_NAME
---------- --------------------------------------------------
1 /u01/oradata/CDB2/users01.dbf
1 /u01/oradata/CDB2/undotbs01.dbf
1 /u01/oradata/CDB2/sysaux01.dbf
1 /u01/oradata/CDB2/system01.dbf
2 /u01/oradata/CDB2/pdbseed/system01.dbf
2 /u01/oradata/CDB2/pdbseed/sysaux01.dbf
This implies the CDB's files are all under /u01/oradata/CDB2/ , with the seed database's files in another subdirectory
pdbseed ”. Since these files are not overly sensitive to I/O requirements, you can store them on lower tier storage.
The other PDBs however are a different story and have different I/O requirements from the seed. Assume that the
/u01/oradata/CDB2/pdbs/ mount point is the default mount point for PDBs. You could then clone your seed as follows:
SQL> create pluggable database fspdb1 admin user pdbdba identified by password
2 file_name_convert=(
3 '/u01/oradata/CDB2/pdbseed/','/u01/oradata/CDB2/pdbs/fspdb1/');
Pluggable database created.
The file locations are reflected accordingly:
SQL> select con_id, file_name
2 from cdb_data_files
3 where con_id = 4;
CON_ID FILE_NAME
---------- --------------------------------------------------
4 /u01/oradata/CDB2/pdbs/fspdb1/system01.dbf
4 /u01/oradata/CDB2/pdbs/fspdb1/sysaux01.dbf
The final clause to the “create pluggable database statement” allows you to grant roles to the admin user, but this
will be discussed later in the chapter in the section “Users and Roles”.
After the PDB has been cloned, it is in mount mode. To access it you need to open it. See further down in the
chapter for more information about opening and closing PDBs. The PDB also needs backing up.
Cloning from another PDB
The ability to clone a PDB from another PDB is a very nice feature. As part of it you have a process that handles the
copy process as well, which should make the creation of a spin-off PDB a very simple process. As with the creation of a
user-PDB you have several options as to where to place the files and to restrict the storage usage of the new PDB.
Cloning a local PDB is the first case to be demonstrated. To that extent the PDB to be cloned is plugged into
the current CDB. The source you want to clone from has to be opened in read-only mode. This is very similar to the
requirement when exporting metadata for transporting tablespaces. Closing an active PDB is a disruptive process and
therefore needs to be carefully coordinated with the business users. To initiate the cloning process, shut down the
source PDB in preparation to making it read-only:
SQL> alter pluggable database pdb1 close immediate;
Pluggable database altered.
 
Search WWH ::




Custom Search