Home » RDBMS Server » Backup & Recovery » problem while taking cold backup
problem while taking cold backup [message #217729] Mon, 05 February 2007 02:10 Go to next message
pavan27
Messages: 50
Registered: December 2006
Location: bangalore
Member
Hi to every one.

i am learning oracle dba. now i am in backup and recovery.
i am facing this problem.

i my database is oracle 10g rel2 OS redhat linux AS4

my script file is
vi getfiles.sql

set echo off
set paues off
set feed off
set head off
spool cold_backup.sh

select 'cp ' ||name|| ' /diks1/oradata/sai/backup' from v$datafile;

select 'cp ' ||name|| ' /diks1/oradata/sai/backup' from v$tempfile;

select 'cp ' ||name|| ' /diks1/oradata/sai/backup' from v$controlfile

select 'cp ' ||member|| ' /diks1/oradata/sai/backup' from v$log file;

spool off
:wq

$sqlplus " / as sysdba"
startup
sql> @ getfies.sh
cp /oraeng/app/oracle/product/oradata/sai/system01.dbf /disk1/oradata/sai/backup
cp /oraeng/app/oracle/product/oradata/sai/system01.dbf /disk1/oradata/sai/backup
cp /oraeng/app/oracle/product/oradata/sai/system01.dbf /disk1/oradata/sai/backu
p
.
.
.
like wise i have 11 diffrent files to copy

shutdown
exit
$ sh cold_backup.sh

when i exevute this command i am getting this messages


cold_backup.sql : line 3 : p: command not found
cold_backup.sql : line 6 : p: command not found
cold_backup.sql : line 9 : p: command not found
cold_backup.sql : line 16 : p: command not found
cold_backup.sql : line 19 : p: command not found
cold_backup.sql : line 22 : p: command not found

when i check in the back up dir i have some file not alll

i dont know what i am doing wrong can any one send me suggestion
Re: problem while taking cold backup [message #217760 is a reply to message #217729] Mon, 05 February 2007 05:37 Go to previous messageGo to next message
Mahesh Rajendran
Messages: 10707
Registered: March 2002
Location: oracleDocoVille
Senior Member
Account Moderator
Quote:
sql> @ getfies.sh
cp /oraeng/app/oracle/product/oradata/sai/system01.dbf /disk1/oradata/sai/backup
cp /oraeng/app/oracle/product/oradata/sai/system01.dbf /disk1/oradata/sai/backup
cp /oraeng/app/oracle/product/oradata/sai/system01.dbf /disk1/oradata/sai/backu

YOu are trying to execute a shell script from sql*plus.
Why? Execute it from OS ( give permissions for the cold_backup.sh).
else
call the file as cold_backup.sql and it should have entries like
!cp /oraeng/app/oracle/product/oradata/sai/system01.dbf /disk1/oradata/sai/backup

So during spooling the files, add entry
select '!cp ' ||name|| ' /diks1/oradata/sai/backup' from v$datafile;


PS:
Search the forum before posting. Almost all the questions asked are already answered in one form or other.
Re: problem while taking cold backup [message #217762 is a reply to message #217760] Mon, 05 February 2007 05:44 Go to previous message
pavan27
Messages: 50
Registered: December 2006
Location: bangalore
Member
i found the solution. i am doing write. but i did not give
set lines . so it is the problme..

thanks for giving suggestions.

pavan
Previous Topic: Recovery error during duplicate database on remote host
Next Topic: shutdwon script before run coldback up script in linux
Goto Forum:
  


Current Time: Thu May 02 13:40:11 CDT 2024