3.18 SQL
Purpose
Use the SQL command to execute SQL commands and PL/SQL procedures. This command is easier to use than in Oracle Database 11.2 and earlier releases, because the SQL command does not need to be enclosed in quotation marks and does not need to be prefixed with "SQL". For the original syntax, see SQL (Quoted).
See Also:
Prerequisites
None
(sqlKeyword::=, allSqlKeywords::=
sqlKeyword::=
allSqlKeywords::=
Semantics
sqlcommand::=
Syntax Element | Description |
---|---|
|
Executes the SQL command in the catalog database. |
|
Executes the SQL command over the named channel. |
|
Executes the SQL command in the target database. |
|
The appropriate SQL syntax for the specified keyword, which RMAN sends to SQL for processing. |
|
Indicates the body of a PL/SQL block. |
|
Indicates a declarative part of a PL/SQL block. |
|
A PL/SQL statement or block, which RMAN sends to SQL for processing. Bind variables are not supported and cause execution errors. Any output cannot be viewed. |
|
A single slash (/) as the first and only character on a line. |
sqlKeyword::=
The sqlkeyword
clause lists the SQL commands that you can execute in RMAN. For the SQL syntax, see the Oracle Database SQL Language Reference. The exceptions are described in the following table.
Syntax Element | Description |
---|---|
|
Replaces the RMAN |
|
Requires the |
|
Executes the RMAN |
|
Executes the RMAN |
|
Uses these column widths to display the returned rows:
Use the SQL Bind variables are not supported and cause execution errors. |
allSqlKeywords::=
The allSqlKeywords clause is preceded by the SQL
keyword, which eliminates the ambiguity between SQL and RMAN commands.
Syntax Element | Description |
---|---|
|
Executes the SQL |
|
Executes the SQL |
|
Executes the SQL |
|
Executes the SQL |
Examples
Example 3-67 Adding a Data File
This example adds a data file to the USERS
tablespace:
RMAN> ALTER TABLESPACE users ADD DATAFILE '/disk1/oradata/users02.dbf' SIZE 1M AUTOEXTEND ON NEXT 10K MAXSIZE 2M; Statement processed
Example 3-68 Querying a Table
This example selects a column from the V$DATABASE
dynamic performance view:
RMAN> SELECT dbid FROM v$database; using target database control file instead of recovery catalog DBID ---------- 3152825380
Example 3-69 Creating a Directory
This example creates the DEST_DIR
directory:
RMAN> CREATE DIRECTORY dest_dir AS '/usr/admin/destination'; Statement processed