将数据库从一台机器复制到另一台机器上

将adump,bdump,cdump,dpdump,pfile,udump目录复制到weblogic29机器上来

[root@weblogic28 ~]# scp -r /u01/app/oracle/admin/* root@10.138.130.29:/u01/app/oracle/admin
root@10.138.130.29's password:
init.ora.10282012165755                       100% 2508     2.5KB/s   00:00
jytest_ora_4650.trc                           100%  623     0.6KB/s   00:00
jytest_ora_2871.trc                           100% 1196     1.2KB/s   00:00
jytest_ora_5148.trc                           100% 5584     5.5KB/s   00:00
jytest_ora_2844.trc                           100%  623     0.6KB/s   00:00
jytest_ora_28167.trc                          100% 7441     7.3KB/s   00:00
jytest_ora_28498.trc                          100%  682     0.7KB/s   00:00
jytest_ora_3013.trc                           100% 2689     2.6KB/s   00:00
jytest_ora_4931.trc                           100%  680     0.7KB/s   00:00
jytest_ora_4722.trc                           100% 5585     5.5KB/s   00:00
jytest_ora_2986.trc                           100%  623     0.6KB/s   00:00
jytest_ora_4682.trc                           100%  680     0.7KB/s   00:00
jytest_ora_4554.trc                           100%  623     0.6KB/s   00:00
jytest_ora_4584.trc                           100%  680     0.7KB/s   00:00
jytest_ora_4685.trc                           100%  867     0.9KB/s   00:00
jytest_ora_4586.trc                           100%  867     0.9KB/s   00:00
jytest_ora_29312.trc                          100% 2420     2.4KB/s   00:00
jytest_ora_4901.trc                           100%  623     0.6KB/s   00:00
jytest_ora_27695.trc                          100% 6482     6.3KB/s   00:00
jytest_ora_28454.trc                          100%  707     0.7KB/s   00:00
jytest_ora_8595.trc                           100% 5587     5.5KB/s   00:00
jytest_ora_3068.trc                           100%  623     0.6KB/s   00:00
jytest_ora_3098.trc                           100%  680     0.7KB/s   00:00
jytest_ora_28499.trc                          100% 4070     4.0KB/s   00:00
jytest_ora_2952.trc                           100%  623     0.6KB/s   00:00
jytest_ora_3057.trc                           100%  809     0.8KB/s   00:00
jytest_ora_29281.trc                          100%  625     0.6KB/s   00:00
jytest_ora_29311.trc                          100%  682     0.7KB/s   00:00
jytest_ora_2985.trc                           100%  939     0.9KB/s   00:00
jytest_ora_27246.trc                          100%  790     0.8KB/s   00:00
jytest_ora_2808.trc                           100%  623     0.6KB/s   00:00
jytest_ora_3831.trc                           100% 2078     2.0KB/s   00:00
jytest_ora_2841.trc                           100%  939     0.9KB/s   00:00
jytest_ora_28469.trc                          100%  625     0.6KB/s   00:00
ora_4682.aud                                  100%  655     0.6KB/s   00:00
ora_3128.aud                                  100%  643     0.6KB/s   00:00
ora_3113.aud                                  100%  643     0.6KB/s   00:00
ora_23604.aud                                 100%  635     0.6KB/s   00:00
ora_23712.aud                                 100%  656     0.6KB/s   00:00
ora_8595.aud                                  100%  654     0.6KB/s   00:00
ora_4650.aud                                  100% 1292     1.3KB/s   00:00
ora_4586.aud                                  100%  785     0.8KB/s   00:00
ora_2986.aud                                  100%  650     0.6KB/s   00:00
ora_2981.aud                                  100%  650     0.6KB/s   00:00
ora_6652.aud                                  100%  654     0.6KB/s   00:00
ora_29275.aud                                 100%  644     0.6KB/s   00:00
ora_3831.aud                                  100%  648     0.6KB/s   00:00
ora_2808.aud                                  100%  650     0.6KB/s   00:00
ora_5146.aud                                  100%  654     0.6KB/s   00:00
ora_4718.aud                                  100%  654     0.6KB/s   00:00
ora_3163.aud                                  100%  643     0.6KB/s   00:00
ora_2844.aud                                  100%  650     0.6KB/s   00:00
ora_28469.aud                                 100% 1296     1.3KB/s   00:00
ora_6654.aud                                  100%  654     0.6KB/s   00:00
ora_2985.aud                                  100%  782     0.8KB/s   00:00
ora_3117.aud                                  100%  643     0.6KB/s   00:00
ora_3099.aud                                  100%  643     0.6KB/s   00:00
ora_3037.aud                                  100%  643     0.6KB/s   00:00
ora_8593.aud                                  100%  654     0.6KB/s   00:00
ora_29311.aud                                 100%  657     0.6KB/s   00:00
ora_29312.aud                                 100%  787     0.8KB/s   00:00
ora_4444.aud                                  100%  780     0.8KB/s   00:00
ora_4218.aud                                  100%  779     0.8KB/s   00:00
ora_27559.aud                                 100%  656     0.6KB/s   00:00
ora_20375.aud                                 100%  635     0.6KB/s   00:00
ora_4346.aud                                  100%  779     0.8KB/s   00:00
ora_26269.aud                                 100%  663     0.7KB/s   00:00
ora_3068.aud                                  100%  650     0.6KB/s   00:00
ora_2837.aud                                  100%  650     0.6KB/s   00:00
ora_4901.aud                                  100% 1292     1.3KB/s   00:00
ora_7427.aud                                  100%  654     0.6KB/s   00:00
ora_2952.aud                                  100%  650     0.6KB/s   00:00
ora_4722.aud                                  100%  654     0.6KB/s   00:00
ora_3026.aud                                  100%  643     0.6KB/s   00:00
ora_3032.aud                                  100%  643     0.6KB/s   00:00
ora_4932.aud                                  100%  648     0.6KB/s   00:00
ora_3031.aud                                  100%  643     0.6KB/s   00:00
ora_4931.aud                                  100%  655     0.6KB/s   00:00
ora_28449.aud                                 100%  637     0.6KB/s   00:00
ora_26271.aud                                 100%  663     0.7KB/s   00:00
ora_2933.aud                                  100%  775     0.8KB/s   00:00
ora_3115.aud                                  100%  643     0.6KB/s   00:00
ora_23714.aud                                 100%  656     0.6KB/s   00:00
ora_28454.aud                                 100%  782     0.8KB/s   00:00
ora_6628.aud                                  100%  654     0.6KB/s   00:00
ora_4296.aud                                  100%  635     0.6KB/s   00:00
ora_4121.aud                                  100%  635     0.6KB/s   00:00
ora_3036.aud                                  100%  643     0.6KB/s   00:00
ora_3127.aud                                  100%  643     0.6KB/s   00:00
ora_3013.aud                                  100%  650     0.6KB/s   00:00
ora_3116.aud                                  100%  643     0.6KB/s   00:00
ora_29281.aud                                 100% 1296     1.3KB/s   00:00
ora_2932.aud                                  100%  643     0.6KB/s   00:00
ora_27246.aud                                 100%  656     0.6KB/s   00:00
ora_2871.aud                                  100%  650     0.6KB/s   00:00
ora_4340.aud                                  100%  635     0.6KB/s   00:00
ora_3172.aud                                  100%  643     0.6KB/s   00:00
ora_28498.aud                                 100%  657     0.6KB/s   00:00
ora_7404.aud                                  100%  654     0.6KB/s   00:00
ora_6630.aud                                  100%  654     0.6KB/s   00:00
ora_5148.aud                                  100%  654     0.6KB/s   00:00
ora_27695.aud                                 100%  656     0.6KB/s   00:00
ora_3098.aud                                  100%  650     0.6KB/s   00:00
ora_4685.aud                                  100%  785     0.8KB/s   00:00
ora_28586.aud                                 100%  656     0.6KB/s   00:00
ora_4584.aud                                  100%  655     0.6KB/s   00:00
ora_3057.aud                                  100%  775     0.8KB/s   00:00
ora_6108.aud                                  100%  654     0.6KB/s   00:00
ora_28499.aud                                 100%  787     0.8KB/s   00:00
ora_3033.aud                                  100%  643     0.6KB/s   00:00
ora_4554.aud                                  100% 1292     1.3KB/s   00:00
ora_28167.aud                                 100%  650     0.6KB/s   00:00
ora_20329.aud                                 100%  635     0.6KB/s   00:00
ora_7767.aud                                  100%  648     0.6KB/s   00:00
ora_2841.aud                                  100%  782     0.8KB/s   00:00
ora_23638.aud                                 100%  635     0.6KB/s   00:00
jytest_arc8_28547.trc                         100%  798     0.8KB/s   00:00
jytest_j002_22070.trc                         100%  748     0.7KB/s   00:00
jytest_p007_28515.trc                         100% 1144     1.1KB/s   00:00
jytest_arcl_5080.trc                          100%  449KB 448.6KB/s   00:00
jytest_arco_5086.trc                          100%  447KB 446.8KB/s   00:00
jytest_arc7_5043.trc                          100%  452KB 451.8KB/s   00:00
jytest_arcj_28569.trc                         100%  749     0.7KB/s   00:00
jytest_j009_25217.trc                         100%  720     0.7KB/s   00:00
jytest_p010_28521.trc                         100% 1144     1.1KB/s   00:00
jytest_arc4_5037.trc                          100%  448KB 448.3KB/s   00:00
jytest_arcm_28575.trc                         100%  717     0.7KB/s   00:00
jytest_arcp_5088.trc                          100%  591KB 591.3KB/s   00:00
jytest_arcp_28581.trc                         100% 1787     1.8KB/s   00:00
jytest_arcc_28555.trc                         100%  758     0.7KB/s   00:00
jytest_arc6_28543.trc                         100%  756     0.7KB/s   00:00
jytest_lgwr_28481.trc                         100% 3934     3.8KB/s   00:00
jytest_arc6_5041.trc                          100%  445KB 444.7KB/s   00:00
jytest_arci_28567.trc                         100%  717     0.7KB/s   00:00
jytest_arc7_28545.trc                         100%  756     0.7KB/s   00:00
jytest_arcr_5092.trc                          100%  451KB 451.4KB/s   00:00
jytest_p002_28505.trc                         100% 1144     1.1KB/s   00:00
jytest_p009_28519.trc                         100% 1144     1.1KB/s   00:00
jytest_p011_28523.trc                         100% 1144     1.1KB/s   00:00
jytest_lgwr_2998.trc                          100%  790     0.8KB/s   00:00
jytest_lgwr_29293.trc                         100%  764     0.8KB/s   00:00
jytest_arc2_28535.trc                         100%  759     0.7KB/s   00:00
jytest_arcn_28577.trc                         100%  717     0.7KB/s   00:00
jytest_arc8_5047.trc                          100%  452KB 452.0KB/s   00:00
jytest_arc1_5031.trc                          100%  451KB 450.8KB/s   00:00
jytest_arc0_5029.trc                          100%  449KB 449.0KB/s   00:00
jytest_p013_28527.trc                         100% 1144     1.1KB/s   00:00
jytest_arc3_5035.trc                          100%  450KB 449.7KB/s   00:00
jytest_lgwr_4664.trc                          100%  762     0.7KB/s   00:00
jytest_arcs_5094.trc                          100%  451KB 451.2KB/s   00:00
jytest_pmon_28471.trc                         100% 4877     4.8KB/s   00:00
jytest_arc5_28541.trc                         100%  728     0.7KB/s   00:00
jytest_arci_5074.trc                          100%  447KB 447.4KB/s   00:00
jytest_arcb_28553.trc                         100%  716     0.7KB/s   00:00
jytest_p006_28513.trc                         100% 1144     1.1KB/s   00:00
jytest_arce_28559.trc                         100% 1533     1.5KB/s   00:00
jytest_p005_28511.trc                         100% 1144     1.1KB/s   00:00
jytest_arc5_5039.trc                          100%  448KB 448.1KB/s   00:00
jytest_arct_5096.trc                          100%  451KB 451.1KB/s   00:00
jytest_pmon_4904.trc                          100% 1594     1.6KB/s   00:00
jytest_arcl_28573.trc                         100%  749     0.7KB/s   00:00
jytest_smon_28485.trc                         100%  679     0.7KB/s   00:00
jytest_j004_23117.trc                         100%  746     0.7KB/s   00:00
jytest_j005_23119.trc                         100%  721     0.7KB/s   00:00
jytest_arcq_28583.trc                         100%  729     0.7KB/s   00:00
jytest_arck_28571.trc                         100%  759     0.7KB/s   00:00
jytest_p014_28529.trc                         100% 1144     1.1KB/s   00:00
jytest_arcr_28585.trc                         100%  718     0.7KB/s   00:00
jytest_lns1_5098.trc                          100% 2085     2.0KB/s   00:00
jytest_arcs_28587.trc                         100%  729     0.7KB/s   00:00
jytest_lgwr_4914.trc                          100% 2094     2.0KB/s   00:00
jytest_p001_28503.trc                         100% 1144     1.1KB/s   00:00
jytest_p012_28525.trc                         100% 1144     1.1KB/s   00:00
jytest_arc3_28537.trc                         100%  770     0.8KB/s   00:00
jytest_arck_5078.trc                          100%  447KB 447.4KB/s   00:00
jytest_arca_28551.trc                         100%  758     0.7KB/s   00:00
jytest_arc1_28533.trc                         100% 1755     1.7KB/s   00:00
jytest_arca_5057.trc                          100%  449KB 448.6KB/s   00:00
jytest_arcc_5062.trc                          100%  450KB 450.0KB/s   00:00
jytest_arcb_5060.trc                          100%  449KB 448.8KB/s   00:00
jytest_arcf_28561.trc                         100% 1518     1.5KB/s   00:00
jytest_arc2_5033.trc                          100%  453KB 453.3KB/s   00:00
jytest_arc4_28539.trc                         100%  801     0.8KB/s   00:00
jytest_pmon_29283.trc                         100% 3682     3.6KB/s   00:00
jytest_j007_24157.trc                         100%  745     0.7KB/s   00:00
jytest_arce_5066.trc                          100%  449KB 449.4KB/s   00:00
jytest_p004_28509.trc                         100% 1144     1.1KB/s   00:00
jytest_arc0_28531.trc                         100%  759     0.7KB/s   00:00
jytest_arcm_5082.trc                          100%  453KB 452.6KB/s   00:00
jytest_arc9_28549.trc                         100%  756     0.7KB/s   00:00
jytest_j008_25215.trc                         100%  748     0.7KB/s   00:00
jytest_arcg_28563.trc                         100%  787     0.8KB/s   00:00
jytest_arcj_5076.trc                          100%  447KB 446.5KB/s   00:00
jytest_pmon_3070.trc                          100% 4645     4.5KB/s   00:00
jytest_p000_28501.trc                         100% 1144     1.1KB/s   00:00
jytest_lns1_29118.trc                         100% 1205     1.2KB/s   00:00
jytest_p003_28507.trc                         100% 1144     1.1KB/s   00:00
jytest_lgwr_4566.trc                          100%  790     0.8KB/s   00:00
jytest_arcg_5070.trc                          100%  448KB 448.4KB/s   00:00
jytest_arcf_5068.trc                          100%  448KB 448.3KB/s   00:00
jytest_j006_24155.trc                         100%  750     0.7KB/s   00:00
jytest_arch_5072.trc                          100%  449KB 449.3KB/s   00:00
jytest_p008_28517.trc                         100% 1144     1.1KB/s   00:00
jytest_arch_28565.trc                         100%  717     0.7KB/s   00:00
jytest_arc9_5049.trc                          100%  451KB 451.2KB/s   00:00
jytest_pmon_4556.trc                          100% 4359     4.3KB/s   00:00
jytest_arcn_5084.trc                          100%  451KB 450.8KB/s   00:00
jytest_pmon_4652.trc                          100% 3677     3.6KB/s   00:00
jytest_arcd_5064.trc                          100%  450KB 449.7KB/s   00:00
jytest_mmnl_4926.trc                          100%   31MB  31.3MB/s   00:01
alert_jytest.log                              100%   31MB  31.2MB/s   00:01
jytest_lgwr_3080.trc                          100%   10KB   9.9KB/s   00:00
jytest_arcd_28557.trc                         100%  758     0.7KB/s   00:00
jytest_arco_28579.trc                         100%  748     0.7KB/s   00:00
jytest_arcq_5090.trc                          100%  448KB 448.0KB/s   00:00

