SQL command executes a SQL statement or a PL/SQL stored procedure from within RMAN. This syntax is available for compatibility with Oracle Database Release 11.2 and earlier, but for ease of use, refer to
Specifies the case-sensitive name of a channel to use when executing an RMAN command within a
The channel must first be allocated by
Specifies a SQL statement for execution (see Example 3-69).
You must use duplicate single quotes to insert a single quote into a quoted string when the quoted string uses the same style of quoting. For example, if the string that RMAN passes to SQL contains a file name, then the file name must be enclosed in duplicate single quotes and the entire string following the
SQL 'BEGIN rman.rman_purge; END;';
Example 3-69 Archiving the Unarchived Online Logs
This example backs up a tablespace and then archives all unarchived online redo logs.
BACKUP TABLESPACE users; sql 'ALTER SYSTEM ARCHIVE LOG CURRENT';
Example 3-70 Specifying a File Name Within a Quoted String
This example specifies a file name by using duplicate single quotes within a double-quoted string.
sql 'ALTER TABLESPACE users ADD DATAFILE ''/disk1/oradata/users02.dbf'' SIZE 100K AUTOEXTEND ON NEXT 10K MAXSIZE 100K';