Standby Database’ i Nasıl Activate Edebiliriz

Standby database’ lerimizi doğası gereği bir disaster durumu yaşadığımızda ve artık bir primary database’ imiz olmadığında zor günler için sakladığımız bu database’ leri primary yapmak isteyebiliriz. Bu tarz durumlarda nasıl standby database’ imizi primary yapabiliriz biraz bundan bahsetmek istiyorum.

Öncelikle eğer dataguard’ ınızın type’ ı maximum protection ise hiçbir data kaybınız olmadan güvenle açabileceğiniz ve senkron olduğundan %100 emin olduğunuz bir dataguardını var demektir. Eğer maxiumum performance kullanıyorsunuz redo’ nun en son switch olduğu aralığa da bağlı olarak redonun içerisindeki data kadar bir kaybınız olma ihtimali olacaktır. Varsayalımki böyle bir case ile karşılaştık, standbyımızı nasıl activate edecez;

Öncelikle standby’ımızın şu anki durumuna bakalım ;

SQL> select pid, process, status, sequence# from v$managed_standby ;

PID PROCESS STATUS SEQUENCE#
———- ——— ———— ———-
6431 ARCH CONNECTED 0
6501 ARCH CONNECTED 0
6508 ARCH CONNECTED 0
6512 ARCH CONNECTED 0
7287 MRP0 WAIT_FOR_LOG 38091
8028 RFS IDLE 0
7436 RFS IDLE 0
7438 RFS IDLE 0
8024 RFS IDLE 0

9 rows selected.

38091 nolu logu bekliyoruz ancak artık primary’ imiz ayakta olmadığından dolayı bu log gelmeyecek, dolayısıyla apply işlemini burada keselim ;

SQL> alter database recover managed standby database cancel;
Database altered.

Active etmeye çalışalım;

SQL> alter database activate standby database;
Database altered.

Son olarak, database’ i restart ediyoruz ;

SQL> shutdown immediate ;

SQL> startup

ile database’ i tekrar açıyoruz.

Yapılan bu işlemler sırasında alert loga düşen satırlar ;

