一、测试机安装OS+Oracle Software,包括配置oracle用户、组和环境变量(略) 二、开始异机恢复 1. 复制源库最新备份集、初始化参数、密码文件到测试机[oracle@ora10g backupsets]$ scp *20141012* 192.168.1.213:/tmpThe authenticity of host "192.168.1.213 (192.168.1.213)" can"t be established.RSA key fingerprint is 78:0e:33:cb:3f:04:e4:5d:d1:71:29:a4:3f:3a:79:41.Are you sure you want to continue connecting (yes/no)? yesWarning: Permanently added "192.168.1.213" (RSA) to the list of known hosts.oracle@192.168.1.213"s password: Connection closed by 192.168.1.213lost connection[oracle@ora10g backupsets]$ scp *20141012* 192.168.1.213:/tmporacle@192.168.1.213"s password: ora10g-4175411955_20141012_860776699_315.arc 100% 4336KB 2.1MB/s 00:02 ora10g-4175411955_20141012_860776704_316.db 100% 165MB 2.1MB/s 01:20 ora10g-4175411955_20141012_860776830_317.arc 100% 418KB 417.5KB/s 00:00 ora10g-c-4175411955-20141012-00.ctl 100% 7424KB 2.4MB/s 00:03 [oracle@ora10g backupsets]$ scp $ORACLE_HOME/dbs/initora10g.ora oracle@192.168.1.213:/tmporacle@192.168.1.213"s password: initora10g.ora 100% 1136 1.1KB/s 00:00 [oracle@ora10g backupsets]$ scp $ORACLE_HOME/dbs/orapwora10g oracle@192.168.1.213:/tmporacle@192.168.1.213"s password: orapwora10g 100% 1536 1.5KB/s 00:00 如果没有生成过initora10g.ora初始化参数文件,则创建一个:SQL> create pfile from spfile;创建完默认路径是放在$ORACLE_HOME/dbs下面
2. 修改初始化参数[root@bak tmp]# cat initora10g.ora ora10g.__db_cache_size=0ora10g.__java_pool_size=0ora10g.__large_pool_size=0ora10g.__shared_pool_size=0ora10g.__streams_pool_size=0*.audit_file_dest="/oracle/admin/ora10g/adump"*.background_dump_dest="/oracle/admin/ora10g/bdump"*.compatible="10.2.0.1.0"*.control_files="/oradata/ora10g/control01.ctl","/oradata/ora10g/control02.ctl","/oradata/ora10g/control03.ctl"#Restore Controlfile*.core_dump_dest="/oracle/admin/ora10g/cdump"*.db_block_size=8192*.db_domain=""*.db_file_multiblock_read_count=16*.db_name="ora10g"*.db_recovery_file_dest="/oracle/flash_recovery_area"*.db_recovery_file_dest_size=2147483648*.dispatchers="(PROTOCOL=TCP) (SERVICE=ora10gXDB)"*.job_queue_processes=10*.log_archive_format="%t_%s_%r.dbf"*.nls_language="SIMPLIFIED CHINESE"*.nls_territory="CHINA"*.open_cursors=300*.pga_aggregate_target=0*.processes=150*.remote_login_passwordfile="EXCLUSIVE"*.sga_target=0*.undo_management="AUTO"*.undo_tablespace="UNDOTBS1"*.user_dump_dest="/oracle/admin/ora10g/udump" 注意,假设我这里测试机使用的目录和源库不同,注意红色部分为修改的内容
3. 把密码文件和修改好的初始化参数文件拷贝到测试机相应位置[oracle@bak ~]$ mv /tmp/initora10g.ora $ORACLE_HOME/dbs[oracle@bak ~]$ mv /tmp/orapwora10g $ORACLE_HOME/dbs --------------------------------------
推荐阅读 --------------------------------------
RMAN 配置归档日志删除策略 http://www.linuxidc.com/Linux/2013-11/92670.htmOracle基础教程之通过RMAN复制数据库 http://www.linuxidc.com/Linux/2013-07/87072.htmRMAN备份策略制定参考内容 http://www.linuxidc.com/Linux/2013-03/81695.htmRMAN备份学习笔记 http://www.linuxidc.com/Linux/2013-03/81892.htmOracle数据库备份加密 RMAN加密 http://www.linuxidc.com/Linux/2013-03/80729.htm--------------------------------------分割线 --------------------------------------
4. 在测试机根据初始化参数文件中指定的路径创建目录(注意目录必须对于oracle用户有读写权限)[root@bak tmp]# mkdir /oradata/ora10g -p[root@bak tmp]# mkdir /oracle/admin/ora10g/adump -p[root@bak tmp]# mkdir /oracle/admin/ora10g/bdump[root@bak tmp]# mkdir /oracle/admin/ora10g/cdump[root@bak tmp]# mkdir /oracle/admin/ora10g/udump[root@bak tmp]# chown oracle:oinstall /oradata -R[root@bak tmp]# chmod 755 /oradata -R[root@bak tmp]# chown oracle:oinstall /oracle -R[root@bak tmp]# chmod 755 /oracle -R
5. 启动实例到nomountSQL> startup nomountORA-00371: not enough shared pool memory, should be atleast 72265318 bytes 由于假设测试机配置要比源库低,而暂时不确定如何分配SGA,刚才在初始化参数中把内存分配的值,都设置成了0,包括sga_target,既然没有自动分配内存组件,那么手动设置sga_target=1G SQL> ![oracle@bak ~]$ vim /u01/app/oracle/product/10.2.0/db_1/dbs/initora10g.ora ...*.sga_target=1G
...修改保存后,重新启动实例 [oracle@bak ~]$ sqlplus / as sysdba SQL*Plus: Release 10.2.0.1.0 - Production on Sun Oct 12 17:25:50 2014 Copyright (c) 1982, 2005, Oracle. All rights reserved. Connected to an idle instance. SQL> startup nomountORA-01261: Parameter db_recovery_file_dest destination string cannot be translatedORA-01262: Stat failed on a file destination directoryLinux Error: 2: No such file or directory 由于刚才忘记创建了/oracle/flash_recovery_area这个目录,因此报错,如果测试机并不想启用FRA的话,可以把该参数注释掉 SQL> ![oracle@bak ~]$ vim /u01/app/oracle/product/10.2.0/db_1/dbs/initora10g.ora
...#*.db_recovery_file_dest="/oracle/flash_recovery_area"#*.db_recovery_file_dest_size=2147483648... [oracle@bak ~]$ sqlplus / as sysdba
SQL*Plus: Release 10.2.0.1.0 - Production on Sun Oct 12 17:28:08 2014 Copyright (c) 1982, 2005, Oracle. All rights reserved. Connected to an idle instance. SQL> startup nomountORACLE instance started. Total System Global Area 1073741824 bytesFixed Size 1223512 bytesVariable Size 264242344 bytesDatabase Buffers 805306368 bytesRedo Buffers 2969600 bytesSQL> 注意,如果登陆SQLPLUS时碰到无法用OS Local验证,只需用netca创建一个监听即可解决
6. 恢复测试机控制文件[oracle@bak ~]$ rman target / Recovery Manager: Release 10.2.0.1.0 - Production on Sun Oct 12 17:42:07 2014 Copyright (c) 1982, 2005, Oracle. All rights reserved. connected to target database: ora10g (not mounted) RMAN> restore controlfile from "/tmp/ora10g-c-4175411955-20141012-00.ctl"; Starting restore at 12-OCT-14using target database control file instead of recovery catalogallocated channel: ORA_DISK_1channel ORA_DISK_1: sid=156 devtype=DISK channel ORA_DISK_1: restoring control filechannel ORA_DISK_1: restore complete, elapsed time: 00:00:05output filename=/oradata/ora10g/control01.ctloutput filename=/oradata/ora10g/control02.ctloutput filename=/oradata/ora10g/control03.ctlFinished restore at 12-OCT-14 RMAN> alter database mount; database mountedreleased channel: ORA_DISK_1 在CentOS 6.4下安装Oracle 11gR2(x64) http://www.linuxidc.com/Linux/2014-02/97374.htmOracle 11gR2 在VMWare虚拟机中安装步骤 http://www.linuxidc.com/Linux/2013-09/89579p2.htmDebian 下 安装 Oracle 11g XE R2 http://www.linuxidc.com/Linux/2014-03/98881.htm
更多详情见请继续阅读下一页的精彩内容: http://www.linuxidc.com/Linux/2014-10/108250p2.htm
Install Orace 11g on Solaris 10 Sparc 64 bit使用rowid和rownum获取记录时要注意的问题相关资讯 RMAN异机恢复 RMAN恢复
- 异机RMAN数据不完全恢复 (06月14日)
- RMAN数据库恢复失败解决一例 (11/13/2014 19:00:18)
- RMAN备份数据库后到另一台机器上恢 (06/06/2014 19:34:44)
| - 如何使用 RMAN 异机恢复部分表空间 (12/19/2014 19:21:47)
- Oracle rman恢复到异地、异机 (09/12/2014 20:54:36)
- 使用RMAN进行表空间TSPITR自动恢复 (05/04/2014 08:45:49)
|
本文评论 查看全部评论 (0)