Home » RDBMS Server » Backup & Recovery » Hot Backup Urgent help please
Hot Backup Urgent help please [message #56323] Wed, 19 March 2003 08:33 Go to next message
Messages: 1
Registered: March 2003
Junior Member
I have a following scipt for the hotbackup

set serveroutput on
set trimspool on
set line 500
set head off
set feed off

spool backup.cmd

copy_cmnd constant varchar2(30) := 'ocopy'; -- Use "ocopy" for NT
copy_dest constant varchar2(30) := 'c:backup'; -- C:BACKUP for NT

dbname varchar2(30);
logmode varchar2(30);
select name, log_mode
into dbname, logmode
from sys.v_$database;

if logmode <> 'ARCHIVELOG' then
'ERROR: Database must be in ARCHIVELOG mode!!!');
end if;

dbms_output.put_line('spool backup.'||dbname||'.'||
to_char(sysdate, 'ddMonyy')||'.log');

-- Loop through tablespaces
for c1 in (select tablespace_name ts
from sys.dba_tablespaces)
dbms_output.put_line('alter tablespace '||c1.ts||' begin backup;');
-- Loop through tablespaces' data files
for c2 in (select file_name fil
from sys.dba_data_files
where tablespace_name = c1.ts)
dbms_output.put_line('HOST '||copy_cmnd||' '||c2.fil||' '||copy_dest);
end loop;

dbms_output.put_line('alter tablespace '||c1.ts||' end backup;');
end loop;

-- Backup controlfile and switch logfiles
dbms_output.put_line('alter database backup controlfile to trace;');
dbms_output.put_line('alter database backup controlfile to '||''''||
dbms_output.put_line('alter system switch logfile;');
dbms_output.put_line('spool off');

spool off

set head on
set feed on
set serveroutput off


When I execute it everything goes fine until the last command 'Alter system switch
logfile' It simply hangs when this command is being executed. Is it
necessary to execute this command to take a successful backup.

Our server has around 14 GB of archive logs and no backup has been
taken yet. Can I delete the files upto a particular time? Will it
create any problems? If yes how do I create space on the system as only 1 GB is left.

Thanks in advance.

Re: Hot Backup Urgent help please [message #56324 is a reply to message #56323] Wed, 19 March 2003 09:03 Go to previous message
Messages: 4
Registered: March 2002
Junior Member
Help Please
Previous Topic: rman restore to another box
Next Topic: Recover back space from datafiles
Goto Forum:

Current Time: Fri Jun 02 07:57:11 CDT 2023