SQL
The SQL command executes a SQL statement or a PL/SQL stored procedure.
Format
SQL "<sql_statmement>"
Usage Notes
-
The SQL statement or PL/SQL stored procedure is executed on the database instance to which DGMGRL is connected and must be enclosed within double quotation marks.
-
Pure SQL statements must be entered without a semicolon (;) and execution of SELECT statements is not supported.
-
If the command contains a filename, then the filename must be enclosed in single quotation marks and the entire command string must be enclosed in double quotation marks. For example, use the following syntax:
SQL "CREATE TABLESPACE temp1 DATAFILE '?/oradata/trgt/temp1.dbf' SIZE 10M TEMPORARY"
-
PL/SQL stored procedures must be entered within standard PL/SQL
begin…; end;anonymous block syntax.
Command Example
The following command opens all the pluggable databases.
DGMGRL> SQL "alter pluggable database all open"
The following command executes a stored PL/SQL procedure to wait for 30 seconds.
DGMGRL> SQL "begin dbms_drs.sleep(30); end;"