Oracle8i Backup and Recovery Guide Release 8.1.5 A67773-01 |
|
To execute a SQL statement from within Recovery Manager. For valid SQL syntax, see the Oracle8i SQL Reference.
sql "CREATE TABLESPACE temp1 DATAFILE ' '$ORACLE_HOME/dbs/temp1.f' ' "
If you attempt to use single quotes for the string following the SQL parameter or single quotes for the filename, then the command fails.
'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. |
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';
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;"
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; }