千家信息网

Installation Oracle11gR2 RAC---修改在线日志

发表于:2025-01-23 作者:千家信息网编辑
千家信息网最后更新 2025年01月23日,连接数据库服务器,查询现有在线日志组信息并添加在线日志组。Connected to Oracle Database 11g Enterprise Edition Release 11.2.0.4.0C
千家信息网最后更新 2025年01月23日Installation Oracle11gR2 RAC---修改在线日志

连接数据库服务器,查询现有在线日志组信息并添加在线日志组。

Connected to Oracle Database 11g Enterprise Edition Release 11.2.0.4.0

Connected as system

SQL> select * from v$logfile;

GROUP# STATUS TYPE MEMBER IS_RECOVERY_DEST_FILE

---------- ------- ------- ------------------------------------------------- ---------------------

2 ONLINE +DATA/oracle/onlinelog/group_2.262.900549871 NO

2 ONLINE +FRA/oracle/onlinelog/group_2.258.900549873 YES

1 ONLINE +DATA/oracle/onlinelog/group_1.261.900549865 NO

1 ONLINE +FRA/oracle/onlinelog/group_1.257.900549867 YES

3 ONLINE +DATA/oracle/onlinelog/group_3.265.900550437 NO

3 ONLINE +FRA/oracle/onlinelog/group_3.259.900550441 YES

4 ONLINE +DATA/oracle/onlinelog/group_4.266.900550445 NO

4 ONLINE +FRA/oracle/onlinelog/group_4.260.900550449 YES

8 rows selected

添加新的日志组文件

SQL> alter database add logfile thread 1 group 5 ('+DATA/oracle/onlinelog/group5','+FRA/oracle/onlinelog/group5') size 200M;

Database altered

SQL> alter database add logfile thread 2 group 6 ('+DATA/oracle/onlinelog/group6','+FRA/oracle/onlinelog/group6') size 200M;

Database altered

SQL> alter database add logfile thread 1 group 7 ('+DATA/oracle/onlinelog/group7','+FRA/oracle/onlinelog/group7') size 200M;

Database altered

SQL> alter database add logfile thread 2 group 8 ('+DATA/oracle/onlinelog/group8','+FRA/oracle/onlinelog/group8') size 200M;

Database altered

SQL> select * from v$logfile;

GROUP# STATUS TYPE MEMBER IS_RECOVERY_DEST_FILE

---------- ------- ------- ----------------------------------------------- ---------------------

2 ONLINE +DATA/oracle/onlinelog/group_2.262.900549871 NO

2 ONLINE +FRA/oracle/onlinelog/group_2.258.900549873 YES

1 ONLINE +DATA/oracle/onlinelog/group_1.261.900549865 NO

1 ONLINE +FRA/oracle/onlinelog/group_1.257.900549867 YES

3 ONLINE +DATA/oracle/onlinelog/group_3.265.900550437 NO

3 ONLINE +FRA/oracle/onlinelog/group_3.259.900550441 YES

4 ONLINE +DATA/oracle/onlinelog/group_4.266.900550445 NO

4 ONLINE +FRA/oracle/onlinelog/group_4.260.900550449 YES

5 ONLINE +DATA/oracle/onlinelog/group5 NO

5 ONLINE +FRA/oracle/onlinelog/group5 NO

6 ONLINE +DATA/oracle/onlinelog/group6 NO

6 ONLINE +FRA/oracle/onlinelog/group6 NO

7 ONLINE +DATA/oracle/onlinelog/group7 NO

7 ONLINE +FRA/oracle/onlinelog/group7 NO

8 ONLINE +DATA/oracle/onlinelog/group8 NO

8 ONLINE +FRA/oracle/onlinelog/group8 NO

16 rows selected

SQL> select thread#,group#,archived,status from v$log;

THREAD# GROUP# ARCHIVED STATUS

---------- ---------- -------- ----------------

1 1 NO CURRENT

1 2 YES INACTIVE

2 3 YES INACTIVE

2 4 NO CURRENT

1 5 YES UNUSED

2 6 YES UNUSED

1 7 YES UNUSED

2 8 YES UNUSED

8 rows selected

切换日志

SQL> alter system switch logfile;

System altered

SQL> alter system switch logfile;

System altered

SQL> alter system switch logfile;

System altered

SQL> alter system switch logfile;

System altered

SQL> alter system switch logfile;

System altered

SQL> select thread#,group#,archived,status from v$log;

THREAD# GROUP# ARCHIVED STATUS

---------- ---------- -------- ----------------

1 1 YES ACTIVE

1 2 YES ACTIVE

2 3 YES INACTIVE

2 4 YES ACTIVE

1 5 NO CURRENT

2 6 YES ACTIVE

1 7 YES INACTIVE

2 8 NO CURRENT

8 rows selected

SQL> select * from v$logfile;

GROUP# STATUS TYPE MEMBER IS_RECOVERY_DEST_FILE

---------- ------- ------- ----------------------------------------------- ---------------------

2 ONLINE +DATA/oracle/onlinelog/group_2.262.900549871 NO

