欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  数据库

Oracle 11G RAC 修改归档模式

程序员文章站 2022-06-16 11:14:04
...

Oracle 11G R2 RAC修改归档模式 库建好以后默认是非归档模式,需要修改一下 推荐阅读: Oracle 11G RAC OCR 与 db_unique_name

Oracle 11G R2 RAC修改归档模式

库建好以后默认是非归档模式,需要修改一下

推荐阅读:

Oracle 11G RAC OCR 与 db_unique_name 配置关系 说明

重新配置与卸载Oracle 11GR2 Grid Infrastructure


测试第一种方法:

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#

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