sql> sql> sql> set linesize 200; sql> set pagesize 200; sql> select * from v$log; group# thread# sequence# first_change# first_tim
bytes
members arc status
---------- ---------- ---------- ---------- ---------- --- ---------------------------- --------1 894596 22-may-08
1
30
104857600
2 no
current
2 775135 21-may-08
1
27
104857600
1 no
inactive
3 797456 21-may-08
1
29
104857600
1 no
inactive
4 797289 21-may-08
1
28
102400
1 no
inactive
sql> sql> sql> alter system switch logfile; alter system switch logfile * error at line 1: ora-01089: immediate shutdown in progress - no operations are permitted sql> sql> sql> sql> conn sys/oracle as sysdba connected to an idle instance. sql> startup oracle instance started. total system global area fixed size variable size database buffers redo buffers
135338868 bytes 453492 bytes 109051904 bytes 25165824 bytes 667648 bytes
database mounted. database opened. sql> set linesize 200; sql> set pagesize 200l sp2-0268: pagesize option not a valid number sql> set pagesize 200;
sql> sql> sql> select * from v$log; group# thread# sequence# first_change# first_tim
bytes
members arc status
---------- ---------- ---------- ---------- ---------- --- ---------------------------- --------1 894596 22-may-08
1
30
104857600
2 no
current
2 775135 21-may-08
1
27
104857600
1 no
inactive
3 797456 21-may-08
1
29
104857600
1 no
inactive
4 797289 21-may-08
1
28
102400
1 no
inactive
sql> ---- to drop a memeber sql> sql> alter dataabase drop logfile group 1; alter dataabase drop logfile group 1 * error at line 1: ora-00940: invalid alter command sql> alter database drop logfile group 1; alter database drop logfile group 1 * error at line 1: ora-01623: log 1 is current log for thread 1 - cannot drop ora-00312: online log 1 thread 1: 'd:\oracle\oradata\iimdba\redo01.log' ora-00312: online log 1 thread 1: 'd:\oracle\oradata\iimdba\remem1.log' sql> ------ we can't drop the current member sql> sql> sql> alter database drop logfile group 4; alter database drop logfile group 4 * error at line 1: ora-00350: log 4 of thread 1 needs to be archived ora-00312: online log 4 thread 1: 'd:\oracle\oradata\iimdba\redo04.log' sql> arhcive log list sp2-0734: unknown command beginning "arhcive lo..." - rest of line ignored. sql> archive log list database log mode archive mode automatic archival disabled archive destination d:\oracle\ora92\rdbms
oldest online log sequence 27 next log sequence to archive 27 current log sequence 30 sql> alter database drop logfile group 4; alter database drop logfile group 4 * error at line 1: ora-00350: log 4 of thread 1 needs to be archived ora-00312: online log 4 thread 1: 'd:\oracle\oradata\iimdba\redo04.log' sql> sql> alter database log_archive_start=true scope=spfile; alter database log_archive_start=true scope=spfile * error at line 1: ora-02231: missing or invalid option to alter database sql>
alter system set log_archive_start=true scope=spfile;
system altered. sql> shutdown immediate; database closed. database dismounted. oracle instance shut down. sql> startup oracle instance started. total system global area fixed size variable size database buffers redo buffers
135338868 bytes 453492 bytes 109051904 bytes 25165824 bytes 667648 bytes
database mounted. database opened. sql> sql> alter database drop logfile group 4; database altered. sql> ------------ we want to change the automatic archival should be enabled... sql> sql> sql> --- nexct sql> sql> --- we want to drop a memeber in a group... sql> sql> alter database drop logfile member 'd:\oracle\oradata\iimdba\remem1.log'; alter database drop logfile member 'd:\oracle\oradata\iimdba\remem1.log' * error at line 1:
ora-01609: log 1 is the current log for thread 1 - cannot drop members ora-00312: online log 1 thread 1: 'd:\oracle\oradata\iimdba\redo01.log' ora-00312: online log 1 thread 1: 'd:\oracle\oradata\iimdba\remem1.log' sql> ---- we cant drop the current memeber.... sql> sql> archive log list database log mode archive mode automatic archival enabled archive destination d:\oracle\ora92\rdbms oldest online log sequence 27 next log sequence to archive 30 current log sequence 30 sql> sql> select * from v$log; group# thread# sequence# first_change# first_tim
bytes
members arc status
---------- ---------- ---------- ---------- ---------- --- ---------------------------- --------1 894596 22-may-08
1
30
104857600
2 no
2 775135 21-may-08
1
27
104857600
1 yes inactive
3 797456 21-may-08
1
29
104857600
1 yes inactive
sql> alter database swtich logfile; alter database swtich logfile * error at line 1: ora-02231: missing or invalid option to alter database sql> alter database switch logfile; alter database switch logfile * error at line 1: ora-02231: missing or invalid option to alter database sql> alter system swtich logfile; alter system swtich logfile * error at line 1: ora-02065: illegal option for alter system sql> alter system switch logfile; system altered.
current
sql> select * from v$log; group# thread# sequence# first_change# first_tim
bytes
members arc status
---------- ---------- ---------- ---------- ---------- --- ---------------------------- --------1 894596 22-may-08
1
30
104857600
2 yes active
2 922521 22-may-08
1
31
104857600
1 no
3 797456 21-may-08
1
29
104857600
1 yes inactive
group# thread# sequence# first_change# first_tim
bytes
current
sql> alter system checkpoint; system altered. sql> select * from v$log; members arc status
---------- ---------- ---------- ---------- ---------- --- ---------------------------- --------1 894596 22-may-08
1
30
104857600
2 yes inactive
2 922521 22-may-08
1
31
104857600
1 no
3 797456 21-may-08
1
29
104857600
1 yes inactive
current
sql> alter database drop logfile member 'd:\oracle\oradata\iimdba\remem1.log'; database altered. sql> select * from v$log; group# thread# sequence# first_change# first_tim
bytes
members arc status
---------- ---------- ---------- ---------- ---------- --- ---------------------------- --------1 894596 22-may-08
1
30
104857600
1 yes inactive
2 922521 22-may-08
1
31
104857600
1 no
current
3 797456 21-may-08
1
29
104857600
1 yes inactive
sql> alter database drop logfile member 'd:\oracle\oradata\iimdba\redo01.log'; alter database drop logfile member 'd:\oracle\oradata\iimdba\redo01.log' * error at line 1: ora-00361: cannot remove last log member d:\oracle\oradata\iimdba\redo01.log for group 1 sql> sql> sql> sql> sql> sql> sql> sql>
------- every group hve atleast one member... --- so we cant drop the last member in tat group ---for renaming select * from v$log;
group# thread# sequence# first_change# first_tim
bytes
members arc status
---------- ---------- ---------- ---------- ---------- --- ---------------------------- --------1 894596 22-may-08
1
30
104857600
1 yes inactive
2 922521 22-may-08
1
31
104857600
1 no
3 797456 21-may-08
1
29
104857600
1 yes inactive
current
sql> select * from v$#logfile; select * from v$#logfile * error at line 1: ora-00942: table or view does not exist sql> select * from v$logfile; group# status
type
---------- ------- ------member -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------3 stale online d:\oracle\oradata\iimdba\redo03.log
2
online
d:\oracle\oradata\iimdba\redo02.log
1
online
d:\oracle\oradata\iimdba\redo01.log
sql> desc v$loghist name null? type ---------------------------------------------------------------------------------------------------------------- ----------------------------------------------------------------------------------thread# number sequence# number first_change# number first_time date switch_change# number sql> select * from v$loghist; thread#
sequence# first_change# first_tim switch_change#
---------- ---------- ------------- --------- -------------1
19
322982 12-may-08
327865
1
20
327865 14-may-08
398929
1
21
398929 15-may-08
447297
1
22
447297 15-may-08
486239
1
23
486239 15-may-08
509339
1
24
509339 15-may-08
572607
1
25
572607 16-may-08
601130
1
26
601130 19-may-08
775135
1
27
775135 21-may-08
797289
1
28
797289 21-may-08
797456
1
29
797456 21-may-08
894596
1
30
894596 22-may-08
922521
12 rows selected. sql> select * from all_log_groups; no rows selected sql>
select * from user_log_groups;
no rows selected sql>
select * from v_$log_history; recid
stamp
thread#
sequence# first_change# first_tim next_change#
---------- ---------- ---------- ---------- ------------- --------- -----------1
654705658
1
19
322982 12-may-08
327865
2
654772871
1
20
327865 14-may-08
398929
3
654784088
1
21
398929 15-may-08
447297
4
654791615
1
22
447297 15-may-08
486239
5
654792915
1
23
486239 15-may-08
509339
6
654858946
1
24
509339 15-may-08
572607
7
655120980
1
25
572607 16-may-08
601130
8
655291523
1
26
601130 19-may-08
775135
9
655300152
1
27
775135 21-may-08
797289
10
655300228
1
28
797289 21-may-08
797456
11
655377821
1
29
797456 21-may-08
894596
12
655391389
1
30
894596 22-may-08
922521
12 rows selected. sql> select * from dba_log_groups; no rows selected sql> select * from v$log; group# thread# sequence# first_change# first_tim
bytes
members arc status
---------- ---------- ---------- ---------- ---------- --- ---------------------------- --------1 894596 22-may-08
1
30
104857600
1 yes inactive
2 922521 22-may-08
1
31
104857600
1 no
3 797456 21-may-08
1
29
104857600
1 yes inactive
current
sql> alter database clear logfile group 2; alter database clear logfile group 2 * error at line 1: ora-01624: log 2 needed for crash recovery of thread 1 ora-00312: online log 2 thread 1: 'd:\oracle\oradata\iimdba\redo02.log' sql> alter database clear logfile group 1; database altered. sql> select * from v$log; group# thread# sequence# first_change# first_tim
bytes
members arc status
---------- ---------- ---------- ---------- ---------- --- ---------------------------- --------1 894596 22-may-08
1
0
104857600
1 yes unused
2 922521 22-may-08
1
31
104857600
1 no
3 797456 21-may-08
1
29
104857600
1 yes inactive
current
sql> -------- if we clear a goup then it be unused... sql> sql> ----- if the group is unused then it be sequence is 0. sql> sql> sql> alter database rename file 'd:\oracle\oradata\iimdba\redo03.log' to 'd:\oracle\oradata\iimdba\redo04.log'; database altered. sql> select * from v$log; group# thread# sequence# first_change# first_tim
bytes
members arc status
---------- ---------- ---------- ---------- ---------- --- ---------------------------- --------1 894596 22-may-08
1
0
104857600
1 yes unused
2 922521 22-may-08
1
31
104857600
1 no
3 797456 21-may-08
1
29
104857600
1 yes inactive
current
sql> select * from v$logfile; group# status
type
---------- ------- ------member -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------3 stale online d:\oracle\oradata\iimdba\redo04.log
2
online
d:\oracle\oradata\iimdba\redo02.log
1
online
d:\oracle\oradata\iimdba\redo01.log
sql> shutdown immediate; database closed. database dismounted. oracle instance shut down. sql> sql> sql> startup oracle instance started. total system global area fixed size variable size
135338868 bytes 453492 bytes 109051904 bytes
database buffers
25165824 bytes
redo buffers
667648 bytes
database mounted. ora-00341: log 3 of thread 1, wrong log # in header ora-00312: online log 3 thread 1: 'd:\oracle\oradata\iimdba\redo04.log' sql> ------------ we want to physcically rename the file in specific path sql> sql> ------ first shutdown and rename and then startup sql> sql> shutdown immediate; ora-01109: database not open database dismounted. oracle instance shut down. sql> startup oracle instance started. total system global area
135338868 bytes
fixed size variable size
453492 bytes 109051904 bytes
database buffers
25165824 bytes
redo buffers
667648 bytes
database mounted. ora-00341: log 3 of thread 1, wrong log # in header ora-00312: online log 3 thread 1: 'd:\oracle\oradata\iimdba\redo04.log' sql> shutdown immediate; ora-01109: database not open database dismounted. oracle instance shut down. sql> startup oracle instance started. total system global area fixed size variable size database buffers redo buffers
135338868 bytes 453492 bytes 109051904 bytes 25165824 bytes 667648 bytes
database mounted. ora-00341: log 3 of thread 1, wrong log #
in header
ora-00312: online log 3 thread 1: 'd:\oracle\oradata\iimdba\redo04.log' sql> shutdown immediate; ora-01109: database not open database dismounted. oracle instance shut down. sql> satrtup sp2-0042: unknown command "satrtup" - rest of line ignored. sql> startup oracle instance started. total system global area
135338868 bytes
fixed size
453492 bytes
variable size
109051904 bytes
database buffers
25165824 bytes
redo buffers
667648 bytes
database mounted. ora-00341: log 3 of thread 1, wrong log # in header ora-00312: online log 3 thread 1: 'd:\oracle\oradata\iimdba\redo04.log' sql> select * from v$log; group# thread# sequence# first_change# first_tim
bytes
members arc status
---------- ---------- ---------- ---------- ---------- --- ---------------------------- --------1 894596 22-may-08
1
0
104857600
1 yes unused
2 922521 22-may-08
1
31
104857600
1 no
3 797456 21-may-08
1
29
104857600
1 yes inactive
current
sql> select * from v$logfile; group# status
type
---------- ------- ------member ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
3 stale
online
d:\oracle\oradata\iimdba\redo04.log
2
online
d:\oracle\oradata\iimdba\redo02.log
1
online
d:\oracle\oradata\iimdba\redo01.log
sql> alter system switch logfile; alter system switch logfile * error at line 1: ora-01109: database not open sql> alter database open; alter database open * error at line 1: ora-00341: log 3 of thread 1, wrong log # in header ora-00312: online log 3 thread 1: 'd:\oracle\oradata\iimdba\redo04.log' sql> alter database clear unarchived logfile group 3; database altered. sql> alter database open; database altered. sql> select * from v$log; group# thread# sequence# first_change# first_tim
bytes
members arc status
---------- ---------- ---------- ---------- ---------- --- ---------------------------- --------1 894596 22-may-08
1
0
104857600
1 yes unused
2 922521 22-may-08
1
31
104857600
1 no
3 797456 21-may-08
1
0
104857600
1 yes unused
current
sql> sql> db_create_online_dest_1; sp2-0734: unknown command beginning "db_create_..." - rest of line ignored. sql> select archiver from v$instance; archive ------started sql> archive log list; database log mode archive mode automatic archival enabled archive destination d:\oracle\ora92\rdbms oldest online log sequence 0 next log sequence to archive 31 current log sequence 31 sql> alter system archive_log_start=false scope=spfile; alter system archive_log_start=false scope=spfile * error at line 1: ora-02065: illegal option for alter system sql> ed wrote file afiedt.buf 1* alter system set archive_log_start=false scope=spfile sql> / alter system set archive_log_start=false scope=spfile * error at line 1: ora-02065: illegal option for alter system sql> alter system set log_ 2 archive_start=false scope=spfile; alter system set log_ * error at line 1: ora-02065: illegal option for alter system sql> alter system set log_archive__start=false scope=spfile; alter system set log_archive__start=false scope=spfile * error at line 1: ora-02065: illegal option for alter system sql> sql> sql> sql>
sql> sql> sql> sql> sql> sql> sql> sql> sql> sql> sql> sql> sql> sql> sql> sql> sql> sql> sql> sql> sql> sql> sql> sql> sql> sql> sql> sql> sql> sql> sql> sql> archive log list database log mode automatic archival archive destination oldest online log sequence next log sequence to archive current log sequence sql> shutdown immediate; database closed. database dismounted. oracle instance shut down. sql> alter 2 sql> startup oracle instance started. total system global area fixed size variable size database buffers redo buffers database mounted.
archive mode enabled d:\oracle\ora92\rdbms 0 31 31
135338868 bytes 453492 bytes 109051904 bytes 25165824 bytes 667648 bytes
database opened. sql> alter database noarchivelog; alter database noarchivelog * error at line 1: ora-01126: database must be mounted exclusive and not open for this operation sql> shutdown immediate; database closed. database dismounted. oracle instance shut down. sql> satrt mount; sp2-0734: unknown command beginning "satrt moun..." - rest of line ignored. sql> startuop mont; sp2-0734: unknown command beginning "startuop m..." - rest of line ignored. sql> startup mount; oracle instance started. total system global area fixed size variable size database buffers redo buffers
135338868 bytes 453492 bytes 109051904 bytes 25165824 bytes 667648 bytes
database mounted. sql> alter database noarchivelog; database altered. sql> archive log list database log mode no archive mode automatic archival enabled archive destination d:\oracle\ora92\rdbms oldest online log sequence 0 current log sequence 31 sql> sql> alter system set log_archive_start=false scope=spfile; system altered. sql> alter database open; database altered. sql> --------- we set false to true in open stage... sql> sql> ----- but we can't set true to false in open stage the database should be in mount stage... sql> sql> archive log list database log mode no archive mode automatic archival enabled archive destination d:\oracle\ora92\rdbms
oldest online log sequence 0 current log sequence 31 sql> alter system set log_archive_start=true scope=spfile; system altered. sql> alter database archivelog; alter database archivelog * error at line 1: ora-01126: database must be mounted exclusive and not open for this operation sql> spool off