Sie sind auf Seite 1von 2

switchover 11.

stdby:

select process,status,sequence# from v$managed_standby;

-- If MRP is not running, then start the process


-- with real time enabled using the below query in the standby database.

alter database recover managed standby disconnect from session;

-- check query gap:

primary:

select max(sequence#) from v$archived_log;

stdby:
select max(sequence#) from v$archived_log;

-- verify temp tablespace match both site:

select tmp.name filename,bytes,ts.name tablespace


from v$tempfile tmp, v$tablespace ts where tmp.ts#=ts.ts#;

select name from v$datafile where status='OFFLINE';

Switchover Steps:
-----------------

-- Check if there are any jobs running


-- on the primary database using the below query.

primary:
--------

select * from dba_jobs_running;


select * from dba_scheduler_running_jobs;

-- wait jobs or can be stopped by:

alter system set job_queue_processes=0 scope=spfile;

-- can be switched over?

select switchover_status from v$database;

-- A value of TO STANDBY or SESSIONS ACTIVE


-- (which requires the WITH SESSION SHUTDOWN clause
-- on the switchover command) indicates that the primary database
-- can be switched to the standby role.

-- If neither of these values is returned,


-- a switchover is not possible because redo transport
-- is either mis-configured or is not functioning properly.

ALTER DATABASE COMMIT TO SWITCHOVER TO PHYSICAL STANDBY;


if gt error:

alter database commit to switchover to physical standby with session shutdown;

stdby:

-- Switchover the standby database to primary

select switchover_status from v$database;

-- A value of TO PRIMARY or SESSIONS ACTIVE indicates


-- that the standby database is ready to be switched
-- to the primary role. If neither of these values is returned,
-- verify that redo apply is active and that redo transport
-- is configured and working properly.
-- Continue to query this column until the value returned is either
-- TO PRIMARY or SESSIONS ACTIVE.

alter database commit to switchover to primary with session shutdown;

alter database open;

select status, instance_name, database_role from v$database, v$instance;

old primary:
------------

shutdown immediate;
startup mount;
alter database recover managed standby database disconnect from session;
select status, instance_name, database_role from v$database, v$instance;

-- probably reset jobs parameter

Das könnte Ihnen auch gefallen