Oracle DB 使用RMAN将数据库移植到ASM存储区
- 将数据库移植到ASM 存储区
- 将表空间移植到ASM 存储中
3. 将 TBSASMMIG 移植到ASM 存储中。完成操作后,请检查移植是否成功,并且该表空间中的表是否保持原样。
- sys@TEST0924> select FILE_NAME,TABLESPACE_NAME from dba_data_files;
- FILE_NAME TABLESPACE_NAME
- -------------------------------------------------- ------------------------------
- /u01/app/oracle/oradata/test0924/users01.dbf USERS
- /u01/app/oracle/oradata/test0924/sysaux01.dbf SYSAUX
- /u01/app/oracle/oradata/test0924/system01.dbf SYSTEM
- /u01/app/oracle/oradata/test0924/example01.dbf EXAMPLE
- /u01/app/oracle/oradata/test0924/undotbs01.dbf UNDOTBS1
- sys@TEST0924> create tablespace TBSASMMIG datafile '/u01/app/oracle/oradata/test0924/tbsasmmig01.dbf' size 10m;
- Tablespace created.
- sys@TEST0924> create table t2 (id number,name varchar2(20)) tablespace TBSASMMIG;
- Table created.
- sys@TEST0924> insert into t2 values (1,'a1');
- 1 row created.
- sys@TEST0924> commit;
- Commit complete.
- sys@TEST0924> select file_id,file_name,tablespace_name from dba_data_files;
- FILE_ID FILE_NAME TABLESPACE_NAME
- ---------- -------------------------------------------------- ------------------------------
- 4 /u01/app/oracle/oradata/test0924/users01.dbf USERS
- 3 /u01/app/oracle/oradata/test0924/tbsasmmig01.dbf TBSASMMIG
- 2 /u01/app/oracle/oradata/test0924/sysaux01.dbf SYSAUX
- 1 /u01/app/oracle/oradata/test0924/system01.dbf SYSTEM
- 5 /u01/app/oracle/oradata/test0924/example01.dbf EXAMPLE
- 9 /u01/app/oracle/oradata/test0924/undotbs01.dbf UNDOTBS1
- 6 rows selected.
- [oracle@rtest ~]$ rman target /
- Recovery Manager: Release 11.2.0.3.0 - Production on Sun Nov 3 17:02:51 2013
- Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
- connected to target database: TEST0924 (DBID=2720875862)
- RMAN> sql 'alter database datafile 3 offline';
- sql statement: alter database datafile 3 offline
- RMAN> backup as copy datafile 3 format '+DATA';
- Starting backup at 03-NOV-13
- allocated channel: ORA_DISK_1
- channel ORA_DISK_1: SID=127 device type=DISK
- allocated channel: ORA_DISK_2
- channel ORA_DISK_2: SID=191 device type=DISK
- allocated channel: ORA_DISK_3
- channel ORA_DISK_3: SID=157 device type=DISK
- channel ORA_DISK_1: starting datafile copy
- input datafile file number=00003 name=/u01/app/oracle/oradata/test0924/tbsasmmig01.dbf
- output file name=+DATA/test0924/datafile/tbsasmmig.264.830538365 tag=TAG20131103T170603 RECID=13 STAMP=830538366
- channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:07
- Finished backup at 03-NOV-13
- Starting Control File and SPFILE Autobackup at 03-NOV-13
- piece handle=/u01/app/oracle/fast_recovery_area/TEST0924/autobackup/2013_11_03/o1_mf_s_830538370_97fl6mr9_.bkp comment=NONE
- Finished Control File and SPFILE Autobackup at 03-NOV-13
- RMAN> switch datafile 3 to copy;
- datafile 3 switched to datafile copy "+DATA/test0924/datafile/tbsasmmig.264.830538365"
- RMAN> recover datafile 3;
- Starting recover at 03-NOV-13
- using channel ORA_DISK_1
- using channel ORA_DISK_2
- using channel ORA_DISK_3
- starting media recovery
- media recovery complete, elapsed time: 00:00:00
- Finished recover at 03-NOV-13
- RMAN> sql 'alter database datafile 3 online';
- sql statement: alter database datafile 3 online
- sys@TEST0924> select file_id,file_name,tablespace_name from dba_data_files;
- FILE_ID FILE_NAME TABLESPACE_NAME
- ---------- -------------------------------------------------- ------------------------------
- 4 /u01/app/oracle/oradata/test0924/users01.dbf USERS
- 3 +DATA/test0924/datafile/tbsasmmig.264.830538365 TBSASMMIG
- 2 /u01/app/oracle/oradata/test0924/sysaux01.dbf SYSAUX
- 1 /u01/app/oracle/oradata/test0924/system01.dbf SYSTEM
- 5 /u01/app/oracle/oradata/test0924/example01.dbf EXAMPLE
- 9 /u01/app/oracle/oradata/test0924/undotbs01.dbf UNDOTBS1
- 6 rows selected.
- sys@TEST0924> select * from t2
- 2 ;
- ID NAME
- ---------- --------------------
- 1 a1
另一种转换方法:
- RMAN> backup tablespace users;
- Starting backup at 24-OCT-13
- using target database control file instead of recovery catalog
- allocated channel: ORA_DISK_1
- channel ORA_DISK_1: SID=163 device type=DISK
- allocated channel: ORA_DISK_2
- channel ORA_DISK_2: SID=226 device type=DISK
- allocated channel: ORA_DISK_3
- channel ORA_DISK_3: SID=9 device type=DISK
- channel ORA_DISK_1: starting full datafile backup set
- channel ORA_DISK_1: specifying datafile(s) in backup set
- input datafile file number=00004 name=/u01/app/oracle/oradata/test0924/users01.dbf
- channel ORA_DISK_1: starting piece 1 at 24-OCT-13
- channel ORA_DISK_1: finished piece 1 at 24-OCT-13
- piece handle=/u01/app/oracle/fast_recovery_area/TEST0924/backupset/2013_10_24/o1_mf_nnndf_TAG20131024T101748_96lc0dxh_.bkp tag=TAG20131024T101748 comment=NONE
- channel ORA_DISK_1: backup set complete, elapsed time: 00:00:07
- Finished backup at 24-OCT-13
- Starting Control File and SPFILE Autobackup at 24-OCT-13
- piece handle=/u01/app/oracle/fast_recovery_area/TEST0924/autobackup/2013_10_24/o1_mf_s_829649875_96lc0obm_.bkp comment=NONE
- Finished Control File and SPFILE Autobackup at 24-OCT-13
- RMAN> run
- 2> {sql 'alter tablespace users offline immediate';
- 3> set newname for datafile 4 to '+DATA';
- 4> restore tablespace users;
- 5> switch datafile 4;
- 6> recover tablespace users;
- 7> sql 'alter tablespace users online';
- 8> }
- sql statement: alter tablespace users offline immediate
- executing command: SET NEWNAME
- Starting restore at 24-OCT-13
- using channel ORA_DISK_1
- using channel ORA_DISK_2
- using channel ORA_DISK_3
- channel ORA_DISK_1: starting datafile backup set restore
- channel ORA_DISK_1: specifying datafile(s) to restore from backup set
- channel ORA_DISK_1: restoring datafile 00004 to +DATA
- channel ORA_DISK_1: reading from backup piece /u01/app/oracle/fast_recovery_area/TEST0924/backupset/2013_10_24/o1_mf_nnndf_TAG20131024T101748_96lc0dxh_.bkp
- channel ORA_DISK_1: piece handle=/u01/app/oracle/fast_recovery_area/TEST0924/backupset/2013_10_24/o1_mf_nnndf_TAG20131024T101748_96lc0dxh_.bkp tag=TAG20131024T101748
- channel ORA_DISK_1: restored backup piece 1
- channel ORA_DISK_1: restore complete, elapsed time: 00:00:07
- Finished restore at 24-OCT-13
- datafile 4 switched to datafile copy
- input datafile copy RECID=6 STAMP=829650049 file name=+DATA/test0924/datafile/users.260.829650045
- Starting recover at 24-OCT-13
- using channel ORA_DISK_1
- using channel ORA_DISK_2
- using channel ORA_DISK_3
- starting media recovery
- media recovery complete, elapsed time: 00:00:01
- Finished recover at 24-OCT-13
- sql statement: alter tablespace users online
- sys@TEST0924> select file_name from dba_data_files;
- FILE_NAME
- ----------------------------------------------------------------------------------------------------
- +DATA/test0924/datafile/users.260.829650045
- /u01/app/oracle/oradata/test0924/sysaux01.dbf
- /u01/app/oracle/oradata/test0924/system01.dbf
- /u01/app/oracle/oradata/test0924/example01.dbf
- /u01/app/oracle/oradata/test0924/undotbs02.dbf
- /u01/app/oracle/oradata/test0924/undotbs01.dbf
- /u01/app/oracle/oradata/test0924/inventory01.dbf
- 7 rows selected.
Oracle DB 使用RMAN将数据库移植到ASM存储区的更多相关文章
- Oracle DB 使用RMAN恢复目录
• 对恢复目录和RMAN 资料档案库控制文件的使用进行比较• 创建和配置恢复目录• 在恢复目录中注册数据库• 同步恢复目录• 使用RMAN 存储脚本• 备份恢复目录• 创建虚拟专用目录 RMAN 资料 ...
- Oracle Study之--Oracle 11gR2通过RMAN克隆数据库
Oracle Study之--Oracle 11gR2通过RMAN克隆数据库 Purpose of Database Duplication A duplicate database is usefu ...
- Oracle DB 执行表空间时间点恢复
• 列出在执行表空间时间点恢复(TSPITR) 时会发生的操作 • 阐释TSPITR 使用的术语的定义 • 确定适合将TSPITR 用作解决方案的情况 • 确定时间点恢复的正确目标时间 • 确定不能使 ...
- Oracle【IT实验室】数据库备份与恢复之四:RMAN(备份与恢复管理器)
RMAN是ORACLE提供的一个备份与恢复的工具,可以用来备份和还原数据库文件. 归档日志和控制文件.它也可以用来执行完全或不完全的数据库恢复. RMAN可以由命令行接口或者 OEM的 Backup ...
- Hyper-V安装Oracle Linux6_4 Oracle db 12c并使用rman做异机恢复
本文记录在Windows Server 2012 R2上安装Oracle Enterprise Linux 6.4以及使用RMAN进行进行异机恢复的过程. Windows服务器增加Hyper-V功能 ...
- Oracle DB 管理数据库的空间
• 描述4 KB 扇区磁盘的概念及使用 • 使用可移动表空间 • 描述可移动表空间的概念 数据库存储 数据库存储 数据库包括物理结构和逻辑结构.由于物理结构和逻辑结构是分开的,因此管理数据的物 理存储 ...
- Oracle 11gR2使用RMAN duplicate复制数据库
11g的RMAN duplicate 个人感觉比10g的先进了很多,10g需在rman备份的基础上进行复制,使用RMAN duplicate创建一个数据完全相同但DBID不同的数据库.而11g的RMA ...
- Oracle RMAN 恢复数据库到不同主机(一)
一.RMAN 备份的内容 RMAN做数据库全备时包含了 数据文件.归档日志.控制文件和参数文件和备份日志,如下: arch_20160223_08qukp2t_1_1 arch_20160223_0 ...
- Oracle 11gR2 使用RMAN Duplicate复制数据库
Oracle 11gR2 使用RMAN Duplicate复制数据库 前言: 上周刚做完一个项目,用户要求RAC的数据库可以自己主动备份到另外一个单节点上,单节点可以正常拿起来就能用. ...
随机推荐
- C++ 指针引用
//指针引用 #include<iostream> using namespace std; struct Teacher{ ]; int age; }; int InitA(Teache ...
- 【UVa】Salesmen(dp)
http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&p ...
- hdu 1233 还是畅通project
本题链接:点击打开链接 本题大意: 有n个村庄,n*(n-1)/2条路,输入每条路所连接是哪两个村庄及长度,求使全部村庄均连通(并不是都两两连通) 所铺公路的最短路程. 解题思路: 使用并查集基础及K ...
- QTreeWidget 获取被双击的子项的层次路径
from PyQt5.QtWidgets import (QApplication, QWidget, QHBoxLayout, QTreeWidget, QTreeWidgetItem, QGrou ...
- gcc参数PIE和PIC的区别和共同点
gcc参数的PIE和PIC 区别 PIE:用在可执行文件 PIC:用在库文件 共同点 生成跟位置没有关系的symbol
- MD5的各种实现——也是醉了
MD5即Message-Digest Algorithm 5(信息-摘要算法5).用于确保信息传输完整一致. 是计算机广泛使用的杂凑算法之中的一个(又译摘要算法.哈希算法),主流编程语言普遍已有MD5 ...
- 自己开发iOS版按键精灵--TTouch
利用闲余时间,把之前的按键录制和播放整理了一些,开发了一个iOS版按键录制.播放的越狱APP,类似按键精灵.触动精灵等按键类的基本功能.脚本采用lua语法格式,可直接执行lua脚本,通过lua和obj ...
- 【theano】tutorial
http://deeplearning.net/software/theano/tutorial/index.html#tutorial
- C++ 智能指针学习
C++ Code 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 ...
- Spring_day02--课程安排_Spring的bean管理(注解)(注解创建对象/注入属性、配置文件和注解混合使用)
Spring_day02 上节内容回顾 今天内容介绍 Spring的bean管理(注解) 注解介绍 Spring注解开发准备 注解创建对象 注解注入属性 配置文件和注解混合使用 AOP概念 AOP原理 ...