将数据文件,控制文件和重做日志文件复制到weblogic29这台机器上

[root@weblogic28 ~]# scp -r /u01/app/oracle/oradata/* root@10.138.130.29:/u01/app/oracle/oradata
root@10.138.130.29's password:
redo07a.log                                   100%   50MB  25.0MB/s   00:02
hygeia01.dbf                                  100%   20GB  42.9MB/s   07:57
redo04a.log                                   100%   50MB  50.0MB/s   00:01
control02.ctl                                 100% 6896KB   6.7MB/s   00:00
temp01.dbf                                    100% 5120MB  43.4MB/s   01:58
redo06b.log                                   100%   50MB  25.0MB/s   00:02
users01.dbf                                   100% 5128KB   5.0MB/s   00:00
control03.ctl                                 100% 6896KB   6.7MB/s   00:00
redo06a.log                                   100%   50MB  25.0MB/s   00:02
control01.ctl                                 100% 6896KB   6.7MB/s   00:00
redo05a.log                                   100%   50MB  50.0MB/s   00:01
redo07b.log                                   100%   50MB  50.0MB/s   00:01
redo05b.log                                   100%   50MB  50.0MB/s   00:01
sysaux01.dbf                                  100% 5120MB  43.0MB/s   01:59
redo04b.log                                   100%   50MB  50.0MB/s   00:01
redo01.log                                    100%   50MB  50.0MB/s   00:01
redo03.log                                    100%   50MB  25.0MB/s   00:02
redo02.log                                    100%   50MB  50.0MB/s   00:01
system01.dbf                                  100% 5120MB  41.0MB/s   02:05
undotbs01.dbf                                 100% 5120MB  34.1MB/s   02:30

