-
Procedure for Primary Oracle server reboot
-
Create safe backups for Primary and Standby databases
C:\Users\oracle>set
oracle_sid=<SID_NAME>
C:\Users\oracle>
rman target /
RMAN>
backup database current controlfile;
RMAN>
BACKUP INCREMENTAL LEVEL 0 DATABASE CURRENT CONTROLFILE PLUS
ARCHIVELOG;
Check
Oracle RMAN status:
SQL>
select sid, start_time,(sofar/totalwork) * 100 done,
to_char(sysdate
+ time_remaining/3600/24,'dd-mm-yyyy hh24:mi')
from
v$session_longops
where
opname not like '%aggregate%' and opname like 'RMAN%' and totalwork
> sofar;
-
Stop
Oracle Enterprise Manager Console
C:\Users\oracle>set
oracle_sid=<SID_NAME>
C:\Users\oracle>emctl
status dbconsole
Oracle
Enterprise Manager 11g is running.
C:\Users\oracle>emctl
stop dbconsole
The
OracleDBConsole<DB_NAME> service was stopped successfully.
-
Disable Primary and Standby scheduled backup tasks that might interfere with
switchover and reboot activity
Set
backup jobs for all databases to Disabled.
-
Switchover
databases to Standby
Check
gaps for online redo
SQL>
SELECT THREAD#, SEQUENCE# FROM V$THREAD;
SQL>
SELECT THREAD#, MAX(SEQUENCE#) FROM V$ARCHIVED_LOG
WHERE
APPLIED = 'YES'
AND
RESETLOGS_CHANGE# = (SELECT RESETLOGS_CHANGE#
FROM
V$DATABASE_INCARNATION
WHERE
STATUS = 'CURRENT')
GROUP
BY THREAD#;
Check
the difference (should not be bigger the 1 or 2 according to Oracle
documentation)
Check
no jobs are running (automatic jobs starting at 22:00 should be
finished) :
SQL>
SELECT * FROM DBA_JOBS_RUNNING;
Tail
alert log files (optional)
PS
C:\Users\oracle> Get-Content
E:\app\oracle\diag\rdbms\<db_name>\<SID>\trace\alert_<sid>.log
-wait
Perform
switchover
DGMGRL>
CONNECT SYS/password@primary
DGMGRL>
SHOW CONFIGURATION
DGMGRL>
SWITCHOVER TO <standby database name>;
DGMGRL>
SHOW CONFIGURATION
SQL>
SELECT NAME FROM V$SERVICES;
SQL>
SELECT NAME FROM V$SERVICES;
-
Prepare server for reboot
C:\Users\oracle>dgmgrl
/@<primary_db_name>
DGMGRL>
show configuration;
Fast-Start
Failover: ENABLED
DGMGRL>
disable fast_start failover;
Disabled.
DGMGRL>
show configuration;
Fast-Start
Failover: DISABLED
Configuration
Status:
SUCCESS
C:\Users\oracle> sqlplus /nolog
SQL>
conn / as sysdba
SQL>
select db_unique_name, database_role, open_mode from v$database;
SQL>
show parameter log_archive_dest_state_2;
SQL>
alter system set log_archive_dest_state_2=defer scope=both;
SQL>
alter system switch logfile;
SQL>
shutdown immediate
-
REBOOT
New standby SERVER
-
Startup Oracle services and instances on New standby server reboot
C:\Users\oracle>
set oracle_sid=<SID_NAME>
C:\Users\oracle> sqlplus /nolog
SQL>
conn / as sysdba
SQL>
startup mount
SQL>
select db_unique_name, database_role, open_mode from v$database;
SQL>
show parameter log_archive_dest_state_2;
NAME
TYPE VALUE
------------------------------------
----------- ------------------------------
log_archive_dest_state_2
string ENABLE
C:\Users\oracle>
dgmgrl /@<db_name>
DGMGRL>
show database verbose <primary database>;
DGMGRL>
enable fast_start failover;
DGMGRL>
show configuration verbose;
-
Switchover databases to Primary
Check
gaps for online redo
SQL>
SELECT THREAD#, SEQUENCE# FROM V$THREAD;
SQL>
SELECT THREAD#, MAX(SEQUENCE#) FROM V$ARCHIVED_LOG
WHERE
APPLIED = 'YES'
AND
RESETLOGS_CHANGE# = (SELECT RESETLOGS_CHANGE#
FROM
V$DATABASE_INCARNATION
WHERE
STATUS = 'CURRENT')
GROUP
BY THREAD#;
Check
the difference (should not be bigger the 1 or 2 according to Oracle
documentation)
Check
no jobs are running (automatic jobs starting at 22:00 should be
finished) :
SQL>
SELECT * FROM DBA_JOBS_RUNNING;
Tail
alert log files (optional)
PS
C:\Users\oracle> Get-Content
E:\app\oracle\diag\rdbms\<db_name>\<SID>\trace\alert_<sid>.log
-wait
Perform
switchover
DGMGRL>
CONNECT SYS/password@New primary
DGMGRL>
SHOW CONFIGURATION
DGMGRL>
SWITCHOVER TO <Primary database name>;
DGMGRL>
SHOW CONFIGURATION
SQL>
SELECT NAME FROM V$SERVICES;
SQL>
SELECT NAME FROM V$SERVICES;
-
Enable scheduled tasks
Enable
Scheduled tasks
-
Procedure for STANDBY Oracle server reboot
-
Create safe backups for Primary and Standby databases
C:\Users\oracle>set
oracle_sid=<SID_NAME>
C:\Users\oracle>
rman target /
RMAN>
backup database current controlfile;
RMAN>
BACKUP INCREMENTAL LEVEL 0 DATABASE CURRENT CONTROLFILE PLUS
ARCHIVELOG;
Check
Oracle RMAN status:
SQL>
select sid, start_time,(sofar/totalwork) * 100 done,
to_char(sysdate
+ time_remaining/3600/24,'dd-mm-yyyy hh24:mi')
from
v$session_longops
where
opname not like '%aggregate%' and opname like 'RMAN%' and totalwork
> sofar;
-
Disable
DCO scheduled backup tasks that might interfere with reboot activity
Set
backup jobs for all databases to Disabled.
-
Prepare server for reboot (stop databases and Oracle services)
C:\Users\oracle>dgmgrl
/@<primary_db_name>
DGMGRL>
show configuration;
Fast-Start
Failover: ENABLED
DGMGRL>
disable fast_start failover;
Disabled.
DGMGRL>
show configuration;
Fast-Start
Failover: DISABLED
Configuration
Status:
SUCCESS
C:\Users\oracle>
sqlplus /nolog
SQL>
conn / as sysdba
SQL>
select db_unique_name, database_role, open_mode from v$database;
SQL>
show parameter log_archive_dest_state_2;
SQL>
alter system set log_archive_dest_state_2=defer scope=both;
SQL>
alter system switch logfile;
SQL>
shutdown immediate
-
REBOOT
Standby SERVER
-
Startup Oracle services and instances on Standby server after server reboot
C:\Users\oracle>
set oracle_sid=<SID_NAME>
C:\Users\oracle>
sqlplus /nolog
SQL>
conn / as sysdba
SQL>
startup mount
SQL>
select db_unique_name, database_role, open_mode from v$database;
SQL>
show parameter log_archive_dest_state_2;
NAME
TYPE VALUE
------------------------------------
----------- ------------------------------
log_archive_dest_state_2
string ENABLE
C:\Users\oracle>
dgmgrl /@<db_name>
DGMGRL>
show database verbose <primary database>;
DGMGRL>
enable fast_start failover;
DGMGRL>
show configuration verbose;
SQL>
set linesize 200
SQL>
select (select (to_char(sysdate,'dd - mm - yyyy hh24:mi:ss')) from
dual) as TimeofExec, db_unique_name,
database_role,
open_mode from v$database;
-
Enable scheduled tasks on Standby server
Enable
Scheduled tasks