Dataguard switch over to a

Forget the fear of the future, look to be a test record, this switch more conventional
1] master - standby database to check again, as if you can start up
both the current sequence consistent with
the role of the state is as follows
- the main library
SQL> Archive log List;
database log mode archive mode
automatic archival enabled
archive destination / u01 / app / oracle / oradata test / / flash_recovery_area
earliest online log sequence 524
next archived log sequence 526
current log sequence 526
SQL> the SELECT SWITCHOVER_STATUS, database_role from v $ database;

SWITCHOVER_STATUS DATABASE_ROLE
-------------------- ----------------
TO STANDBY PRIMARY

- prepared by the library
SQL> archive log list;
Database log mode Archive Mode
Automatic archival Enabled
Archive destination / u01 / app / oracle / oradata test / / flash_recovery_area
earliest online log sequence 524
next archived log sequence 0
Current log sequence 526
SQL> select switchover_status, database_role from v $ database ;

SWITCHOVER_STATUS DATABASE_ROLE
-------------------- ----------------
NOT ALLOWED PHYSICAL STANDBY

2] to switch
- the main library
- to convert the primary role for the standby role
SQL> the ALTER Database PHYSICAL the commit to switchover to standby;

Database has changed.
SQL> the shutdown load immediate
ORA-01012: not logged ON

load immediate --shutdown
SQL> the Startup Mount
ORACLE instance started.

Area System, Ltd. Free Join 3975139328 bytes Total
Fixed Size 2.25936 million bytes
Variable Size 2,768,242,272 bytes
Database Buffers 1,191,182,336 bytes
Redo Buffers 13.45536 million bytes
database loading is completed.

After the mount has become the repository of origin prepared by the library
SQL> select switchover_status, database_role from v $ database;

SWITCHOVER_STATUS DATABASE_ROLE
-------------------- ----------------
RECOVERY NEEDED PHYSICAL STANDBY

- prepared by the library
- View standby state
SQL> select switchover_status, database_role from v $ database;

SWITCHOVER_STATUS DATABASE_ROLE
-------------------- ----------------
SESSIONS ACTIVE PHYSICAL STANDBY

- the - the role of library equipment modified to Primary
/ * needed for a later closing other sql window , otherwise reported the following error

The SQL> ALTER to switchover to the commit Primary Database;
ALTER to switchover to the commit Primary Database
*
Line 1 Error:
ORA-01 093: the ALTER DATABASE the CLOSE allowed only when there is no session connection
* /

Confirmed that no session is connected to the results of
SQL> the ALTER Database the commit to switchover to Primary;

Database has changed.

- The new standby database state has become like the original primary database
SQL> select switchover_status, database_role from v $ database;

SWITCHOVER_STATUS DATABASE_ROLE
-------------------- ----------------
NOT ALLOWED PRIMARY

- Open the database
alter database open;

Preparation of libraries (libraries of origin)
the SQL> SELECT SWITCHOVER_STATUS, database_role from V $ Database;

SWITCHOVER_STATUS DATABASE_ROLE
-------------------- ----------------
RECOVERY NEEDED PHYSICAL STANDBY

- modify ago - the main library for the log application
SQL> the ALTER DATABASE RECOVER the MANAGED STANDBY DATABASE the USING CURRENT LOGFILE DISCONNECT the FROM SESSION;

Database has changed.

- the new primary database (original standby database) become like the original primary database
SQL> select switchover_status, database_role from v $ database;

SWITCHOVER_STATUS DATABASE_ROLE
-------------------- ----------------
NOT ALLOWED PHYSICAL STANDBY

] Check
the new primary library switches on both sides of the log to see if the same sequence (a simple manner)
ALTER System Switch logfile;
Archive log List;

See master, standby database if there GAP
the SELECT the STATUS, GAP_STATUS the FROM V $ ARCHIVE_DEST_STATUS the WHERE DEST_ID = 2;

 

Guess you like

Origin www.cnblogs.com/ritchy/p/10948639.html