RFS[14]: Opened log for thread 1 sequence 38090 dbid 2037406162 branch 753212180
Archived Log entry 35549 added for thread 1 sequence 38090 rlc 753212180 ID 0x79704fd2 dest 2:
Mon Aug 06 17:00:10 2012
Media Recovery Log /u03/oradata/tester/arch/tester1_38090_753212180.arc
Media Recovery Waiting for thread 1 sequence 38091
Mon Aug 06 17:16:39 2012
ALTER DATABASE RECOVER standby database until cancel
ORA-1153 signalled during: ALTER DATABASE RECOVER standby database until cancel …
Mon Aug 06 17:16:58 2012
alter database recover managed standby database cancel
Mon Aug 06 17:16:59 2012
MRP0: Background Media Recovery cancelled with status 16037
Errors in file /u01/oracle/diag/rdbms/tester_stby/tester/trace/tester_pr00_16741.trc:
ORA-16037: user requested cancel of managed recovery operation
Recovery interrupted!
Errors in file /u01/oracle/diag/rdbms/tester_stby/tester/trace/tester_pr00_16741.trc:
ORA-16037: user requested cancel of managed recovery operation
Waiting for MRP0 pid 16725 to terminate
Mon Aug 06 17:16:59 2012
MRP0: Background Media Recovery tester shutdown (tester)
Managed Standby Recovery Canceled (tester)
Completed: alter database recover managed standby database cancel
Mon Aug 06 17:17:20 2012
alter database activate standby database
ALTER DATABASE ACTIVATE [PHYSICAL] STANDBY DATABASE
alter database activate standby database (tester)
Begin: Standby Redo Logfile archival
End: Standby Redo Logfile archival
RESETLOGS after incomplete recovery UNTIL CHANGE 93627333345
Resetting resetlogs activation ID 2037403602 (0x79704fd2)
Standby became primary SCN: 93627333343
Mon Aug 06 17:17:24 2012
Setting recovery target incarnation to 3
ACTIVATE STANDBY: Complete – Database mounted as primary
Completed: alter database activate standby database
Mon Aug 06 17:17:36 2012
Shutting down instance (immediate)
Shutting down instance: further logons disabled
Stopping background tester MMNL
Stopping background tester MMON
License high water mark = 26
All dispatchers and shared servers shutdown
ALTER DATABASE CLOSE NORMAL
ORA-1109 signalled during: ALTER DATABASE CLOSE NORMAL…
ALTER DATABASE DISMOUNT
Completed: ALTER DATABASE DISMOUNT
ARCH: Archival disabled due to shutdown: 1089
Shutting down archive testeres
Archiving is disabled
Mon Aug 06 17:17:38 2012
ARCH shutting down
ARC0: Archival stopped
Mon Aug 06 17:17:38 2012
ARCH shutting down
Mon Aug 06 17:17:38 2012
ARCH shutting down
Mon Aug 06 17:17:38 2012
ARCH shutting down
ARC2: Archival stopped
ARC1: Archival stopped
ARC3: Archival stopped
ARCH: Archival disabled due to shutdown: 1089
Shutting down archive testeres
Archiving is disabled
Archive tester shutdown avoided: 0 active
Mon Aug 06 17:17:40 2012
Stopping background tester VKTM:
Mon Aug 06 17:17:44 2012
Instance shutdown complete
Mon Aug 06 17:17:47 2012
Starting ORACLE instance (normal)
LICENSE_MAX_SESSION = 0
LICENSE_SESSIONS_WARNING = 0
Picked latch-free SCN scheme 3
Autotune of undo retention is turned on.
IMODE=BR
ILAT =85
LICENSE_MAX_USERS = 0
SYS auditing is disabled
Starting up:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 – 64bit Production.
Using parameter settings in server-side spfile /u01/oracle/db/11.2.0/dbs/spfiletester.ora
System parameters with non-default values:
testeres = 500
sessions = 780
memory_target = 4000M
control_files = “/u02/oradata/tester/ct/control01.ctl”
control_files = “/u03/oradata/tester/ct/control02.ctl”
control_files = “/u02/oradata/tester/ct/control03.ctl”
db_block_size = 8192
compatible = “11.2.0.0.0”
log_archive_dest_1 = “LOCATION=/u03/oradata/tester/arch”
log_archive_dest_2 = “SERVICE=tester ARCH ASYNC VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=tester reopen=300”
log_archive_dest_state_2 = “DEFER”
fal_client = “tester_STBY”
fal_server = “tester”
log_archive_config = “DG_CONFIG=(tester,tester_stby)”
log_archive_format = “tester%t_%s_%r.arc”
db_recovery_file_dest = “/u03/oradata/tester/flash_recovery_area”
db_recovery_file_dest_size= 3852M
standby_file_management = “AUTO”
undo_tablespace = “UNDOTBS1”
remote_login_passwordfile= “EXCLUSIVE”
db_domain = “”
dispatchers = “(PROTOCOL=TCP) (SERVICE=testerXDB)”
audit_file_dest = “/u01/oracle/admin/tester/adump”
audit_trail = “DB”
db_name = “tester”
db_unique_name = “tester_STBY”
open_cursors = 300
diagnostic_dest = “/u01/sq/ora_1/oracle”
Oracle instance running with ODM: Veritas 5.0.30.00 ODM Library, Version 1.1
Mon Aug 06 17:17:47 2012
PMON started with pid=2, OS id=23964
Mon Aug 06 17:17:48 2012
VKTM started with pid=3, OS id=23966
VKTM running at (100ms) precision
Mon Aug 06 17:17:48 2012
GEN0 started with pid=4, OS id=23970
Mon Aug 06 17:17:48 2012
DIAG started with pid=5, OS id=23972
Mon Aug 06 17:17:48 2012
DBRM started with pid=6, OS id=23974
Mon Aug 06 17:17:48 2012
PSP0 started with pid=7, OS id=23976
Mon Aug 06 17:17:48 2012
DIA0 started with pid=8, OS id=23978
Mon Aug 06 17:17:48 2012
MMAN started with pid=9, OS id=23980
Mon Aug 06 17:17:48 2012
DBW0 started with pid=10, OS id=23982
Mon Aug 06 17:17:48 2012
DBW1 started with pid=11, OS id=23984
Mon Aug 06 17:17:48 2012
LGWR started with pid=12, OS id=23986
Mon Aug 06 17:17:48 2012
CKPT started with pid=13, OS id=23988
Mon Aug 06 17:17:48 2012
SMON started with pid=14, OS id=23990
Mon Aug 06 17:17:48 2012
RECO started with pid=15, OS id=23992
Mon Aug 06 17:17:48 2012
MMON started with pid=16, OS id=23994
starting up 1 dispatcher(s) for network address ‘(ADDRESS=(PARTIAL=YES)(PROTOCOL=TCP))’…
Mon Aug 06 17:17:48 2012
MMNL started with pid=17, OS id=23996
starting up 1 shared server(s) …
DISM started, OS id=24002
ORACLE_BASE from environment = /u01/sq/ora_1/oracle
Mon Aug 06 17:17:50 2012
ALTER DATABASE MOUNT
Successful mount of redo thread 1, with mount id 2074816510
Database mounted in Exclusive Mode
Lost write protection disabled
Completed: ALTER DATABASE MOUNT
Mon Aug 06 17:17:55 2012
ALTER DATABASE OPEN
Assigning activation ID 2074816510 (0x7bab2ffe)
LGWR: STARTING ARCH testerES
Mon Aug 06 17:17:55 2012
ARC0 started with pid=22, OS id=24039
ARC0: Archival started
LGWR: STARTING ARCH testerES COMPLETE
ARC0: STARTING ARCH testerES
Thread 1 opened at log sequence 1
Current log# 1 seq# 1 mem# 0: /u02/oradata/tester/rd/redo01a.log
Current log# 1 seq# 1 mem# 1: /u03/oradata/tester/rd/redo01b.log
Successful open of redo thread 1
MTTR advisory is disabled because FAST_START_MTTR_TARGET is not set
Mon Aug 06 17:17:56 2012
ARC1 started with pid=21, OS id=24065
SMON: enabling cache recovery
Mon Aug 06 17:17:56 2012
ARC2 started with pid=23, OS id=24067
Mon Aug 06 17:17:56 2012
ARC3 started with pid=24, OS id=24069
ARC1: Archival started
ARC2: Archival started
ARC1: Becoming the ‘no FAL’ ARCH
ARC1: Becoming the ‘no SRL’ ARCH
ARC2: Becoming the heartbeat ARCH
Successfully onlined Undo Tablespace 2.
Undo initialization finished serial:0 start:1989022041 end:1989022590 diff:549
Dictionary check beginning
Dictionary check complete
Verifying file header compatibility for 11g tablespace encryption..
Verifying 11g file header compatibility for tablespace encryption completed
SMON: enabling tx recovery
*********************************************************************
WARNING: The following temporary tablespaces contain no files.
This condition can occur when a backup controlfile has
been restored. It may be necessary to add files to these
tablespaces. That can be done using the SQL statement:

ALTER TABLESPACE ADD TEMPFILE

Alternatively, if these temporary tablespaces are no longer
needed, then they can be dropped.
Empty temporary tablespace: tester_tmp
*********************************************************************
Re-creating tempfile /u02/oradata/tester/temp_01b.dbf
ARC3: Archival started
ARC0: STARTING ARCH testerES COMPLETE
Re-creating tempfile /u02/oradata/tester/temp_01a.dbf
Database Characterset is WE8ISO8859P9
No Resource Manager plan active
replication_dependency_tracking turned off (no async multimaster replication found)
Starting background tester QMNC
Mon Aug 06 17:17:59 2012
QMNC started with pid=25, OS id=24092
LOGSTDBY: Validating controlfile with logical metadata
LOGSTDBY: Validation complete
Completed: ALTER DATABASE OPEN

Be Sociable, Share!

One comment

  1. Çok ihtiyaç duyduğum bir anda bu sayfaya erişmem beni çok mutlu yardımlarınız paylaşımlarınız ve sağ duyunuz için teşekkürler….

Bir cevap yazın

E-posta hesabınız yayımlanmayacak. Gerekli alanlar * ile işaretlenmişlerdir


9 + = on