Put your tips and tricks online - Share your knowledge! Login | Register
 
 
  Search     Advanced search
 

Home | Ask Question | Add tip | Questions | My tips | Recent tips & tricks | Suggest a category | FAQ | Forums

 
 
 
 Category : Home > Databases > Oracle     

Put tablespaces in backup mode


--
-- Sample script to generate start backup and end backup scripts 
-- for all tablespaces in the database
--

set pagesize 0 echo off feedback off verify off

spool BEGIN_BACKUP.sql

SELECT 'spool BEGIN_BACKUP.log'
FROM dual;

SELECT 'ALTER SYSTEM SWITCH LOGFILE;'
FROM dual;

SELECT 'ALTER TABLESPACE ' || tablespace_name || ' BEGIN BACKUP;'
FROM dba_tablespaces;

SELECT 'ALTER DATABASE BACKUP CONTROLFILE TO TRACE;'
FROM dual;

SELECT 'spool off'
FROM dual;

SELECT 'EXIT;'
FROM dual;

spool off

spool END_BACKUP.sql

SELECT 'spool END_BACKUP.log'
FROM dual;

SELECT 'ALTER TABLESPACE ' || tablespace_name || ' END BACKUP;'
FROM dba_tablespaces;

SELECT 'ALTER SYSTEM SWITCH LOGFILE;'
FROM dual;

SELECT 'spool off'
FROM dual;

SELECT 'EXIT;'
FROM dual;

spool off

EXIT;


  Options
 
   del.icio.us  |  newsvine  |  digg  |  furl  |  google  |  yahoo  |  Ma.gnolia  |  vigillar  |  reddit  |  technorati  |  icerocket  |  pubsub

       Rate this tip:    

Start discussion or add comment to this tip

  Details
Tip reference : #34
views : 1075
Added on : 10/26/05
Submited by : h8dk97
 
Send a message Send a message Printer friendly output Printer friendly output
Display this member's tips Display this member's tips (149)
 
 
<< Previous Next >>
 Most viewed tips 
  Databases > Oracle > Security : How to unlock Oracle user account  
  Databases > Oracle > Performance Tuning : How to enable trace in Oracle  
  Databases > Oracle : Kill user session  
  Databases > Oracle : Scripts to backup Oracle database on Windows NT  
   
  All categories
Databases | Programming | Hardware | Operating Systems | Networking | Internet | ERP / CRM | Games & Multimedia | Graphics & Design | Miscellaneous | Office Software | TipLib FAQ
 
 

Home |  FAQ |  Terms of Use |  Privacy Policy

© 2005 tiplib.com