Modify the archive mode in the RAC Environment

Source: Internet
Author: User

Changing the archive mode in the RAC environment the archive mode switching is slightly different from that in a single instance, mainly because of the differences in shared storage. In this case, we can switch the RAC database to a non-cluster state and switch the archive mode on an instance to complete the archive Mode Conversion of the RAC database. This document describes how to switch from non-archive mode to archive mode, but not archive mode. Www.2cto.com [SQL] 1. Main steps: Back up spfile, to prevent the database from being unable to start because parameter modification fails. Set cluster_database to false to start a single instance to mount. Place the database in archive mode (alter database archivelog/noarchivelog) change the cluster parameter cluster_database to true to disable single-instance cluster database startup. 2. Environment: oracle @ bo2dbp: ~> Cat/etc/issue Welcome to SUSE Linux Enterprise Server 10 SP3 (x86_64)-Kernel \ r (\ l). oracle @ bo2dbp: ~> Sqlplus-v SQL * Plus: Release 10.2.0.3.0-Production use asm storage to store archived logs 3. Modify the cluster database to archive mode oracle @ bo2dbp: ~> Export ORACLE_SID = ora10g1 oracle @ bo2dbp: ~> Sqlplus/as sysdba SQL * Plus: Release 10.2.0.3.0-Production on Mon Dec 24 16:53:18 2012 Copyright (c) 1982,200 6, Oracle. all Rights Reserved. connected to: Oracle Database 10g Release 10.2.0.3.0-64bit Production With the Real Application Clusters option SQL> archive log list; --> View the Archive mode of the current Database log Mode No Archive mode --> non-Archive Mode: Automatic archival Disabled Archive destination USE_DB_RECO VERY_FILE_DEST Oldest online log sequence 59 Current log sequence 60 SQL> select instance_name, host_name, status from gv $ instance; INSTANCE_NAME HOST_NAME STATUS ---------------- ------------------ -------------- ora10g1 bo2dbp OPEN ora10g2 bo2dbs open SQL> show parameter cluster --> View cluster Parameters. If cluster_database is true, it indicates the cluster database. Otherwise, non-cluster database name type value --------------------------------------------------- -------------------------- Cluster_database boolean TRUE cluster_database_instances integer 2 cluster_interconnects string SQL> create pfile = '/u01/oracle/db/dbs/ora10g_assist.ora' from spfile; --> back up the spfile File created first. SQL> alter system set cluster_database = false scope = spfile sid = '*'; --> modify this parameter to a non-cluster database. This parameter is a static parameter and must be set to scope = spfile System altered. oracle @ bo2dbp: ~> Srvctl stop database-d ora10g --> close database oracle @ bo2dbp: ~> Srvctl start instance-d ora10g-I ora10g1-o mount --> start a single instance to the mount state oracle @ bo2dbp: ~> Sqlplus/as sysdba SQL> select instance_name, status from v $ instance; INSTANCE_NAME STATUS -------------- ------------ ora10g1 mounted SQL> alter database archivelog; --> change Database to archive mode database altered. SQL> alter system set cluster_database = true scope = spfile sid = '*'; --> change database to cluster mode System altered. SQL> ho srvctl stop instance-d ora10g-I ora10g1 --> close current instance SQL> ho srvctl start database-d ora10g --> start cluster database SQL> archive log list; ORA-03135: connection lost contact SQL> conn/as sysdba Connected. SQL> archive log list; --> View the Archive mode Database log Mode Archive mode --> the Archive Mode is in the Archive mode. The Automatic Archive destination USE_DB_RECOVERY_FILE_DEST --> the Archive location is the value of the parameter DB_RECOVERY_FILE_DEST, Oldest --> Next log sequence to archive 61 Current log sequence 61 SQL> show parameter db_recovery_file NAME TYPE VALUE ----------- mongodb_recovery_file_dest string + REV 1_big integer 2G 4, archive verify SQL> select inst_id, name, thread #, sequence #, status from gv $ archived_log; --> no archived log no rows selected SQL> alter system switch logfile; --> archive System altered on instance 1. SQL> col name format a65 SQL> select inst_id, name, thread #, sequence #, status from gv $ archived_log; --> check that the logs with 61 sequence have archived INST_ID name thread # SEQUENCE # S ---------- bytes -----------1 + REV/ora10g/archivelog/2012_12_24/limit 1 61 SQL> select name, thread #, sequence #, status from v $ archived_log; --> the following is an instance-level view of name thread # SEQUENCE # s sequence -----------+ REV/ora10g/archivelog/2012_12_24/lifecycle 1 61 a SQL> conn system/oracle @ ora10g2 --> connect to instance 2 Connected. SQL> show parameter instance_name; name type value generation ----------- -------------------------------- instance_name string ora10g2 SQL> alter system switch logfile; --> archive System altered on instance 2. SQL> select inst_id, name, thread #, sequence #, status from gv $ archived_log; --> you can see that the log with a sequence of 43 has been archived --> note that the same archived log appears in both the Chinese and foreign instances in this view, INST_ID name thread # SEQUENCE # S ---------- visible -----------1 + REV/ora10g/archivelog/2012_12_24/61 A 1 + REV/ora10g/archivelog /2012_12_24/Jun 2 43 A 2 + REV/ora10g/archivelog/2012_12_24/Jun 1 61 A 2 + REV/ora10g/archivelog/2012_12_24/Jun 2 43 A --> view log status --> note that the v $ log view displays the groups and statuses of the two instances --> Use thread # To differentiate them, if thread # is set to 1, the log group on instance 1 has 1, 2, and 1 is in the current status. thread #2 is similar. SQL> select * from v $ log; GROUP # THREAD # SEQUENCE # bytes members arc status FIRST_CHANGE # FIRST_TIM ---------- ------------ ---------- --- hour ----------- 1 1 62 52428800 2 no current 4314741 24-DEC-12 2 1 61 52428800 2 yes active 4312116 24-DEC-12 3 2 43 52428800 2 yes active 4312300 24-DEC-12 4 2 44 52428800 2 no current 4315097 24-DEC-12 --> archive the CURRENT log, note that this command is equivalent to alter system switch logfile under a single instance --> it is different in the rac environment, that is, the current logs on all instances will be archived SQL> alter system archive log current; System altered. --> The following query verifies the preceding description --> log 62 and 44 are the archived log SQL statements generated at the same time by the preceding command> select inst_id, name, thread #, sequence #, status from gv $ archived_log; INST_ID name thread # SEQUENCE # S ---------- bytes -----------2 + REV/ora10g/archivelog/2012_12_24/REV 1 61 A 2 + REV/ora10g/archivelog/2012_12_24/limit 2 2 + REV/ora10g/archivelog/2012_12_24/g02 44 A 2 + REV/ora10g/archivelog/REV/g01 62 A 1 + REV/ora10g/archivelog/2012_12_24/g01 61 A 1 + REV/ora10g/archivelog/2012_12_24/REV 2 43 A 1 + REV/ora10g/archivelog/2012_12_24/REV 2 44 A 1 + REV/ora10g/archivelog/logs/ thread_eclipseq_62.457.802894341 1 62 A 8 rows selected. source http://blog.csdn.net/robinson_0612/article/details/8446304

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.