--添加测试表空间SQL>
create
tablespace xff datafile '/u01/oradata/xifenfei.dbf'
size
10m autoextend on
maxsize 100m;Tablespace
created.--查看数据文件位置SQL>
select
name
from
v$datafile;NAME--------------------------------------------------------------------------------+DATA/tasm/system01.dbf+DATA/tasm/undotbs01.dbf+DATA/tasm/sysaux01.dbf+DATA/tasm/users01.dbf+DATA/tasm/example01.dbf/u01/oradata/xifenfei.dbf6
rows
selected.--创建测试表SQL>
create
table
hr.a tablespace xff 2
as 3
select
* from
dba_tables;Table
created.SQL>
select
count(*)
from
hr.a; COUNT(*)---------- 1580--转移数据文件位置[oracle@localhost
oradata]$ rman target /Recovery
Manager: Release 10.2.0.3.0 - Production on
Mon Jun 27 04:30:22 2011Copyright
(c) 1982, 2005, Oracle. All
rights reserved.connected
to
target database:
TASM (DBID=3032096031)RMAN>
sql 'alter
tablespace xff offline';using
target database
control file instead
of
recovery catalogsql
statement: alter
tablespace xff offlineRMAN>
backup as
copy tablespace xff format '+DATA';Starting
backup at
27-JUN-11allocated
channel: ORA_DISK_1channel
ORA_DISK_1: sid=132 devtype=DISKchannel
ORA_DISK_1: starting datafile copyinput
datafile fno=00006 name=/u01/oradata/xifenfei.dbfoutput
filename=+DATA/tasm/datafile/xff.269.754893121 tag=TAG20110627T043200 recid=2 stamp=754893123channel
ORA_DISK_1: datafile copy complete, elapsed time:
00:00:03Finished
backup at
27-JUN-11RMAN>
switch tablespace xff to
copy;datafile
6 switched to
datafile copy "+DATA/tasm/datafile/xff.269.754893121"RMAN>
sql 'alter
tablespace xff online';sql
statement: alter
tablespace xff online--查看转移后的数据文件位置SQL>
select
name
from
v$datafile;NAME--------------------------------------------------------------------------------+DATA/tasm/system01.dbf+DATA/tasm/undotbs01.dbf+DATA/tasm/sysaux01.dbf+DATA/tasm/users01.dbf+DATA/tasm/example01.dbf+DATA/tasm/datafile/xff.269.7548931216
rows
selected.--测试其中数据是否存在SQL>
select
count(*)
from
hr.a; COUNT(*)---------- 1580--创建asm中文件别名ASMCMD>
mkalias +DATA/tasm/datafile/xff.269.754893121 +DATA/tasm/xff01.dbf--文件重命名SQL>
alter
tablespace xff offline;Tablespace
altered.SQL>
alter
database
rename file '+DATA/tasm/datafile/xff.269.754893121'
to
'+DATA/tasm/xff01.dbf';Database
altered.SQL>
alter
tablespace xff online;Tablespace
altered.SQL>
select
name
from
v$datafile;NAME--------------------------------------------------------------------------------+DATA/tasm/system01.dbf+DATA/tasm/undotbs01.dbf+DATA/tasm/sysaux01.dbf+DATA/tasm/users01.dbf+DATA/tasm/example01.dbf+DATA/tasm/xff01.dbf6
rows
selected.--手工删除原来数据[oracle@localhost
oradata]$ rm xifenfei.dbf |
asm数据文件迁移(os–>asm)
最新推荐文章于 2024-12-06 10:59:37 发布
本文介绍如何在Oracle数据库环境中操作数据文件,包括添加测试表空间、查看数据文件位置、创建测试表、转移数据文件位置、数据文件重命名及文件别名创建等步骤。

924

被折叠的 条评论
为什么被折叠?



