下面设置主节点数据库为force logging模式:
SQL> alter database force logging;
Database altered.
force logging存在的意义:使得Oracle无论什么操作都进行redo的写入。
通过select语句可以查看:
SQL> select FORCE_LOGGING from v$database;
FOR
---
YES
因为刚建立数据库,还没有生成归档日志,我们可以手工进行日志切换来让数据库产生日志文件:
SQL> alter system switch logfile;
System altered.
SQL> alter system switch logfile;
System altered.
SQL> alter system switch logfile;
System altered.
SQL> select name from v$archived_log;
NAME
--------------------------------------------------------------------------------
/arch/1_2_697298091.dbf
/arch/1_3_697298091.dbf
/arch/1_4_697298091.dbf
查看已有的日志文件:
SQL> select * from v$logfile;
rows will be truncated
GROUP# STATUS TYPE MEMBER
---------- ------- ------- --------------------------------------------------------
3 ONLINE /home/db/oracle/oradata/ora/redo03.log
2 ONLINE /home/db/oracle/oradata/ora/redo02.log
1 ONLINE /home/db/oracle/oradata/ora/redo01.log
为备节点创建同样大小的三组日志文件并检验:
SQL> alter database add standby logfile group 4 ('/home/db/oracle/oradata/ora/redo04.log') size 50m;
Database altered.
SQL> alter database add standby logfile group 5 ('/home/db/oracle/oradata/ora/redo05.log') size 50m;
Database altered.
SQL> alter database add standby logfile group 6 ('/home/db/oracle/oradata/ora/redo06.log') size 50m;
Database altered.
SQL> select * from v$logfile;
rows will be truncated
GROUP# STATUS TYPE MEMBER
---------- ------- ------- --------------------------------------------------------
3 ONLINE /home/db/oracle/oradata/ora/redo03.log
2 ONLINE /home/db/oracle/oradata/ora/redo02.log
1 ONLINE /home/db/oracle/oradata/ora/redo01.log
5 STANDBY /home/db/oracle/oradata/ora/redo05.log
4 STANDBY /home/db/oracle/oradata/ora/redo04.log
6 STANDBY /home/db/oracle/oradata/ora/redo06.log
6 rows selected.
关闭数据库,即将来到第一个重要步骤,修改服务器参数文件。
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
阅读(1482) | 评论(0) | 转发(0) |