如何将正在运行的基于oracle的业务数据库,倒入另外一个服务器上。

解决方案 »

  1.   

    如果数据量大,数据库在归档模式下,可以考虑rman来迁移数据,
      

  2.   

    两个节点:
    $ pwd
    /oracle/admin/
    $ mkdir dxdb
    $ cd dxdb
    $ mkdir adump bdump cdump udump节点1:
    $cd /arch/DXDB/archivelog
    $cd 2009_06_05
    $rm o*
    cd ../2009_06_06
    rm o*节点2:
    $cd /arch/DXDB/autobackup
    $cd 2009_06_05
    $rm *
    $ cd /rman
    $ rmanRecovery Manager: Release 10.2.0.4.0 - Production on Sat Jun 6 19:58:55 2009Copyright (c) 1982, 2007, Oracle.  All rights reserved.RMAN> connect target /connected to target database: DXDB (DBID=2908250559, not open)RMAN> shutdown immediateusing target database control file instead of recovery catalog
    database dismounted
    Oracle instance shut downRMAN> set dbid=2908250559executing command: SET DBIDRMAN> startup nomount pfile='/oracle/product/10.2.0/db/dbs/initdxdb_rman.ora';connected to target database (not started)
    Oracle instance startedTotal System Global Area    8589934592 bytesFixed Size                     2069904 bytes
    Variable Size               1358957168 bytes
    Database Buffers            7214202880 bytes
    Redo Buffers                  14704640 bytesRMAN> restore controlfile from '/rman/cntrl_1759_1_688730210';Starting restore at 06-JUN-09
    allocated channel: ORA_DISK_1
    channel ORA_DISK_1: sid=1088 devtype=DISKchannel ORA_DISK_1: restoring control file
    channel ORA_DISK_1: restore complete, elapsed time: 00:00:02
    output filename=/dev/vgdx/rdxdb_ctl1_256m
    output filename=/dev/vgdx/rdxdb_ctl2_256m
    Finished restore at 06-JUN-09RMAN> alter database mount;database mounted
    released channel: ORA_DISK_1
      

  3.   

    RMAN> run{
    2>     allocate channel ch00 type disk;
        allocate channel ch01 type disk;
        allocate channel ch02 type disk;
    3> 4> 5>     allocate channel ch03 type disk;
        allocate channel ch04 type disk;
        allocate channel ch05 type disk;
        allocate channel ch06 type disk;
    6> 7> 8> 9>     allocate channel ch07 type disk;
        allocate channel ch08 type disk;
        allocate channel ch09 type disk;
        allocate channel ch10 type disk;
    10> 11> 12> 13>     allocate channel ch11 type disk;
        restore database;
        release channel ch00;
        release channel ch01;
    14> 15> 16> 17>     release channel ch02;
        release channel ch03;
        release channel ch04;
        release channel ch05;
    18> 19> 20> 21>     release channel ch06;
        release channel ch07;
        release channel ch08;
        release channel ch09;
    22> 23> 24> 25>     release channel ch10;
        release channel ch11;
    }
    26> 27> 
    allocated channel: ch00
    channel ch00: sid=1088 devtype=DISKallocated channel: ch01
    channel ch01: sid=1087 devtype=DISKallocated channel: ch02
    channel ch02: sid=1086 devtype=DISKallocated channel: ch03
    channel ch03: sid=1085 devtype=DISKallocated channel: ch04
    channel ch04: sid=1084 devtype=DISKallocated channel: ch05
    channel ch05: sid=1083 devtype=DISKallocated channel: ch06
    channel ch06: sid=1082 devtype=DISKallocated channel: ch07
    channel ch07: sid=1081 devtype=DISKallocated channel: ch08
    channel ch08: sid=1080 devtype=DISKallocated channel: ch09
    channel ch09: sid=1079 devtype=DISKallocated channel: ch10
    channel ch10: sid=1078 devtype=DISKallocated channel: ch11
    channel ch11: sid=1077 devtype=DISKStarting restore at 06-JUN-09
    Starting implicit crosscheck backup at 06-JUN-09
    Crosschecked 34 objects
    Crosschecked 2 objects
    Finished implicit crosscheck backup at 06-JUN-09Starting implicit crosscheck copy at 06-JUN-09
    Finished implicit crosscheck copy at 06-JUN-09searching for all files in the recovery area
    cataloging files...
    cataloging doneList of Cataloged Files
    =======================
    File Name: /arch/DXDB/archivelog/2009_06_05/o1_mf_1_17262_52jzd4ys_.arc
    File Name: /arch/DXDB/archivelog/2009_06_05/o1_mf_1_17263_52jzfjbg_.arc
    File Name: /arch/DXDB/archivelog/2009_06_05/o1_mf_1_17264_52jzh0j5_.arc
    File Name: /arch/DXDB/archivelog/2009_06_05/o1_mf_1_17265_52k0h1yw_.arc
    File Name: /arch/DXDB/archivelog/2009_06_05/o1_mf_1_17266_52k1h28d_.arc
    File Name: /arch/DXDB/archivelog/2009_06_05/o1_mf_1_17267_52k2gz1r_.arc
    File Name: /arch/DXDB/archivelog/2009_06_05/o1_mf_1_17268_52k3h4vh_.arc
    File Name: /arch/DXDB/archivelog/2009_06_05/o1_mf_1_17269_52k4jxvd_.arc
    File Name: /arch/DXDB/archivelog/2009_06_05/o1_mf_1_17270_52k6bpho_.arc
    File Name: /arch/DXDB/archivelog/2009_06_05/o1_mf_1_17271_52k8gt2o_.arc
    File Name: /arch/DXDB/archivelog/2009_06_05/o1_mf_1_17272_52kbsbro_.arc
    File Name: /arch/DXDB/archivelog/2009_06_05/o1_mf_1_17273_52kdcg4s_.arc
    File Name: /arch/DXDB/archivelog/2009_06_05/o1_mf_1_17274_52kgmhl2_.arc
    File Name: /arch/DXDB/archivelog/2009_06_05/o1_mf_1_17275_52khy02l_.arc
    File Name: /arch/DXDB/archivelog/2009_06_05/o1_mf_1_17276_52kjzw20_.arc
    File Name: /arch/DXDB/archivelog/2009_06_05/o1_mf_1_17277_52klbm5h_.arc
    File Name: /arch/DXDB/archivelog/2009_06_05/o1_mf_1_17278_52kn8mj2_.arc
    File Name: /arch/DXDB/archivelog/2009_06_05/o1_mf_1_17279_52kocjmh_.arc
    File Name: /arch/DXDB/archivelog/2009_06_05/o1_mf_1_17280_52kpflhd_.arc
    File Name: /arch/DXDB/archivelog/2009_06_05/o1_mf_1_17281_52kqh29h_.arc
    File Name: /arch/DXDB/archivelog/2009_06_05/o1_mf_1_17282_52ks8ts8_.arc
    File Name: /arch/DXDB/archivelog/2009_06_05/o1_mf_1_17283_52kv8k6y_.arc
    File Name: /arch/DXDB/archivelog/2009_06_05/o1_mf_1_17284_52kxffgg_.arc
    File Name: /arch/DXDB/archivelog/2009_06_05/o1_mf_1_17285_52kzdcn0_.arc
    File Name: /arch/DXDB/archivelog/2009_06_05/o1_mf_1_17286_52l1btxn_.arc
    File Name: /arch/DXDB/archivelog/2009_06_05/o1_mf_1_17287_52l3goot_.arc
    File Name: /arch/DXDB/archivelog/2009_06_05/o1_mf_1_17288_52l5ofs5_.arc
    File Name: /arch/DXDB/archivelog/2009_06_05/o1_mf_1_17289_52l7qvkl_.arc
    File Name: /arch/DXDB/archivelog/2009_06_05/o1_mf_1_17290_52l9t5vc_.arc
    File Name: /arch/DXDB/archivelog/2009_06_05/o1_mf_1_17291_52lcqv8s_.arc
    File Name: /arch/DXDB/archivelog/2009_06_05/o1_mf_1_17292_52lfrgs3_.arc
    File Name: /arch/DXDB/archivelog/2009_06_05/o1_mf_2_25013_52jys8n8_.arc
    File Name: /arch/DXDB/archivelog/2009_06_05/o1_mf_2_25014_52jzfjcg_.arc
    File Name: /arch/DXDB/archivelog/2009_06_05/o1_mf_2_25015_52k035p2_.arc
    File Name: /arch/DXDB/archivelog/2009_06_05/o1_mf_2_25016_52k0n97m_.arc
    File Name: /arch/DXDB/archivelog/2009_06_05/o1_mf_2_25017_52k13oom_.arc
    File Name: /arch/DXDB/archivelog/2009_06_05/o1_mf_2_25018_52k1gzsh_.arc
    File Name: /arch/DXDB/archivelog/2009_06_05/o1_mf_2_25019_52k1sfh9_.arc
    File Name: /arch/DXDB/archivelog/2009_06_05/o1_mf_2_25020_52k24b4b_.arc
    File Name: /arch/DXDB/archivelog/2009_06_05/o1_mf_2_25021_52k2gy5g_.arc
    File Name: /arch/DXDB/archivelog/2009_06_05/o1_mf_2_25022_52k2t0pv_.arc
    File Name: /arch/DXDB/archivelog/2009_06_05/o1_mf_2_25023_52k35b0g_.arc
    File Name: /arch/DXDB/archivelog/2009_06_05/o1_mf_2_25024_52k3h34w_.arc
    File Name: /arch/DXDB/archivelog/2009_06_05/o1_mf_2_25025_52k3sspy_.arc
    File Name: /arch/DXDB/archivelog/2009_06_05/o1_mf_2_25026_52k449o6_.arc
    File Name: /arch/DXDB/archivelog/2009_06_05/o1_mf_2_25027_52k4jtyt_.arc
    File Name: /arch/DXDB/archivelog/2009_06_05/o1_mf_2_25028_52k5235x_.arc
    File Name: /arch/DXDB/archivelog/2009_06_05/o1_mf_2_25029_52k5q2bt_.arc
    File Name: /arch/DXDB/archivelog/2009_06_05/o1_mf_2_25030_52k6bnlw_.arc
    File Name: /arch/DXDB/archivelog/2009_06_05/o1_mf_2_25031_52k734xc_.arc
    File Name: /arch/DXDB/archivelog/2009_06_05/o1_mf_2_25032_52k7q85t_.arc
    File Name: /arch/DXDB/archivelog/2009_06_05/o1_mf_2_25033_52k8gskc_.arc
    File Name: /arch/DXDB/archivelog/2009_06_05/o1_mf_2_25034_52k94l4t_.arc
    File Name: /arch/DXDB/archivelog/2009_06_05/o1_mf_2_25035_52k9y2q0_.arc
    File Name: /arch/DXDB/archivelog/2009_06_05/o1_mf_2_25036_52kbs8jx_.arc
    File Name: /arch/DXDB/archivelog/2009_06_05/o1_mf_2_25037_52kco9r4_.arc
    File Name: /arch/DXDB/archivelog/2009_06_05/o1_mf_2_25038_52kdmftj_.arc
    File Name: /arch/DXDB/archivelog/2009_06_05/o1_mf_2_25039_52kflmtc_.arc
    File Name: /arch/DXDB/archivelog/2009_06_05/o1_mf_2_25040_52kgmgq3_.arc
    File Name: /arch/DXDB/archivelog/2009_06_05/o1_mf_2_25041_52kh5kp9_.arc
    File Name: /arch/DXDB/archivelog/2009_06_05/o1_mf_2_25042_52khknwz_.arc
    File Name: /arch/DXDB/archivelog/2009_06_05/o1_mf_2_25043_52khxxrj_.arc
    File Name: /arch/DXDB/archivelog/2009_06_05/o1_mf_2_25044_52kjb72x_.arc
    File Name: /arch/DXDB/archivelog/2009_06_05/o1_mf_2_25045_52kjo4w8_.arc
    File Name: /arch/DXDB/archivelog/2009_06_05/o1_mf_2_25046_52kjzvch_.arc
    File Name: /arch/DXDB/archivelog/2009_06_05/o1_mf_2_25047_52kkbsyq_.arc
    File Name: /arch/DXDB/archivelog/2009_06_05/o1_mf_2_25048_52kkp3dz_.arc
    File Name: /arch/DXDB/archivelog/2009_06_05/o1_mf_2_25049_52klbj72_.arc
    File Name: /arch/DXDB/archivelog/2009_06_05/o1_mf_2_25050_52km225s_.arc
    File Name: /arch/DXDB/archivelog/2009_06_05/o1_mf_2_25051_52kmrtm4_.arc
    File Name: /arch/DXDB/archivelog/2009_06_05/o1_mf_2_25052_52kn8m4x_.arc
    skipping datafile 1; already restored to file /dev/vgdx/rdxdb_syst_08g
    skipping datafile 22; already restored to file /dev/vgdx1/rdxdb1_8192m_000
    channel ch00: starting datafile backupset restore