Oracle8i Backup and Recovery Guide
Release 8.1.5

A67773-01

Library

Product

Contents

Index

Prev Prev Next


sql

Syntax


Purpose

To execute a SQL statement from within Recovery Manager. For valid SQL syntax, see the Oracle8i SQL Reference.

Requirements

Keywords and Parameters

'command'  

specifies a SQL statement for execution. For example, issuing the following:

sql 'ALTER SYSTEM ARCHIVE LOG ALL'; 

at the RMAN prompt archives the online redo logs.  

Examples

Making an O/S Copy of an Online Tablespace

This example hosts out to the operating system to make an O/S copy of online tablespace TBS_1 and then catalogs it:

sql 'ALTER TABLESPACE tbs_1 BEGIN BACKUP';
host 'cp $ORACLE_HOME/dbs/tbs_1.f/dbs/tbs_1.f $ORACLE_HOME/copy/temp3.f';
sql 'ALTER TABLESPACE tbs_1 END BACKUP';
catalog datafilecopy '$ORACLE_HOME/copy/temp3.f';
sql 'ALTER SYSTEM ARCHIVE LOG ALL';
Specifying a Filename within a Quoted String

This example specifies a filename using duplicate single quotes within the context of a double-quoted string:

sql "ALTER TABLESPACE tbs_1 ADD DATAFILE ''/oracle/dbs/tbs_7.f'' NEXT 10K MAXSIZE 100k;"
Opening with the RESETLOGS Option

This example performs incomplete recovery and opens the database with the RESETLOGS option:

run {
     set until scn 1000;
     allocate channel c1 type 'sbt_tape';
     restore database;
     recover database;
     sql 'ALTER DATABASE OPEN RESETLOGS';
     reset database;
}



Prev

Top

Next
Oracle
Copyright © 1999 Oracle Corporation.

All Rights Reserved.

Library

Product

Contents

Index