FS
Documentation

Backup3G/DA-Oracle/Commands

From Documentation

< Backup3GRevision as of 07:03, 11 April 2006; view current revision
←Older revision | Newer revision→
Jump to: navigation, search

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.


Oracle Online

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

-h implies HOT backup -n oldest archive log

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

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

-b start backup mode

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

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

-e end backup mode

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

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

-w implies switch logs

<code>svrmgrl {<br>    connect / as sysdba;<br>    archive log list;<br>    alter system archive log current;<br>    archive log list;<br>}</code>

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

-l implies list log files

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

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

-t implies save control file

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

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

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

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

<code>svrmgrl {<br>    connect / as sysdba;<br>    startup open;<br>}</code>

Oracle Export

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

-x implies export as <export_user>

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

FSoracle <oracle_user> -u <SID>

-u implies unrestrict user access to <SID>

<code>svrmgrl {<br>    connect / as sysdba;<br>    alter system disable restricted session;<br>}</code>