Oracle8i 第一日曜日を取得

alter session set nls_date_format = ‘yyyy/mm/dd’;
alter session set NLS_DATE_LANGUAGE=’japanese’;
select NEXT_DAY(round(DATE ’2010-1-01′-1,’dd’),’日曜’) first_sun from dual;
select NEXT_DAY(round(DATE ’2010-2-01′-1,’dd’),’日曜’) first_sun from dual;
select NEXT_DAY(round(DATE ’2010-3-01′-1,’dd’),’日曜’) first_sun from dual;
select NEXT_DAY(round(DATE ’2010-4-01′-1,’dd’),’日曜’) first_sun from dual;
select NEXT_DAY(round(DATE ’2010-5-01′-1,’dd’),’日曜’) first_sun from dual;
select NEXT_DAY(round(DATE ’2010-6-01′-1,’dd’),’日曜’) first_sun from dual;
select NEXT_DAY(round(DATE ’2010-7-01′-1,’dd’),’日曜’) first_sun from dual;
select NEXT_DAY(round(DATE ’2010-8-01′-1,’dd’),’日曜’) first_sun from dual;
select NEXT_DAY(round(DATE ’2010-9-01′-1,’dd’),’日曜’) first_sun from dual;
select NEXT_DAY(round(DATE ’2010-10-01′-1,’dd’),’日曜’) first_sun from dual;
select NEXT_DAY(round(DATE ’2010-11-01′-1,’dd’),’日曜’) first_sun from dual;
select NEXT_DAY(round(DATE ’2010-12-01′-1,’dd’),’日曜’) first_sun from dual;

▼ 上記の実行結果

FIRST_SUN
———-
2010/01/03
2010/02/07
2010/03/07
2010/04/04
2010/05/02
2010/06/06
2010/07/04
2010/08/01
2010/09/05
2010/10/03
2010/11/07
2010/12/05

Oracle8i redo変更

select group#,thread#,sequence#,bytes members,status from v$log;

alter database TEST drop logfile group 1;
alter database TEST drop logfile group 2;
alter database TEST drop logfile group 3;
alter database TEST drop logfile group 4;

select group#,thread#,sequence#,bytes members,status from v$log;

alter database TEST add logfile group 1 ‘/test/TEST/TEST_REDO01.dbf’ size 500M reuse ;
alter database TEST add logfile group 2 ‘/test/TEST/TEST_REDO02.dbf’ size 500M reuse ;
alter database TEST add logfile group 3 ‘/test/TEST/TEST_REDO03.dbf’ size 500M reuse ;
alter database TEST add logfile group 4 ‘/test/TEST/TEST_REDO04.dbf’ size 500M reuse ;

alter system switch logfile;