ºìÁªLinuxÃÅ»§
Linux°ïÖú

Oracle9i RMAN±¸·Ý¼°»Ö¸´²½Öè

·¢²¼Ê±¼ä:2006-09-03 12:44:39À´Ô´:ºìÁª×÷Õß:cxtt228
¡¡¡¡ÔÚÕâÀïûÓÐÌÖÂÛ¶àôÉîÈëµÄRMAN¼¼Êõ£¬Ò²Ã»ÓиæËß´ó¼ÒÕâÑùÈ¥±àд±¸·Ý½Å±¾£¬Õâ²¢²»ÊÇÎҵijõÖÔ£¬ÎÒÖ»Ïë°ÑÎÒ»áµÄд³öÀ´£¬ºÍ´ó¼ÒÒ»Æðѧϰ£¬Ò»Æð½ø²½£¬Ð»Ð»¡£

1¡¢Çл»·þÎñÆ÷¹éµµÄ£Ê½£¬Èç¹ûÒѾ­Êǹ鵵ģʽ¿ÉÌø¹ý´Ë²½£º

%sqlplus /nolog £¨Æô¶¯sqlplus£©

SQL> conn / as sysdba £¨ÒÔDBAÉí·ÝÁ¬½ÓÊý¾Ý¿â£©

SQL> shutdown immediate£» £¨Á¢¼´¹Ø±ÕÊý¾Ý¿â£©

SQL> startup mount £¨Æô¶¯ÊµÀý²¢¼ÓÔØÊý¾Ý¿â£¬µ«²»´ò¿ª£©

SQL> alter database archivelog£» £¨¸ü¸ÄÊý¾Ý¿âΪ¹éµµÄ£Ê½£©

SQL> alter database open£» £¨´ò¿ªÊý¾Ý¿â£©

SQL> alter system archive log start£» £¨ÆôÓÃ×Ô¶¯¹éµµ£©

SQL> exit £¨Í˳ö£©

2¡¢Á¬½Ó£º

%rman target=rman/rman@mydb £¨Æô¶¯»Ö¸´¹ÜÀíÆ÷£©

3¡¢»ù±¾ÉèÖãº

RMAN> configure default device type to disk£» £¨ÉèÖÃĬÈϵı¸·ÝÉ豸Ϊ´ÅÅÌ£©

RMAN> configure device type disk parallelism 2£» £¨ÉèÖñ¸·ÝµÄ²¢Ð춱ð£¬Í¨µÀÊý£©

RMAN> configure channel 1 device type disk fromat '/backup1/backup_%U'£» £¨ÉèÖñ¸·ÝµÄÎļþ¸ñʽ£¬Ö»ÊÊÓÃÓÚ´ÅÅÌÉ豸£©

RMAN> configure channel 2 device type disk fromat '/backup2/backup_%U'£» £¨ÉèÖñ¸·ÝµÄÎļþ¸ñʽ£¬Ö»ÊÊÓÃÓÚ´ÅÅÌÉ豸£©

RMAN> configure controlfile autobackup on£» £¨´ò¿ª¿ØÖÆÎļþÓë·þÎñÆ÷²ÎÊýÎļþµÄ×Ô¶¯±¸·Ý£©

RMAN> configure controlfile autobackup format for device type disk to '/backup1/ctl_%F'£» £¨ÉèÖÿØÖÆÎļþÓë·þÎñÆ÷²ÎÊýÎļþ×Ô¶¯±¸·ÝµÄÎļþ¸ñʽ£©

4¡¢²é¿´ËùÓÐÉèÖãº

RMAN> show all

5¡¢²é¿´Êý¾Ý¿â·½°¸±¨±í£º

RMAN> report schema£»

6¡¢±¸·ÝÈ«¿â£º

RMAN> backup database plus archivelog delete input£» £¨±¸·ÝÈ«¿â¼°¿ØÖÆÎļþ¡¢·þÎñÆ÷²ÎÊýÎļþÓëËùÓй鵵µÄÖØ×öÈÕÖ¾£¬²¢É¾³ý¾ÉµÄ¹éµµÈÕÖ¾£©

7¡¢±¸·Ý±í¿Õ¼ä£º

RMAN> backup tablespace system plus archivelog delete input£» £¨±¸·ÝÖ¸¶¨±í¿Õ¼ä¼°¹éµµµÄÖØ×öÈÕÖ¾£¬²¢É¾³ý¾ÉµÄ¹éµµÈÕÖ¾£©

8¡¢±¸·Ý¹éµµÈÕÖ¾£º

RMAN> backup archivelog all delete input£»

9¡¢¸´ÖÆÊý¾ÝÎļþ£º

RMAN> copy datafile 1 to '/oracle/dbs/system.copy'£»

10¡¢²é¿´±¸·ÝºÍÎļþ¸´±¾£º

RMAN> list backup£»

11¡¢ÑéÖ¤±¸·Ý£º

RMAN> validate backupset 3£»

12¡¢´Ó×Ô¶¯±¸·ÝÖлָ´·þÎñÆ÷²ÎÊýÎļþ£º

RMAN> shutdown immediate£» £¨Á¢¼´¹Ø±ÕÊý¾Ý¿â£©

RMAN> startup nomount£» £¨Æô¶¯ÊµÀý£©

RMAN> restore spfile to pfile '/backup1/mydb.ora' from autobackup£» £¨´Ó×Ô¶¯±¸·ÝÖлָ´·þÎñÆ÷²ÎÊýÎļþ£©

