网络很多帖子介绍的都是不完全恢复的方法.
注意: 迁移前要保证是归档状态下.1 迁移在线重做日志文件迁移重做日志的方法与不完全恢复的做法是一致的。在ASM上有两个磁盘组,一个是DATA,一个是FRA。
1.1 修改参数SQL> show parameter db_create;NAME TYPE VALUE------------------------------ ----------- -------------db_create_file_dest stringdb_create_online_log_dest_1 stringdb_create_online_log_dest_2 stringdb_create_online_log_dest_3 stringdb_create_online_log_dest_4 stringdb_create_online_log_dest_5 stringSQL> alter system set db_create_online_log_dest_1 = "+DATA";System altered.SQL> alter system set db_create_file_dest = "+DATA";System altered.SQL> alter system set db_recovery_file_dest = "+FRA";System altered.SQL> show parameter db_create;NAME TYPE VALUE------------------------------ ----------- -------------db_create_file_dest string +DATAdb_create_online_log_dest_1 string +DATAdb_create_online_log_dest_2 stringdb_create_online_log_dest_3 stringdb_create_online_log_dest_4 stringdb_create_online_log_dest_5 stringSQL> show parameter db_recoveryNAME TYPE VALUE------------------------------- ----------- -------------db_recovery_file_dest string +FRAdb_recovery_file_dest_size big integer 2G
1.2 增加日志组增加日志组,新的日志组路径指向ASM,并删除旧的日志组SQL> alter database add logfile group 4 size 25M;Database altered.SQL> alter database add logfile group 5 size 25M;Database altered.SQL> alter database add logfile group 6 size 25M;Database altered.SQL> select group#,status from v$log; GROUP# STATUS---------- ------------- 1 INACTIVE 2 INACTIVE 3 CURRENT 4 UNUSED 5 UNUSED 6 UNUSED6 rows selected.
1.3 删除日志组SQL> alter database drop logfile group 1;Database altered.SQL> alter database drop logfile group 2;Database altered.SQL> alter system switch logfile;System altered.SQL> alter system checkpoint;System altered.SQL> alter database drop logfile group 3;Database altered.
1.4 查看ASM日志组此时可以看到在ASM上的日志组信息:[Oracle@cent4 ~]$ export ORACLE_SID=+ASM[oracle@cent4 ~]$ asmcmdASMCMD> lsDATA/FRA/ASMCMD> cd dataASMCMD> cd testASMCMD> cd onlinelogASMCMD> lsgroup_4.256.752606807group_5.257.752606815group_6.258.752606821ASMCMD> pwd+data/test/onlinelog
2 迁移数据文件迁移数据文件要在mount的状态下进行。
2.1 原数据库切换到mount状态下SQL> shutdown immediateSQL> startup mount
2.2 在rman下迁移数据文件[oracle@cent4 ~]$ rman target /Recovery Manager: Release 10.2.0.1.0 - Production on 星期二 5月 31 17:29:36 2011Copyright (c) 1982, 2005, Oracle. All rights reserved.connected to target database: TEST (DBID=2050570208, not open)RMAN> backup as copy database format "+DATA";Starting backup at 2011-05-31 17:29:54using target database control file instead of recovery catalogallocated channel: ORA_DISK_1channel ORA_DISK_1: sid=100 devtype=DISKchannel ORA_DISK_1: starting datafile copyinput datafile fno=00001 name=/oradata/test/system01.dbfoutput filename=+DATA/test/datafile/system.259.752606999 tag=TAG20110531T172955 recid=2 stamp=752607035channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:45channel ORA_DISK_1: starting datafile copyinput datafile fno=00003 name=/oradata/test/sysaux01.dbfoutput filename=+DATA/test/datafile/sysaux.260.752607043 tag=TAG20110531T172955 recid=3 stamp=752607059channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:25channel ORA_DISK_1: starting datafile copyinput datafile fno=00005 name=/oradata/test/example01.dbfoutput filename=+DATA/test/datafile/example.261.752607067 tag=TAG20110531T172955 recid=4 stamp=752607075channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:15channel ORA_DISK_1: starting datafile copyinput datafile fno=00002 name=/oradata/test/undotbs01.dbfoutput filename=+DATA/test/datafile/undotbs1.262.752607083 tag=TAG20110531T172955 recid=5 stamp=752607084channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:07channel ORA_DISK_1: starting datafile copyinput datafile fno=00004 name=/oradata/test/users01.dbfoutput filename=+DATA/test/datafile/users.263.752607089 tag=TAG20110531T172955 recid=6 stamp=752607089channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:01channel ORA_DISK_1: starting datafile copycopying current control fileoutput filename=+DATA/test/controlfile/backup.264.752607091 tag=TAG20110531T172955 recid=7 stamp=752607091channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:03channel ORA_DISK_1: starting full datafile backupsetchannel ORA_DISK_1: specifying datafile(s) in backupsetincluding current SPFILE in backupsetchannel ORA_DISK_1: starting piece 1 at 2011-05-31 17:31:34channel ORA_DISK_1: finished piece 1 at 2011-05-31 17:31:35piece handle=+DATA/test/backupset/2011_05_31/nnsnf0_tag20110531t172955_0.265.752607095 tag=TAG20110531T172955 comment=NONEchannel ORA_DISK_1: backup set complete, elapsed time: 00:00:02Finished backup at 2011-05-31 17:31:35 RMAN> switch database to copy;datafile 1 switched to datafile copy "+DATA/test/datafile/system.259.752606999"datafile 2 switched to datafile copy "+DATA/test/datafile/undotbs1.262.752607083"datafile 3 switched to datafile copy "+DATA/test/datafile/sysaux.260.752607043"datafile 4 switched to datafile copy "+DATA/test/datafile/users.263.752607089"datafile 5 switched to datafile copy "+DATA/test/datafile/example.261.752607067"
2.3 查看ASM数据文件在ASMCMD中看到的结果:ASMCMD> lsEXAMPLE.261.752607067SYSAUX.260.752607043SYSTEM.259.752606999UNDOTBS1.262.752607083USERS.263.752607089
Oracle 用户、角色、权限(系统权限、对象权限)的数据字典表ORA-00600: 内部错误代码, 参数: [evapls1], [], [], [], [], [], [], []相关资讯 Oracle数据库 Oracle入门教程 oracle数据库教程
- Oracle数据库全球化 (03月01日)
- Oracle数据库日期过滤方法性能比较 (02/02/2015 13:20:26)
- Oracle数据库安装中端口被占用问题 (10/29/2014 07:42:24)
| - 在CentOS 6.6上搭建C++运行环境并 (10/10/2015 19:44:40)
- Oracle数据库无法使用localhost和 (11/14/2014 16:39:10)
- 使用SQLT来构建Oracle测试用例 (08/28/2014 06:17:41)
|
本文评论 查看全部评论 (0)