FS
Documentation

Backup3G/DA-Oracle/Commands

This page was last modified 01:23, 5 September 2007.

From Documentation

< Backup3G(Difference between revisions)
Jump to: navigation, search
Revision as of 00:12, 12 April 2006
Moff (Talk | contribs)
(Oracle Offline)
← Previous diff
Current revision
Moff (Talk | contribs)
(DA-Oracle Commands moved to Backup3G/DA-Oracle/Commands)
Line 1: Line 1:
Following are the SVRMGRL/SQLPLUS commands used by DA-Oracle. The FSoracle commands are the shell commands called from ORAonline, ORAofflne and ORAexport respectively. Code boxes are the svrmgrl/sqlplus (and exp) commands called from do_oracle according to FSoracle flags (eg -c, -x etc). Italics are comments. Following are the SVRMGRL/SQLPLUS commands used by DA-Oracle. The FSoracle commands are the shell commands called from ORAonline, ORAofflne and ORAexport respectively. Code boxes are the svrmgrl/sqlplus (and exp) commands called from do_oracle according to FSoracle flags (eg -c, -x etc). Italics are comments.
- + 
 +== Technical Note ==
 + 
 +Please note that this article recreates Technical Note 211.
== Oracle Online == == Oracle Online ==
Line 6: Line 9:
FSoracle &lt;oracle_user&gt; -h /tmp/oradata$$ -n oldest &lt;SID&gt; -f /tmp/oralog$$ FSoracle &lt;oracle_user&gt; -h /tmp/oradata$$ -n oldest &lt;SID&gt; -f /tmp/oralog$$
-<em>-h implies HOT backup+''-h implies HOT backup''<br>
--n oldest archive log</em>+''-n oldest archive log''
<pre>svrmgrl { <pre>svrmgrl {
connect / as sysdba; connect / as sysdba;
Line 16: Line 19:
archive log list; archive log list;
}</pre> }</pre>
 +
FSoracle &lt;oracle_user&gt; -b &lt;tablespace&gt; &lt;SID&gt; FSoracle &lt;oracle_user&gt; -b &lt;tablespace&gt; &lt;SID&gt;
-<em>-b start backup mode</em>+''-b start backup mode''
<pre>svrmgrl { <pre>svrmgrl {
connect / as sysdba; connect / as sysdba;
Line 25: Line 29:
where (d.file_id = v.file#) and (d.tablespace_name = &lt;tablespace&gt;); where (d.file_id = v.file#) and (d.tablespace_name = &lt;tablespace&gt;);
}</pre> }</pre>
 +
FSoracle &lt;oracle_user&gt; -e &lt;tablespace&gt; &lt;SID&gt; FSoracle &lt;oracle_user&gt; -e &lt;tablespace&gt; &lt;SID&gt;
-<em>-e end backup mode</em>+''-e end backup mode''
<pre>svrmgrl { <pre>svrmgrl {
connect / as sysdba; connect / as sysdba;
Line 34: Line 39:
where (d.file_id = v.file#) and (d.tablespace_name = &lt;tablespace&gt;); where (d.file_id = v.file#) and (d.tablespace_name = &lt;tablespace&gt;);
}</pre> }</pre>
 +
FSoracle &lt;oracle_user&gt; -w &lt;oldest_log&gt; -f /tmp/oralog$$ &lt;SID&gt; FSoracle &lt;oracle_user&gt; -w &lt;oldest_log&gt; -f /tmp/oralog$$ &lt;SID&gt;
-<em>-w implies switch logs</em>+''-w implies switch logs''
<pre>svrmgrl { <pre>svrmgrl {
connect / as sysdba; connect / as sysdba;
Line 46: Line 52:
FSoracle &lt;oracle_user&gt; -l “&lt;oldest_log&gt; &lt;last_log&gt;” -f /tmp/oralog$$ &lt;SID&gt; FSoracle &lt;oracle_user&gt; -l “&lt;oldest_log&gt; &lt;last_log&gt;” -f /tmp/oralog$$ &lt;SID&gt;
-<em>-l implies list log files</em>+''-l implies list log files''
<pre>svrmgrl { <pre>svrmgrl {
connect / as sysdba; connect / as sysdba;
Line 56: Line 62:
(Name = ‘log_archive_dest_9’) or (Name = ‘log_archive_dest_10’); (Name = ‘log_archive_dest_9’) or (Name = ‘log_archive_dest_10’);
}</pre> }</pre>
 +
FSoracle &lt;oracle_user&gt; -t &lt;control_file&gt; &lt;SID&gt; FSoracle &lt;oracle_user&gt; -t &lt;control_file&gt; &lt;SID&gt;
-<em>-t implies save control file</em>+''-t implies save control file''
<pre>svrmgrl { <pre>svrmgrl {
connect / as sysdba; connect / as sysdba;
alter database backup control file to ‘&lt;save_file&gt;’; alter database backup control file to ‘&lt;save_file&gt;’;
}</pre> }</pre>
 +
FSoracle &lt;oracle_user&gt; -p &lt;param_dir&gt; &lt;SID&gt; FSoracle &lt;oracle_user&gt; -p &lt;param_dir&gt; &lt;SID&gt;
-<em>-p implies misc Oracle files in &lt;param_dir&gt;</em>+''-p implies misc Oracle files in &lt;param_dir&gt;''
- +
== Oracle Offline == == Oracle Offline ==
Line 84: Line 91:
shutdown immediate; shutdown immediate;
}</pre> }</pre>
 +
FSoracle &lt;oracle_user&gt; -p &lt;param_dir&gt; &lt;SID&gt; FSoracle &lt;oracle_user&gt; -p &lt;param_dir&gt; &lt;SID&gt;
Line 95: Line 103:
startup open; startup open;
}</pre> }</pre>
-<br>+ 
 + 
