CLI cookbook: attaching or detaching a PDB
This topic describes how to attach or detach a PDB using the command-line interface.
PDB CLI attach
Ensure the new source environment has been fully discovered by the Delphix Engine, including CDB discovery.
Login to the engine via SSH with a Delphix admin account.
Select the PDB dSource database to be attached.
CODEdelphix> database delphix database> select "R268PDB1" delphix database 'R268PDB1'>
Attach the PDB dSource to the correct source PDB in the new environment using the
attachSource
command; you will need to specify the environment user and login credentials for the PDB dSource.CODEdelphix database 'R268PDB1'> attachSource delphix database 'R268PDB1' attachSource *> set attachData.type=OraclePDBAttachData delphix database 'R268PDB1' attachSource *> set attachData.config=R268PDB1 delphix database 'R268PDB1' attachSource *> set attachData.environmentUser=ora12201 delphix database 'R268PDB1' attachSource *> commit R268PDB1 Dispatched job JOB-46 DB_ATTACH_SOURCE job started for "Untitled/R268PDB1". Starting validation of attach parameters for database "Untitled/R268PDB1". Validation finished for database "Untitled/R268PDB1" Obtaining information from source database "Untitled/R268PDB1". The dSource "R268PDB1" was successfully linked from source database "Untitled/R268PDB1". DB_ATTACH_SOURCE job for "Untitled/R268PDB1" completed successfully.
PDB CLI detach
Login to the engine via SSH with a Delphix admin account.
Select the PDB dSource database to be detached.
CODEdelphix> database delphix database> select "R268PDB1" delphix database 'R268PDB1'>
Detach the PDB dSource using the
detachSource
command:CODEdelphix database 'R268PDB1'> detachSource delphix database 'R268PDB1' detachSource *> set source=R268PDB1 delphix database 'R268PDB1' detachSource *> commit Dispatched job JOB-45 DB_DETACH_SOURCE job started for "Untitled/R268PDB1". DB_DETACH_SOURCE job for "Untitled/R268PDB1" completed successfully.