Restore Oracle database to another server
1. Copy or remotely mount the backupset folder from the source server to the target server
2. On the target server, export ORACLE_SID as same as the source database and run "rman target /"
3. Restore spfile from backup:
RMAN> startup nomount;
startup failed: ORA-01078: failure in processing system parameters
LRM-00109: could not open parameter file '/u01/app/oracle/product/11.2.0/dbhome_1/dbs/initorcl01.ora'
starting Oracle instance without parameter file for retrieval of spfile
Oracle instance started
Total System Global Area 158662656 bytes
Fixed Size 2211448 bytes
Variable Size 88080776 bytes
Database Buffers 62914560 bytes
Redo Buffers 5455872 bytes
RMAN> restore spfile from '/u01/app/remote/flash_recovery_area/ORCL01/backupset/2014_10_01/o1_mf_ncsn1_TAG20141001T011809_b2q3ojl8_.bkp';
Starting restore at 27-OCT-14
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=18 device type=DISK
channel ORA_DISK_1: restoring spfile from AUTOBACKUP /u01/app/remote/flash_recovery_area/ORCL01/backupset/2014_10_01/o1_mf_ncsn1_TAG20141001T011809_b2q3ojl8_.bkp
channel ORA_DISK_1: SPFILE restore from AUTOBACKUP complete
Finished restore at 27-OCT-14
4. Open another ssh session, export ORACLE_SID and run "sqlplus / as sysdba" and create pfile from spfile:
[oracle@localhost dbs]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.1.0 Production on Mon Oct 27 10:34:57 2014
Copyright (c) 1982, 2009, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> create pfile from spfile;
File created.
SQL> exit
5. Review the pfile just created and mkdir all the file dests:
[oracle@localhost dbs]$ cat initorcl01.ora
orcl01.__db_cache_size=188743680
orcl01.__java_pool_size=4194304
orcl01.__large_pool_size=4194304
orcl01.__oracle_base='/u01/app/oracle'#ORACLE_BASE set from environment
orcl01.__pga_aggregate_target=272629760
orcl01.__sga_target=515899392
orcl01.__shared_io_pool_size=0
orcl01.__shared_pool_size=306184192
orcl01.__streams_pool_size=4194304
*.audit_file_dest='/u01/app/oracle/admin/orcl01/adump'
*.audit_trail='db'
*.compatible='11.2.0.0.0'
*.control_files='/u01/app/oracle/oradata/orcl01/control01.ctl','/u01/app/oracle/flash_recovery_area/orcl01/control02.ctl'
*.db_block_size=8192
*.db_domain=''
*.db_name='orcl01'
*.db_recovery_file_dest='/u01/app/oracle/flash_recovery_area'
*.db_recovery_file_dest_size=4070572032
*.diagnostic_dest='/u01/app/oracle'
*.dispatchers='(PROTOCOL=TCP) (SERVICE=orcl01XDB)'
*.memory_target=787480576
*.open_cursors=300
*.processes=150
*.remote_login_passwordfile='EXCLUSIVE'
*.undo_tablespace='UNDOTBS1'
[oracle@localhost dbs]$ mkdir -p /u01/app/oracle/admin/orcl01/adump
[oracle@localhost dbs]$ mkdir -p /u01/app/oracle/oradata/orcl01
[oracle@localhost dbs]$ mkdir -p /u01/app/oracle/flash_recovery_area/orcl01
6. In the RMAN session, restore the control files:
RMAN> restore controlfile from '/u01/app/remote/flash_recovery_area/ORCL01/backupset/2014_10_01/o1_mf_ncsn1_TAG20141001T011809_b2q3ojl8_.bkp';
7. Restart database in mount mode. You cannot directly alter database mount because the spfile has been restored:
RMAN> alter database mount;
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of alter db command at 10/27/2014 10:35:35
ORA-01103: database name 'ORCL01' in control file is not 'DUMMY'
RMAN> shutdown immediate;
Oracle instance shut down
RMAN> startup mount;
8. Catalog the backupsets:
RMAN> catalog start with '/u01/app/remote/flash_recovery_area/ORCL01/backupset/2014_10_01';
9. In the sqlplus session, check v$datafile and v$logfile and mkdir the directories.
SQL> select file#,name from v$datafile;
FILE#
----------
NAME
--------------------------------------------------------------------------------
1
/u01/app/oracle/oradata/orcl01/system01.dbf
2
/u01/app/oracle/oradata/orcl01/sysaux01.dbf
3
/u01/app/oracle/oradata/orcl01/undotbs01.dbf
FILE#
----------
NAME
--------------------------------------------------------------------------------
4
/u01/app/oracle/oradata/orcl01/user01.dbf
5
/u01/app/oracle/oradata/orcl01/example01.dbf
6
/u01/app/oracle/oradata/orcl01/index01
6 rows selected.
SQL> select member from v$logfile;
MEMBER
----------------------------------------------------------------------------------------------------
/u01/app/oracle/oradata/orcl01/redo03.log
/u01/app/oracle/oradata/orcl01/redo02.log
/u01/app/oracle/oradata/orcl01/redo01.log
In this case, /u01/app/oracle/oradata/orcl01 has been created at step 5.
10. In RMAN session, restore database, recover database and open database with resetlogs option
RMAN> restore database;
...
RMAN> recover database;
...
RMAN> alter database open resetlogs;
...
P.S.: if you want to restore datafiles to a different path, in step 10:
RMAN> run{
2> set newname for datafile 1 to '/u01/app/oracle/oradata/newpath/system01.dbf';
3> restore database;
4> switch datafile all;
5> recover database;
6> }
Restore Oracle database to another server的更多相关文章
- Create Oracle Enterprise Manager repository data after restore a database from another server
1. Set password for SYS in password file: orapwd file=$ORACLE_HOME/dbs/orapw<ORACLE_SID> 2. Dr ...
- Ways to access Oracle Database in PostgreSQL
Today, organizations stores information(data) in different database systems. Each database system ha ...
- Oracle Database Memory Structures
Oracle Database creates and uses memory structures for various purposes. For example, memory stores ...
- Oracle Database Server 'TNS Listener'远程数据投毒漏洞(CVE-2012-1675)解决
环境:Windows 2008 R2 + Oracle 10.2.0.3 应用最新bundle patch后,扫描依然报出漏洞 Oracle Database Server 'TNS Listener ...
- 使用 Oracle GoldenGate 在 Microsoft SQL Server 和 Oracle Database 之间复制事务
使用 Oracle GoldenGate 在 Microsoft SQL Server 和 Oracle Database 之间复制事务 作者:Nikolay Manchev 分步构建一个跨这些平台的 ...
- Linked Server for SQL Server 2012(x64) to Oracle Database 12c(x64)
因为把两台数据库装了同一台机机器上,所以没有安装oracle Client的部分,Oracle部分使用netca创建的Net Service Name,使用tnsping以及登入方式的确认用户权限的以 ...
- how to backup and restore database of SQL Server
Back up 1,右键选中需要备份的数据库,Tasks-->Backup 2.General中,Destination,先remove掉之前的,然后再Add 需要注意的是,add的文件,必须要 ...
- Linux 平台安装Oracle Database 12c
1)下载Oracle Database 12cRelease 1安装介质 官方的下载地址: 1:http://www.oracle.com/technetwork/database/enterpris ...
- P6 EPPM Manual Installation Guide (Oracle Database)
P6 EPPM Manual Installation Guide (Oracle Database) P6 EPPM Manual Installation Guide (Oracle Databa ...
随机推荐
- Window10+VS2015+DevExpress.net 15.1.7完美破解(图)
终于找到一个可用的破解工具了,并更新到最新的组件包DevExpressComponents-15.1.7.15288.exe,先看图 破解方法: 先安装DevExpressUniversalTrial ...
- Android自定义控件
开发自定义控件的步骤: 1.了解View的工作原理 2. 编写继承自View的子类 3. 为自定义View类增加属性 4. 绘制控件 5. 响应用户消息 6 .自定义回调函数 一.Vie ...
- FZU 1686 神龙的难题 (重复覆盖)
Problem 1686 神龙的难题 Accept: 397 Submit: 1258Time Limit: 1000 mSec Memory Limit : 32768 KB Prob ...
- 转:fatal error: SDL/SDL.h: No such file or directory
Ubuntu的新得立已经包含SDL库,所以通过几个简单的命令就可以安装,比windows还傻瓜! sudo apt-get install libsdl1.2-dev(比较大,10M左右) 附加包: ...
- shell编程之运算符
declare声明变量类型 declare [+ / -] [选项] 变量名 - :给变量设定类型属性 + :取消变量的类型属性 -a :将变量声明为数组型 -i :将变量声明为整数型 -x ...
- 【私人定制jackson】定制jackson的自定义序列化(null值的处理)
最近用springMVC做服务端的http+json的接口,出现一个不是特别容易解决的问题: 在对List类型的值进行处理时,有一部分服务是有做一些逻辑判断的,在逻辑判断不通过的时候会返回一个null ...
- 乌邦图ubuntu配置iptables的NAT上网
cat /etc/network/iptables.up.rules # Generated by iptables-save v1. :: *nat :PREROUTING ACCEPT [:] : ...
- poj -- 1042 Gone Fishing(枚举+贪心)
题意: John现有h个小时的空闲时间,他打算去钓鱼.钓鱼的地方共有n个湖,所有的湖沿着一条单向路顺序排列(John每在一个湖钓完鱼后,他只能走到下一个湖继续钓),John必须从1号湖开始钓起,但是他 ...
- mysql在linux下不区分大小写
1.先停止mysql service mysql stop 2.如果用rpm直接安装的mysql,路径在:/usr/下,查找my.cnf. 3.在[mysqld]下添加: lower_case_tab ...
- 记录一次自己对nginx+fastcgi(fpm)+mysql压力测试结果
nginx + fastcgi(fpm) 压力测试: CentOS release 5.9 16核12G内存 静态页面: 并发1000,压测200秒,测试结果: 系统最大负载5.47 成功响应: 25 ...