还要将参数文件和口令文件复制过来

[root@weblogic28 ~]# scp -r /u01/app/oracle/product/10.2.0/db/dbs/* root@10.138.130.29:/u01/app/oracle/product/10.2.0/db/dbs
root@10.138.130.29's password:
alert_jytest.log                              100%  435     0.4KB/s   00:00
hc_jytest.dat                                 100% 1552     1.5KB/s   00:00
initdw.ora                                    100%   13KB  12.6KB/s   00:00
initjytest.ora                                100% 1753     1.7KB/s   00:00
init.ora                                      100% 8385     8.2KB/s   00:00
lkJYTEST                                      100%   24     0.0KB/s   00:00
orapwjytest                                   100% 1536     1.5KB/s   00:00
spfilejytest.ora                              100% 4608     4.5KB/s   00:00

修改环境变量

[oracle@weblogic29 ~]$ vi .bash_profile
# .bash_profile

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
        . ~/.bashrc
fi

# User specific environment and startup programs

TEMP=/u01/tmp
TMPDIR=/u01/tmp
export TEMP TMPDIR
export LD_ASSUME_KERNEL=2.6.9
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=/u01/app/oracle/product/10.2.0/db
export ORA_CRS_HOME=/u01/crs/oracle/product/10.2.0/crs
export ORACLE_SID=jytest
export NLS_LANG=AMERICAN_AMERICA.ZHS16GBK
export ORA_NLS33=$ORACLE_HOME/ocommon/nls/admin/data
LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib
export LD_LIBRARY_PATH
export PATH=$PATH:$ORACLE_HOME/bin
".bash_profile" 28L, 772C written
[oracle@weblogic29 ~]$ startup mount

