如何通过RMAN进行裸设备和文件系统之间的数据文件迁移
2015-01-23 12:23
786 查看
[oracle@danaly ~]$ sqlplus "/ as sysdba" SQL*Plus: Release 10.2.0.1.0 - Production on Wed Nov 30 14:41:53 2005 Copyright (c) 1982, 2005, Oracle. All rights reserved. Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production With the Partitioning, Oracle Label Security, OLAP and Data Mining Scoring Engine options SQL> create tablespace eygle datafile '/dev/cciss/c0d0p11' size 10M; Tablespace created. SQL> create table eygle tablespace eygle as select * from dba_objects; Table created. SQL> select count(*) from eygle; COUNT(*) ---------- 50420 SQL> alter tablespace eygle offline; Tablespace altered. SQL> exit Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production With the Partitioning, Oracle Label Security, OLAP and Data Mining Scoring Engine options
2.使用RMAN的COPY功能备份裸设备文件为文件系统文件
[oracle@danaly ~]$ rman target /
Recovery Manager: Release 10.2.0.1.0 - Production on Wed Nov 30 16:00:42 2005
Copyright (c) 1982, 2005, Oracle. All rights reserved.
connected to target database: DANALY (DBID=3965153484)
RMAN> copy datafile '/dev/cciss/c0d0p11' to '/opt/oracle/eygle01.dbf';
Starting backup at 30-NOV-05using target database control file instead of recovery catalogallocated channel: ORA_DISK_1channel ORA_DISK_1: sid=137 devtype=DISKchannel ORA_DISK_1: starting datafile copyinput datafile fno=00002 name=/dev/cciss/c0d0p11output filename=/opt/oracle/eygle01.dbf tag=TAG20051130T160137 recid=2 stamp=575740898channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:02Finished backup at 30-NOV-05
RMAN> exitRecovery Manager complete.
3.通过rename修改文件位置[oracle@danaly ~]$ sqlplus "/ as sysdba"SQL*Plus: Release 10.2.0.1.0 - Production on Wed Nov 30 16:01:54 2005Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to:Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - ProductionWith the Partitioning, Oracle Label Security, OLAP and Data Mining Scoring Engine options
SQL> alter database rename file '/dev/cciss/c0d0p11' to '/opt/oracle/eygle01.dbf';
Database altered.
SQL> alter tablespace eygle online;
Tablespace altered.
SQL> select file_name from dba_data_files where tablespace_name='EYGLE';
FILE_NAME--------------------------------------------------------------------------------/opt/oracle/eygle01.dbf
4.进行数据修改SQL> insert into eygle as select * from eygle;insert into eygle as select * from eygle *ERROR at line 1:ORA-00926: missing VALUES keyword
SQL> insert into eygle select * from eygle;insert into eygle select * from eygle *ERROR at line 1:ORA-01653: unable to extend table SYS.EYGLE by 128 in tablespace EYGLE
SQL> alter database datafile '/opt/oracle/eygle01.dbf' resize 20m;Database altered.
SQL> insert into eygle select * from eygle;50420 rows created.
SQL> commit;Commit complete.
SQL> alter tablespace eygle offline;Tablespace altered.
SQL> exitDisconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - ProductionWith the Partitioning, Oracle Label Security, OLAP and Data Mining Scoring Engine options
5.从文件系统迁移文件至裸设备
[oracle@danaly ~]$ rman target /
Recovery Manager: Release 10.2.0.1.0 - Production on Wed Nov 30 16:08:51 2005
Copyright (c) 1982, 2005, Oracle. All rights reserved.
connected to target database: DANALY (DBID=3965153484)
RMAN> copy datafile '/opt/oracle/eygle01.dbf' to '/dev/cciss/c0d0p11';
Starting backup at 30-NOV-05using target database control file instead of recovery catalogallocated channel: ORA_DISK_1channel ORA_DISK_1: sid=135 devtype=DISKchannel ORA_DISK_1: starting datafile copyinput datafile fno=00002 name=/opt/oracle/eygle01.dbfoutput filename=/dev/cciss/c0d0p11 tag=TAG20051130T160935 recid=3 stamp=575741376channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:01Finished backup at 30-NOV-05
RMAN> exit
Recovery Manager complete.[oracle@danaly ~]$ sqlplus "/ as sysdba"
SQL*Plus: Release 10.2.0.1.0 - Production on Wed Nov 30 16:09:48 2005
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to:Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - ProductionWith the Partitioning, Oracle Label Security, OLAP and Data Mining Scoring Engine options
SQL> alter database rename file '/opt/oracle/eygle01.dbf' to '/dev/cciss/c0d0p11';
Database altered.
SQL> alter tablespace eygle online;
Tablespace altered.
SQL> select count(*) from eygle;
COUNT(*)---------- 100840
SQL>
来自为知笔记(Wiz)
相关文章推荐
- mysql通过拷贝数据文件的方式进行数据库迁移
- 使用RMAN在ASM和文件系统之间拷贝数据
- Linux 服务器之间如何进行文件目录共享NFS(网络文件系统)
- ORACLE11g 没有控制文件如何通过rman备份恢复数据的详细实战过程
- mysql 通过拷贝数据文件的方式进行数据库迁移实例
- mysql 通过拷贝数据文件的方式进行数据库迁移实例
- 管理员如何执行WCM内容内在Portal系统之间进行内容与配置迁移
- 在UNIX裸设备和文件系统之间双向复制数据库数据文件
- ORACLE11g 没有控制文件如何通过rman备份恢复数据的详细实战过程
- mysql通过拷贝数据文件的方式进行数据库迁移
- 在android系统内webview中的html文件之间如何进行数值的传输
- 通过proc文件系统让Linux内核空间和用户空间之间进行通信
- 使用RMAN在ASM和文件系统之间拷贝数据
- Oracle迁移数据文件从文件系统至裸设备
- 使用热备份进行分时恢复----怎样通过归档逐步恢复以缩短数据迁移时间
- 通过编写rcS文件实现系统启动后进行一系列初始设置
- 如何实现在窗体和窗体之间进行传递数据
- 利用EXP/IMP进行数据迁移,如何转换表空间操作(完整版)
- 如何使用proc文件系统让用户空间和内核空间进行交互
- 如何进行编码和通过 Visual C# InfoPath 中以编程方式解码文件附件