use tool RMan
http://chinaunix.net/jh/19/165758.html

解决方案 »

  1.   

    exp 的 INCTYPE已废弃用rman
      

  2.   

    我没有试过,看下这个方法还能使用吗?不行就得用RMAN  
     增量导出/导入增量导出是一种常用的数据备份方法,它只能对整个数据库来实施,并且必须作为SYSTEM来导出。在进行此种导出时,系统不要求回答任何问题。导出文件名缺省为export.dmp,如果不希望自己的输出文件定名为export.dmp,必须在命令行中指出要用的文件名。增量导出包括三个类型:(1)“完全”增量导出(Complete)即备份整个数据库,比如:$exp system/manager inctype=complete file=990702.dmp(2) “增量型”增量导出备份上一次备份后改变的数据。比如:$exp system/manager inctype=incremental file=990702.dmp(3) “累计型”增量导出(Cumulative)累计型导出方式只是导出自上次“完全” 导出之后数据库中变化了的信息。比如:$exp system/manager inctype=cumulative file=990702.dmp数据库管理员可以排定一个备份日程表,用数据导出的三个不同方式合理高效地完成。比如数据库的备份任务可作如下安排:星期一:完全导出(A)星期二:增量导出(B)星期三:增量导出(C)星期四:增量导出(D)星期五:累计导出(E)星期六:增量导出(F)星期日:增量导出(G)如果在星期日,数据库遭到意外破坏,数据库管理员可按以下步骤来恢复数据库:第一步:用命令CREATE DATABASE重新生成数据库结构;第二步:创建一个足够大的附加回段。第三步:完全增量导入A:$imp system./manager inctype= RECTORE FULL=Y FILE=A第四步:累计增量导入E:$imp system/manager inctype= RECTORE FULL=Y FILE =E第五步:最近增量导入F:$imp system/manager inctype=RESTORE FULL=Y FILE=F
      

  3.   

    to up:
    你没有看清我的问题,问题是不能使用INCTYPE参数,这是关键!
      

  4.   

    9i 中 exp 命令中的 增量备份真的不支持了吗???可RMAN 使用起来如此之麻烦,既然RMAN支持增量备份,那EXP为何不支持了呢???
      

  5.   

    各位大侠:谁有在WINDOWS 2000下用RMAN 进行数据库完全备份和增量备份的例子,急急急!!!
      

  6.   

    4.2.2 RMAN备份方案
    RMAN也可以进行联机备份,而且备份与恢复方法将比OS备份更简单可靠。
    1、连接数据库,创建测试表并插入记录
    SQL*Plus: Release 8.1.6.0.0 - Production on Tue May 6 13:46:32 2003
    (c) Copyright 1999 Oracle Corporation.  All rights reserved.
    SQL> connect internal/password as sysdba;
    Connected.SQL> create table test(a int) tablespace users;
    Table created
    SQL> insert into test values(1);
    1 row inserted
    SQL> commit;
    Commit complete2、备份数据库表空间users
    C:\>rman
    Recovery Manager: Release 8.1.6.0.0 - Production
    RMAN> connect rcvcat rman/rman@back
    RMAN-06008: connected to recovery catalog database
    RMAN> connect target internal/virpure
    RMAN-06005: connected to target database: TEST (DBID=1788174720)RMAN> run{
    2> allocate channel c1 type disk;
    3> backup tag 'tsuser' format 'd:\backup\tsuser_%u_%s_%p'
    4> tablespace users;
    5> release channel c1;
    6> }RMAN-03022: compiling command: allocate
    RMAN-03023: executing command: allocate
    RMAN-08030: allocated channel: c1
    RMAN-08500: channel c1: sid=16 devtype=DISKRMAN-03022: compiling command: backup
    RMAN-03025: performing implicit partial resync of recovery catalog
    RMAN-03023: executing command: partial resync
    RMAN-08003: starting partial resync of recovery catalog
    RMAN-08005: partial resync complete
    RMAN-03023: executing command: backup
    RMAN-08008: channel c1: starting full datafile backupset
    RMAN-08502: set_count=5 set_stamp=494177612 creation_time=16-MAY-03
    RMAN-08010: channel c1: specifying datafile(s) in backupset
    RMAN-08522: input datafile fno=00003 name=D:\ORACLE\ORADATA\TEST\USER01.DBF
    RMAN-08013: channel c1: piece 1 created
    RMAN-08503: piece handle=D:\BACKUP\TSUSER_05EN93AC_5_1 comment=NONE
    RMAN-08525: backup set complete, elapsed time: 00:00:01
    RMAN-03023: executing command: partial resync
    RMAN-08003: starting partial resync of recovery catalog
    RMAN-08005: partial resync complete
    RMAN-03022: compiling command: release
    RMAN-03023: executing command: release
    RMAN-08031: released channel: c1
    RMAN>3、继续在测试表中插入记录
    SQL> insert into test values(2);
    1 row inserted
    SQL> commit;
    Commit complete
    SQL> select * from test;
                             A
    ---------------------------------------
                             1
                             2
    SQL> alter system switch logfile;
    System altered.
    SQL>r
    1* alter system switch logfile;
    System altered.4、关闭数据库,模拟丢失数据文件
    SQL> shutdown immediate;
    Database closed.
    Database dismounted.
    ORACLE instance shut downC:\>del D:\ORACLE\ORADATA\TEST\USER01.DBF5、启动数据库,检查错误
    SQL> startup
    ORACLE instance started.
    Total System Global Area  102020364 bytes
    Fixed Size                    70924 bytes
    Variable Size              85487616 bytes
    Database Buffers           16384000 bytes
    Redo Buffers                  77824 bytes
    Database mounted.
    ORA-01157: cannot identify/lock data file 3 - see DBWR trace file
    ORA-01110: data file 3: 'D:\ORACLE\ORADATA\TEST\USER01.DBF'6、先打开数据库
    SQL> alter database datafile 3 offline drop;
    Database altered.
    SQL> alter database open;
    Database altered.7、恢复该表空间
    恢复脚本可以是恢复单个数据文件
    run{
    allocate channel c1 type disk;
    restore datafile 3;
    recover datafile 3;
    sql 'alter database datafile 3 online';
    release channel c1;
    }
    也可以是,恢复表空间
    run{
    allocate channel c1 type disk;
    restore tablespace users;
    recover tablespace users;
    sql 'alter database datafile 3 online';
    release channel c1;
    }
    过程如下:
    C:\>rman
    Recovery Manager: Release 8.1.6.0.0 - Production
    RMAN> connect rcvcat rman/rman@back
    RMAN-06008: connected to recovery catalog database
    RMAN> connect target internal/virpure
    RMAN-06005: connected to target database: TEST (DBID=1788174720)RMAN> run{
    2> allocate channel c1 type disk;
    3> restore datafile 3;
    4> recover datafile 3;
    5> sql 'alter database datafile 3 online';
    6> release channel c1;
    7> }RMAN-03022: compiling command: allocate
    RMAN-03023: executing command: allocate
    RMAN-08030: allocated channel: c1
    RMAN-08500: channel c1: sid=13 devtype=DISK
    RMAN-03022: compiling command: restore
    RMAN-03022: compiling command: IRESTORE
    RMAN-03023: executing command: IRESTORE
    RMAN-08016: channel c1: starting datafile backupset restore
    RMAN-08502: set_count=5 set_stamp=494177612 creation_time=16-MAY-03
    RMAN-08089: channel c1: specifying datafile(s) to restore from backup set
    RMAN-08523: restoring datafile 00003 to D:\ORACLE\ORADATA\TEST\USER01.DBF
    RMAN-08023: channel c1: restored backup piece 1
    RMAN-08511: piece handle=D:\BACKUP\TSUSER_05EN93AC_5_1 tag=TSUSER params=NULL
    RMAN-08024: channel c1: restore complete
    RMAN-03023: executing command: partial resync
    RMAN-08003: starting partial resync of recovery catalog
    RMAN-08005: partial resync complete
    RMAN-03022: compiling command: recover
    RMAN-03022: compiling command: recover(1)
    RMAN-03022: compiling command: recover(2)
    RMAN-03022: compiling command: recover(3)
    RMAN-03023: executing command: recover(3)
    RMAN-08054: starting media recovery
    RMAN-03022: compiling command: recover(4)
    RMAN-06050: archivelog thread 1 sequence 332 is already on disk as file D:\ORACLE\ORADATA\TEST\ARCHIVE\TESTT001S00332.ARC
    RMAN-06050: archivelog thread 1 sequence 333 is already on disk as file D:\ORACLE\ORADATA\TEST\ARCHIVE\TESTT001S00333.ARC
    RMAN-06050: archivelog thread 1 sequence 334 is already on disk as file D:\ORACLE\ORADATA\TEST\ARCHIVE\TESTT001S00334.ARC
    RMAN-03023: executing command: recover(4)
    RMAN-08515: archivelog filename=D:\ORACLE\ORADATA\TEST\ARCHIVE\TESTT001S00332.ARC thread=1 sequence=332
    RMAN-08055: media recovery complete
    RMAN-03022: compiling command: sql
    RMAN-06162: sql statement: alter database datafile 3 online
    RMAN-03023: executing command: sql
    RMAN-03022: compiling command: release
    RMAN-03023: executing command: release
    RMAN-08031: released channel: c1
    RMAN>8、检查数据是否完整
    SQL> alter database open;
    Database altered.SQL> select * from test;
                             A
    ---------------------------------------
                             1
                             2
    说明:
    1、RMAN也可以实现单个表空间或数据文件的恢复,恢复过程可以在mount下或open方式下,如果在open方式下恢复,可以减少down机时间
    2、如果损坏的是一个数据文件,建议offline并在open方式下恢复
    3、这里可以看到,RMAN进行数据文件与表空间恢复的时候,代码都比较简单,而且能保证备份与恢复的可靠性,所以建议采用RMAN的备份与恢复
      

  7.   

    to  LGQDUCKY(飘):我的表空间是yiyao, 我用 RMAN 备份:
    RMAN> run{
    2> allocate channel c1 type disk;
    3> backup tag 'yiyao' format 'd:\backup\yiyao_%u_%s_%p'
    4> tablespace yiyao;
    5> release channel c1;
    6> }提示错误:
    未创建恢复目录
    未创建恢复目录
      

  8.   

    backup tag 'yiyao' format 'd:\backup\yiyao_%u_%s_%p'
    你的BACKUP目录是否存在