One switchover of 10g mongourad

Source: Internet
Author: User

One switchover of 10g mongourad

Query the status of the master database: SQL> select switchover_status from v $ database; the SWITCHOVER_STATUS--------------------SESSIONSACTIVE replaces the role of the master Database: SQL> alter database commit to switchover to physical standby with session shutdown; database altered.

 

In this case, alter_log has the following information, indicating that the standby log is automatically created:
standbyredo logfiles that match the primary database:ALTERDATABASE ADD STANDBY LOGFILE 'srl1.f' SIZE 52428800;ALTERDATABASE ADD STANDBY LOGFILE 'srl2.f' SIZE 52428800;ALTERDATABASE ADD STANDBY LOGFILE 'srl3.f' SIZE 52428800;ALTER DATABASE ADD STANDBY LOGFILE 'srl4.f' SIZE 52428800;

 

The status of the slave database switchover_status is changed from not allowed to primary:
SQL>select switchover_status from v$database;SWITCHOVER_STATUS--------------------NOTALLOWEDSQL>select switchover_status from v$database;SWITCHOVER_STATUS--------------------TOPRIMARY

 

Change the slave database to the master database:
SQL>ALTER DATABASE COMMIT TO SWITCHOVER TO PRIMARY WITH SESSION SHUTDOWN;Database altered.SQL>select switchover_status from v$database;SWITCHOVER_STATUS--------------------TO STANDBYSQL> select DATABASE_ROLE fromv$database;DATABASE_ROLE----------------PRIMARY

 

Test that the original master database has started to receive logs.
SQL> alter system switchlogfile;System altered.

 

Alert_log Of the new master database:
RFS[4]: Identified database type as'physical standby'Thu Aug  1 13:03:47 2013Primary database is in MAXIMUMPERFORMANCE modeRFS[2]: Successfully opened standbylog 5: '/u01/app/oracle/oradata/orcl/redo05.log'

 

Run switchover again to restore to the initial state: In the master database:
SQL> select switchover_statusfrom v$database;SWITCHOVER_STATUS--------------------SESSIONS ACTIVESQL>  alter database commit to switchover tophysical standby with session shutdown;Database altered.

 

Run the following command in the slave database:
SQL> select switchover_statusfrom v$database;SWITCHOVER_STATUS--------------------NOT ALLOWEDSQL>  select switchover_status from v$database;SWITCHOVER_STATUS--------------------TO PRIMARYSQL> ALTER DATABASE COMMIT TOSWITCHOVER TO PRIMARY WITH SESSION SHUTDOWN;Database altered.SQL> select switchover_statusfrom v$database;SWITCHOVER_STATUS--------------------TO STANDBY

 

After restarting the Primary and Secondary databases respectively:
SQL> startup mountORACLE instance started.Total System Global Area  281018368 bytesFixed Size                  1218944 bytesVariable Size             100664960 bytesDatabase Buffers          171966464 bytesRedo Buffers                7168000 bytesDatabase mounted.SQL> select  PROTECTION_MODE,PROTECTION_LEVEL  from v$database;PROTECTION_MODE      PROTECTION_LEVEL----------------------------------------MAXIMUM AVAILABILITY MAXIMUM AVAILABILITYSQL> recover managed standbydatabase disconnect from session;Media recovery complete.

 

Logfile is switched once in the master database;
SQL>  alter system switch logfile;System altered.

 

Slave database logs:
Thu Aug  1 14:19:44 2013Primary database is in MAXIMUMAVAILABILITY modeStandby controlfile consistent withprimaryRFS[2]: Successfully opened standbylog 5: '/u01/app/oracle/oradata/orcl/redo05.log'Thu Aug  1 14:19:48 2013Media Recovery Log/u01/app/oracle/oradata/orcl/archivelog/1_72_793805797.dbfMedia Recovery Waiting for thread 1sequence 73 (in transit)

 

Successful!

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.