¿ÏÀüÇÑ µ¥ÀÌÅÍ º¹±¸´Â DBA »ý¸íÀÔ´Ï´Ù.
No. 12077
PURPOSE
-------
»ç¿ëÀÚÀÇ ½Ç¼ö·Î Áß¿äÇÑ µ¥ÀÌŸ¸¦ delete ÇÏ¿´°Å³ª, Å×À̺íÀ» dropÇÏ¿´À»
°æ¿ì º¹±¸ÇÏ´Â ÀýÂ÷¸¦ Á¤¸®ÇÑ ÀÚ·áÀÌ´Ù.
Explanation
-----------
»ç¿ë ÁßÀÎ database ÀÇ archive log mode ¿©ºÎ¸¦ ´ÙÀ½°ú °°ÀÌ È®ÀÎ ÈÄ
archive log modeÀÎÁö ¾Æ´ÑÁö¿¡ µû¶ó º¹±¸ ¹æ¹ýÀÌ ´Þ¶óÁø´Ù.
os>svrmgrl
SVRMGR> connect internal;
SVRMGR> archive log list
Database log mode ARCHIVELOG
Automatic archival ENABLED
Archive destination ?/dbs/arch
Oldest online log sequence 2525
Current log sequence 2527
1. Archive modeÀÎ °æ¿ì º¹±¸ ¹æ¹ý
archive log mode·Î ¿î¿µÁßÀÌ¸é¼ full backup¹× archive fileµéÀÌ ¸ðµÎ
Á¸ÀçÇÏ´Â °æ¿ì º¹±¸°¡ Ç×»ó °¡´ÉÇÏ´Ù.
À̶§ ´Ù½Ã ´ÙÀ½°ú °°ÀÌ µÎ°¡ÁöÀÇ °æ¿ì¸¦ ±¸ºÐÇÏ¿© º¹±¸ ÀÛ¾÷À» ¼öÇàÇÒ ÇÊ¿ä°¡
ÀÖÀ¸¸ç ¾Æ·¡¿¡ °¢°¢ÀÇ °æ¿ì¿¡ ´ëÇÑ ÀýÂ÷¸¦ ÀÚ¼¼È÷ ¼³¸íÇÑ´Ù.
(1) dropÀ̳ª deleteÇÑ ½ÃÁ¡ÀÌ ¾ó¸¶ Áö³ªÁö ¾Ê¾Ò°Å³ª, ȤÀº ÇÊ¿ä¿¡ ÀÇÇØ
database Àüü¸¦ data ¼Õ½Ç ÀÌÀü ½ÃÁ¡À¸·Î µ¹¸®°íÀÚ ÇÏ´Â °æ¿ì
(2) ¼Õ½ÇµÈ data¸¸À» dropÀ̳ª deleteÀÌÀü »óŸ¦ ¹Þ¾Æ³»°í, ³ª¸ÓÁö data´Â
¸ðµÎ drop/deleteÀÌÈÄ ¹ß»ýÇÑ transactionÀÇ ¹Ý¿µºÐÀ» À¯Áö½ÃÅ°±â À§ÇØ
ÇöÀç ½ÃÁ¡À¸·Î ¸ÂÃß¾îÇá ÇÏ´Â °æ¿ì
1-1 database Àüü¸¦ dropÀ̳ª delete ÀÌÀü½ÃÁ¡À¸·Î µ¹¸®°íÀÚ ÇÒ ¶§
ÀÌ·¯ÇÑ °æ¿ì´Â µ¥ÀÌŸ ¼Õ½ÇÀÌ ¹ß»ýÇϱâ ÀÌÀüÀÇ datafileµé¿¡ ´ëÇÑ backupÀ»
restoreÇÑ ÈÄ ¼Õ½Ç ¹ß»ý ½ÃÁ¡ Á÷Àü±îÁö time based·Î imcomplete recovery¸¦
¼öÇàÇÏ¸é µÈ´Ù.
(1) db¸¦ shutdown½ÃŲ ÈÄ ÇöÀç »óŸ¦ ¸¸¾àÀÇ °æ¿ì¸¦ ´ëºñÇÏ¿© cold
backupÀ» ¹Þ¾ÆµÐ´Ù.
shutdown immediate·Î db¸¦ ³»¸®°í, datafiles, redo log files, control
files ¸ðµÎ tarµîÀÇ ¸í·É¾î¸¦ ÀÌ¿ëÇÏ¿© backupÀ» ¹Þ¾ÆµÐ´Ù.
ÀÌ°ÍÀº ¸¸¾àÀÇ °æ¿ì ÀÌÀü backupÀ̳ª archive file¿¡ ¹®Á¦°¡ ÀÖ´Â °æ¿ì,
»èÁ¦µÈ dataÀÇ º¹±¸°¡ ºÒ°¡´ÉÇÒ °æ¿ì ÇöÀç »óÅÂ·Î¶óµµ µ¹¸®±â À§ÇÑ
°ÍÀÌ´Ù.
(2) µ¥ÀÌŸ¸¦ »èÁ¦Çϱâ ÀÌÀü »óÅ¿¡¼ ¹Þ¾ÆµÐ datafile full backupÀ»
restoreÇÑ´Ù.
redo log files°ú controlfilesÀº ÇöÀç °ÍÀ» ±×´ë·Î ÀÌ¿ëÇÏ°í, ÇöÀç
»óÅÂÀÇ ¸ðµç datafilesÀ» Áö¿ì°í µ¥ÀÌŸ°¡ »èÁ¦µÇ±â Àü¿¡ ¹Þ¾ÆµÐ
backup datafileÀ» restore½ÃŲ´Ù.
(temp datafileÀÇ °æ¿ì´Â restore½Ã°£À» ÁÙÀ̱â À§ÇØ restoreÇÏÁö
¾Ê¾ÆµµµÈ´Ù.)
(3) restoreÇÑ backup½ÃÁ¡ ÀÌÈÄÀÇ archive fileµéÀ» archive log
destination¿¡ À§Ä¡½ÃŲ´Ù.
full backup ÀÌÈÄÀÇ archive fileµéÀ» ÀϺΠtape Àåºñµî¿¡ backupÀ»
¹Þ¾ÆµÎ°í Áö¿î »óŶó¸é ±×·¯ÇÑ fileÀ»À» ´Ù½Ã ¿ø·¡ À§Ä¡¿¡ restore
ÇÏ¿©, full backup¹ÞÀº ½ÃÁ¡ºÎÅÍ º¹±¸ÇÏ°íÀÚ ÇÏ´Â ½ÃÁ¡±îÁöÀÇ
archive log fileµéÀÌ ¸ðµÎ log archive destination¿¡ Á¸ÀçÇÏ´ÂÁö
È®ÀÎÇÑ´Ù.
(4) µ¥ÀÌŸ »èÁ¦ ÀÌÀü ½ÃÁ¡±îÁö time based·Î recover¸¦ ¼öÇàÇÑ´Ù.
À̶§ ³¯Â¥¿Í ½Ã°£ ÁöÁ¤Àº Ç×»ó ¾Æ·¡ ¿¹¿Í °°Àº Çü½ÄÀ¸·Î ÁöÁ¤ÇÑ´Ù.
¸¸¾à µ¥ÀÌŸ¸¦ »èÁ¦ÇÑ ½Ã°£ÀÌÈÄ·Î ÁöÁ¤ÇÏ°Ô µÇ¸é recoveryÈÄ¿¡µµ
¿©ÀüÈ÷ data´Â Áö¿öÁø »óÅ·Πº¸¿©Áø´Ù.
os>svrmgrl
SVRMGR> connect internal
SVRMGR> startup mount;
SVRMGR> set autorecovery on
SVRMGR> recover database until time '2001-01-30:21:00:00';
SVRMGR> alter database open resetlogs;
(a) ¸¸¾à À̶§, controlfileÀÌ ÇöÀç°ÍÀÌ Á¸ÀçÇÏÁö ¾Ê¾Æ datafile»Ó
¾Æ´Ï¶ó, controlfileµµ °ú°Å°ÍÀ» »ç¿ëÇß´Ù¸é, recovery command¸¦
´ÙÀ½°ú °°ÀÌ ÁöÁ¤ÇÏ¸é µÈ´Ù.
recover database using backup controlfile (¾Æ·¡ÁÙ°ú À̾îÁü)
until time '2001-01-30:21:00:00';
(b) temp datafileÀ» restoreÇÏÁö ¾ÊÀº °æ¿ì¶ó¸é startup mount¼öÇà
Á÷ÈÄ ´ÙÀ½°ú °°Àº ¹®ÀåÀ» Ãß°¡ÇÏ¸é µÈ´Ù.
alter databse datafile '/oracle/oradata/temp01.dbf'
offline drop;
/oracle/oradata/temp01.dbf´Â temp datafileÀÇ À̸§À» ¿¹·Î µç
°ÍÀÌ´Ù.
(5) ¿øÇÏ´Â data°¡ Á¦´ë·Î Á¶È¸µÇ´ÂÁö È®ÀÎÇÑ´Ù.
1-2. »èÁ¦µÈ data¸¸À» º¹±¸ÇÏ°í ³ª¸ÓÁö´Â ÇöÀç »óŸ¦ À¯ÁöÇÏ°íÀÚ ÇÏ´Â °æ¿ì
ÀÌ·¯ÇÑ °æ¿ì´Â µ¥ÀÌŸ°¡ »èÁ¦µÇ±â ÀÌÀü »óÅÂÀÇ backup datafile Áß¿¡
SYSTEM, RBS¿Í »èÁ¦µÈ data°¡ µé¾îÀÖ´Â datafile¸¸À» restore½ÃÄÑ time
based·Î recoveryÇÏ¿© db¸¦ open½ÃŲ ÈÄ ¿øÇÏ´Â table¸¸ export¸¦ ¹Þ¾Æ³½´Ù.
±×¸®°í ´Ù½Ã ÇöÀç »óÅÂÀÇ db¿¡ export¹ÞÀº ³»¿ëÀ» import½ÃÅ°´Â °ÍÀÌ´Ù.
À̶§ »èÁ¦µÈ data¸¦ export¹Þ±â±îÁöÀÇ ÀýÂ÷¿¡ ´ëÇؼ ´ÙÀ½°ú °°ÀÌ ¼¼°¡Áö
°æ¿ìÀÇ ¹æ¹ýÀ» »ý°¢ÇÒ ¼ö ÀÖ´Ù.
(a) ´Ù¸¥ ½Ã½ºÅÛ¿¡ backupÀ̳ª test¿ëÀ¸·Î oracleÀÌ ¼³Ä¡µÇ¾î ÀÖ´Â °æ¿ì
±× ½Ã½ºÅÛ¿¡ backupÀ» restoreÇÏ¿© ÇØ´ç tableÀ» export ¹Þ´Â ¹æ¹ý
(b) °°Àº ½Ã½ºÅÛ¿¡ backupÀ» restore ÇϵÇ, db name°ú oracle_sid¸¦ ´Ù¸¥
À̸§À¸·Î º¯°æÇÏ¿© ´Ù¸¥ db¸¦ ¸¸µé¾î recoveryÈÄ openÇÏ¿© export¹Þ´Â
¹æ¹ý <Bulletin:11616 ÂüÁ¶>
(c) ÇöÀç db´Â cold backup¹Þ¾Æ µÎ°í, backupÀ» restoreÇÏ¿© exportÀ»
¹Þ¾Æ³»´Â ¹æ¹ý
¿©±â¿¡¼ (a)ÀÇ °æ¿ì´Â ´Ù¸¥ ½Ã½ºÅÛ¿¡ ÀÌ¿ëÇÏ°íÀÚ ÇÏ´Â datafileÀÇ oracle
version ÀÌ»óÀÇ oracle software°¡ ÀÌ¹Ì ¼³Ä¡µÇ¾î ÀÖ¾î¾ß ÇÑ´Ù.
(b)ÀÇ °æ¿ì´Â ÇöÀç »óÅÂÀÇ cold backupÀ» ¹Þ¾Ò´Ù°¡ export¹ÞÀº ÈÄ ´Ù½Ã
ÇöÀç »óŸ¦ restoreÇÒ ÇÊ¿ä´Â ¾ø¾ÖÁÖÁö¸¸, ´ë½Å SYSTEM, RBS, user
datafile ¸¸ÅÀÇ disk space°¡ Ãß°¡·Î ÇÊ¿äÇϸç, »õ·Î¿î db¸¦ Ãß°¡·Î
±¸¼ºÇÏ´Â °ÍÀ̹ǷΠinit.ora file ±¸¼º µîÀÇ ÀÛ¾÷ÀÌ ÇÊ¿äÇÏ´Ù.
ÀÌ°Í¿¡ °üÇÑ ÀÚ¼¼ÇÑ ÀýÂ÷´Â <Bulletin:11616>À» ÂüÁ¶Çϵµ·Ï ÇÑ´Ù.
ÀÌ ÀÚ·á¿¡¼´Â ÀÌÁß (c)¿¡ ´ëÇÑ °Í¸¸À» ÀÚ¼¼È÷ ¼³¸íÇÑ´Ù.
(1) ÇöÀçÀÇ ¸ðµç datafiles°ú redo log files, control filesÀ» ´ÙÀ½°ú °°ÀÌ
½ÅÁßÈ÷ cold backupÀ» ¹Þ¾ÆµÎµµ·Ï ÇÑ´Ù.
ÀÌ°ÍÀº ÀÌÈÄ¿¡ »èÁ¦ÇÑ data¸¦ º¹±¸ÇÏ¿© export¸¦ ¹ÞÀº ÈÄ¿¡ ´Ù½Ã ÇöÀç
»óÅÂÀÇ db·Î µÇµ¹¾Æ¿À±â À§ÇÑ °ÍÀÌ´Ù.
´Ü ÀÌ ¶§ tar µîÀ» ÀÌ¿ëÇÏ¿© cold backupÇÏ´Â ´ë½Å¿¡ disk »ó¿¡ cold
backupÀ» ¹Þ¾Æ ½Ã°£À» Àý¾àÇÒ ¼ö ÀÖ´Ù. disk·ÎÀÇ backupÀÌ °¡´ÉÇÑ
ÀÌÀ¯´Â export¸¦ À§ÇÑ time based recovery¸¦ ¼öÇàÇϱâ À§ÇØ ÇÊ¿äÇÑ
datafileÀÌ SYSTEM, RBS, »èÁ¦µÈ data¸¦ Æ÷ÇÔÇÑ user datafile
Á¤µµÀ̱⠶§¹®ÀÌ´Ù.
os>svrmgrl
SVRMGR> connect internal
SVRMGR> shutdown immediate;
SVRMGR> exit
os>cp /oracle/oradata/*.ctl /oracle/backup/*.ctl
os>cp /oracle/oradata/redo*.log /oracle/backup/redo*.log
os>mv /oracle/oradata/system01.dbf /oracle/backup/system01.bak
os>mv /oracle/oradata/rbs01.dbf /oracle/backup/rbs01.bak
os>mv /oracle/oradata/tools01.dbf /oracle/backup/tools01.bak
...
redo log fileÀ̳ª controlfileÀÇ °æ¿ì´Â time based recovery½Ã¿¡µµ
ÇÊ¿äÇϹǷΠcp¸¦ ¹Þ¾ÆµÎ°í, datafileÀÇ °æ¿ì´Â mv¸¦ ÀÌ¿ëÇϵµ·Ï ÇÑ´Ù.
À§ÀÇ ¿¹¿¡ Á¦½ÃµÈ fileÀ̸§µéÀº ÇØ´ç ȯ°æ¿¡ ¸Â°Ô º¯°æµÇ¾î¾ß Çϸç,
tar¸¦ ÀÌ¿ëÇÏ¿© tape¿¡ ¿Å°Üµµ °ü°è´Â ¾øÀ¸³ª, ´Ü cold backup¿¡
ÇØ´çÇÏ´Â ¸ðµç datafiles, redo log files, control files¸¦ ¹Þ¾ÆµÎ¾î¾ß
ÇÑ´Ù.
(2) »èÁ¦ÇÑ data°¡ Á¸ÀçÇÒ ´ç½Ã¿¡ ¹Þ¾ÆµÐ backup¿¡¼ SYSTEM datafile, RBS
datafile, ±×¸®°í »èÁ¦ÇÑ tableÀÌ µé¾îÀÖ´Â datafile¸¸À» restoreÇÑ´Ù.
redo log files°ú controlfilesÀº ÇöÀç °ÍÀ» ±×´ë·Î ÀÌ¿ëÇÑ´Ù.
(3) restoreÇÑ backup½ÃÁ¡ ÀÌÈÄÀÇ archive fileµéÀ» archive log
destination¿¡ À§Ä¡½ÃŲ´Ù.
full backup ÀÌÈÄÀÇ archive fileµéÀ» ÀϺΠtape Àåºñ µî¿¡ backupÀ»
¹Þ¾ÆµÎ°í Áö¿î »óŶó¸é ±×·¯ÇÑ fileÀ»À» ´Ù½Ã ¿ø·¡ À§Ä¡¿¡ restore
ÇÏ¿©, full backup¹ÞÀº ½ÃÁ¡ºÎÅÍ º¹±¸ÇÏ°íÀÚ ÇÏ´Â ½ÃÁ¡±îÁöÀÇ
archive log fileµéÀÌ ¸ðµÎ log archive destination¿¡ Á¸ÀçÇÏ´ÂÁö
È®ÀÎÇÑ´Ù.
(4) restoreÇÏÁö ¾ÊÀ» datafile, Áï SYSTEM, RBS, »èÁ¦µÈ data¸¦ Æ÷ÇÔÇÏ
´Â user datafileÀ» Á¦¿ÜÇÑ ¸ðµç datafileÀº ¸ðµÎ offline drop½ÃÅ°
°í, µ¥ÀÌŸ »èÁ¦ ÀÌÀü ½ÃÁ¡±îÁö time based·Î recover¸¦ ¼öÇàÇÑ´Ù.
À̶§ ³¯Â¥¿Í ½Ã°£ ÁöÁ¤Àº Ç×»ó ¾Æ·¡ ¿¹¿Í °°Àº Çü½ÄÀ¸·Î ÁöÁ¤ÇÑ´Ù.
¸¸¾à µ¥ÀÌŸ¸¦ »èÁ¦ÇÑ ½Ã°£ÀÌÈÄ·Î ÁöÁ¤ÇÏ°Ô µÇ¸é recoveryÈÄ¿¡µµ
¿©ÀüÈ÷ data´Â Áö¿öÁø »óÅ·Πº¸¿©Áø´Ù.
os>svrmgrl
SVRMGR> connect internal
SVRMGR> startup mount;
SVRMGR> alter database datafile '/oracle/oradata/temp01.dbf'
offline drop; (ÀÁÙ°ú À̾îÁü)
SVRMGR> alter database datafile '/oracle/oradata/userdata05.dbf'
offline drop; (ÀÁÙ°ú À̾îÁü)
... ÀÌ¿Í °°ÀÌ resotreÇÏÁö ¾ÊÀº datafileÀ» ¸ðµÎ offline drop½ÃŲ´Ù.
SVRMGR> set autorecovery on
SVRMGR> recover database until time '2001-01-30:21:00:00';
SVRMGR> alter database open resetlogs;
¸¸¾à À̶§, controlfileÀÌ ÇöÀç°ÍÀÌ Á¸ÀçÇÏÁö ¾Ê¾Æ datafile»Ó ¾Æ´Ï¶ó,
controlfileµµ °ú°Å°ÍÀ» »ç¿ëÇß´Ù¸é, recovery command¸¦ ´ÙÀ½°ú °°ÀÌ
ÁöÁ¤ÇÏ¸é µÈ´Ù.
SVRMGR>recover database using backup controlfile until time
'2001-01-30:21:00:00'; (ÀÁÙ°ú À̾îÁü)
(5) ¿øÇÏ´Â data°¡ Á¦´ë·Î Á¶È¸µÇ´ÂÁö È®ÀÎÇÑ ÈÄ ÇÊ¿äÇÑ tableÀ» exportÇÑ´Ù.
¿¹¸¦ µé¾î scott userÀÇ dept tableÀ» º¹±¸ÇÏ°íÀÚ ÇÑ°ÍÀ̾ú´Ù¸é ´ÙÀ½°ú
°°ÀÌ export¸¦ ¹Þ´Â´Ù.
os>exp scott/tiger file=dept.dmp tables=dept log=deptlog1
(6) time based·Î recoveryÈÄ openÇÑ db´Â shutdownÇÏ¿© ¾ø¾Ö°í (1)¹ø¿¡¼
¹Þ¾ÆµÐ ÇöÀç »óÅÂÀÇ backupÀ» restoreÇÑ´Ù.
shutdownÀº immediate³ª abort ¸ðµÎ °¡´ÉÇϸç, shutdownÈÄ restoreÇÑ
SYSTEM, RBS, user datafile¸ðµÎ »èÁ¦ÇÏ°í, »ç¿ëÇÏ´ø controlfiles,
redo log filesµµ ¸ðµÎ »èÁ¦ÇÑ´Ù.
±×¸®°í (1)¿¡¼ mv³ª cp·Î (ȤÀº tar·Î) ¿Å°Ü³õÀº ¸ðµç datafiles,
controlfiles, redo log files¸¦ ¿ø·¡ÀÇ directory¿Í À̸§À¸·Î
À§Ä¡½ÃŲ´Ù. SYSTEM, RBS, user datafileµµ ¹Ýµå½Ã (1)¹ø »óÅÂÀÇ
ÇöÀç »óÅ backupÀ» restoreÇÏ¿©¾ß ÇÑ´Ù.
(7) db¸¦ startup½ÃŲ ÈÄ (5)¿¡¼ ¹ÞÀº export³»¿ëÀ» import½ÃŲ´Ù.
os>imp scott/tiger file=dept.dmp tables=dept ignore=y commit=y
log=deptlog2 (ÀÁÙ°ú À̾îÁü)
(8) ¿øÇÏ´Â data°¡ Á¦´ë·Î Á¶È¸µÇ´ÂÁö È®ÀÎÇÑ´Ù.
2. No archive mode ·Î ¿î¿µÇÒ °æ¿ì º¹±¸ ¹æ¹ý
archive mode ·Î ¿î¿µÇÏÁö ¾Ê¾ÒÀ» °æ¿ì¿¡´Â, »èÁ¦ÇÑ data¸¦ export ¹Þ¾Æ
µÎ¾ú°Å³ª, ȤÀº data°¡ »èÁ¦ Àü ¹Þ¾ÆµÐ cold backupÀÌ Á¸ÀçÇÏ´Â °æ¿ì
º¹±¸°¡ °¡´ÉÇÏ´Ù.
(1) export°¡ Á¸ÀçÇÏ´Â °æ¿ì
´ÙÀ½°ú °°ÀÌ importÇÑ´Ù. scott userÀÇ dept°¡ »èÁ¦µÈ °æ¿ì¸¦ ¿¹·Î µé¾ú´Ù.
os>imp scott/tiger file=dept.dmp tables=dept ignore=y commit=y log=log1
(2) cold backupÀÌ Á¸ÀçÇÏ´Â °æ¿ì
´Ù¸¥ ½Ã½ºÅÛ¿¡ »ç¿ë°¡´ÉÇÑ oracle engineÀÌ ¼³Ä¡µÇ¾î ÀÖ´Ù¸é, ±×°÷À»
ÀÌ¿ëÇϰųª, ȤÀº ÇöÀç database¸¦ backup¹Þ¾ÆµÐÈÄ ÇöÀç ½Ã½ºÅÛ¿¡
restoreÇÏ¿© export¸¦ ¹Þ¾Æ³¾ ¼ö ÀÖ´Ù.
(1) ÇöÀçÀÇ ¸ðµç datafiles°ú redo log files, datafilesÀ» ´ÙÀ½°ú °°ÀÌ
½ÅÁßÈ÷ cold backupÀ» ¹Þ¾ÆµÎµµ·Ï ÇÑ´Ù.
ÀÌ°ÍÀº ÀÌÈÄ¿¡ »èÁ¦ÇÑ data¸¦ º¹±¸ÇÏ¿© export¸¦ ¹ÞÀº ÈÄ¿¡ ´Ù½Ã ÇöÀç
»óÅÂÀÇ db·Î µÇµ¹¾Æ¿À±â À§ÇÑ °ÍÀÌ´Ù.
´Ü ÀÌ ¶§ tar µîÀ» ÀÌ¿ëÇÏ¿© cold backupÇÏ´Â ´ë½Å¿¡ disk »ó¿¡ cold
backupÀ» ¹Þ¾Æ ½Ã°£À» Àý¾àÇÒ ¼ö ÀÖ´Ù. disk·ÎÀÇ backupÀÌ °¡´ÉÇÑ
ÀÌÀ¯´Â export¸¦ À§ÇÑ time based recovery¸¦ ¼öÇàÇϱâ À§ÇØ ÇÊ¿äÇÑ
datafileÀÌ SYSTEM, RBS, »èÁ¦µÈ data¸¦ Æ÷ÇÔÇÑ user datafile
Á¤µµÀ̱⠶§¹®ÀÌ´Ù.
os>svrmgrl
SVRMGR> connect internal
SVRMGR> shutdown immediate;
SVRMGR> exit
os>mv /oracle/oradata/*.ctl /oracle/backup/*.ctl
os>mv /oracle/oradata/redo*.log /oracle/backup/redo*.log
os>mv /oracle/oradata/system01.dbf /oracle/backup/system01.bak
os>mv /oracle/oradata/rbs01.dbf /oracle/backup/rbs01.bak
os>mv /oracle/oradata/tools01.dbf /oracle/backup/tools01.bak
...
À§ÀÇ ¿¹¿¡ Á¦½ÃµÈ fileÀ̸§µéÀº ÇØ´ç ȯ°æ¿¡ ¸Â°Ô º¯°æµÇ¾î¾ß Çϸç,
tar¸¦ ÀÌ¿ëÇÏ¿© tape¿¡ ¿Å°Üµµ °ü°è´Â ¾øÀ¸³ª, ´Ü cold backup¿¡
ÇØ´çÇÏ´Â ¸ðµç datafiles, redo log files, control files¸¦ ¹Þ¾ÆµÎ¾î¾ß
ÇÑ´Ù.
(2) »èÁ¦ÇÑ data°¡ Á¸ÀçÇÒ ´ç½Ã¿¡ ¹Þ¾ÆµÐ backup¿¡¼ SYSTEM datafile,
RBS datafile, ±×¸®°í »èÁ¦ÇÑ tableÀÌ µé¾îÀÖ´Â datafile¸¸À»
restoreÇÑ´Ù.
backup´ç½ÃÀÇ redo log files°ú controlfilesµµ restoreÇÏ¿©¾ß ÇÑ´Ù.
(3) restoreÇÏÁö datafile, Áï SYSTEM, RBS, »èÁ¦µÈ data¸¦ Æ÷ÇÔÇÏ´Â user
datafileÀ» Á¦¿ÜÇÑ ¸ðµç datafileÀº ¸ðµÎ offline drop½ÃÅ°°í,
database¸¦ open½ÃŲ´Ù.
os>svrmgrl
SVRMGR> connect internal
SVRMGR> startup mount;
SVRMGR> alter database datafile '/oracle/oradata/temp01.dbf'
offline drop; (ÀÁÙ°ú À̾îÁü)
SVRMGR> alter database datafile '/oracle/oradata/userdata05.dbf'
offline drop; (ÀÁÙ°ú À̾îÁü)
... ÀÌ¿Í °°ÀÌ resotreÇÏÁö ¾ÊÀº datafileÀ» ¸ðµÎ offline drop½ÃŲ´Ù.
SVRMGR> alter database open;
(4) ¿øÇÏ´Â data°¡ Á¦´ë·Î Á¶È¸µÇ´ÂÁö È®ÀÎÇÑ ÈÄ ÇÊ¿äÇÑ tableÀ» export
ÇÑ´Ù.
¿¹¸¦ µé¾î scott userÀÇ dept tableÀ» º¹±¸ÇÏ°íÀÚ ÇÑ °ÍÀ̾ú´Ù¸é
´ÙÀ½°ú °°ÀÌ export¸¦ ¹Þ´Â´Ù.
os>exp scott/tiger file=dept.dmp tables=dept log=deptlog1
(5) exprot¹Þ¾Æ³½ database´Â shutdownÇÏ¿© ¾ø¾Ö°í (1)¹ø¿¡¼ ¹Þ¾ÆµÐ
ÇöÀç »óÅÂÀÇ backupÀ» restoreÇÑ´Ù.
shutdownÀº immediate³ª abort ¸ðµÎ °¡´ÉÇϸç, shutdownÈÄ restoreÇÑ
SYSTEM, RBS, user datafile¸ðµÎ »èÁ¦ÇÏ°í, »ç¿ëÇÏ´ø controlfiles,
redo log filesµµ ¸ðµÎ »èÁ¦ÇÑ´Ù.
±×¸®°í (1)¿¡¼ mv³ª tar·Î ¿Å°Ü³õÀº ¸ðµç datafiles, controlfiles,
redo log files¸¦ ¿ø·¡ÀÇ directory¿Í À̸§À¸·Î À§Ä¡½ÃŲ´Ù.
(6) db¸¦ startup½ÃŲ ÈÄ (4)¿¡¼ ¹ÞÀº export³»¿ëÀ» import½ÃŲ´Ù.
os>imp scott/tiger file=dept.dmp tables=dept ignore=y commit=y
log=deptlog2 (ÀÁÙ°ú À̾îÁü)
(7) ¿øÇÏ´Â data°¡ Á¦´ë·Î Á¶È¸µÇ´ÂÁö È®ÀÎÇÑ´Ù.
|