oracle10g_rman_語法測試_spool_sql_startup

wisdomone1發表於2009-09-25

--spool就是把rman輸出資訊匯入到一個檔案中,如此檔案打不開,rman就關閉spool功能,繼續執行其它命令
Spooling RMAN Output to a File: Example
This example directs RMAN output to standard output for the backup of datafile 1, then directs output to a log file for the backup of datafile 2, then directs output to a different log file for the whole database backup:

BACKUP DATAFILE 1;
SPOOL LOG TO '/tmp/df2log.f';
BACKUP DATAFILE 2;
SPOOL LOG OFF;
SPOOL LOG TO '/tmp/dblog.f';
BACKUP DATABASE;
SPOOL LOG OFF;


---在rman中用sql選項執行sqlplus相關命令
Archiving the Unarchived Online Logs: Example
This example backs up a tablespace and then archives all unarchived online logs:

BACKUP TABLESPACE users;
SQL "ALTER SYSTEM ARCHIVE LOG CURRENT";
Specifying a Filename within a Quoted String: Example
This example specifies a filename by 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;"
Executing a PL/SQL Stored Procedure Within RMAN: Example
This example issues a PL/SQL stored procedure called scott.update_log:

RUN
{
  SQL ' BEGIN scott.update_log; END; ';
}


---startup相關命令選項
startup dba --只有restricted session許可權的使用者才能連線資料庫
        force --先abort then startup
        mount
        nomount  --is useful for lose of spfile
        pfile=''

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/9240380/viewspace-615571/,如需轉載,請註明出處,否則將追究法律責任。

相關文章