Oracle 11G RAC 修改归档模式
Oracle 11G R2 RAC修改归档模式
库建好以后默认是非归档模式,需要修改一下
推荐阅读:
测试第一种方法:
SQL> archive log list;
Database log mode No Archive Mode
Automatic archival Disabled
Archive destination USE_DB_RECOVERY_FILE_DEST
Oldest online log sequence 19
Current log sequence 20
SQL>
SQL> Select NAME, CREATED, LOG_MODE, CHECKPOINT_CHANGE#, ARCHIVE_CHANGE# from V$DATABASE;
NAME CREATED LOG_MODE CHECKPOINT_CHANGE# ARCHIVE_CHANGE#
--------- --------- ------------ ------------------ ---------------
MOMORAC 04-JUN-13 NOARCHIVELOG 2709486 2583268
SQL>
SQL> conn / as sysdba
Connected.
SQL> archive log list;
Database log mode No Archive Mode
Automatic archival Disabled
Archive destination USE_DB_RECOVERY_FILE_DEST
Oldest online log sequence 20
Current log sequence 21
SQL> show parameter USE_DB_RECOVERY_FILE_DEST
SQL> show parameter DB_RECOVERY_FILE_DEST
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
db_recovery_file_dest string +FRA
db_recovery_file_dest_size big integer 5G
SQL>
SQL> show parameter LOG_ARCHIVE_START
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
log_archive_start boolean FALSE
SQL>
SQL> host srvctl stop database -d momorac
SQL> host srvctl status database -d momorac
Instance momo1 is not running on node node1
Instance momo2 is not running on node node2
Instance momo3 is not running on node node3
SQL> show user;
USER is "SYS"
SQL> startup mount exclusive
ORA-03135: connection lost contact
SQL> conn / as sysdba
Connected to an idle instance.
SQL>
SQL> startup mount exclusive
ORACLE instance started.
Total System Global Area 297119744 bytes
Fixed Size 1344540 bytes
Variable Size 184552420 bytes
Database Buffers 104857600 bytes
Redo Buffers 6365184 bytes
Database mounted.
SQL> host srvctl status database -d momorac
Instance momo1 is running on node node1
Instance momo2 is not running on node node2
Instance momo3 is not running on node node3
SQL>
SQL> select OPEN_MODE from v$database;
OPEN_MODE
--------------------
MOUNTED
SQL>
SQL> conn / as sysdba
Connected to an idle instance.
SQL>
SQL> startup mount exclusive restrict;
ORACLE instance started.
Total System Global Area 297119744 bytes
Fixed Size 1344540 bytes
Variable Size 184552420 bytes
Database Buffers 104857600 bytes
Redo Buffers 6365184 bytes
Database mounted.
SQL>
同时看日志 :
ALTER SYSTEM SET local_listener='(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=10.101.5.73)(PORT=1521))))' SCOPE=MEMORY SID='momo1';
Fri Jun 07 14:58:27 2013
NOTE: Loaded library: System
Fri Jun 07 14:58:27 2013
SUCCESS: diskgroup ASM1 was mounted
Fri Jun 07 14:58:28 2013
NOTE: dependency between database momorac and diskgroup resource ora.ASM1.dg is established
Fri Jun 07 14:58:34 2013
Successful mount of redo thread 1, with mount id 1497705681
Database mounted in Shared Mode (CLUSTER_DATABASE=TRUE)
Lost write protection disabled
Fri Jun 07 14:58:35 2013
Completed: ALTER DATABASE MOUNT
SQL>
SQL> alter database archivelog;
Database altered.
Completed: ALTER DATABASE MOUNT
Fri Jun 07 15:00:17 2013
alter database archivelog
Completed: alter database archivelog
SQL> shutdown immediate
ORA-01109: database not open
Database dismounted.
ORACLE instance shut down.
SQL>
SQL> host srvctl start database -d momorac
SQL> host srvctl status database -d momorac
Instance momo1 is running on node node1
Instance momo2 is running on node node2
Instance momo3 is running on node node3
SQL>
SQL> conn / as sysdba
Connected.
SQL> archivg log list;
SP2-0734: unknown command beginning "archivg lo..." - rest of line ignored.
SQL> archive log list;
Database log mode Archive Mode
Automatic archival Enabled
Archive destination USE_DB_RECOVERY_FILE_DEST
Oldest online log sequence 20
Next log sequence to archive 21
Current log sequence 21
SQL>
node2 node3上查看一下
[oracle@node2 ~]$ db_env
momo2
ORACLE_SID= momo2
[oracle@node2 ~]$ sqlplus /nolog
SQL*Plus: Release 11.2.0.3.0 Production on Fri Jun 7 15:05:33 2013
Copyright (c) 1982, 2011, Oracle. All rights reserved.
SQL> conn / as sysdba
Connected.
SQL> archiveg log list;
SP2-0734: unknown command beginning "archiveg l..." - rest of line ignored.
SQL> archive log list;
Database log mode Archive Mode
Automatic archival Enabled
Archive destination USE_DB_RECOVERY_FILE_DEST
Oldest online log sequence 14
Next log sequence to archive 15
Current log sequence 15
SQL>
[oracle@node3 ~]$ db_env
momo3
ORACLE_SID= momo3
[oracle@node3 ~]$ sqlplus /nolog
SQL*Plus: Release 11.2.0.3.0 Production on Fri Jun 7 15:05:25 2013
Copyright (c) 1982, 2011, Oracle. All rights reserved.
SQL> conn / as sysdba
Connected.
SQL> archiveg log list;
SP2-0734: unknown command beginning "archiveg l..." - rest of line ignored.
SQL> archive log list;
Database log mode Archive Mode
Automatic archival Enabled
Archive destination USE_DB_RECOVERY_FILE_DEST
Oldest online log sequence 7
Next log sequence to archive 8
Current log sequence 8
SQL>
SQL> Select NAME, INST_ID, OPEN_MODE, CREATED, LOG_MODE, CHECKPOINT_CHANGE#, ARCHIVE_CHANGE# from GV$DATABASE;
NAME INST_ID OPEN_MODE CREATED LOG_MODE CHECKPOINT_CHANGE# ARCHIVE_CHANGE#
--------- ---------- -------------------- --------- ------------ ------------------ ---------------
MOMORAC 3 READ WRITE 04-JUN-13 ARCHIVELOG 2869044 2583268
MOMORAC 1 READ WRITE 04-JUN-13 ARCHIVELOG 2869044 2583268
MOMORAC 2 READ WRITE 04-JUN-13 ARCHIVELOG 2869044 2583268
SQL>
这样竟然也可以?
SQL> alter system switch logfile;
System altered.
SQL>
相关推荐
运算符用于执行程序代码运算,会针对一个以上操作数项目来进行运算。以上实例中 7、5 和 12 是操作数。关系运算符用于计算结果是否为 true 或者 false。逻辑运算符用于测定变量或值之间的逻辑。