Unlike SRVCTL or Oracle Enterprise Manager, SQL*Plus is an instance-oriented management tool. This means that SQL*Plus commands operate on the current instance. The current instance can be either the local default instance on which you initiated your SQL*Plus session, or it can be a remote instance to which you connect with Oracle Net Services. For an Oracle RAC environment that runs multiple instances on one database at the same time, this implies that you need to consider the extent to which SQL*Plus can operate on this instance. Due to those restrictions, you should not use SQL*Plus to manage policy-managed databases.
For example, when using pluggable databases (PDBs)—regardless of whether those databases are managed in an administrator-managed or a policy-managed style—you must consider that any alteration performed on the PDB using a SQL*Plus connection will, by default, only affect the current instance. To make changes affecting all instances that belong to the PDB, you must use the ALTER PLUGGABLE DATABASE
command with instance=all
. When using PDBs you must connect, using a dynamic database service (net_service_name
), to an instance, as PDBs represent themselves as dynamic database services associated with one or more instances of an Oracle RAC database.
See Also:
Oracle Database Administrator's Guide for more information
Because, by default, the SQL*Plus prompt does not identify the current instance, you should direct your commands to the correct instance. Starting a SQL*Plus session and connecting to the database without specifying an instance directs all SQL*Plus commands to the local instance. In this case, the default instance is also the current instance.
Since the SQL*Plus prompt does not identify the current instance by default, you should direct your commands to the correct instance. Starting a SQL*Plus session and connecting to the database without specifying an instance directs all SQL*Plus commands to the local instance. In this case, the default instance is also the current instance. To connect to a different instance in SQL*Plus, issue a new CONNECT
command and specify a remote instance net service name, as shown in the following example, where password
is the password:
CONNECT user_name@net_service_name Enter password: password
Connecting as SYSOPER
or SYSDBA
enables you to perform privileged operations, such as instance startup and shutdown. Multiple SQL*Plus sessions can connect to the same instance at the same time. SQL*Plus automatically disconnects you from the first instance whenever you connect to another one.
Note:
Use the SYSASM
privilege instead of the SYSDBA
privilege to connect to and administer an Oracle ASM instance. If you use the SYSDBA
privilege to connect to an Oracle ASM instance, then Oracle Database writes warnings to the alert log files because commands that run using the SYSDBA
privilege on an Oracle ASM instance are deprecated.
See Oracle Automatic Storage Management Administrator's Guide for more information.
See Also:
Oracle Database Net Services Administrator's Guide for the proper specification of net_service_name
Oracle Database Administrator's Guide for information about connecting to the database using SYSDBA
or SYSOPER
privileges