Name

SQL

Synopsis

Allows you to execute SQL commands from the RMAN prompt.

Syntax

SQL {' | "}command{' | "};

Examples

The following example uses SQL to issue an ALTER SYSTEM command:

RMAN> SQL 'alter system switch logfile';

This next example, which takes a datafile offline, illustrates the use of an SQL command that has ticks within it. Each occurrence of two ticks in the string results in one tick in the command as actually executed.

RMAN> SQL "alter database datafile 
  ''/d01/oradata/brdstn/users_01.dbf'' offline";

Get Oracle RMAN Pocket Reference now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.