create_pluggable_database
Creates a pluggable database.
Format
emcli create_pluggable_database -cdbTargetName="Specify the CDB target name for creating new PDB" -cdbTargetType="Specify the CDB target type - oracle_database, rac_database" -cdbHostCreds="Specify the host credentials on which the CDB target is located. (owner:name)" [-cdbTargetCreds="Specify the credentials of container database on which the new PDB will be created. (owner:name)"] -pdbName="Specify a name for the new PDB" -sourceType="Type of pdb to be created - DEFAULT, UNPLUGGED_PDB, CLONE, PROFILE" [-sourcefromSWLIB="If -sourceType is 'UNPLUGGED_PDB', specify if the dump location is SWLIB or not."] [-pdbTemplateInSWLIB="If -sourceFromSWLIB, specify the URN of pdb template component in SWLIB."] [-sourcePDBTempStagingLocation="Specify fully qualified location for staging temporary files. If not specified it will be defaulted to to "C:\Temp" in case of Windows and "\tmp" otherwise."] [-unpluggedPDBType="If -sourceType is 'UNPLUGGED_PDB', specify pdb dump type - ARCHIVE, RMAN, XML."] [-sourcePDBArchiveLocation="If -unpluggedPDBType=ARCHIVE, this is fully qualified archive location"] [-sourcePDBMetadataFile="If -unpluggedPDBType=RMAN or XML, this is fully qualified path of the source PDB metadata file"] [-sourcePDBDataBackup="If -unpluggedPDBType=RMAN, this is fully qualified path of the source PDB datafile"] [-moveDatafiles="If -unpluggedPDBType=XML, this will move the source PDB datafiles to the destination"] [-excludeStandbys="If -unpluggedPDBType=XML and if 'moveDatafiles' is specified, this will exclude the new PDB from standby CDBs"] [-sourcePDBName="If -sourceType is 'CLONE', specify the name of an existing PDB which is a valid em target"] [-sourceCDBCreds="If -sourceType is 'CLONE', specify the credentials of container database on which the -sourcePDBName is present. (owner:name)"] [-pdbAdminCreds="Name of pdb credentials with admin role. (owner:name)"] [-useOMF="Specifies that the datafiles can be stored in OMF location"] [-sameAsSource="Specifies that the datafiles of new PDB can be stored in the same location as that of source CDB"] [-newPDBFileLocation="Specify the storage location for datafiles of the created PDB."] [-createAsClone="If -sourceType is 'UNPLUGGED_PDB' and if 'createAsClone' is specified, the PDB will be created as clone."] [-lockAllUsers="If -sourceType is 'UNPLUGGED_PDB' and if 'lockAllUsers' is specified, all PDB users of the new PDB will be locked."] [-noUserTablespace="Specifies that the new DEFAULT PDB will not be created with USERS tablespace."] [-useSnapClone="If -sourceType is 'CLONE', specify if Snap Clone should be used for cloning"] [-sourceCDBHostCreds="If -sourceType is 'CLONE' and -useSnapClone is specified, this is the host credentials for the source container database. (owner:name)"] [-mountPointPrefix="If -sourceType is 'CLONE' and -useSnapClone is specified, this is the mount point prefix for the clone volumes"] [-writableSpace="If -sourceType is 'CLONE' and -useSnapClone is specified, this is the writable space in GB for the clone volumes"] [-saveProfile="If -sourceType is 'CLONE' and -useSnapClone is specified, -saveProfile allows the created snapshot to be saved as profile"] [-profileName="If -saveProfile is specified, -profileName is required"] [-profileLocation="If -saveProfile is specified, -profileLocation is required"] [-profileURN="If -sourceType is 'PROFILE', -profileURN is required"] [-privHostCreds="If -sourceType is 'CLONE' and -useSnapClone is specified, this is the privileged host credentials to mount the volumes at the specified locations. (owner:name)"] [ ] indicates that the parameter is optional
Options
-
cdbTargetName
Target container database for which pluggable database is to be created. It should be a valid target on enterprise manager.
-
cdbTargetType
Type of target container database.
-
cdbHostCreds
Credentials for the host on which the target container database is located. This is the name of the credentials saved in enterprise manager. To specify a credential owned by an user other than the current, use the form (owner:name).
-
cdbTargetCreds
Credentials for the container database on which the new PDB will be created. This is the name of the credentials stored in enterprise manager.
-
pdbName
Pluggable database name to be created. This works as a prefix in case of multiple pluggable database creation and will be suffixed with sequence number to generate pdb name <pdbname>#
-
numOfPdbs
Total number of pluggable databases to be created. The maximum number of new pluggable databases that are allowed in a given container database is 252 . If not specified, the default value is 1.
-
sourceType
Type of pluggable database to be created. The valid values are:-
DEFAULT: This will create a pluggable database from seed pluggable database
-
UNPLUGGED_PDB: This will create a pluggable database from existing dump of an unplugged database like Archive, RMAN file set, or from XML
-
CLONE: This will create a pluggable database from an existing pluggable database
-
PROFILE: This will create a pluggable database from an existing PDB profile
-
-
sourceFromSWLIB
If the -sourceType is specified as 'UNPLUGGED_PDB' and the dump is available in software library, this flag must be set.
-
pdbTemplateInSWLIB
If the -sourceFromSWLIB, specify the valid URN of the pdb template in Software Library.
-
sourcePDBTempStagingLocation
Specify fully qualified location for staging temporary files. If not specified, the default location is "C:\Temp" in case of Windows and "\tmp" otherwise. Files are deleted after the operation.
-
unpluggedPDBType
If the -sourceType is specified as 'UNPLUGGED_PDB' and the dump is from file system, this specifies the type of dump to be used. The valid values are:-
ARCHIVE: This will create a pluggable database from existing PDB archive
-
RMAN: This will create a pluggable database from existing PDB RMAN file set
-
XML: This will create a pluggable database from the metadata file
-
-
sourcePDBArchiveLocation
If the -unpluggedPDBType is specified as ARCHIVE, this is the fully qualified location of PDB archive.
-
sourcePDBMetadataFile
If the -unpluggedPDBType is specified as RMAN or XML, this is the fully qualified location of the metadata file.
-
sourcePDBDataBackup
If the -unpluggedPDBType is specified as RMAN, this is the fully qualified location of datafile backup.
-
moveDatafiles
This parameter is applicable only if the parameter -unpluggedPDBType is specified as XML. This option indicates that the datafiles of the source pluggable database should be moved to the destination datafiles location.
-
excludeStandbys
This parameter is applicable only if the parameter -unpluggedPDBType is specified as XML and if 'moveDatafiles' is indicated. This option will exclude the new pluggable database from all standby container databases (STANDBYS=NONE).
-
sourcePDBName
If -sourceType is specified as clone, this specifies the name of the pluggable database from which the new pluggable database will be cloned from. This has to be a valid target in enterprise manager.
-
sourceCDBCreds
If -sourceType is specified as clone, provide the credentials for the container database on which the -sourcePDBName is present. This is the name of the credentials stored in enterprise manager.
-
useOMF
Destination of the datafiles for the new pluggable database will be the OMF location. This is valid only if the source CDB is OMF.
-
sameAsSource
Destination of the datafiles for the new pluggable database will be same as CDB. In case of multi PDB creation this option is invalid.
-
newPDBFileLocation
Destination of the datafiles for the new pluggable database.
-
pdbAdminCreds
New pluggable database admin credentials. This is a mandatory parameter, if the source of new pluggable database is DEFAULT, for other options, it is optional.
-
createAsClone
This flag specifies whether the new pluggable database should be created as clone, if the -sourcePDBType is specified as 'UNPLUGGED_PDB' and is used by default in case of multiple pluggable database creation.
-
lockAllUsers
This flag specifies whether all the users should be locked in case of -sourcePDBType being 'UNPLUGGED_PDB'.
-
noUserTablespace
This flag specifies whether new DEFAULT PDB should be created without USER tablespace. This is applied only if the -sourceType is DEFAULT.
-
useSnapClone
This flag specifies whether Snap Clone can be used for cloning the PDB. This is applied only if the -sourceType is CLONE.
-
sourceCDBHostCreds
This is the host credentials to get storage information of the source container database. This is applied only if the -sourceType is CLONE and -useSnapClone is specified.
-
mountPointPrefix
This is the mount point prefix for the clone volumes. This is applied only if the -sourceType is CLONE and -useSnapClone is specified.
-
writableSpace
This is the writable space in GB for the clone volumes. This is applied only if the -sourceType is CLONE and -useSnapClone is specified.
-
saveProfile
This allows the snapshot created for the source PDB to be saved as a profile. This is applied only if the -sourceType is CLONE and -useSnapClone is specified.
-
profileName
This specifies the name of the profile to be created. This is applied only if -saveProfile is specified.
-
profileLocation
This specifies the location under software library where the created profile will be saved. This is applied only if -saveProfile is specified.
-
profileURN
This specifies the URN of the profile from which PDB will be created. This is applied only if the -sourceType is PROFILE.
-
privHostCreds
This is the privileged host credentials to mount the volumes at the specified locations. This is applied only if the -sourceType is CLONE and -useSnapClone is specified.
Examples
Example 1
emcli create_pluggable_database -cdbTargetName=database -cdbTargetType=oracle_database -pdbName=pdb -sourceType=UNPLUGGED_PDB -unpluggedPDBType=ARCHIVE -sourcePDBArchiveLocation=/u01/app/oracle/product/12.1.0/dbhome_2/assistants/dbca/templates/a.tar.gz -cdbHostCreds=HOST_CREDS -cdbTargetCreds=DBSNMP -newPDBFileLocation=/u01/app/oradata/pdb -pdbAdminCreds=pdb_creds -lockAllUsers
Example 2
emcli create_pluggable_database -cdbTargetName=database -cdbTargetType=oracle_database -pdbName=pdb -numOfPdbs=1 -sourceType=CLONE -cdbHostCreds=SYSMAN:HOST_CREDS -cdbTargetCreds=SYSMAN:DBSNMP -sourcePDBName=source_pdb -sourceCDBCreds=CDB_SYS_CREDS -useSnapClone -srcCDBHostCreds=SYS -mountPointPrefix=/mount/point/prefix -writableSpace=1 -sourcePDBTempStagingLocation=/tmp -privHostCreds=HOST_SUDO -saveProfile -profileName=PROFILENAME -profileLocation=MyProfiles
Example 3
emcli create_pluggable_database -cdbTargetName=database -cdbTargetType=oracle_database -pdbName=pdb -numOfPdbs=1 -sourceType=PROFILE -cdbHostCreds=HOST_CREDS -cdbTargetCreds=DBSNMP -mountPointPrefix=/mount/point/prefix -writableSpace=1 -sourcePDBTempStagingLocation=/tmp -privHostCreds=HOST_SUDO -profileURN=oracle:defaultService:em:provisioning:1:PROFILE:URN:RANDOM:0.1
Example 4
emcli create_pluggable_database -cdbTargetName=database -cdbTargetType=oracle_database -pdbName=pdb -numOfPdbs=2 -sourceType=UNPLUGGED_PDB -unpluggedPDBType=RMAN -sourcePDBMetadataFile=/u01/app/oracle/product/12.1.0/dbhome_2/assistants/dbca/templates/a.xml -sourcePDBDataBackup=/u01/app/oracle/product/12.1.0/dbhome_2/assistants/dbca/templates/a.dfb -cdbHostCreds=HOST_CREDS -cdbTargetCreds=DBSNMP -newPDBFileLocation=/u01/app/oradata/pdb -pdbAdminCreds=pdb_creds -createAsClone
Example 5
emcli create_pluggable_database -cdbTargetName=database -cdbTargetType=oracle_database -cdbHostCreds=HOST_CREDS -cdbTargetCreds=CDB_SYS_CREDS -pdbName=pdb -sourceType=CLONE -sourcePDBName=source_pdb -sourceCDBCreds=CDB_SYS_CREDS -useSnapClone -srcCDBHostCreds=HOST_CREDS -mountPointPrefix=/oracle -writableSpace=1 -sourcePDBTempStagingLocation=/tmp -privHostCreds=ROOT_CREDS