C:\Users\Administrator>sqlplus sys/********@solgle_db1 as sysdba
SQL*Plus: Release 11.2.0.1.0 Production on 星期一 10月 20 17:50:14 2014
Copyright (c) 1982, 2010, Oracle. All rights reserved.
连接到:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, Real Application Clusters, Automatic Storage Management,
OLAP,
Data Mining and Real Application Testing options
SQL> select group#,bytes/1024/1024,status from gv$log;
GROUP# BYTES/1024/1024 STATUS
---------- --------------- --------------------------------
1 50 CURRENT
2 50 ACTIVE
3 50 ACTIVE
4 50 CURRENT
1 50 CURRENT
2 50 ACTIVE
3 50 ACTIVE
4 50 CURRENT
已选择8行。
SQL> select group#,bytes/1024/1024,status from gv$log order by group# asc;
GROUP# BYTES/1024/1024 STATUS
---------- --------------- --------------------------------
1 50 CURRENT
1 50 CURRENT
2 50 ACTIVE
2 50 ACTIVE
3 50 ACTIVE
3 50 ACTIVE
4 50 CURRENT
4 50 CURRENT
已选择8行。
SQL> select group#,thread#,bytes/1024/1024,status from gv$log order by group# as
c;
GROUP# THREAD# BYTES/1024/1024 STATUS
---------- ---------- --------------- --------------------------------
1 1 50 CURRENT
1 1 50 CURRENT
2 1 50 ACTIVE
2 1 50 ACTIVE
3 2 50 ACTIVE
3 2 50 ACTIVE
4 2 50 CURRENT
4 2 50 CURRENT
已选择8行。
SQL> alter database add logfile thread 1 group 5 size 200m;
数据库已更改。
SQL> alter database add logfile thread 1 group 6 size 200m;
数据库已更改。
SQL> alter database add logfile thread 2 group 7 size 200m;
数据库已更改。
SQL> alter database add logfile thread 2 group 8 size 200m;
数据库已更改。
SQL> set pagesize 200
SQL> select group#,thread#,bytes/1024/1024,status from gv$log order by group# asc,thread# asc;
GROUP# THREAD# BYTES/1024/1024 STATUS
---------- ---------- --------------- --------------------------------
1 1 50 CURRENT
1 1 50 CURRENT
2 1 50 INACTIVE
2 1 50 INACTIVE
3 2 50 ACTIVE
3 2 50 ACTIVE
4 2 50 ACTIVE
4 2 50 ACTIVE
5 1 200 UNUSED
5 1 200 UNUSED
6 1 200 UNUSED
6 1 200 UNUSED
7 2 200 CURRENT
7 2 200 CURRENT
8 2 200 UNUSED
8 2 200 UNUSED
已选择16行。
SQL>
SQL> alter database drop logfile group 2;
数据库已更改。
SQL> alter database add logfile thread 1 group 2 size 200m;
数据库已更改。
SQL> select group#,thread#,bytes/1024/1024,status from gv$log order by group# as
c,thread# asc;
GROUP# THREAD# BYTES/1024/1024 STATUS
---------- ---------- --------------- --------------------------------
1 1 50 CURRENT
1 1 50 CURRENT
2 1 200 UNUSED
2 1 200 UNUSED
3 2 50 INACTIVE
3 2 50 INACTIVE
4 2 50 INACTIVE
4 2 50 INACTIVE
5 1 200 UNUSED
5 1 200 UNUSED
6 1 200 UNUSED
6 1 200 UNUSED
7 2 200 ACTIVE
7 2 200 ACTIVE
8 2 200 CURRENT
8 2 200 CURRENT
已选择16行。
SQL> alter database drop logfile group 3;
数据库已更改。
SQL> alter database add logfile thread 2 group 3 size 200m;
数据库已更改。
SQL> alter database drop logfile group 4;
数据库已更改。
SQL> alter database add logfile thread 2 group 4 size 200m;
数据库已更改。
SQL> select group#,thread#,bytes/1024/1024,status from gv$log order by group# as
c,thread# asc;
GROUP# THREAD# BYTES/1024/1024 STATUS
---------- ---------- --------------- --------------------------------
1 1 50 CURRENT
1 1 50 CURRENT
2 1 200 UNUSED
2 1 200 UNUSED
3 2 200 UNUSED
3 2 200 UNUSED
4 2 200 UNUSED
4 2 200 UNUSED
5 1 200 UNUSED
5 1 200 UNUSED
6 1 200 UNUSED
6 1 200 UNUSED
7 2 200 ACTIVE
7 2 200 ACTIVE
8 2 200 CURRENT
8 2 200 CURRENT
已选择16行。
SQL> alter system switch logfile; --多次
系统已更改。
SQL> select group#,thread#,bytes/1024/1024,status from gv$log order by group# as
c,thread# asc;
GROUP# THREAD# BYTES/1024/1024 STATUS
---------- ---------- --------------- --------------------------------
1 1 50 INACTIVE
1 1 50 INACTIVE
2 1 200 CURRENT
2 1 200 CURRENT
3 2 200 ACTIVE
3 2 200 ACTIVE
4 2 200 ACTIVE
4 2 200 ACTIVE
5 1 200 UNUSED
5 1 200 UNUSED
6 1 200 UNUSED
6 1 200 UNUSED
7 2 200 CURRENT
7 2 200 CURRENT
8 2 200 ACTIVE
8 2 200 ACTIVE
已选择16行。
SQL> alter database drop logfile group 1;
数据库已更改。
SQL> alter database add logfile thread 1 group 1 size 200m;
数据库已更改。
SQL> select group#,thread#,bytes/1024/1024,status from gv$log order by group# as
c,thread# asc;
GROUP# THREAD# BYTES/1024/1024 STATUS
---------- ---------- --------------- --------------------------------
1 1 200 UNUSED
1 1 200 UNUSED
2 1 200 CURRENT
2 1 200 CURRENT
3 2 200 ACTIVE
3 2 200 ACTIVE
4 2 200 ACTIVE
4 2 200 ACTIVE
5 1 200 UNUSED
5 1 200 UNUSED
6 1 200 UNUSED
6 1 200 UNUSED
7 2 200 CURRENT
7 2 200 CURRENT
8 2 200 ACTIVE
8 2 200 ACTIVE
已选择16行。