== Oracle Export == == Oracle Export ==
Line 110: Line 119:
} }
exp &lt;export_user&gt; direct full=y file=&lt;device_nr&gt;</pre> exp &lt;export_user&gt; direct full=y file=&lt;device_nr&gt;</pre>
 +
FSoracle &lt;oracle_user&gt; -u &lt;SID&gt; FSoracle &lt;oracle_user&gt; -u &lt;SID&gt;
Line 118: Line 128:
alter system disable restricted session; alter system disable restricted session;
}</pre> }</pre>
 +
 +
 +
 +== Oracle Archive Logs ==
 +
 +FSoracle &lt;oracle_user&gt; -v &lt;SID&gt;
 +
 +<em>-v implies switch archive logs</em>
 +<pre>
 +svrmgrl {
 + connect / as sysdba;
 + archive log list;
 + alter system archive log current;
 + archive log list;
 +}</pre>
 +
 +FSoracle &lt;oracle_user&gt; -d -f /tmp/oralog$$ &lt;SID&gt;
 +
 +<em>-d implies list log directories</em>
 +<pre>svrmgrl {
 + connect / as sysdba;
 + select value from v$parameter where (Name = ‘log_archive_dest’) or
 + (Name = ‘log_archive_dest_1’) or (Name = ‘log_archive_dest_2’) or
 + (Name = ‘log_archive_dest_3’) or (Name = ‘log_archive_dest_4’) or
 + (Name = ‘log_archive_dest_5’) or (Name = ‘log_archive_dest_6’) or
 + (Name = ‘log_archive_dest_7’) or (Name = ‘log_archive_dest_8’) or
 + (Name = ‘log_archive_dest_9’) or (Name = ‘log_archive_dest_10’);
 +}</pre>
 +
 +
 +----
 +Copyright © 1990-2006 Functional Software. All rights reserved.
 +
 +{| cellpadding="10" cellspacing="5"
 +|-
 +|[[DA-Oracle Command Reference|Previous Section]]
 +|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
 +|[[DA-Oracle Commands|Next Section]]
 +|}

Current revision

Following are the SVRMGRL/SQLPLUS commands used by DA-Oracle. The FSoracle commands are the shell commands called from ORAonline, ORAofflne and ORAexport respectively. Code boxes are the svrmgrl/sqlplus (and exp) commands called from do_oracle according to FSoracle flags (eg -c, -x etc). Italics are comments.

Contents

Technical Note

Please note that this article recreates Technical Note 211.

Oracle Online

FSoracle <oracle_user> -h /tmp/oradata$$ -n oldest <SID> -f /tmp/oralog$$

-h implies HOT backup
-n oldest archive log

svrmgrl {
    connect / as sysdba;
    select dba_data_files.file, dba_data_files.tablespace_name, ENABLED,
        dba_data_files.status, dba_data_files.file_id, dba_data_files.bytes/(1024*1024)
        from dba_data_files, v$datafile where dba_data_files.file_id = v$datafile.file#;
    select name from v$controlfile;
    archive log list;
}

