Home > Oracle Database / Applications News > Try this simple cold backup script
Oracle Database / Applications News:
EMAIL THIS

Try this simple cold backup script

By Kenny Smith
15 Dec 2003 | IOUG

Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   


The following is backup and recovery tip #1 from "30 tips in 30 minutes," brought to you by the IOUG. Return to the main page for more tips on this topic.


Need to perform a cold backup fast? This script lets you create a backup from SQL*Plus connected as SYSDBA.

Rem Set SQL*Plus variables to manipulate output
set feedback off heading off verify off
set pagesize 0 linesize 200
Rem Set SQL*Plus user variables used in script
Rem Linux User variables
define dir = '/backup'
define fil = '/tmp/closed_backup_commands.sql'
prompt *** Spooling to &fil
spool &fil
select 'host cp '|| name ||' &dir' from v$datafile order by 1;
select 'host cp '|| member ||' &dir' from v$logfile order by 1;
select 'host cp '|| name ||' &dir' from v$controlfile order by 1;
select 'host cp '|| name ||' &dir' from v$tempfile order by 1;
spool off;
Rem Shutdown the database cleanly
shutdown immediate;
Rem Run the copy file commands
@&fil
Rem Start the database again
startup;

On Linux, connect to SQL*Plus as SYSDBA and run this script like this:

LINUX> sqlplus /nolog
SQL> connect system/manager as sysdba
SQL> @closed_backup.sql

For more information see Chapter 4 of "Oracle backup and recovery 101."


Get more tips in minutes! Return to the main page.

About the author: Kenny Smith has been working with Oracle technology on HP servers for over a decade. He specializes in Oracle database architecture, database administration and development. He has presented at numerous Oracle conferences on two continents. He has published many articles describing Oracle solutions and has co-authored "Oracle backup and recovery 101" from Oracle Press.

IOUG: Become a member of the IOUG to access the paper referenced here and a repository of technical content created for Oracle users by Oracle users.

Tags: Cold backupsVIEW ALL TAGS

Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   



RELATED CONTENT
Cold backups
Is a cold backup needed in addition to daily hot backups?
Cold backup on Unix server
What files need to be backed up under 9i for a cold backup?
Back up an Oracle database on a Linux platform
Moving datafiles from production to development by cold backup and renaming
Cold backup using RMAN
Step-by-step backup procedures
Oracle backup and recovery scripts, part III: Backup and recovery under Windows NT
Oracle backup and recovery scripts, part I: Cold backup under Unix

RELATED RESOURCES
2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
Search Bitpipe.com for the latest white papers and business webcasts
Whatis.com, the online computer dictionary



Oracle News, Oracle Training, Oracle Management
HomeNewsTopicsTipsAsk the ExpertsMultimediaWhite PapersProductsBlogs
About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
SEARCH 
TechTarget provides technology professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective purchase decisions and managing their organizations' technology projects - with its network of technology-specific websites, events and online magazines.

TechTarget Corporate Web Site  |  Media Kits  |  Site Map




All Rights Reserved, Copyright 2003 - 2009, TechTarget | Read our Privacy Policy
  TechTarget - The IT Media ROI Experts