RMAN Scriptleri
Full Backup (Ve log dosyasının mail ile gönderilmesi)
Script başlatıcı
|
1 2 3 4 |
#!/bin/bash . ~/.bash_profile umask 077 rman target=/ log /u02/Yedek/RMAN_FULL.log @/home/oracle/Batches/Full/RmanFullYedekParameter |
#smtp-cli -verbose -host=smtp.gmail.com:587 -enable-auth -user mailadiniz@gmail.com -password mail_sifresi
-from mailadiniz@gmail.com -to mehmet at sydba.org -subject "test vt Rman log" -attach /u02/Yedek/RMAN_FULL.log
#rman target=/ log /u02/Yedek/RMAN_FULL.log append @/home/oracle/Batches/RmanFullYedekParameter
Parametre Dosyası "RmanFullYedekParameter"
|
1 2 3 4 5 6 7 8 9 10 11 |
RUN { allocate channel c1 type disk MAXPIECESIZE 16G; BACKUP AS COMPRESSED BACKUPSET DATABASE FORMAT '/u02/Yedek/dbf_%d_%t_%s' tag=dbf_full_yedek; BACKUP ARCHIVELOG ALL FORMAT '/u02/Yedek/arc_%d_%t_%s' tag=arc_full_yedek; release channel c1; } crosscheck backup; crosscheck archivelog all; delete noprompt expired backup; delete noprompt archivelog until time "sysdate-7"; |
INCREMENTAL Backup INCREMENTAL LEVEL 0
Script başlatıcı
|
1 2 3 4 |
#!/bin/bash . ~/.bash_profile umask 077 rman target=/ log /u02/Yedek/RMAN_L0.log @/home/oracle/Batches/Inc/L0_Parameter |
#smtp-cli -verbose -host=smtp.gmail.com:587 -enable-auth -user mailadiniz@gmail.com -password mail_sifresi
-from mailadiniz@gmail.com -to mehmet at sysdba.org -subject "test vt Rman L0 log" -attach /u02/Yedek/RMAN_L0.log
#rman target=/ log /u02/Yedek/RMAN_FULL.log append @/home/oracle/Batches/RmanFullYedekParameter
Parametre Dosyası "L0_Parameter"
|
1 2 3 4 5 6 7 8 9 10 11 |
RUN { allocate channel c1 type disk MAXPIECESIZE 15G; BACKUP AS COMPRESSED BACKUPSET INCREMENTAL LEVEL 0 tag DBF_Inc_L0 DATABASE FORMAT '/u02/Yedek/Dbf_ INC0_%d_%T_%U'; BACKUP ARCHIVELOG ALL tag ARC_Inc_L0 FORMAT '/u02/Yedek/Arc_INC0_%d_%T_%U'; release channel c1; } crosscheck backup; crosscheck archivelog all; delete noprompt expired backup; delete noprompt archivelog until time "sysdate-7"; |
INCREMENTAL Backup INCREMENTAL LEVEL 1
Script başlatıcı
|
1 2 3 4 |
#!/bin/bash . ~/.bash_profile umask 077 rman target=/ log /u02/Yedek/RMAN_L1.log @/home/oracle/Batches/Inc/L1_Parameter |
#smtp-cli -verbose -host=smtp.gmail.com:587 -enable-auth -user mailadiniz@gmail.com -password mail_sifresi
-from mailadiniz@gmail.com -to mehmet at sysdba.org -subject "test vt Rman L1 log" -attach /u02/Yedek/RMAN_L1.log
Parametre Dosyası "L1_Parameter"
|
1 2 3 4 5 6 7 8 9 10 |
RUN { allocate channel c1 type disk MAXPIECESIZE 15G; BACKUP AS COMPRESSED BACKUPSET INCREMENTAL LEVEL 1 tag DBF_INC_L1 CUMULATIVE DATABASE FORMAT '/u02/Yedek/Dbf_L1_%d_%T_%U'; BACKUP ARCHIVELOG ALL tag ARC_Inc_L1 FORMAT '/u02/Yedek/Arc_INC1_%d_%T_%U'; release channel c1; } crosscheck backup; crosscheck archivelog all; delete noprompt expired backup; |
Sıkıştırarak Yedek Alma
|
1 2 3 4 |
backup as compressed backupset database format '/u01/Rman/dbf_%d_%t_%s.rman' Tag='DBF_Manuel_DDMMYYYY' plus archivelog format '/u01/Rman/arc_%d_%t_%s.rman' tag='Arc_Manuel_DDMMYYYY' |
Microsoft Windows Sistemlerde BatchFile ile Yedek Başlatma
|
1 |
rman target=/ log E:BackUpRMAN.log append @E:BackUpDBF_ARC_FullYedek.txt |
Full Yedek
|
1 2 3 4 5 6 7 8 9 10 |
RUN { allocate channel c1 type disk MAXPIECESIZE 16G; backup as compressed backupset database format 'E:BackUpRmanDBF_%d_%t_%s.rman' Tag='Rman_DBF_FullYedek'; backup archivelog all format 'E:BackUpRmanARC_%d_%t_%s.rman' tag='Rman_Arc_FullYedek'; release channel c1; crosscheck backup; crosscheck archivelog all; delete noprompt expired backup; } |
Full Yedek (Sonrasında Archivelog ları siler, Haftanın 6 günü üsttekini 7. gün bu script çalıştırılarak haftalık archive loglar sistemde de tutulabilir, güvenlik amaçlı)
|
1 2 3 4 5 6 7 8 9 10 11 |
RUN { allocate channel c1 type disk MAXPIECESIZE 16G; backup as compressed backupset database format 'E:BackUpRmanDBF_%d_%t_%s.rman' Tag='Rman_DBF_FullYedek'; backup archivelog all format 'E:BackUpRmanARC_%d_%t_%s.rman' tag='Rman_Arc_FullYedek'; release channel c1; crosscheck backup; crosscheck archivelog all; delete noprompt expired backup; BACKUP ARCHIVELOG ALL DELETE INPUT; } |
Not : Bu scriptler fikir vermesi açısından konulmuştur. Siz kendinize göre geliştirebilirsiniz.
