在Oracle 10g数据库中,如果需要将ASM实例中一个磁盘组的数据文件转移到另一个磁盘组上。可以采用以前传统的文件系统的方式迁移,
在oracle 10g数据库中,如果需要将asm实例中一个磁盘组的数据文件转移到另一个磁盘组上。可以采用以前传统的文件系统的方式迁移,也可以采用表空间级别拷贝的方式迁移。
例如有一个库sdb,users表空间的数据文件都在vg1磁盘组上,现在要移动vg2磁盘组上,,这样操作一下就能完成这个任务。
backup as copy tablespace users format '+vg2';
switch tablespace users to copy;
这两个命令需要在rman下操作,因为只有rman下才能管理asm磁盘组中的文件。
测试环境为oracle 10.2.0.4 for linux x86,以下为测试过程。
第一步,检查环境,确认users表空间,并将数据库重启到mounted状态。
[oracle@db-172-17-2-8 bdump]$ export oracle_sid=sdb
[oracle@db-172-17-2-8 bdump]$ sqlplus / as sysdba
sql*plus: release 10.2.0.4.0 - production on tue feb 19 16:47:13 2013
copyright (c) 1982, 2007, oracle. all rights reserved.
connected to:
oracle database 10g enterprise edition release 10.2.0.4.0 - 64bit production
with the partitioning, olap, data mining and real application testing options
sql> select name from v$tablespace
2 ;
name
------------------------------
users
undotbs1
system
sysaux
ofcardquery
temp
6 rows selected.
sql> shutdown immediate
database closed.
database dismounted.
oracle instance shut down.
sql> startup mount
oracle instance started.
total system global area 1610612736 bytes
fixed size 2084296 bytes
variable size 385876536 bytes
database buffers 1207959552 bytes
redo buffers 14692352 bytes
database mounted.
第二步,使用rman工具copy表空间,再switch。这个switch操作完成了数据字典的修改。
[oracle@db-172-17-2-8 bdump]$ rman target /
recovery manager: release 10.2.0.4.0 - production on tue feb 19 16:48:20 2013
copyright (c) 1982, 2007, oracle. all rights reserved.
connected to target database: sdb (dbid=2245827732, not open)
rman> backup as copy tablespace users format '+vg2';
starting backup at 19-feb-13
using target database control file instead of recovery catalog
allocated channel: ora_disk_1
channel ora_disk_1: sid=151 devtype=disk
channel ora_disk_1: starting datafile copy
input datafile fno=00005 name=+vg1/sdb/users02.dbf
output filename=+vg2/sdb/datafile/users.285.807814137 tag=tag20130219t164857 recid=17 stamp=807814139
channel ora_disk_1: datafile copy complete, elapsed time: 00:00:03
channel ora_disk_1: starting datafile copy
input datafile fno=00004 name=+vg1/sdb/users01.dbf
output filename=+vg2/sdb/datafile/users.284.807814141 tag=tag20130219t164857 recid=18 stamp=807814141
channel ora_disk_1: datafile copy complete, elapsed time: 00:00:01
finished backup at 19-feb-13
rman> switch tablespace users to copy;
datafile 4 switched to datafile copy "+vg2/sdb/datafile/users.284.807814141"
datafile 5 switched to datafile copy "+vg2/sdb/datafile/users.285.807814137"
rman> recover database;
starting recover at 19-feb-13
using channel ora_disk_1
starting media recovery
media recovery complete, elapsed time: 00:00:00
finished recover at 19-feb-13

每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号