10g 文件系统转ASM方法

I 创建ASM实例

创建CSS服务
root用户执行
$ORACLE_HOME/bin/localconfig add

DBCA配置ASM实例以及创建磁盘组


II 修改SPFILE中控制文件路径

alter system set control_files='+DATA' scope=spfile;
alter system set db_create_file_dest='+DATA' scope=spfile;

关闭数据库
shut immediate;

III 利用rman迁移数据库的控制文件和数据文件到ASM上
rman target /
startup nomount;

利用现有的控制文件在ASM中生成新的控制文件
restore controlfile from '/oracle/oradata/neil10g/control01.ctl';

利用rman将数据文件复制到ASM
alter database mount;
run{
allocate channel ch1 device type disk;
allocate channel ch2 device type disk;
allocate channel ch3 device type disk;
allocate channel ch4 device type disk;
backup as copy database format '+DATA';
release channel ch1;
release channel ch2;
release channel ch3;
release channel ch4;
}

切换控制文件中记录的数据文件指针到ASM
switch database to copy;

做恢复
recover database;

打开数据库
alter database open;

IV 将临时文件迁移到ASM上

回到sqlplus环境
sqlplus / as sysdba

查看临时文件
col tf_name for a40
col ts_name for a15
select tf.name tf_name,ts.name ts_name,tf.status,tf.enabled from v$tempfile tf,v$tablespace ts where tf.ts#=ts.ts#;

添加临时文件到ASM
alter tablespace temp add tempfile '+DATA' size 100m;

删除原有临时文件
alter tablespace temp drop tempfile  '/oracle/oradata/neil10g/temp01.dbf';

V 将重做日志文件迁移到ASM上

查看重做日志文件
col member for a40
select l.status,lf.member from v$log l,v$logfile lf where l.group#=lf.group#;

添加新重做日志文件到ASM
alter database add logfile '+DATA' size 10m;
alter database add logfile '+DATA' size 10m;
alter database add logfile '+DATA' size 10m;

删除原重做日志
alter database drop logfile '/oracle/oradata/neil10g/redo03.log';
alter database drop logfile '/oracle/oradata/neil10g/redo01.log';
alter system switch logfile;
alter system checkpoint;
alter database drop logfile '/oracle/oradata/neil10g/redo02.log';

VI 删除原文件系统上的文件

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/7986761/viewspace-1697009/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/7986761/viewspace-1697009/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值