PDB Commands
Use commands with the pdb keyword to manage the Pluggable Databases (PDBs) in your cluster database.
You can add, modify, remove, list the configuration of, enable, disable, start, stop, and obtain the status of PDBs.
Related Topics
srvctl add pdb
Adds a Pluggable Database (PDB) configuration to Oracle Clusterware.
Syntax
srvctl add pdb -db db_unique_name -pdb pdb_name
[-cardinality {num_of_instances | ALL}] [-maxcpu max_cpu_usage]
[-mincpuunit min_cpu_usage] [-approot approot_database]
[-startoption start_options] [-stopoption stop_options]
[-policy policy] [-importfile file_name]
Parameters
Table: srvctl add pdb Command Parameters
| Parameter | Description |
|---|---|
-db db_unique_name | The unique name of the Container Database (CDB). |
-pdb pdb_name | The name of the PDB. |
-cardinality { num_of_instances | ALL} | The number of instances of the PDB to be open at any time. If you specify Note: If this parameter is not set, then the PDB can run on any node on which the cluster database can run. Where the PDB runs is determined by the preferred and available lists of the PDB services. If this parameter is set, then the PDB services must be |
-maxcpu max_cpu_usage | The maximum CPU usage limit for the PDB. |
-mincpuunit min_cpu_usage | The minimum CPU usage limit for the PDB. |
-approot approot_database | The application root PDB. |
-startoption start_options | Startup options for the PDB, such as Note: For multi-word startup options, such as |
-stoption stop_options | Stop options for the PDB, such as NORMAL. The default stop option is IMMEDIATE. |
-policy policy | Management policy for the Pluggable Database, where policy can be one of the following values:
|
-importfile file_name | Specify the JSON file containing the resource configuration to use when adding or re-creating the resource. |
Usage Notes
If a PDB's management policy is RESTART, then the management policy for the CDB must be RANK.
Related Topics
srvctl config pdb
Displays the configuration information for a Pluggable Database (PDB).
Syntax
srvctl config pdb -db db_unique_name [-pdb pdb_name]
Parameters
Table: srvctl config pdb Command Parameters
| Parameter | Description |
|---|---|
-db db_unique_name | Unique name for the Container Database (CDB). |
-pdb pdb_name | The name of the PDB. |
Example
This examples shows the configuration information for the crmeast PDB.
srvctl config pdb -db crm -pdb crmeast
Pluggable database name: crmeast
Application Root PDB:
Maximum CPU count (whole CPUs): 0
Minimum CPU count unit (1/100 CPU count): 0
Start Option: open
Stop Option: immediate
srvctl disable pdb
Disables a running Pluggable Database (PDB) from Oracle Clusterware management.
Syntax
srvctl disable pdb -db db_unique_name -pdb pdb_name [-node node_name]
Parameters
Table: srvctl disable pdb Command Parameters
| Parameter | Description |
|---|---|
-db db_unique_name | The unique name of the Container Database (CDB). |
-pdb pdb_name | The name of the PDB . |
-node node_name | The node on which you want to disable the PDB. Note: You can only use this parameter only with Oracle Clusterware. |
Example
The following example disables the PDB crmeast:
srvctl disable pdb -db crm -pdb crmeast
srvctl enable pdb
Enables the Pluggable Database (PDB) for Oracle Clusterware management.
Syntax
srvctl enable pdb -db db_unique_name -pdb pdb_name [-node node_name]
Parameters
Table: srvctl enable pdb Command Parameters
| Parameter | Description |
|---|---|
-db db_unique_name | The unique name of the Container Database (CDB). |
-pdb pdb_name | The name of the PDB that you want to enable. |
-node node_name | The name of the node on which the PDB resource resides that you want to enable. Note: You can only use this parameter with Oracle Clusterware. |
Example
The following example enables a PDB named crmeast for Oracle Clusterware management:
srvctl enable pdb -db crm -pdb crmeast
srvctl modify pdb
Modifies the configuration for a Pluggable Database (PDB).
Syntax
srvctl modify pdb -db db_unique_name -pdb pdb_name
[-cardinality {num_of_instances | ALL}]
[-maxcpu max_cpu_usage] [-mincpuunit min_cpu_usage]
[-rank rank] [-startoption start_options]
[-stopoption stop_options] [-policy policy]
Parameters
Table: srvctl modify pdb Command Parameters
| Parameter | Description |
|---|---|
-db db_unique_name | Unique name for the Container Database (CDB). |
-pdb pdb_name | The name of the PDB. |
-cardinality { num_of_instances | ALL} | The number of instances of the PDB to be open at any time. If you specify Note: You can modify the |
-maxcpu max_cpu_usage | The maximum CPU usage limit for the PDB in whole CPUs. Specify a positive integer value that is equal to or greater than 1. You must be logged in as either the |
-mincpuunit min_cpu_usage | The minimum CPU usage limit for the PDB. Specify a positive integer value that is equal to or greater than 10. The value must be in hundredths of the total CPU count (1/100 CPU count). You must be logged in as either the |
-rank rank | The rank of the PDB. The range of values you can specify for this parameter is 0 to 5. The default value is 0. You must be logged in as either the Note: You can modify the |
-startoption start_options | Startup options for the PDB, such as Note: For multi-word startup options, such as |
-stoption stop_options | Stop options for the PDB, such as NORMAL. The default stop option is IMMEDIATE. |
-policy policy | Management policy for the Pluggable Database, where policy can be one of the following values: AUTOMATIC, MANUAL, or RESTART. |
Related Topics
srvctl relocate pdb
Relocates a Pluggable Database (PDB) from one Oracle Clusterware node to another.
Syntax
srvctl relocate pdb -db db_unique_name -currentnode current_node [-pdb pluggable_database]
[-targetnode target_node] [-drain_timeout timeout] [-stopoption stop_options] [-force [-verbose]]
Parameters
Table: srvctl relocate pdb Command Parameters
| Parameter | Description |
|---|---|
-db db_unique_name | The unique name of the Container Database (CDB). |
-currentnode current_node | Name of the node where the PDB is currently running. |
-pdb pdb_name | The name of the PDB. |
-targetnode target_node | Name of node where the PDB is to be relocated. If you do not specify a target node, then Oracle Clusterware chooses a new location. |
-drain_timeout timeout | Specify the time, in seconds, allowed for resource draining to be completed. Accepted values are an empty string (""), 0, or any positive integer. The default value is an empty string, which means that this parameter is not set. If it is set to 0, then draining occurs immediately. Drain timeout is the maximum time the service waits before exiting, until the draining of sessions is completed. If session draining completes in 10 seconds and the drain timeout value is 100 seconds, then SRVCTL continues after 10 seconds. It does not wait for the remaining 90 seconds. |
-stopoption stop_options | Stop options for the PDB, such as NORMAL or IMMEDIATE. The default stop option is IMMEDIATE. |
-force | Use this parameter to force relocate the PDB and its services, and any dependent resources. |
-verbose | Optionally, you can use this parameter to display detailed output. |
Example
This example relocates the PDB orclpdb1 from node1 to node2:
srvctl relocate pdb -db orcl -pdb orclpdb1 -currentnode node1 -targetnode node2
srvctl remove pdb
Removes the Pluggable Database (PDB) configuration from Oracle Clusterware management.
Syntax
srvctl remove pdb -db db_unique_name -pdb pdb_name
[-force] [-noprompt] [-verbose]
Parameters
Table: srvctl remove pdb Command Parameters
| Parameter | Description |
|---|---|
-db db_unique_name | Unique name of the Container Database (CDB). |
-pdb pdb_name | The name of the PDB. |
-force | Forcibly remove the PDB and ignore any dependencies. |
-noprompt | Suppress prompts. |
-verbose | Display verbose output. |
Example
This example shows how to remove configuration from Oracle Clusterware management of the PDB named crmeast in the Container Database (CDB) named crm.
$ srvctl remove pdb -db crm -pdb crmeast
srvctl start pdb
Starts a Pluggable Database (PDB) and the associated services based on the management policy of the service. All the services with the AUTOMATIC management policy will start automatically.
Syntax
srvctl start pdb -db db_unique_name -pdb pdb_name
[-startoption start_options] [-node node_list]
Parameters
Table: srvctl start pdb Command Parameters
| Parameter | Description |
|---|---|
-db db_unique_name | The unique name of the database to start. |
-pdb pdb_name | The name of the PDB to start. |
-startoption start_options | Options for the startup command, such as Notes:
|
-node node_list | Comma-separated list of nodes on which to start the PDB. |
Examples
The following example starts the crmeast PDB in READ ONLY mode:
srvctl start pdb -db crm -pdb crmeast -startoption "read only"
srvctl status pdb
This command displays the current state of the Pluggable Database (PDB).
Syntax
srvctl status pdb -db db_unique_name [-pdb pdb_name]
[-detail]
Parameters
Table: srvctl status pdb Parameters
| Parameter | Description |
|---|---|
-db db_unique_name | The unique name of the Container Database (CDB). |
-pdb pdb_name | The name of the PDB. If you do not specify a PDB name, then information on all the PDBs in that particular database are displayed. |
-detail | Display detailed status information. |
Examples
This example shows sample output for the status information for the crmeast and crmnorth PDBs.
$ srvctl status pdb -db crm -pdb crmeast
Pluggable database crmeast of crm is running on nodes site1, site3.
$ srvctl status pdb -db crm -pdb crmnorth
Pluggable database crmnorth of crm is not running.
srvctl stop pdb
Stops a Pluggable Database (PDB) and its services.
Syntax
srvctl stop pdb -db db_unique_name -pdb pdb_name [-node node_name]
[-stopoption stop_options] [-drain_timeout timeout]
[-stopsvcoption stop_service_options] [-force]
Parameters
Table: srvctl stop pdb Command Parameters
| Parameter | Description |
|---|---|
-db db_unique_name | The unique name for the Container Database (CDB). |
-pdb pdb_name | The name of the PDB to stop. |
-node node_name | The name of the node on which to stop the PDB. If you do not specify any nodes, then the specified PDB is stopped on all the nodes where the PDB is running. |
-stopoption stop_options | Options for the shutdown command, such as NORMAL or IMMEDIATE. The default value is IMMEDIATE. |
-drain_timeout timeout | The time, in seconds, for the resource draining action to complete. By default, this parameter is not set. You can specify 0 or any positive integer. An empty string unsets the parameter. If you specify zero, then the agent will perform the actions related to service draining, immediately. Drain timeout is the maximum time the service waits before exiting (in case of |
-stopsvcoption stop_service_options | Options for stopping services, such as TRANSACTIONAL or IMMEDIATE. If you do not specify this open, then the stop option set in the service resource attribute USR_ORA_STOP_MODE is used. |
-force | Use this parameter to force stop the PDB and its services, and any dependent resources. |
Example
The following command stops a PDB named crmeast that is open in the crm database, allowing 50 seconds for all sessions to drain from the PDB:
srvctl stop pdb -db crm -pdb crmeast -drain_timeout 50