Use RMAN to build mongoard for Master/Slave switchover

Source: Internet
Author: User

The process of using rman duplicate to create a slave database is much simpler. You do not need to manually create a slave Database Control File.

Master database SPFILE

*. Log_archive_format = '% T % S % r. arc'
*. DB_UNIQUE_NAME = 'primary'
*. Log_archive_config = 'dg _ CONFIG = (primary, standby )'
*. Log_archive_dest_1 = 'location = C:/Oracle/product/10.2.0/oradata/arch VALID_FOR = (ALL_LOGFILES, ALL_ROLES) DB_UNIQUE_NAME = primary'
*. Log_archive_dest_2 = 'service = standby arch ASYNC VALID_FOR = (ONLINE_LOGFILES, PRIMARY_ROLE) DB_UNIQUE_NAME = standby'
*. STANDBY_FILE_MANAGEMENT = AUTO
*. LOG_ARCHIVE_DEST_STATE_1 = ENABLE
*. LOG_ARCHIVE_DEST_STATE_2 = ENABLE

*. FAL_SERVER = 'standby'

*. FAL_CLIENT = 'primary'

The slave database SPFILE creates a SPFILE in the master database for the slave database and modifies it.

*. Log_archive_format = '% T % S % r. arc'
*. DB_UNIQUE_NAME = 'standby'
*. Log_archive_config = 'dg _ CONFIG = (primary, standby )'
*. Log_archive_dest_1 = 'location = C:/oracle/product/10.2.0/oradata/arch VALID_FOR = (ALL_LOGFILES, ALL_ROLES) DB_UNIQUE_NAME = standby'
*. Log_archive_dest_2 = 'service = primary arch ASYNC VALID_FOR = (ONLINE_LOGFILES, PRIMARY_ROLE) DB_UNIQUE_NAME = primary'
*. STANDBY_FILE_MANAGEMENT = AUTO
*. LOG_ARCHIVE_DEST_STATE_1 = ENABLE
*. LOG_ARCHIVE_DEST_STATE_2 = ENABLE
*. FAL_SERVER = 'primary'
*. FAL_CLIENT = 'standby'


TNS listeners can communicate with each other through TNSPING.

Master database operations

Modify the LOGFILE size to 100 mb and add four groups of backup online logs.

SQL> alter database add logfile group 4 'C: \ oracle \ product \ 10.2.0 \ oradata \ orcl \ r
Edolog04.log 'size 50 M;

SQL> alter database add logfile group 5'c: \ oracle \ product \ 10.2.0 \ oradata \ orcl \ r
Edolog05.log 'size 50 M;

SQL> alter system switch logfile;

SQL> alter database drop logfile group 1;

SQL> alter database drop logfile group 2;

SQL> alter database drop logfile group 3;

SQL> alter database add logfile group 2 'C: \ oracle \ product \ 10.2.0 \ oradata \ orcl \ r
Edolog02.log 'size 100 M;

SQL> alter database add logfile group 3 'C: \ oracle \ product \ 10.2.0 \ oradata \ orcl \ r
Edolog03.log 'size 100 M;

SQL> alter database drop logfile group 4;

SQL> select group #, sequence #, status from v $ log;


GROUP # SEQUENCE # STATUS
----------------------------------------------------
1 15 CURRENT
2 0 UNUSED
3 0 UNUSED
5 14 ACTIVE


SQL> alter system switch logfile;

SQL> select group #, sequence #, status from v $ log;


GROUP # SEQUENCE # STATUS
----------------------------------------------------
1 19 INACTIVE
2 20 ACTIVE
3 21 CURRENT
5 18 INACTIVE

SQL> alter database drop logfile group 5;

The database has been changed.

SQL> select group #, sequence #, status from v $ log;


GROUP # SEQUENCE # STATUS
----------------------------------------------------
1 19 INACTIVE
2 20 ACTIVE
3 21 CURRENT

SQL> alter database add standby logfile group 4 'C: \ oracle \ product \ 10.2.0 \ oradat
A \ orcl \ standbylog04.log 'size 50 M;

The database has been changed.

SQL> alter database add standby logfile group 5'c: \ oracle \ product \ 10.2.0 \ oradat
A \ orcl \ standbylog05.log 'size 50 M;

The database has been changed.

SQL> alter database add standby logfile group 6 'C: \ oracle \ product \ 10.2.0 \ oradat
A \ orcl \ standbylog06.log 'size 50 M;

The database has been changed.

SQL> alter database add standby logfile group 7'c: \ oracle \ product \ 10.2.0 \ oradat
A \ orcl \ standbylog07.log 'size 50 M;

The database has been changed.

-- Add a member to a log Group
SQL> alter database add logfile member 'C: \ oracle \ product \ 10.2.0 \ oradata \ orcl \ re
Dolog012.log 'to group 1;

The database has been changed.

-- Delete a member of a log Group

SQL> alter database drop logfile member 'C: \ oracle \ product \ 10.2.0 \ oradata \ orcl \
Redolog012.log ';

The database has been changed.

RMAN full backup database control file archive log

RMAN> backup full format 'C: \ backup \ fullbackup _ % d _ % T _ % s. bak 'database include cu

Rrent controlfile for standby;

 

RMAN> SQL 'alter system archive log current ';

SQL statement: alter system archive log current
RMAN> backup archivelog all format 'C: \ backup \ archive _ % d _ % T _ % s ';

For more details, please continue to read the highlights on the next page:

 

Recommended reading:

Basic Oracle tutorial-copying a database through RMAN

Reference for RMAN backup policy formulation

RMAN backup learning notes

Oracle Database Backup encryption RMAN Encryption

  • 1
  • 2
  • 3
  • Next Page

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.