数据库全备份
RMAN> run{
2> allocate channel c1 type disk;
3> backup full tag 'dbfull' format '/orabackup/dbfile/db_%d_t%t_s%s_p%p'
4> database include current controlfile;
5> sql 'alter system archive log current';
6> release channel c1;
7> }
28
allocated channel: c1
channel c1: sid=113 devtype=DISK
Starting backup at 25-NOV-03
channel c1: starting full datafile backupset
channel c1: specifying datafile(s) in backupset
including current SPFILE in backupset
including current controlfile in backupset
input datafile fno=00002 name=/oradata/sjzdb/undotbs01.dbf
input datafile fno=00006 name=/oradata/sjzdb/SJZEM_DATA01.dbf
input datafile fno=00007 name=/oradata/sjzdb/SJZEM_INDEX01.dbf
input datafile fno=00001 name=/oradata/sjzdb/system01.dbf
input datafile fno=00003 name=/oradata/sjzdb/indx01.dbf
input datafile fno=00004 name=/oradata/sjzdb/tools01.dbf
input datafile fno=00005 name=/oradata/sjzdb/users01.dbf
channel c1: starting piece 1 at 25-NOV-03
channel c1: finished piece 1 at 25-NOV-03
piece handle=/orabackup/dbfile/db_dSJZDB_t511008342_s15_p1 comment=NONE
channel c1: backup set complete, elapsed time: 00:01:46
Finished backup at 25-NOV-03
sql statement: alter system archive log current
released channel: c1
RMAN>list backup―――查看备份集

Archive log 全备份
RMAN> run {
2> allocate channel dev1 type disk;29
3> backup format '/orabackup/archfile/log_d%d_t%t_s%s_p%p'
4> (archivelog all);
5> sql 'alter system archive log current';
6> release channel dev1;
7> }
allocated channel: dev1
channel dev1: sid=118 devtype=DISK
Starting backup at 25-NOV-03
current log archived
channel dev1: starting archive log backupset
channel dev1: specifying archive log(s) in backup set
input archive log thread=1 sequence=5 recid=1 stamp=510836951
input archive log thread=1 sequence=6 recid=2 stamp=511006273
input archive log thread=1 sequence=7 recid=3 stamp=511007953
input archive log thread=1 sequence=8 recid=4 stamp=511008449
input archive log thread=1 sequence=9 recid=5 stamp=511009258
input archive log thread=1 sequence=10 recid=6 stamp=511009738
channel dev1: starting piece 1 at 25-NOV-03
channel dev1: finished piece 1 at 25-NOV-03
piece handle=/orabackup/archfile/log_dSJZDB_t511009739_s16_p1 comment=NONE
channel dev1: backup set complete, elapsed time: 00:00:16
Finished backup at 25-NOV-03
sql statement: alter system archive log current
released channel: dev1
RMAN>

解决方案 »

  1.   

    逻辑备份
    使用oracle 的逻辑备份工具exp 可以进行逻辑备份,此备份方法适用户数据量少与
    2G 的情况,比如可以单独备份某张大数据量的表;
    举例:
    C:\>exp name/mima@sid owner=name compress=y file=d:\orcl.dmp
    log=d:\orcllog.log buffer=900000
    或者
    C:\>exp name/mima@sid
    compress=y file=d:\exp.dmp compress=y tables=(table1,table2);冷备份
    1、停止监听;
    2、关闭数据库
    【注意】不能是以abort 方式关闭
    3、使用cp、rcp 或tar 等操作系统命令,复制/oradata 目录下所有文件到备份目录或磁带;
    例如:
    cp(拷贝命令)
    cp /oradata /orabackup
    rcp(远程拷贝命令,需要配置信任关系)
    27
    在另外一台被信任的主机上
    rcp sundb:/oradate /orabackup
    tar (归档命令)
    cd /oradate
    tar -cvf ./ /orabackup/20031206.tar
    4、启动数据库;
    5、启动监听;
      

  2.   

    学习,楼主solaris下面的数据库是什么版本?
      

  3.   

    zhaokeke2004:我用的是9.0 第二版的oracle啊。
      

  4.   

    请教:zwj0712(阿张)
         你说了冷备份。
         那热备份是如何的呢?谢谢!
      

  5.   

    楼主可以学习一下RMAN的具体用法.
      

  6.   

    ORACLE数据库的逻辑备份分为三种模式:表备份、用户备份和完全备份。
    不需要停止什么服务,也不需要转入受限模式
      

  7.   

    IMP恢复的时候要注意先删除数据库中相同数据
      

  8.   

    . . exporting table                          TDATE          8 rows exportedEXP-00079: Data in table "theoler69_TAB" is protected. Conventional path may onl
    y be exporting partial table.
    . . exporting table                  theoler69_TAB          0 rows exported
    . exporting synonyms
    . exporting views
    . exporting referential integrity constraints
    . exporting stored procedures
    . exporting operators
    . exporting indextypes
    . exporting bitmap, functional and extensible indexes
    EXP-00091: Exporting questionable statistics.
    EXP-00091: Exporting questionable statistics.
    EXP-00091: Exporting questionable statistics.
    EXP-00091: Exporting questionable statistics.
    EXP-00091: Exporting questionable statistics.
    EXP-00091: Exporting questionable statistics.
    EXP-00091: Exporting questionable statistics.
    EXP-00091: Exporting questionable statistics.
    EXP-00091: Exporting questionable statistics.
    EXP-00091: Exporting questionable statistics.
    EXP-00091: Exporting questionable statistics.
    . exporting posttables actions
    . exporting triggers
    . exporting materialized views
    . exporting snapshot logs
    . exporting job queues
    . exporting refresh groups and children
    . exporting dimensions
    . exporting post-schema procedural objects and actions
    . exporting user history table
    . exporting default and system auditing options
    . exporting statistics
    Export terminated successfully with warnings.
    $
    \导出的时候报了这个错误:
    EXP-00079: Data in table "theoler69_TAB" is protected. Conventional path may onl
    y be exporting partial table.应该如何解决呢?