[root@weblogic29 ~]# su - oracle
[oracle@weblogic29 ~]$ export ORACLE_SID=jytest
[oracle@weblogic29 ~]$ export ORACLE_HOME='/u01/app/oracle/product/10.2.0/db/dbs
[oracle@weblogic29 ~]$ echo $ORACLE_SID
jytest
[oracle@weblogic29 ~]$ echo $ORACLE_HOME
='/u01/app/oracle/product/10.2.0/db/dbs
[oracle@weblogic29 ~]$ sqlplus / as sysdba

SQL*Plus: Release 10.2.0.4.0 - Production on Mon Jun 1 18:33:39 2009

Copyright (c) 1982, 2007, Oracle.  All Rights Reserved.

Connected to an idle instance.

SQL> startup mount pfile='/u01/app/oracle/product/10.2.0/db/dbs/initjytest.ora'
ORA-09925: Unable to create audit trail file
Linux-x86_64 Error: 13: Permission denied
Additional information: 9925SQL>
[root@weblogic28 ~]# chown -R oracle:oinstall /u01/oracle
SQL> startup mount pfile='/u01/app/oracle/product/10.2.0/db/dbs/initjytest.ora'
ORACLE instance started.

Total System Global Area 6442450944 bytes
Fixed Size                  2030368 bytes
Variable Size            1090520288 bytes
Database Buffers         5335154688 bytes
Redo Buffers               14745600 bytes
Database mounted.
SQL> create spfile from pfile;

File created.

SQL> alter database open;

Database altered.

发表评论

电子邮件地址不会被公开。