程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
 程式師世界 >> 數據庫知識 >> Oracle數據庫 >> Oracle教程 >> oracledg壞境主庫redolog修改大小

oracledg壞境主庫redolog修改大小

編輯:Oracle教程

oracledg壞境主庫redolog修改大小



--備庫standby
主庫四個redolog 以前都是50M大小

SQL>

alter database recover managed standby database cancel;

Database altered.

SQL> alter database add standby logfile group 11 ('+DATA/orcldg/onlinelog/standby_group_11.log') size 60M;
alter database add standby logfile group 12 ('+DATA/orcldg/onlinelog/standby_group_12.log') size 60M;
alter database add standby logfile group 13 ('+DATA/orcldg/onlinelog/standby_group_13.log') size 60M;
alter database add standby logfile group 14 ('+DATA/orcldg/onlinelog/standby_group_14.log') size 60M;
alter database add standby logfile group 15 ('+DATA/orcldg/onlinelog/standby_group_15.log') size 60M;
alter database add standby logfile group 16 ('+DATA/orcldg/onlinelog/standby_group_16.log') size 60M;


備庫standby刪除
alter database drop logfile group 5;
alter database drop logfile group 6;
alter database drop logfile group 7;
alter database drop logfile group 8;
alter database drop logfile group 9;
alter database drop logfile group 10;



主庫redo添加


alter database add logfile thread 1 group 11 ('+DATA/orcl/onlinelog/group_11.log') size 60m;
alter database add logfile thread 1 group 12 ('+DATA/orcl/onlinelog/group_12.log') size 60m;
alter database add logfile thread 2 group 13 ('+DATA/orcl/onlinelog/group_13.log') size 60m;
alter database add logfile thread 2 group 14 ('+DATA/orcl/onlinelog/group_14.log') size 60m;


主庫redo 刪除
alter database drop logfile group 1;
alter database drop logfile group 2;
alter database drop logfile group 3;
alter database drop logfile group 4;



備庫redo添加

剛開始刪除的時候可能報錯,執行以下命令:

alter system set standby_file_management='manual';

然後刪除

alter database add logfile group 5 ('+DATA/orcldg/onlinelog/group_05.log') size 60m;
alter database add logfile group 6 ('+DATA/orcldg/onlinelog/group_06.log') size 60m;
alter database add logfile thread 2 group 7 ('+DATA/orcldg/onlinelog/group_07.log') size 60m;
alter database add logfile thread 2 group 8 ('+DATA/orcldg/onlinelog/group_08.log') size 60m;

alter database clear logfile '+DATA/orcldg/onlinelog/group_2.272.862167353'


備庫redo刪除
alter database drop logfile group 1;
alter database drop logfile group 2;
alter database drop logfile group 3;
alter database drop logfile group 4;

--這種也是可以的
alter database add logfile member ('+DATA/orcldg/onlinelog/group_2.273.862167353') size 60M reuse;

create spfile from pfile='$ORACLE_HOME/dbs/pfile_for_standby.txt'

如果遇到錯誤可以查看 log_file_name_convert 與 db_file_name_convert 是否有問題
alter system set log_file_name_convert='+DATA/orcl/onlinelog, +DATA/orcldg/onlinelog' scope=spfile;
alter system set db_file_name_convert='+DATA/orcl/datafile, +DATA/orcldg/datafile' scope=spfile;



--主庫standby 刪除
alter database drop logfile group 5;

alter database drop logfile group 6;

alter database drop logfile group 7;
alter database drop logfile group 8;
alter database drop logfile group 9;
alter database drop logfile group 10;
主庫standby 添加

alter database add standby logfile group 5 ('+DATA/orcl/onlinelog/standby_group_05.log') size 60M reuse;
alter database add standby logfile group 6 ('+DATA/orcl/onlinelog/standby_group_06.log') size 60M reuse;

alter database add standby logfile group 7 ('+DATA/orcl/onlinelog/standby_group_07.log') size 60M reuse;
alter database add standby logfile group 8 ('+DATA/orcl/onlinelog/standby_group_08.log') size 60M reuse;

alter database add standby logfile group 9 ('+DATA/orcl/onlinelog/standby_group_9.log') size 60M reuse;
alter database add standby logfile group 10 ('+DATA/orcl/onlinelog/standby_group_10.log') size 60M reuse;


然後在備庫執行
alter database recover managed standby database using current logfile disconnect;
alter system set standby_file_management='auto';

  1. 上一頁:
  2. 下一頁:
Copyright © 程式師世界 All Rights Reserved