13¡¢´Ó×Ô¶¯±¸·ÝÖлָ´¿ØÖÆÎļþ£º

RMAN> shutdown immediate£» £¨Á¢¼´¹Ø±ÕÊý¾Ý¿â£©

RMAN> startup nomount£» £¨Æô¶¯ÊµÀý£©

RMAN> restore controlfile to '/backup1' from autobackup£» £¨´Ó×Ô¶¯±¸·ÝÖлָ´¿ØÖÆÎļþ£©
ÎÄÕÂÆÀÂÛ

¹²ÓÐ 1 ÌõÆÀÂÛ

  1. cxtt228 ÓÚ 2006-09-03 12:45:16·¢±í:

    13¡¢»Ö¸´ºÍ¸´Ô­È«Êý¾Ý¿â£º

    RMAN> shutdown immediate£» £¨Á¢¼´¹Ø±ÕÊý¾Ý¿â£©

    RMAN> exit £¨Í˳ö£©

    %mv /oracle/dbs/tbs_12.f /oracle/dbs/tbs_12.bak £¨½«Êý¾ÝÎļþÖØÃüÃû£©

    %mv /oracle/dbs/tbs_13.f /oracle/dbs/tbs_13.bak £¨½«Êý¾ÝÎļþÖØÃüÃû£©

    %mv /oracle/dbs/tbs_14.f /oracle/dbs/tbs_14.bak £¨½«Êý¾ÝÎļþÖØÃüÃû£©

    %mv /oracle/dbs/tbs_15.f /oracle/dbs/tbs_15.bak £¨½«Êý¾ÝÎļþÖØÃüÃû£©

    %rman target=rman/rman@mydb £¨Æô¶¯»Ö¸´¹ÜÀíÆ÷£©

    RMAN> startup pfile=/oracle/admin/mydb/pfile/initmydb.ora £¨Ö¸¶¨³õʼ»¯²ÎÊýÎļþÆô¶¯Êý¾Ý¿â£©

    RMAN> restore database£» £¨»¹Ô­Êý¾Ý¿â£©

    RMAN> recover database£» £¨»Ö¸´Êý¾Ý¿â£©

    RMAN> alter database open£» £¨´ò¿ªÊý¾Ý¿â£©

    14¡¢»Ö¸´ºÍ¸´Ô­±í¿Õ¼ä£º

    RMAN> sql 'alter tablespace users offline immediate'£» £¨½«±í¿Õ¼äÍÑ»ú£©

    RMAN> exit £¨Í˳ö»Ö¸´¹ÜÀíÆ÷£©

    %mv /oracle/dbs/users01.dbf /oracle/dbs/users01.bak £¨½«±í¿Õ¼äÖØÃüÃû£©

    %rman target=rman/rman@mydb £¨Æô¶¯»Ö¸´¹ÜÀíÆ÷£©

    RMAN> restore tablespace users£» £¨»¹Ô­±í¿Õ¼ä£©

    RMAN> recover tablespace users£» £¨»Ö¸´±í¿Õ¼ä£©

    RMAN> sql 'alter tablespace users online'£» £¨½«±í¿Õ¼äÁª»ú£©

    15¡¢ÔöÁ¿±¸·ÝÓë»Ö¸´£º

    µÚÒ»ÌìµÄÔöÁ¿»ù±¾±¸·Ý£º

    RMAN> backup incremental level=0 database plus archivelog delete input£»

    µÚ¶þÌìµÄÔöÁ¿²îÒ챸·Ý£º

    RMAN> backup incremental level=2 database plus archivelog delete input£»

    µÚÈýÌìµÄÔöÁ¿²îÒ챸·Ý£º

    RMAN> backup incremental level=2 database plus archivelog delete input£»

    µÚËÄÌìµÄÔöÁ¿²îÒ챸·Ý£º

    RMAN> backup incremental level=1 database plus archivelog delete input£»

    µÚÎåÌìµÄÔöÁ¿²îÒ챸·Ý£º

    RMAN> backup incremental level=2 database plus archivelog delete input£»

    µÚÁùÌìµÄÔöÁ¿²îÒ챸·Ý£º

    RMAN> backup incremental level=2 database plus archivelog delete input£»

    µÚÆßÌìµÄÔöÁ¿²îÒ챸·Ý£º

    RMAN> backup incremental level=0 database plus archivelog delete input£»

    ÔöÁ¿»Ö¸´£º

    RMAN> shutdown immediate£»

    RMAN> exit

    %mv /oracle/dbs/tbs_12.f /oracle/dbs/tbs_12.bak

    %mv /oracle/dbs/tbs_13.f /oracle/dbs/tbs_13.bak

    %mv /oracle/dbs/tbs_14.f /oracle/dbs/tbs_14.bak

    %mv /oracle/dbs/tbs_15.f /oracle/dbs/tbs_15.bak

    %rman target=rman/rman@mydb

    RMAN> startup pfile=/oracle/admin/mydb/pfile/initmydb.ora

    RMAN> restore database£»

    RMAN> recover database£»

    RMAN> alter database open.£¨e129£©on.htm

    simulator/doc/license_keys.htm

    simulator/doc/sdk.style.css

    simulator/doc/davehitzforeword.htm

    simulator/doc/faq.htm

    simulator/doc/troubleshooting.htm

    simulator/license.htm

    simulator/readme.htm

    simulator/runsim.sh

    simulator/setup.sh

    simulator/sim.tgz