RMAN BACKUP
1. RMAN (Recovery Manager) °³³ä
- ±âÁ¸ ¹æ½ÄÀÇ ¹é¾÷°ú º¹±¸´Â ¼öÇàÇÏ´Â ÁÖü°¡ »ç¶÷ÀÌÁö¸¸ RMAN ºÎÅÍ´Â »ç¶÷ÀÌ RMAN¿¡°Ô ¸í·ÉÀ» ÇÏ°í ½ÇÁ¦ ÀÛ¾÷À» ¼öÇàÇÏ´Â ÁÖü°¡ RMANÀ¸·Î ¹Ù²ñ
- ¾ÆÁÖ Æí¸®ÇÑ À¯Æ¿¸®Æ¼Áö¸¸ Çö½ÇÀûÀ¸·Î ¿©·¯ °¡Áö ¹®Á¦Á¡À̳ª »õ·Î ¹è¿ö¾ß¸¸ ¾µ ¼ö ÀÖ´Â µîÀÇ ¹®Á¦Á¡ ¶§¹®¿¡ ³Î¸® »ç¿ëµÇÁö´Â ¾Ê°í ÀÖÀ½
- oracle 10g ¹öÀüºÎÅÍ º»°ÝÀûÀ¸·Î »ç¿ëµÇ°í ÀÖ´Â ASM (Automatic Storage Management) ±â¹ÝÀÇ ¹é¾÷ ¹× º¹±¸´Â RMAN ¹Û¿¡ ÇÒ ¼ö ¾øÀ½
* RMANÀÇ ÁÖ¿ä ÀåÁ¡
- ÀÚÁÖ ½ÇÇàÇÏ´Â ÀÛ¾÷À» ½ºÅ©¸³Æ®·Î ÀúÀå (Recovery Catalog¸¦ »ç¿ëÇÒ °æ¿ì¿¡¸¸ Áö¿ø)
- ÁõºÐ ºí·Ï ·¹º§ ¹é¾÷ ±â´É Áö¿ø
- »ç¿ëµÇÁö ¾ÊÀº ºí·Ï °Ç³Ê¶Ù°í ¹é¾÷ ¼öÇà
- ¹é¾÷ ¼öÇà Áß ÈÑ¼ÕµÈ ºí·Ï °¨Áö
2. RMAN ±¸¼º ¹× ±¸Á¶
- °ü¸®ÀÚ°¡ RMAN À¯Æ¿¸®Æ¼¿¡°Ô ¹é¾÷À̳ª º¹±¸¸¦ ¸í·ÉÇϸé RMAN À¯Æ¿¸®Æ¼´Â °ü¸®ÀÚ¸¦ ´ë½ÅÇÏ¿© ´ë»ó ¼¹ö (target database)¿¡ Á¢¼ÓÇÏ¿© server process¿¡°Ô ¹é¾÷À» ¼öÇàÇÏ°Ô ÇÔ
- recover catalog server °¡ ÀÖÀ» °æ¿ì °ü·Ã Á¤º¸¸¦ catalog database ¿¡ ÀúÀåÀ» ÇÏ°í ¸¸¾à ¾øÀ» °æ¿ì¿¡´Â target database ÀÇ control file¿¡ ±â·Ï
- RMANÀº ¹é¾÷ ¹× º¹±¸¸¦ ¼öÇàÇÒ ¶§ ±âº»ÀûÀ¸·Î PGA¸¦ »ç¿ëÇϸç PGA °ø°£ÀÌ ºÎÁ·ÇÒ °æ¿ì SGA (large pool, shared pool)À» »ç¿ë
* RMAN Memory ±¸Á¶
- RMANÀº ¹é¾÷ ¹ÞÀ» ¶§ »ç¿ëÇÏ´Â Input buffer °¡ ÀÖ°í ¹é¾÷ Çǽº¿¡(¹é¾÷ ÆÄÀÏ) ÀúÀåÇϱâ À§Çؼ »ç¿ëÇÏ´Â output buffer °¡ ÀÖÀ½
- data file º°·Î input buffer °¡ »ý¼º. -> input buffer¿¡ data file¿¡¼ ¹é¾÷ ¹Þ¾Æ¾ß ÇÒ ºí·ÏÀ» °¡Á®¿È -> ¿©·¯ °³ÀÇ input buffer Áß Çϳª°¡ °¡µæ Â÷¸é output buffer·Î ºí·ÏÀ» º¹»ç -> output buffer ¿¡´Â ¿©·¯ data fileÀÇ ºí·ÏÀÌ Á¸Àç -> output buffer °¡ °¡µæ Â÷°Ô µÇ¸é backup set ¿¡ ³»·Á ¾¸
1) Input Buffer
- ÇöÀç ¼öÇàÇÏ°í ÀÖ´Â ¹é¾÷ ÀÛ¾÷ÀÇ ÆÄÀÏÀÇ °³¼ö¿Í ¿ë·®¿¡ µû¶ó ¹öÆÛÀÇ °³¼ö¿Í ¸Þ¸ð¸®ÀÇ ¾çÀÌ ´Þ¶óÁü
- ¸Þ¸ð¸®´Â channel ´ÜÀ§·Î ÇÒ´ç --> ¸Þ¸ð¸®´Â ÇϳªÀÇ channel º°·Î ÇÒ´çÀÌ µÊ. --> ¿©·¯ channel¿¡¼ ÀÛ¾÷À» ÇÑ´Ù¸é ¸Þ¸ð¸®´Â °¢ channel º°·Î ÇÒ´ç
< ¹é¾÷ÆÄÀϺ°·Î input bufferÀÇ »ç¿ë³»¿ª°ú Å©±â Á¶È¸ÇÏ´Â SQL >
2) Output Buffer
- ¹é¾÷ Çǽº¿¡ ³»·Á ¾²À̱â Àü¿¡ »ç¿ëµÇ´Â ¹öÆÛ
- Ãâ·Â ÀåÄ¡°¡ ¹«¾ùÀ̳Ŀ¡ µû¶ó ÀÛµ¿ ¹æ½ÄÀÌ ´Þ¶óÁü
- µð½ºÅ© : channel ´ç 4°³ÀÇ ¹öÆÛ°¡ ÇÒ´ç. °¢ ¹öÆÛÀÇ Å©±â´Â 1m
- Å×ÀÌÇÁ : Å×ÀÌÇÁ µð¹ÙÀ̽ºÀÇ ¼Óµµ¿¡ µû¶ó ´Þ¶óÁü
3. RMAN Packages
- RMANÀº ¹é¾÷ÀÛ¾÷°ú channelÀ» °ü¸®Çϱâ À§Çؼ sys ½ºÅ°¸¶ ¼ÒÀ¯ÀÇ µÎ °³ÀÇ ÆÐÅ°Áö¸¦ »ç¿ë
1) SYS. DBMS_RCVMAN
- ¹é¾÷°ú º¹±¸ ÀÛ¾÷À» ¼öÇàÇϱâ À§Çؼ control file¿¡ Á¢±ÙÇؼ °ü·Ã Á¤º¸¸¦ RMAN¿¡°Ô Àü´ÞÇØ ÁÖ±â À§ÇÑ ÆÐÅ°Áö
- control file ¾ÈÀÇ ½Ã°£Á¤º¸¿Í üũÆ÷ÀÎÆ® Á¤º¸ ¹× ÆÄÀÏÀÇ À§Ä¡¿Í ÆÄÀÏÀÇ Å©±â µîÀ» È®ÀÎÇÏ¿© ÀÛ¾÷ÀÇ ºÎÇÏ¿Í ½ºÄÉÁÙ µîÀ» channel º°·Î Á¶Á¤
2) SYS. DBMS_BACKUP_RESTORE
- control file¿¡ Á¢±ÙÇؼ ÇÊ¿äÇÑ ¸ðµç Á¤º¸µéÀ» °ËÁõÇÏ´Â ¿ªÇÒ
- °ËÁõµÈ Á¤º¸¸¦ RMAN Server Process ¿¡°Ô ³Ñ°ÜÁÖ¸é RMAN Server Process´Â recover.bsq ¸¦ ±â¹ÝÀ¸·Î Çؼ ¹é¾÷°ú º¹±¸¿¡ ÇÊ¿äÇÑ PL/SQL blockÀ» »ý¼º -> ÀÌ·¸°Ô »ý¼ºµÈ PL/SQL blockÀÌ DBMS_BACKUP_RESTORE ÆÐÅ°Ä¡
- ½ÇÁ¦ data file, archive log file, control file ¹é¾÷À» ¼öÇàÇÏ´Â ½ÇÁ¦ ÆÐÅ°Ä¡
- RMAN Àº DBMS_RCVMAN¿¡¼ ¹ÞÀº Á¤º¸¸¦ °¡Áö°í ·Îµå ¹ë·±½ÌÀ̳ª channelº° ÀÛ¾÷À» Á¶Á¤ ÇÑ ÈÄ DBMS_BACK_RESTORE ÆÐÅ°Áö¸¦ È£ÃâÇؼ ½ÇÁ¦ ¹é¾÷ ÀÛ¾÷À» ¼öÇà
4. RMAN ÀÛµ¿ ¿ø¸®
User - RMAN - Server Process - PGA
1) rman target / ·Î ´ë»ó µ¥ÀÌÅͺ£À̽º Á¢¼Ó
- RMANÀº ¼¹öÂÊÀÇ SID¸¦ üũÇÏ°í sys »ç¿ëÀÚ·Î ·Î±×ÀÎ ÇÔ
- ÀνºÅϽº¿¡ Á¢¼ÓÇϱâ À§ÇØ channel server process¸¦ »ý¼ºÇÏ°Ô µÊ(spawn)
- channel server process ÀÇ ±âº»°ªÀº 1°³
- server processÀÇ ¸Þ¸ð¸®ÀÎ PGA ÇÒ´ç
2) SYS.DBMS_RCVMAN ÆÐÅ°Áö È£Ãâ
- ´ë»ó µ¥ÀÌÅͺ£À̽ºÀÇ ¹öÀü°ú ÀüüÀûÀÎ ¹°¸®Àû ±¸Á¶¸¦ ¾Ë±â À§ÇØ SYS.DBMS_RCVMAN ÆÐÅ°Áö¸¦ È£Ãâ
- control file ÀÇ Á¤º¸¸¦ ÀÐ¾î¼ µ¥ÀÌÅͺ£À̽º ÀüüÀÇ ÆÄÀϵ鿡 °üÇÑ Á¤º¸¿Í üũÆ÷ÀÎÆ® Á¤º¸, »ý¼º ½Ã°£ Á¤º¸, °¢ data fileÀÇ ¿Â¶óÀÎ/¿ÀÇÁ¶óÀÎ Á¤º¸ ¹× À§Ä¡ Á¤º¸µéÀ» ¸ðÀ½
- º»°ÝÀûÀÎ ¹é¾÷ÀÛ¾÷À» ¼öÇàÇϱâ Àü¿¡ ¹é¾÷µÇ´Â µ¿¾È º¯°æµÇ´Â Á¤º¸µé·ÎºÎÅÍ ÇöÀç ½ÃÁ¡ÀÇ Á¤º¸¸¦ ÁöÅ°±â À§ÇØ control fileÀ» ½º³À¼¦ Çؼ º¸°ü
3) DBMS_BACKUP_RESTORE
- Á¤ÇØÁø À§Ä¡¿¡ ¹é¾÷ Çǽº¸¦ ¸¸µé°í ¹é¾÷ÆÄÀÏÀ» ÀÐ¾î µéÀ̱â À§ÇÑ ÀÔ·Â ¹öÆÛ¸¦ »ý¼º
- ¸Þ¸ð¸® ÇÒ´ç ÀÛ¾÷ ÈÄ ¹é¾÷ Çǽº ÃʱâÈ
- ¹é¾÷ Çǽº¸¦ ÀúÀåÇϱâ À§ÇØ µð½ºÅ©ÀÇ ¹é¾÷ ÀúÀå À§Ä¡¿¡ ±âº»°ªÀÎ 50MBÀÇ °ø°£À» ¿ì¼± ÇÒ´ç(°¡µæ Â÷¸é »õ·ÎÀÌ 50MB È®º¸. ¹é¾÷ ³¡³ª¸é ³²Àº °ø°£Àº ÇÒ´ç ÇØÁ¦)
- Ãâ·Â¹öÆÛ°¡ °¡µæ Â÷¸é Ãâ·Â¹öÆÛÀÇ ³»¿ëÀ» ¹é¾÷ Çǽº¿¡ ÀúÀå
- ¸ðµç ¹é¾÷ ÆÄÀÏÀÌ ¹é¾÷ Çǽº¿¡ ÀúÀå ¿Ï·áµÇ¸é RMANÀº ´Ù½Ã DBMS_BACKUP_RESTORE ÆÐÅ°Áö¸¦ È£ÃâÇؼ ¹é¾÷ ÇǽºÀÇ À̸§°ú ½Ã°£, ¸¶Áö¸· üũÆ÷ÀÎÆ® Á¤º¸ µîÀ» control file¿¡ ±â·Ï
5. Recovery Catalog(º¹±¸ Ä«Å»·Î±×)
- RMAN »ç¿ë½Ã¿¡ RMANÀ¸·Î ¹é¾÷ º¹±¸ ÀÛ¾÷À» ÇÏ°í °ü·Ã Á¤º¸¸¦ ÀúÀåÇØ µÎ´Â ÀúÀå¼Ò
- Recovery Catalog Server°¡ ¾øÀ» °æ¿ì RMANÀº ¹é¾÷ ¼¹öÀÇ control file ¿¡ ÇØ´ç Á¤º¸¸¦ ÀúÀåÇÏ°Ô µÇ°í Recovery catalog server °¡ ÀÖÀ» °æ¿ì recover catalog ¿¡ Á¤º¸¸¦ ÀúÀå
* Recovery Catalog ¿¡ ÀúÀåµÇ´Â Á¤º¸
1) Data file ¹× ¾ÆÄ«ÀÌºê ¸®µÎ ·Î±× ÆÄÀÏÀÇ ¹é¾÷ ¼Â°ú copyµÈ À̹ÌÁö¿¡ ´ëÇÑ Á¤º¸
2) ¹é¾÷ ´ë»ó¼¹öÀÇ ¹°¸®ÀûÀÎ ±¸Á¶
3) ÀÚÁÖ »ç¿ëÇÏ´Â ¹é¾÷ ½ºÅ©¸³Æ® (Recovery Catalog Server ¸¦ »ç¿ëÇÒ °æ¿ì¿¡¸¸ ÇØ´ç)
- Catalog Server »ç¿ë½Ã Á¢¼Ó ¹æ¹ý : rman / catalog rcuser/rcuser@rcserver
- Catalog Server »ç¿ë ¾ÈÇÒ °æ¿ì Á¢¼Ó ¹æ¹ý : rman target /
* À¯´Ð½º °è¿¿¡¼ rman ½ÇÇà ½Ã ¿¡·¯ ³ª´Â °æ¿ì(°æ·Î ´Þ¶ó¼ »ý±â´Â ¿¡·¯ Á¶Ä¡¹ý)
root ·Î Á¢¼ÓÇÏ¿© cp /home/oracle/product/10g/bin/rman /usr/X11R6/bin µ¤¾î¾º¿ò~
[Ãâó] RMAN (Recovery Manager)|ÀÛ¼ºÀÚ À¯Áî
1. RMAN À» ÀÌ¿ëÇÑ Backup ¼öÇà
RMAN> backup tablespace example;
-- ÀÚµ¿À¸·Î channel ÇÒ´ç
* backup option
#1 check / nocheck : ºÒ·® block / block ¼Õ»ó ¿©ºÎ È®ÀÎ On/Off
#2 max_corrupt : ¼Õ»óµÈ block ÀÇ ÃÖ´ë °¹¼ö ÁöÁ¤ °¡´É
(200À¸·Î ÁöÁ¤ÇßÀ» °æ¿ì 200°³ ÀÌ»ó ¼Õ»óµÇ¸é ¹é¾÷ Áß´Ü)
#3 validate : ¹é¾÷ °¡´É ¿©ºÎ üũ (Info ÆÄÀÏÀÇ Á¤ÇÕ¼º ¿©ºÎ È®ÀÎ)
#4 copies : ¹é¾÷ ÆÄÀÏÀ» ÀÌÁßÀ¸·Î »ý¼ºÇÔ
#5 reuse : µ¿ÀÏÇÑ À̸§ÀÇ ¹é¾÷º»ÀÌ ÀÌ¹Ì Á¸ÀçÇÏ´Â °æ¿ì µ¤¾î¾²±â ¼öÇà
2. Backup ¼öÇà½Ã °í·Á»çÇ×
1) RMAN ¼öÇàÀ¸·Î backup ¼öÇà ½Ã Database °¡ Mount ȤÀº Open »óÅ¿©¾ß ÇÑ´Ù.
- Online Backup : Open »óÅÂ
- Offline Backup : Mount »óÅÂ
- meta Á¤º¸¸¦ controlfile ¿¡ ±â·ÏÀ» Çϱâ À§Çؼ, Controlfile ÀÌ ¿¸° ´Ü°è°¡ µÇ¾î¾ß ÇÔ.
-> mount ÀÌ»óÀÇ ´Ü°è¿¡¼ ¼öÇàµÇ¾î¾ß ÇÏ´Â ÀÌÀ¯
2) Archive Mode ¿¡ µû¸¥ ¹é¾÷
- Nocarchive Log Mode ÀÏ ¶§? Online Backup ÀÌ ºÒ°¡´ÉÇϱ⠶§¹®¿¡ ¹Ýµå½Ã Target DB ¸¦ Mount »óÅ·Î
¸ÂÃá ÈÄ Backup ¼öÇà
- Archive Log Mode ÀÏ ¶§? Online Backup °¡´ÉÇÔ. ±×·¸±â ¶§¹®¿¡ mount / open ´Ü°è ¾ç ÂÊ ´Ù ¹é¾÷ °¡´ÉÇÔ
3. Channel º´·Äµµ ÁöÁ¤
- default ´Â 1·Î ÁöÁ¤µÇ¾î ÀÖÁö¸¸, ´Ü±âÀûÀ¸·Î ÁöÁ¤ÀÌ °¡´ÉÇÔ
¿¹Á¦) 3°³ÀÇ Channel ·Î BackupÀ» ¹Þ°í ½ÍÀ» ¶§
RMAN> RUN {
ALLOCATE CHANNEL c1 DEVICE TYPE sbt;
ALLOCATE CHANNEL c2 DEVICE TYPE sbt;
ALLOCATE CHANNEL c3 DEVICE TYPE sbt;
BACKUP
INCREMENTAL LEVEL = 0
(DATAFILE 1,4,5 CHANNEL c1)
(DATAFILE 2,3,9 CHANNEL c2)
(DATAFILE 6,7,8 CHANNEL c3);
sql ¡®ALTER SYSTEM ARCHIVE LOG CURRENT¡¯;
}
dataFile À» À§ÀÇ ¿¹Á¦¿¡¼ ÁöÁ¤ÇسõÀº ÀÌÀ¯?
-> Datafile ÀÌ 1~9±îÁö ÀÖ´Â °æ¿ì, Datafile À» ÁöÁ¤ÇÏÁö ¾ÊÀ¸¸é default ¼³Á¤¿¡ ÀÇÇØ
¼øÂ÷ÀûÀ¸·Î 3°³ÀÇ Ã¤³ÎÀÌ 1,2,3/4,5,6/7,8,9 ³ª´©¾î °¡Áö°Ô µÈ´Ù
datafile ÀÇ Size °£ÀÇ ºÒ±ÕÇüÀ» ÀÌ·ç´Â °æ¿ì ´ÙÁß Ã¤³ÎÀÇ È¿À²ÀÌ ¶³¾îÁö±â ¶§¹®¿¡
DBA°¡ ÀÓÀÇ·Î ÁöÁ¤ÇØ ÁÙ ¼ö ÀÖ´Ù.
4. ¾ÐÃà ¹é¾÷ (Compresed Backups)
-> ¾ÐÃà Çؼ BackupÀ» ¹Þ´Â °æ¿ì ¿ë·®Ãø¸é¿¡¼´Â °ø°£À» Àû°Ô Â÷ÁöÇÏ´Â ÀåÁ¡ÀÌ ÀÖÁö¸¸,
Restore ÇÒ ¶§ ¼Óµµ°¡ ¶³¾îÁö´Â ´ÜÁ¡ÀÌ ÀÖ´Ù. (º¹±¸ ½Ã ¾ÐÃà Ǭ ÈÄ º¹±¸ ¼öÇàÇØ¾ß ÇÔ)
1) À̹ø ¹é¾÷ ¼öÇà ½Ã ¾ÐÃà ¹é¾÷ ¼öÇà
RMAN> BACKUP AS
COMPRESSED BACKUPSET DATABASE;
2) default ·Î ¾ÐÃà ¹é¾÷ ¼öÇà
RMAN> CONFIGURE BACKUP TYPE TO
COMPRESSED BACKUPSET;
5. Image Copy ¹é¾÷ ¼öÇà
. º¸Åë ±âº»ÀûÀ¸·Î backup set À¸·Î backup ±Ç°íµÊ. (default)
. ´Ü±â / ȤÀº configure ¼³Á¤ °¡´ÉÇÔ
1) ´Ü±âÀûÀ¸·Î image copy ¼öÇà
RMAN> backup as copy tablespace example;
-> [format] ¹é¾÷ À§Ä¡ ÁöÁ¤
-> [like] archive log file ÆÄÀÏ Çü½Ä
2) Tag ¼³Á¤ [Image copy]
. ÆÄÀÏ À̸§ÀÌ ÀÇ¹Ì ¾ø´Â ¹®ÀÚ ¿À̱⠶§¹®¿¡ ADMINÀÌ ÀÌÇØÇÒ ¼ö ÀÖ´Â ³í¸®ÀûÀÎ À̸§À» ºÙÀÌ´Â °Í
. ¹°¸®ÀûÀÎ À̸§À¸·Î´Â È®ÀÎ ºÒ°¡
. Meta Á¤º¸ Á¶È¸ ½Ã ¹°¸®ÀûÀÎ À̸§°ú ÇÔ²² Á¶È¸ °¡´ÉÇÔ
RMAN> BACKUP TAG 'month_full_backup' DATAFILE 1,2,3,4;
6. Archive Log File Backup
. Archive Backup ¼öÇ൵ RMANÀ» ÅëÇÏ¿© ¼öÇà °¡´ÉÇÔ
. ´ÜÀÏ ¹é¾÷ ȤÀº log sequence # ¸¦ ±âÁØÀ¸·Î ´ÙÁß ¹é¾÷ °¡´ÉÇÔ
RMAN> BACKUP FORMAT '/disk1/backup/ar_%t_%s_%p' ARCHIVELOG
FROM SEQUENCE=234 DELETE INPUT)
-- sequence : 234 ÀÌ»óÀÇ # ¸¦ °¡Áø backup file ¸¸ backup °¡´ÉÇÔ
-- delete input : ¹é¾÷ ¿Ï·á ÀÌÈÄ archive log file »èÁ¦
RMAN> backup database plus archivelog;
-- archive log ÆÄÀÏÀ» Æ÷ÇÔÇÑ Àüü DB ¹é¾÷ ¼öÇà
-- archive log file Àº ´Ù¸¥ Á¾·ùÀÇ ÆÄÀÏ°ú ¼¯¿©¼ ¹é¾÷ ÆÄÀÏ·Î ¸¸µé¾îÁú ¼ö ¾øÀ½
-- ¹é¾÷ °á°ú ¹° : DB ¹é¾÷ ÆÄÀÏ set + archive log ÆÄÀÏ set
7. Àüü Database + Archive Log file ¹é¾÷ ¼öÇà
RMAN> BACKUP DATABASE PLUS ARCHIVELOG;
-- RMANÀÌ Áö¿øÇØÁÙ ¼ö ÀÖ´Â ¸ðµç Data¿¡ ´ëÇؼ ¹é¾÷À» ¼öÇà
* Âü°í * Backup Type º° ºñ±³
. »óȲ : 100MBÂ¥¸® Datafile¿¡¼ 80MB ¸¸ »ç¿ëÇÏ°í ÀÖ´Â °æ¿ì
1) Image Copy : 1:1 file match°¡ µÇ¹Ç·Î 100MB ÆÄÀÏ ÅëÂ¥·Î cp
2) Backupset
- backup °á°ú 1°³ÀÇ ÆÄÀÏÀÌ »ý¼ºµÊ
- DB ¿¡¼´Â »ç¿ëÇÏ°í ÀÖ´Â °ø°£¿¡ ´ëÇؼ highwater marking À» ÇØ ³õ´Â´Ù.
- »ç¿ëµÈ °ø°£ ¸¸Å ±îÁö¸¸ Backup set¿¡ ±â·ÏÇÑ´Ù.
-> °ø°£ÀÇ È¿À²¼ºÀÌ ÁÁ´Ù
3) Compresed Backup
- ÆÄÀÏ Áß°£ Áß°£¿¡ »ç¿ëÇÏ°í ÀÖÁö ¾ÊÀº ºó ºí·°±îÁö Á¦¿ÜÇÏ¿© ¹é¾÷ ¼öÇà
- ºó ºí·°ÀÌ Â÷ÁöÇÏ°í ÀÖ´Â °ø°£¿¡ µû¶ó ¾ÐÃ൵°¡ ´Þ¶óÁø´Ù.
- º¹±¸ ½Ã ºó ºí·°ÀÇ À§Ä¡±îÁö ¿øº¹ Çϱ⠶§¹®¿¡ Restore ÇÒ °æ¿ì ¼Óµµ°¡ ¸¹ÀÌ ¶³¾îÁø´Ù.
Ãâó - http://l0vemode.tistory.com/145
2.rman¿¡¼ ¾ÆÄ«ÀÌºê »èÁ¦½Ã ¹®Á¦ÇØ°á ¹æ¹ý
archive¸¦ ¼öµ¿À¸·Î »èÁ¦¸¦ ÇϽô °ÍÀΰ¡¿ä?
¸¸¾à¿¡ ¼öµ¿À¸·Î »èÁ¦¸¦ ÇÏ°Ô µÇ¸é control¿¡ ÀÖ´Â rman Á¤º¸µé°ú physical
ÇÑ °÷¿¡ ÀÖ´Â archive fileÀÌ ´Ù¸£°Ú½À´Ï´Ù.
±×·¯¸é crosscheckÀ» ¼öÇàÇؼ physicalÇÑ °÷ÀÇ archive file°ú rmanÁ¤º¸¸¦
¸ÂÃß¾î¾ß ÇÕ´Ï´Ù.
RMAN>list archivelog all;
Á¤º¸·Î physical ÇÑ °÷ÀÇ archive¸¦ È®ÀÎÇÕ´Ï´Ù. ¸¸¾à ´Ù¸£´Ù¸é crosscheckÀ»
ÇÕ´Ï´Ù.
Å×½ºÆ®>
1. ¼öµ¿À¸·Î archive»èÁ¦
PROD@/data/archive2 $mv 1_172.arc ../archive
PROD@/data/archive2 $mv 1_171.arc ../archive
PROD@/data/archive2 $mv 1_170.arc ../archive
2. archive¹é¾÷ ½ÇÆÐ
PROD@/data/archive2 $rman target /
Recovery Manager: Release 9.2.0.7.0 - Production
Copyright (c) 1995, 2002, Oracle Corporation. All rights reserved.
connected to target database: PROD (DBID=13949627)
RMAN>
RMAN>
RMAN> backup archivelog all;
Starting backup at 14-NOV-06
current log archived
using target database controlfile instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=9 devtype=DISK
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of backup command at 11/14/2006 01:28:51
RMAN-06059: expected archived log not found, lost of archived log compromises recoverability
ORA-19625: error identifying file /data/archive/1_1.arc
ORA-27037: unable to obtain file status
Linux Error: 2: No such file or directory
Additional information: 3
3. list backup È®ÀÎ
RMAN> list archivelog all;
List of Archived Log Copies
Key Thrd Seq S Low Time Name
----
-
----
308 1 1 A 30-SEP-06 /data/archive/1_1.arc
309 1 2 A 30-SEP-06 /data/archive/1_2.arc
310 1 3 A 30-SEP-06 /data/archive/1_3.arc
311 1 4 A 30-SEP-06 /data/archive/1_4.arc
312 1 5 A 30-SEP-06 /data/archive/1_5.arc
313 1 6 A 30-SEP-06 /data/archive/1_6.arc
314 1 7 A 30-SEP-06 /data/archive/1_7.arc
315 1 8 A 30-SEP-06 /data/archive/1_8.arc
316 1 9 A 30-SEP-06 /data/archive/1_9.arc
317 1 10 A 30-SEP-06 /data/archive/1_10.arc
....
....
303 1 339 A 30-SEP-06 /data/archive/1_339.arc
304 1 340 A 30-SEP-06 /data/archive/1_340.arc
305 1 342 A 30-SEP-06 /data/archive/1_342.arc
306 1 343 A 30-SEP-06 /data/archive/1_343.arc
307 1 344 A 30-SEP-06 /data/archive/1_344.arc
RMAN>
4. crosscheck ¼öÇà
RMAN> crosscheck archivelog all;
released channel: ORA_DISK_1
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=9 devtype=DISK
validation failed for archived log
archive log filename=/data/archive/1_1.arc recid=308 stamp=602478075
validation failed for archived log
archive log filename=/data/archive/1_2.arc recid=309 stamp=602478078
validation failed for archived log
archive log filename=/data/archive/1_3.arc recid=310 stamp=602478079
validation failed for archived log
archive log filename=/data/archive/1_343.arc recid=306 stamp=602477610
validation failed for archived log
archive log filename=/data/archive/1_344.arc recid=307 stamp=602477825
Crosschecked 461 objects
5. list backup È®ÀÎ. »óŸ¸ x·Î ¹Ù²ñ
RMAN> list archivelog all;
List of Archived Log Copies
Key Thrd Seq S Low Time Name
----
-
----
308 1 1 X 30-SEP-06 /data/archive/1_1.arc
309 1 2 X 30-SEP-06 /data/archive/1_2.arc
310 1 3 X 30-SEP-06 /data/archive/1_3.arc
6. expire½ÃÅ´
RMAN> delete expired archivelog all;
released channel: ORA_DISK_1
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=9 devtype=DISK
List of Archived Log Copies
Key Thrd Seq S Low Time Name
----
-
----
308 1 1 X 30-SEP-06 /data/archive/1_1.arc
309 1 2 X 30-SEP-06 /data/archive/1_2.arc
310 1 3 X 30-SEP-06 /data/archive/1_3.arc
311 1 4 X 30-SEP-06 /data/archive/1_4.arc
312 1 5 X 30-SEP-06 /data/archive/1_5.arc
313 1 6 X 30-SEP-06 /data/archive/1_6.arc
314 1 7 X 30-SEP-06 /data/archive/1_7.arc
315 1 8 X 30-SEP-06 /data/archive/1_8.arc
....
Do you really want to delete the above objects (enter YES or NO)? yes
deleted archive log
archive log filename=/data/archive/1_1.arc recid=308 stamp=602478075
deleted archive log
archive log filename=/data/archive/1_2.arc recid=309 stamp=602478078
deleted archive log
archive log filename=/data/archive/1_3.arc recid=310 stamp=602478079
deleted archive log
archive log filename=/data/archive/1_4.arc recid=311 stamp=602478080
....
deleted archive log
archive log filename=/data/archive/1_343.arc recid=306 stamp=602477610
deleted archive log
archive log filename=/data/archive/1_344.arc recid=307 stamp=602477825
Deleted 457 EXPIRED objects
RMAN> list archivelog all;
List of Archived Log Copies
Key Thrd Seq S Low Time Name
----
-
----
477 1 170 A 14-NOV-06 /data/archive/1_170.arc
478 1 171 A 14-NOV-06 /data/archive/1_171.arc
479 1 172 A 14-NOV-06 /data/archive/1_172.arc
480 1 173 A 14-NOV-06 /data/archive/1_173.arc
7. backup Àç½Ãµµ Á¤»ó¿Ï·á
RMAN> backup archivelog all;
Starting backup at 14-NOV-06
current log archived
using channel ORA_DISK_1
channel ORA_DISK_1: starting archive log backupset
channel ORA_DISK_1: specifying archive log(s) in backup set
input archive log thread=1 sequence=170 recid=477 stamp=606443504
input archive log thread=1 sequence=171 recid=478 stamp=606443809
input archive log thread=1 sequence=172 recid=479 stamp=606446774
input archive log thread=1 sequence=173 recid=480 stamp=606446929
input archive log thread=1 sequence=174 recid=481 stamp=606447313
channel ORA_DISK_1: starting piece 1 at 14-NOV-06
channel ORA_DISK_1: finished piece 1 at 14-NOV-06
piece handle=/u/ora9i/product/9.2.0/dbs/02i2b9mh_1_1 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:02
Finished backup at 14-NOV-06
===================================================================================================================
10g RMAN¿¡¼´Â µû·Î catalog database°¡ ÇÊ¿ä ¾øÀÌ local control fileÀ» ÀÌ¿ëÇصµ
Å©°Ô ¹®Á¦°¡ ¹ß»ýÇÏÁö ¾Ê´Âµí ÇÏ´Ù.
[oracle@localhost ~] $ rman target /
# database¿¡ full backupÀ» ¼öÇàÇÑ´Ù.
RMAN> BACKUP AS COMPRESSED BACKUPSET INCREMENTAL LEVEL 0 DATABASE
2 TAG rman_db_full
3 FORMAT '/home/oracle/backup/%d.%T.%u.dbfull.rman';
# level 0 full backup ¼öÇàÀÌÈÄÀÇ ÁõºÐ¿¡ ´ëÇØ incremental backupÀ» ¼öÇàÇÑ´Ù.
RMAN> BACKUP AS COMPRESSED BACKUPSET INCREMENTAL LEVEL 1 DATABASE
2 TAG rman_db_inc
3 FORMAT '/home/oracle/backup/%d.%T.%u.dbinc.rman';
#### archive log¸¦ ¹é¾÷ÇÑ´Ù.
# ÇöÀçÀÇ redolog ÆÄÀÏÀ» ¾ÆÄ«À̺êÈ ½ÃŲ´Ù.
RMAN> SQL 'ALTER SYSTEM ARCHIVE LOG CURRENT';
# archive log¸¦ ¹é¾÷ÇÏ°í, ¿øº» archive log´Â »èÁ¦ÇÑ´Ù.
RMAN> BACKUP AS COMPRESSED BACKUPSET ARCHIVELOG ALL DELETE INPUT
2 TAG rman_arc
3 FORMAT '/home/oracle/backup/%d.%T.%u.arc.rman';
# ÄÁÆ®·Ñ ÆÄÀÏ ¹é¾÷.
# ÄÁÆ®·Ñ ÆÄÀÏÀÌ ¾ø´Ù¸é ÄÁÆ®·Ñ ÆÄÀÏ Àå¾Ö½Ã º¹±¸ ÇÒ ¼ö ¾øÀ» °ÍÀÌ´Ù.
RMAN> BACKUP AS COMPRESSED BACKUPSET CURRENT CONTROLFILE
2 TAG rman_ctl
3 FORMAT '/home/oracle/backup/%d.%T.%u.ctl.rman';
# °ú°Å ¹é¾÷º»Áß ¸¸·áµÈ ¹é¾÷º» »èÁ¦.
RMAN> DELETE NOPROMPT EXPIRED BACKUP;
RMAN> DELETE NOPROMPT EXPIRED COPY;
# °ú°Å ¹é¾÷º» Áß Áö±ÝÀÇ ¹é¾÷¿¡ ÀÇÇØ ÇÊ¿ä¾ø¾îÁø ¹é¾÷º» »èÁ¦.
RMAN> DELETE NOPROMPT OBSOLETE;
# ½ÇÁ¦ archivelog ¸ñ·Ï°ú DB»ó¿¡ ±â·ÏµÈ archivelog ¸ñ·ÏÀ» ºñ±³ °Ë»çÇÑ´Ù.
RMAN> CROSSCHECK ARCHIVELOG ALL;
# archivelog¸¦ »èÁ¦ÇÑ´Ù.
# NOPROMPT ¿É¼ÇÀÌ ÀÖÀ»°æ¿ì Y/N¸¦ ¹¯Áö ¾Ê´Â´Ù.
RMAN> DELETE [NOPROMPT] ARCHIVELOG ALL;
////////////////////////// Âü°í (¹é¾÷°á°ú È®ÀÎ) ////////////////////////////////////////
list backup summary;
list backupset;
list backup of controlfile;
///////////////////////////////////////////////////////////////////////////////////
|