ORA-00257: archiver error --11GR2 RAC 设置归档路径和开启flashback
[sql] view
plaincopyprint?
- <wbr> 开启归档和flashback,现在对于11g来说开启RAC和单实例没有什么差别,测试了这么的一个例子,
- 需求:把归档日志存放到ASM上,orcl1的归档存放在+DATA/ARC1下,orcl2的归档放到+DATA/ARC2下。
- Flashbask area是需要单独的一个diskgroup,所以特地给他创建了个新的DG -- SHFLASH
[sql] view
plaincopyprint?
- 一、under asm environment
- [grid@node1 ~]$ sqlplus / as sysasm
- SQL*Plus: Release 11.2.0.1.0 Production on Tue Apr 9 15:06:35 2013
- Copyright (c) 1982, 2009, Oracle. All rights reserved.
- Connected to:
- Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
- With the Real Application Clusters and Automatic Storage Management options
- SQL> CREATE DISKGROUP SHFLASH EXTERNAL REDUNDANCY DISK '/dev/raw/raw2';----此处也可用asmca图形化界面去创建
- SQL> desc v$asm_diskgroup
- Name Null? Type
- ----------------------------------------- -------- ----------------------------
- GROUP_NUMBER NUMBER
- NAME VARCHAR2(30)
- SECTOR_SIZE NUMBER
- BLOCK_SIZE NUMBER
- ALLOCATION_UNIT_SIZE NUMBER
- STATE VARCHAR2(11)
- TYPE VARCHAR2(6)
- TOTAL_MB NUMBER
- FREE_MB NUMBER
- HOT_USED_MB NUMBER
- COLD_USED_MB NUMBER
- REQUIRED_MIRROR_FREE_MB NUMBER
- USABLE_FILE_MB NUMBER
- OFFLINE_DISKS NUMBER
- COMPATIBILITY VARCHAR2(60)
- DATABASE_COMPATIBILITY VARCHAR2(60)
- VOTING_FILES VARCHAR2(1)
- SQL> select group_number,name from v$asm_diskgroup;
- GROUP_NUMBER NAME
- ------------ ------------------------------
- 1 DATA
- 2 SHFLASH
- SQL> alter diskgroup data add directory '+DATA/ARC1';
- Diskgroup altered.
- SQL> alter diskgroup data add directory '+DATA/ARC2';
- Diskgroup altered.
- SQL> EXIT
- Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
- With the Real Application Clusters and Automatic Storage Management options
- 二、under oracle environment
- [grid@node1 ~]$ su - oracle
- Password:
- [oracle@node1 ~]$ sqlplus / as sysdba
- SQL*Plus: Release 11.2.0.1.0 Production on Tue Apr 9 15:15:38 2013
- Copyright (c) 1982, 2009, Oracle. All rights reserved.
- Connected to:
- Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
- With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
- Data Mining and Real Application Testing options
- SQL> alter system set log_archive_dest_1 ='location=+DATA/ARC1' scope=spfile sid='orcl1';
- System altered.
- SQL> alter system set log_archive_dest_1 ='location=+DATA/ARC2' scope=spfile sid='orcl2';
- System altered.
- SQL> show parameter db_recovery
- NAME TYPE VALUE
- ------------------------------------ ----------- ------------------------------
- db_recovery_file_dest string +DATA
- db_recovery_file_dest_size big integer 3882M
- SQL> alter system set db_recovery_file_dest_size=2G scope=both sid='*';
- System altered.
- SQL> alter system set db_recovery_file_dest ='+SHFLASH' scope=both sid='*';
- System altered.
- SQL> show parameter db_flashback
- NAME TYPE VALUE
- ------------------------------------ ----------- ------------------------------
- db_flashback_retention_target integer 1440
- 三、shutdown immediate instance in all nodes
- on node1:
- SQL> show user
- USER is "SYS"
- SQL> shutdown immediate
- Database closed.
- Database dismounted.
- ORACLE instance shut down.
- SQL> !
- [oracle@node1 ~]$ srvctl status database -d orcl
- Instance orcl1 is not running on node node1
- Instance orcl2 is running on node node2
- on node2:
- SQL> show user
- USER is "SYS"
- SQL> shutdown immediate
- Database closed.
- Database dismounted.
- ORACLE instance shut down.
- [oracle@node1 ~]$ export ORACLE_SID=orcl1
- [oracle@node1 ~]$ srvctl status database -d orcl
- Instance orcl1 is not running on node node1
- Instance orcl2 is not running on node node2
- 四、startup mount one instance and enable ARCHIVELOG and FLASHBACK
- [oracle@node1 ~]$ sqlplus / as sysdba
- SQL*Plus: Release 11.2.0.1.0 Production on Tue Apr 9 15:52:06 2013
- Copyright (c) 1982, 2009, Oracle. All rights reserved.
- Connected to an idle instance.
- SQL> startup mount
- ORACLE instance started.
- Total System Global Area 1269366784 bytes
- Fixed Size 2212976 bytes
- Variable Size 889195408 bytes
- Database Buffers 369098752 bytes
- Redo Buffers 8859648 bytes
- Database mounted.
- SQL> alter database archivelog;
- Database altered.
- SQL> alter database flashback on;
- Database altered.
- SQL> desc v$database
- Name Null? Type
- ----------------------------------------- -------- ----------------------------
- DBID NUMBER
- NAME VARCHAR2(9)
- CREATED DATE
- RESETLOGS_CHANGE# NUMBER
- RESETLOGS_TIME DATE
- PRIOR_RESETLOGS_CHANGE# NUMBER
- PRIOR_RESETLOGS_TIME DATE
- LOG_MODE VARCHAR2(12)
- CHECKPOINT_CHANGE# NUMBER
- ARCHIVE_CHANGE# NUMBER
- CONTROLFILE_TYPE VARCHAR2(7)
- CONTROLFILE_CREATED DATE
- CONTROLFILE_SEQUENCE# NUMBER
- CONTROLFILE_CHANGE# NUMBER
- CONTROLFILE_TIME DATE
- OPEN_RESETLOGS VARCHAR2(11)
- VERSION_TIME DATE
- OPEN_MODE VARCHAR2(20)
- PROTECTION_MODE VARCHAR2(20)
- PROTECTION_LEVEL VARCHAR2(20)
- REMOTE_ARCHIVE VARCHAR2(8)
- ACTIVATION# NUMBER
- SWITCHOVER# NUMBER
- DATABASE_ROLE VARCHAR2(16)
- ARCHIVELOG_CHANGE# NUMBER
- ARCHIVELOG_COMPRESSION VARCHAR2(8)
- SWITCHOVER_STATUS VARCHAR2(20)
- DATAGUARD_BROKER VARCHAR2(8)
- GUARD_STATUS VARCHAR2(7)
- SUPPLEMENTAL_LOG_DATA_MIN VARCHAR2(8)
- SUPPLEMENTAL_LOG_DATA_PK VARCHAR2(3)
- SUPPLEMENTAL_LOG_DATA_UI VARCHAR2(3)
- FORCE_LOGGING VARCHAR2(3)
- PLATFORM_ID NUMBER
- PLATFORM_NAME VARCHAR2(101)
- RECOVERY_TARGET_INCARNATION# NUMBER
- LAST_OPEN_INCARNATION# NUMBER
- CURRENT_SCN NUMBER
- FLASHBACK_ON VARCHAR2(18)
- SUPPLEMENTAL_LOG_DATA_FK VARCHAR2(3)
- SUPPLEMENTAL_LOG_DATA_ALL VARCHAR2(3)
- DB_UNIQUE_NAME VARCHAR2(30)
- STANDBY_BECAME_PRIMARY_SCN NUMBER
- FS_FAILOVER_STATUS VARCHAR2(22)
- FS_FAILOVER_CURRENT_TARGET VARCHAR2(30)
- FS_FAILOVER_THRESHOLD NUMBER
- FS_FAILOVER_OBSERVER_PRESENT VARCHAR2(7)
- FS_FAILOVER_OBSERVER_HOST VARCHAR2(512)
- CONTROLFILE_CONVERTED VARCHAR2(3)
- PRIMARY_DB_UNIQUE_NAME VARCHAR2(30)
- SUPPLEMENTAL_LOG_DATA_PL VARCHAR2(3)
- MIN_REQUIRED_CAPTURE_CHANGE# NUMBER
- SQL> select LOG_MODE , FLASHBACK_ON from v$database;
- LOG_MODE FLASHBACK_ON
- ------------ ------------------
- ARCHIVELOG YES
- SQL> alter database open
- 2 ;
- Database altered.
- 五、startup node2
- [oracle@node2 ~]$ sqlplus / as sysdba
- SQL*Plus: Release 11.2.0.1.0 Production on Tue Apr 9 15:52:06 2013
- Copyright (c) 1982, 2009, Oracle. All rights reserved.
- Connected to an idle instance.
- SQL> startup
- 六、test and verify
- [oracle@node1 ~]$ sqlplus / as sysdba
- SQL*Plus: Release 11.2.0.1.0 Production on Tue Apr 9 15:55:23 2013
- Copyright (c) 1982, 2009, Oracle. All rights reserved.
- Connected to:
- Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
- With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
- Data Mining and Real Application Testing options
- SQL> archive log list;
- Database log mode Archive Mode
- Automatic archival Enabled
- Archive destination +DATA/arc1
- Oldest online log sequence 15
- Next log sequence to archive 16
- Current log sequence 16
- SQL> select status from gv$instance;
- STATUS
- ------------
- OPEN
- OPEN
- SQL> desc v$asm_diskgroup
- Name Null? Type
- ----------------------------------------- -------- ----------------------------
- GROUP_NUMBER NUMBER
- NAME VARCHAR2(30)
- SECTOR_SIZE NUMBER
- BLOCK_SIZE NUMBER
- ALLOCATION_UNIT_SIZE NUMBER
- STATE VARCHAR2(11)
- TYPE VARCHAR2(6)
- TOTAL_MB NUMBER
- FREE_MB NUMBER
- HOT_USED_MB NUMBER
- COLD_USED_MB NUMBER
- REQUIRED_MIRROR_FREE_MB NUMBER
- USABLE_FILE_MB NUMBER
- OFFLINE_DISKS NUMBER
- COMPATIBILITY VARCHAR2(60)
- DATABASE_COMPATIBILITY VARCHAR2(60)
- VOTING_FILES VARCHAR2(1)
- SQL> select GROUP_NUMBER ,NAME from v$asm_diskgroup;
- GROUP_NUMBER NAME
- ------------ ------------------------------
- 1 DATA
- 2 SHFLASH
- SQL> select name from v$datafile
- 2 union all
- 3 select name from v$controlfile
- 4 union all
- 5 select member from v$logfile;
- NAME
- --------------------------------------------------------------------------------
- +DATA/orcl/datafile/system.256.811903481
- +DATA/orcl/datafile/sysaux.257.811903483
- +DATA/orcl/datafile/undotbs1.258.811903483
- +DATA/orcl/datafile/users.259.811903483
- +DATA/orcl/datafile/undotbs2.267.811903583
- +DATA/orcl/controlfile/current.261.811903555
- +DATA/orcl/controlfile/current.260.811903555
- +DATA/orcl/onlinelog/group_2.264.811903559
- +DATA/orcl/onlinelog/group_2.265.811903559
- +DATA/orcl/onlinelog/group_1.262.811903559
- +DATA/orcl/onlinelog/group_1.263.811903559
- NAME
- --------------------------------------------------------------------------------
- +DATA/orcl/onlinelog/group_3.268.811903615
- +DATA/orcl/onlinelog/group_3.269.811903617
- +DATA/orcl/onlinelog/group_4.270.811903617
- +DATA/orcl/onlinelog/group_4.271.811903617
- 15 rows selected.
- [oracle@node2 ~]$ sqlplus / as sysdba
- SQL*Plus: Release 11.2.0.1.0 Production on Tue Apr 9 15:55:23 2013
- Copyright (c) 1982, 2009, Oracle. All rights reserved.
- Connected to:
- Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
- With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
- Data Mining and Real Application Testing options
- SQL> archive log list;
- Database log mode Archive Mode
- Automatic archival Enabled
- Archive destination +DATA/arc2
- Oldest online log sequence 15
- Next log sequence to archive 16
- Current log sequence 16
- SQL> desc v$archived_log
- Name Null? Type
- ----------------------------------------- -------- ----------------------------
- RECID NUMBER
- STAMP NUMBER
- NAME VARCHAR2(513)
- DEST_ID NUMBER
- THREAD# NUMBER
- SEQUENCE# NUMBER
- RESETLOGS_CHANGE# NUMBER
- RESETLOGS_TIME DATE
- RESETLOGS_ID NUMBER
- FIRST_CHANGE# NUMBER
- FIRST_TIME DATE
- NEXT_CHANGE# NUMBER
- NEXT_TIME DATE
- BLOCKS NUMBER
- BLOCK_SIZE NUMBER
- CREATOR VARCHAR2(7)
- REGISTRAR VARCHAR2(7)
- STANDBY_DEST VARCHAR2(3)
- ARCHIVED VARCHAR2(3)
- APPLIED VARCHAR2(9)
- DELETED VARCHAR2(3)
- STATUS VARCHAR2(1)
- COMPLETION_TIME DATE
- DICTIONARY_BEGIN VARCHAR2(3)
- DICTIONARY_END VARCHAR2(3)
- END_OF_REDO VARCHAR2(3)
- BACKUP_COUNT NUMBER
- ARCHIVAL_THREAD# NUMBER
- ACTIVATION# NUMBER
- IS_RECOVERY_DEST_FILE VARCHAR2(3)
- COMPRESSED VARCHAR2(3)
- FAL VARCHAR2(3)
- END_OF_REDO_TYPE VARCHAR2(10)
- BACKED_BY_VSS VARCHAR2(3)
- SQL> alter system switch logfile;
- System altered.
- SQL> select THREAD# SEQUENCE# , ARCHIVED from v$archived_log;
- SEQUENCE# ARC
- ---------- ---
- 2 YES
- 1 YES
- 1 YES
- 1 YES
- 1 YES
- 2 YES
- 1 YES
- 1 YES
- 2 YES
- 2 YES
- 2 YES
- SEQUENCE# ARC
- ---------- ---
- 2 YES
- 1 YES
- 2 YES
- 1 YES
- 2 YES
- 2 YES
- 1 YES
- 2 YES
- 2 YES
- 1 YES
- 1 YES
- SEQUENCE# ARC
- ---------- ---
- 1 YES
- 1 YES
- 1 YES
- 25 rows selected.
- SQL> alter system switch logfile;
- System altered.
- SQL> select THREAD# SEQUENCE# , ARCHIVED from v$archived_log;
- SEQUENCE# ARC
- ---------- ---
- 2 YES
- 1 YES
- 1 YES
- 1 YES
- 1 YES
- 2 YES
- 1 YES
- 1 YES
- 2 YES
- 2 YES
- 2 YES
- SEQUENCE# ARC
- ---------- ---
- 2 YES
- 1 YES
- 2 YES
- 1 YES
- 2 YES
- 2 YES
- 1 YES
- 2 YES
- 2 YES
- 1 YES
- 1 YES
- SEQUENCE# ARC
- ---------- ---
- 1 YES
- 1 YES
- 1 YES
- 1 YES
- 2 YES
- 27 rows selected.
- SQL> select LOG_MODE , FLASHBACK_ON from v$database;
- LOG_MODE FLASHBACK_ON
- ------------ ------------------
- ARCHIVELOG YES
开启归档和flashback,现在对于11g来说开启RAC和单实例没有什么差别,测试了这么的一个例子,
需求:把归档日志存放到ASM上,orcl1的归档存放在+DATA/ARC1下,orcl2的归档放到+DATA/ARC2下。
Flashbask area是需要单独的一个diskgroup,所以特地给他创建了个新的DG -- SHFLASH
时间: 2025-01-30 07:31:00