----- ---------------- -------------------- -------------------- --------------------
MOUNTED PHYSICAL STANDBY NOT ALLOWED MAXIMUM PERFORMANCE MAXIMUM PERFORMANCE
/* What we should do before switchover to make sure the success of them*/
SELECT SEQUENCE#,APPLIED FROM V$ARCHIVED_LOG ORDER BY SEQUENCE#;
Use the above sql statment to investigate whether all the arhived log files are applied.
/* Switchover */
primary and standby switchover
(备库一定要是disconnect)
(primary:
shutdown immediate
startup restrict;
select switchover_status from v$database;(switchover_status 是to standby 状态就可以切换了)
alter database commit to switchover to physical standby;
shutdown immediate
startup mount;(startup 是起不来的,因为是2个备库)
)
(standby:如果是to primary就正常了,否则就问题大了)
select switchover_status from v$database;
alter database commit to switchover to primary;
shutdown immediate;(因为控制文件主备格式不一样,必须shutdown)
/* Check the status again to see whether the role transformation is successful */
SQL> select dbid,name,DB_UNIQUE_NAME,switchover_status from v$database;
DBID NAME DB_UNIQUE_NAME SWITCHOVER_STATUS
---------- --------- ------------------------------ --------------------
1412188811 CHICAGO chicago TO PRIMARY
SQL> select dbid,name,DB_UNIQUE_NAME,switchover_status from v$database;
DBID NAME DB_UNIQUE_NAME SWITCHOVER_STATUS
---------- --------- ------------------------------ --------------------
1412188811 CHICAGO boston TO STANDBY
We can know the transformation is successful through the above information.
Creating a Physical Standby Database
This chapter steps you through the process of creating a physical standby database. It includes the following main topics:
■ Preparing the Primary Database for Standby Database Creation
■ Step-by-Step Instructions for Creating a Physical Standby Database
■ Post-Creation Steps
The steps described in this chapter configure the standby database for maximum performance mode, which is the default data protection mode.Chapter 5provides information about configuring the different data protection modes. The discussions in this chapter assume that you specify initialization parameters in a server parameter file (SPFILE), instead of a text initialization parameter file (PFILE).
See also:
■ Oracle Database Administrator's Guidefor information about creating and using server parameter files
■ Oracle Data Guard Brokerand the Enterprise Manager online help system for information about using the graphical user interface to automatically create a physical standby database
3.1 Preparing the Primary Database for Standby Database Creation
Before you create a standby database you must first ensure the primary database is properly configured.
Table 3–1 provides a checklist of the tasks that you perform on the primary database to prepare for physical standby database creation. There is also a reference to the section that describes the task in more detail.
Table 3–1 Preparing the Primary Database for Physical Standby Database Creation
Reference Task
Section 3.1.1 Enable Forced Logging
Section 3.1.2 Create a Password File
Section 3.1.3 Configure a Standby Redo Log
Section 3.1.4 Set Primary Database Initialization Parameters
Section 3.1.5 Enable Archiving
Note: Perform these preparatory tasks only once. After you complete these steps, the database is prepared to serve as the primary database for one or more standby databases.
3.1.1 Enable Forced Logging
Place the primary database in