Script for Cold Backup [message #241054] |
Mon, 28 May 2007 04:41 |
prlzuby
Messages: 35 Registered: June 2006 Location: Pakistan
|
Member |
|
|
Hi....
I need script of cold backup which simply shutdown the database, copy the files and startup.
Thnx
Zaheer
|
|
|
|
|
|
|
|
|
|
Re: Script for Cold Backup [message #241204 is a reply to message #241105] |
Mon, 28 May 2007 17:12 |
DreamzZ
Messages: 1666 Registered: May 2007 Location: Dreamzland
|
Senior Member |
|
|
set heading off
select 'hosT copy '||file_name||' c:\backup\datafiles\
' from dba_data_files;
select 'host copy '||name||' c:\backup\datafiles\controlfiles\ ' from v$controlfile;
select 'host copy '||member||' c:\backup\datafiles\redologs\ ' from v$logile;
copy all the output in the file AND SAVE IT WITH .BAT and schedule it with window scdeullar according to your requirments like every day ,weekly or monthly.
i didnt run these scripts may be it not 100 accurate coz i dont have oracle installed on mine pc.
[Updated on: Mon, 28 May 2007 17:40] Report message to a moderator
|
|
|
|
Re: Script for Cold Backup [message #241551 is a reply to message #241418] |
Wed, 30 May 2007 00:16 |
atif_arl
Messages: 15 Registered: May 2007
|
Junior Member |
|
|
Is this the right way to take Backup through RMAN?
Is this Script takes Backup of whole Database ?
Also want to know that do we restore RMAN Backup on another machine.
Regards,
Atif Mahmood
CREATE TABLESPACE RMAN_DATA
DATAFILE 'D:\ORACLE\ORADATA\PTCL\RMANDF.DBF' SIZE 500M;
CREATE USER RMAN IDENTIFIED BY RMAN
DEFAULT TABLESPACE RMAN_DATA
QUOTA UNLIMITED ON RMAN_DATA
TEMPORARY TABLESPACE TEMP;
GRANT RESOURCE,CONNECT,RECOVERY_CATALOG_OWNER TO RMAN;
CONNECT RMAN/RMAN
C:\>RMAN TARGET SYS/ORACLE RCVCAT RMAN/RMAN
RMAN>CREATE CATALOG;
RMAN>REGISTER DATABASE;
RMAN>RESYNC CATALOG;
RMAN> RUN {
ALLOCATE CHANNEL c1 TYPE disk
FORMAT = 'E:/RMAN_BACKUP/usr0520.bak';
BACKUP DATAFILE 'D:\ORACLE\ORADATA\PTCL\USERS01.DBF';
}
RMAN>RUN {
backup
incremental level 0
format 'E:/RMAN_BACKUP/F_BACKUP/%d_%s_%p'
filesperset 3
(database include current controlfile);
sql 'alter system archive log current';
}
BACKUP
FORMAT 'E:/RMAN_BACKUP/F_BACKUP/df_%d_%s_%p.bus'
DATABASE filesperset = 1;
BACKUP
FORMAT 'E:/RMAN_BACKUP/ARCHIVE_BACKUP/ar_%t_%s_%p'
ARCHIVELOG ALL DELETE ALL INPUT;
|
|
|
Re: Script for Cold Backup [message #241759 is a reply to message #241551] |
Wed, 30 May 2007 10:09 |
DreamzZ
Messages: 1666 Registered: May 2007 Location: Dreamzland
|
Senior Member |
|
|
yes recovery catalog is good approch for hot backups.
Quote: | RMAN>RUN {
backup
incremental level 0
format 'E:/RMAN_BACKUP/F_BACKUP/%d_%s_%p'
filesperset 3
(database include current controlfile);
sql 'alter system archive log current';
}
|
level 0 always take full backup of database.
yes you can restore your rman backup on any other machine.
|
|
|