2 ONLINE +FRA/oracle/onlinelog/group_2.258.900549873 YES

1 ONLINE +DATA/oracle/onlinelog/group_1.261.900549865 NO

1 ONLINE +FRA/oracle/onlinelog/group_1.257.900549867 YES

3 ONLINE +DATA/oracle/onlinelog/group_3.265.900550437 NO

3 ONLINE +FRA/oracle/onlinelog/group_3.259.900550441 YES

4 ONLINE +DATA/oracle/onlinelog/group_4.266.900550445 NO

4 ONLINE +FRA/oracle/onlinelog/group_4.260.900550449 YES

5 ONLINE +DATA/oracle/onlinelog/group5 NO

5 ONLINE +FRA/oracle/onlinelog/group5 NO

6 ONLINE +DATA/oracle/onlinelog/group6 NO

6 ONLINE +FRA/oracle/onlinelog/group6 NO

7 ONLINE +DATA/oracle/onlinelog/group7 NO

7 ONLINE +FRA/oracle/onlinelog/group7 NO

8 ONLINE +DATA/oracle/onlinelog/group8 NO

8 ONLINE +FRA/oracle/onlinelog/group8 NO

16 rows selected

SQL> select thread#,group#,archived,status from v$log;

THREAD# GROUP# ARCHIVED STATUS

---------- ---------- -------- ----------------

1 1 YES INACTIVE

1 2 YES INACTIVE

2 3 YES INACTIVE

2 4 YES INACTIVE

1 5 NO CURRENT

2 6 YES INACTIVE

1 7 YES INACTIVE

2 8 NO CURRENT

8 rows selected

删除原有在线日志组,同时物理文件也会自动删除。

SQL> alter database drop logfile group 1;

Database altered

SQL> alter database drop logfile group 2;

Database altered

SQL> alter database drop logfile group 3;

Database altered

SQL> alter database drop logfile group 4;

Database altered

SQL> select thread#,group#,archived,status from v$log;

THREAD# GROUP# ARCHIVED STATUS

---------- ---------- -------- ----------------

1 5 NO CURRENT

2 6 YES INACTIVE

1 7 YES INACTIVE

2 8 NO CURRENT

SQL> select * from v$logfile;

GROUP# STATUS TYPE MEMBER IS_RECOVERY_DEST_FILE

---------- ------- ------- --------------------------------- ---------------------

5 ONLINE +DATA/oracle/onlinelog/group5 NO

5 ONLINE +FRA/oracle/onlinelog/group5 NO

6 ONLINE +DATA/oracle/onlinelog/group6 NO

6 ONLINE +FRA/oracle/onlinelog/group6 NO

7 ONLINE +DATA/oracle/onlinelog/group7 NO

7 ONLINE +FRA/oracle/onlinelog/group7 NO

8 ONLINE +DATA/oracle/onlinelog/group8 NO

8 ONLINE +FRA/oracle/onlinelog/group8 NO

8 rows selected

SQL> /

GROUP# STATUS TYPE MEMBER IS_RECOVERY_DEST_FILE

---------- ------- ------- -------------------------------- ---------------------

5 ONLINE +DATA/oracle/onlinelog/group5 NO

5 ONLINE +FRA/oracle/onlinelog/group5 NO

6 ONLINE +DATA/oracle/onlinelog/group6 NO

6 ONLINE +FRA/oracle/onlinelog/group6 NO

7 ONLINE +DATA/oracle/onlinelog/group7 NO

7 ONLINE +FRA/oracle/onlinelog/group7 NO

8 ONLINE +DATA/oracle/onlinelog/group8 NO

8 ONLINE +FRA/oracle/onlinelog/group8 NO

8 rows selected

SQL> select thread#,group#,archived,status from v$log;

THREAD# GROUP# ARCHIVED STATUS

---------- ---------- -------- ----------------

1 5 NO CURRENT

2 6 YES INACTIVE

1 7 YES INACTIVE

2 8 NO CURRENT

SQL> alter system switch logfile;

System altered

SQL> /

System altered

SQL> /

System altered

SQL> /

System altered

SQL> /

System altered

SQL> select * from v$logfile;

GROUP# STATUS TYPE MEMBER IS_RECOVERY_DEST_FILE

---------- ------- ------- --------------------------------- ---------------------

5 ONLINE +DATA/oracle/onlinelog/group5 NO

5 ONLINE +FRA/oracle/onlinelog/group5 NO

6 ONLINE +DATA/oracle/onlinelog/group6 NO

6 ONLINE +FRA/oracle/onlinelog/group6 NO

7 ONLINE +DATA/oracle/onlinelog/group7 NO

7 ONLINE +FRA/oracle/onlinelog/group7 NO

8 ONLINE +DATA/oracle/onlinelog/group8 NO

8 ONLINE +FRA/oracle/onlinelog/group8 NO

8 rows selected

SQL> select thread#,group#,archived,status from v$log;

THREAD# GROUP# ARCHIVED STATUS

---------- ---------- -------- ----------------

1 5 YES ACTIVE

2 6 NO CURRENT

1 7 NO CURRENT

2 8 YES ACTIVE

SQL>


0