½Ã³ª¸®¿À05 - ³ë¾ÆÄ«À̺ê¸ðµå¿¡¼­ÀÇ ¿ÏÀüº¹±¸
ÀÛ¼ºÀÚ °ü¸®ÀÚ ÀÛ¼º½Ã°£ 2003-06-13 15:36:59
 

Norachivelog mode¿¡¼­ÀÇ Complete Database Recovery ¼öÇà

1. Database ¸¦ Noarchivelog mode·Î ÀüȯÇÏ°í, ARCH process¸¦ ºñÈ°¼ºÇÏÀÚ.

$ svrmgrl
SVRMGR> connect internal
SVRMGR> shutdown immediate
SVRMGR> ! vi $HOME/dbs/initSID.ora
        --> log_archive_start¸¦ comment ó¸® ¶Ç´Â false·Î setting
SVRMGR> startup mount
SVRMGR> alter database noarchivelog ;
SVRMGR> alter database open ;
SVRMGR> archive log list

2. Full Closed Database Backup ¼öÇà( À̹ø¿¡´Â $HOME/BACKUP directory¿¡¸¸ copy)

SVRMGR> shutdown immediate ;
SVRMGR> host
$ cp -r $HOME/DATA/* $HOME/BACKUP
$ exit
SVRMGR> startup

3. sqlplus¿¡ scott/tiger·Î loginÇؼ­ ´ÙÀ½À» ¼öÇà

$ sqlplus scott/tiger
SQL> @ newemp.sql
SQL> connect system/manager
SQL> select f.file_name from dba_tables t, dba_data_files f
  2  where table_name='NEWEMP'
  3  and t.tablespace_name = f.tablespace_name ;
    --> newemp tableÀÌ ¾î¶² datafile¿¡ µé¾î ÀÖ´ÂÁö¸¦ È®ÀÎ
    --> $HOME/DATA/DISK2/user01.dbf¿¡ newemp tableÀÌ ¼ÓÇØ ÀÖÀ½.
   
4. failure¸¦ ¹ß»ý½ÃÅ°°í, database startup ¼öÇà

SQL> show user
    --> sys ¶Ç´Â system userÀÎÁö È®ÀÎÇÑ´Ù. ¸¸ÀÏ ¾Æ´Ï¶ó¸é...
        connect system/manager¸¦ ¼öÇà
SQL> @ breakdb.sql
$ svrmgrl
SVRMGR> connect internal ;
SVRMGR> startup
    --> $HOME/DATA/DISK2/user01.dbf fileÀÌ ¾øÀ¸¹Ç·Î openÀ» ÇÒ ¼ö ¾ø°í, database´Â mount »óÅÂÀÓ
   
5. Recovery ¼öÇà ÈÄ, database ±âµ¿

SVRMGR> connect / as sysdba
SVRMGR> shutdown abort ;
SVRMGR> ! cp -r $HOME/BACKUP/D* $HOME/DATA
SVRMGR> startup

6. sqlplus¿¡ scott/tiger·Î login Çؼ­ newemp tableÀ» query ÇØ º¸¶ó.

$ sqlplus scott/tiger
SQL> select * from newemp ;
    --> ¾î¶² °á°ú°¡ ³ªÅ¸³ª´Â°¡? ¶Ç, ±× ÀÌÀ¯´Â?
SVRMGR> shutdown immediate ;


¸ñ·Ï | ÀÔ·Â | ¼öÁ¤ | ´äº¯ | »èÁ¦