log_file_name_convert的更改与ORA-01516和ORA-01275

我的standby已经做好,但是我把redo文件的目录和归档目录放到了一起,想改改redo的位置。
初始的位置:
show parameter log_file_name

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
log_file_name_convert                string      +DG1/c3/onlinelog, /app/oracle/oradata/archivelog
sys@c3> archive log list;
Database log mode              Archive Mode
Automatic archival             Enabled
Archive destination            /app/oracle/oradata/archivelog
Oldest online log sequence     0
Next log sequence to archive   0
Current log sequence           6306

我想把redo的目录放到/app/oracle/oradata/c3

第一次的做法:

备库停止应用:alter database recover managed standby database cancel;

然后shutdown备库

从操作系统将文件mv到/app/oracle/oradata/c3下面

在pfile中改变参数log_file_name_convert='+DG1/c3/onlinelog','/app/oracle/oradata/c3'

启动数据库到mount standby database状态,然后执行rename

sys@c3> alter database rename file '/app/oracle/oradata/archivelog/group_14.621.846263659' to '/app/oracle/oradata/c3/group_14.621.846263659'
*
ERROR at line 1:
ORA-01511: error in renaming log/data files
ORA-01516: nonexistent log file, datafile, or tempfile "/app/oracle/oradata/archivelog/group_14.621.846263659"

查看v$logfile已经变成了/app/oracle/oradata/archivelog/group_14.621.846263659

但是备库开启应用后:

Thu Jun 12 13:50:00 CST 2014
Errors in file /app/oracle/oradata/admin/c3/bdump/c3_mrp0_8846.trc:
ORA-00313: open failed for members of log group 13 of thread 1
ORA-00312: online log 13 thread 1: '/app/oracle/oradata/archivelog/group_13.405.846263647'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
Thu Jun 12 13:50:07 CST 2014
Clearing online redo logfile 13 complete
Thu Jun 12 13:50:07 CST 2014

然后在位置/app/oracle/oradata/archivelog又重新创建了redo文件。

我再次将应用停止,然后rename

sys@c3> alter database rename file '/app/oracle/oradata/archivelog/group_9.280.845804869' to '/app/oracle/oradata/c3/group_9.280.845804869';
alter database rename file '/app/oracle/oradata/archivelog/group_9.280.845804869' to '/app/oracle/oradata/c3/group_9.280.845804869'
*
ERROR at line 1:
ORA-01511: error in renaming log/data files
ORA-01275: Operation RENAME is not allowed if standby file management is automatic.

报错,修改参数:

sys@c3> show parameter standby

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
standby_archive_dest                 string      ?/dbs/arch
standby_file_management              string      AUTO
sys@c3> alter system set standby_file_management=manual;

System altered.

再次rename就成功了。

然后将参数修改回来。

sys@c3> alter system set standby_file_management='auto';

System altered.

Elapsed: 00:00:00.01
sys@c3> show parameter standby

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
standby_archive_dest                 string      ?/dbs/arch
standby_file_management              string      auto

如需转载,请注明出处:http://blog.csdn.net/nanaranran/article/details/30473853

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值