修改redo_logfile组成员和大小
1.SYS@ORCL>select GROUP# ,BYTES/1024/1024 size_M,STATUS,ARCHIVED from v$log;
GROUP# SIZE_M STATUS ARC
---------- ---------- ---------------- ---
1 50 INACTIVE YES
2 50 INACTIVE YES
3 50 CURRENT NO
2.删除原有的日志组;(只操作状态为inactive的日志组)
若要操作日志组为current时,需先进行日志切换:alter system switch logfile;
若为active时,则可强制进行检查点:alter system checkpoint;
SYS@ORCL>alter system switch logfile;
System altered.
SYS@ORCL>alter system checkpoint; --强制执行检查点
SYS@ORCL>select GROUP# ,BYTES/1024/1024 size_M,STATUS,ARCHIVED from v$log;
GROUP# SIZE_M STATUS ARC
---------- ---------- ---------------- ---
1 50 INACTIVE YES
2 50 INACTIVE YES
3 50 ACTIVE YES
SYS@ORCL>alter database drop logfile group 1;
Database altered.
SYS@ORCL>alter database drop logfile group 2;
Database altered.
---------------------------
删除后还需要去指定目录删除日志文件,后才能建立文件,如制定别的名字的日志组,应该没有此限制。
---------------------------
3.添加3组大小为200M的日志组;
SYS@ORCL>alter database add logfile group 1 '/u01/app/oracle/oradata/orcl11g/redo01.log'size 200m;
Database altered.
SYS@ORCL>alter database add logfile group 2 '/u01/app/oracle/oradata/orcl11g/redo02.log'size 200m;
Database altered.
SYS@ORCL>alter database add logfile group 3 '/u01/app/oracle/oradata/orcl11g/redo03.log'size 200m;
4.给日志组添加成员
cd /u01/app/oracle/oradata/orcl11g/
mkdir redo_bak
SYS@ORCL>alter database add logfile member '/u01/app/oracle/oradata/orcl11g/redo_bak/redo01_b.log' to group 1;
Database altered.
SYS@ORCL>alter database add logfile member '/u01/app/oracle/oradata/orcl11g/redo_bak/redo02_b.log' to group 2;
Database altered.
SYS@ORCL>alter database add logfile member '/u01/app/oracle/oradata/orcl11g/redo_bak/redo03_b.log' to group 3;
Database altered.
5.删除日志组成员
alter database drop logfile member '/u01/app/oracle/oradata/orcl11g/redo_bak/redo02_b.log';
- 上一篇
遭遇 bug InnoDB: Failing assertion: page_get_n_recs(page) > 1
昨晚遇到了一个mysql 的bug :170112 22:26:06 InnoDB: Assertion failure in thread 139900811020032 in file /expo
- 下一篇
技术人生系列-我和数据中心的故事(第五期)清算/报表/日终跑批程序之性能优化案例
前言不知不觉,技术人生系列·我和数据中心的故事来到了第五期。小y又和大家见面了!前几期主要发了一些TroubleShooting的案例分享,其实小y最擅长的是性能优化,所以从这期开始,小y会陆续的分享