FSoracle <oracle_user> -b <tablespace> <SID>

-b start backup mode

svrmgrl {
    connect / as sysdba;
    alter tablespace <tablespace> begin backup;
    select d.file_id, d.tablespace_name, v.status, v.file# from dba_data_files d, v$backup v
        where (d.file_id = v.file#) and (d.tablespace_name = <tablespace>);
}

FSoracle <oracle_user> -e <tablespace> <SID>

-e end backup mode

svrmgrl {
    connect / as sysdba;
    alter tablespace <tablespace> end backup;
    select d.file_id, d.tablespace_name, v.status, v.file# from dba_data_files d, v$backup v
        where (d.file_id = v.file#) and (d.tablespace_name = <tablespace>);
}

FSoracle <oracle_user> -w <oldest_log> -f /tmp/oralog$$ <SID>

-w implies switch logs

svrmgrl {
    connect / as sysdba;
    archive log list;
    alter system archive log current;
    archive log list;
}

FSoracle <oracle_user> -l “<oldest_log> <last_log>” -f /tmp/oralog$$ <SID>

-l implies list log files

svrmgrl {
    connect / as sysdba;
    select value from v$parameter where (Name = ‘log_archive_dest’) or
        (Name = ‘log_archive_dest_1’) or (Name = ‘log_archive_dest_2’) or
        (Name = ‘log_archive_dest_3’) or (Name = ‘log_archive_dest_4’) or
        (Name = ‘log_archive_dest_5’) or (Name = ‘log_archive_dest_6’) or
        (Name = ‘log_archive_dest_7’) or (Name = ‘log_archive_dest_8’) or
        (Name = ‘log_archive_dest_9’) or (Name = ‘log_archive_dest_10’);
}

FSoracle <oracle_user> -t <control_file> <SID>

-t implies save control file

svrmgrl {
    connect / as sysdba;
    alter database backup control file to ‘<save_file>’;
}

FSoracle <oracle_user> -p <param_dir> <SID>

-p implies misc Oracle files in <param_dir>

Oracle Offline

FSoracle <oracle_user> -c /tmp/oradata$$ <SID>

-c implies COLD backup

svrmgrl {
    connect / as sysdba;
    shutdown immediate;
        (if shutdown fails, shutdown abort;)
    startup exclusive;
    select tablespace_name from dba_data_files;
    select file_name from dba_data_files;
    select member from v$logfile;
    select name from v$controlfile;
    shutdown immediate;
}

FSoracle <oracle_user> -p <param_dir> <SID>

-p implies misc Oracle files in <param_dir>

FSoracle <oracle_user> -s open <SID>

-s implies start mode = open

svrmgrl {
    connect / as sysdba;
    startup open;
}


Oracle Export

FSoracle <oracle_user> -x "<export_user> direct full=y file=<device_nr>" <SID>

-x implies export as <export_user>

svrmgrl {
    connect / as sysdba;
    shutdown immediate;
        (if shutdown fails shutdown abort;)
    startup restrict open;
}
exp <export_user> direct full=y file=<device_nr>

FSoracle <oracle_user> -u <SID>

-u implies unrestrict user access to <SID>

svrmgrl {
    connect / as sysdba;
    alter system disable restricted session;
}


Oracle Archive Logs

FSoracle <oracle_user> -v <SID>

-v implies switch archive logs

svrmgrl {
    connect / as sysdba;
    archive log list;
    alter system archive log current;
    archive log list;
}

FSoracle <oracle_user> -d -f /tmp/oralog$$ <SID>

-d implies list log directories

svrmgrl {
    connect / as sysdba;
    select value from v$parameter where (Name = ‘log_archive_dest’) or
        (Name = ‘log_archive_dest_1’) or (Name = ‘log_archive_dest_2’) or
        (Name = ‘log_archive_dest_3’) or (Name = ‘log_archive_dest_4’) or
        (Name = ‘log_archive_dest_5’) or (Name = ‘log_archive_dest_6’) or
        (Name = ‘log_archive_dest_7’) or (Name = ‘log_archive_dest_8’) or
        (Name = ‘log_archive_dest_9’) or (Name = ‘log_archive_dest_10’);
}



Copyright © 1990-2006 Functional Software. All rights reserved.

Previous Section            Next Section