Dataguard Primary Role
Hii All
Which parameter or parameters defines which oracle will be primary or standby role ? (LOG_ARCHIVE_CONFIG='DG_CONFIG) ??
so how oracle knows I am running in primary or standby ?
After role switch occured what happens on network side ? standby servers ip will change own ip to primary server's ip address ?
Best Regards ..
Hi
Go through:-
[http://download.oracle.com/docs/cd/B19306_01/server.102/b14239/create_ps.htm]
[http://advait.wordpress.com/?s=dataguard]
look at the parameters that are required in the pfile of the standby and the primary.
After role switch occured what happens on network side ? standby servers ip will change own ip to primary server's ip address ?IP doesn't change.For connectivity:-
Dataguard switchover, do i need to change the connectivity details in also
Anand
Edited by: Anand... on Jul 7, 2009 9:18 PM
Similar Messages
-
Hello,
I am confused now, DashBoard says the database on instance A is primary role, but the dm_hadr_availability_replica_states doesn't agree this.
Is it a bug or something else? I didn't find error in log.
SQL Server version is:
Microsoft SQL Server 2014 - 12.0.2456.0 (X64)
Dec 11 2014 17:32:03
Copyright (c) Microsoft Corporation
Enterprise Edition (64-bit) on Windows NT 6.3 <X64> (Build 9600: )did you refresh your dashboard? please refresh the dashboard.
check this http://www.sqlskills.com/blogs/joe/answering-questions-with-the-alwayson-dashboard/
run this code on each instance and see if which is primary
IF SERVERPROPERTY ('IsHadrEnabled') = 1
BEGIN
SELECT
AGC.name -- Availability Group
, RCS.replica_server_name -- SQL cluster node name
, ARS.role_desc -- Replica Role
, AGL.dns_name -- Listener Name
FROM
sys.availability_groups_cluster AS AGC
INNER JOIN sys.dm_hadr_availability_replica_cluster_states AS RCS
ON
RCS.group_id = AGC.group_id
INNER JOIN sys.dm_hadr_availability_replica_states AS ARS
ON
ARS.replica_id = RCS.replica_id
INNER JOIN sys.availability_group_listeners AS AGL
ON
AGL.group_id = ARS.group_id
WHERE
ARS.role_desc = 'PRIMARY'
END
code from here http://www.mssqltips.com/sqlservertip/3206/finding-primary-replicas-for-sql-server-2012-alwayson-availability-groups-with-powershell/
Hope it Helps!! -
Dataguard - Primary not applying logs to Standby
Having an issue applying logs to the standby, seemingly it's not setup correctly. I am sure I'm missing something simple here, but would love any input or help. Thanks in advance.
Background:
Primary: CDPMTSB (Single Stand alone)
Standby: CDPMT (RAC)
Error Message on Primary (Alert Log):
Errors in file /data/oracle/app/oracle/diag/rdbms/cdpmtsb/CDPMTSB/trace/CDPMTSB_arc6_9571.trc:
ORA-16014: log 3 sequence# 4071 not archived, no available destinations
ORA-00312: online log 3 thread 2: '+FRA_DG_01/cdpmtsb/onlinelog/group_3.291.799379949'
ARCH: Archival error occurred on a closed thread. Archiver continuing
ORACLE Instance CDPMTSB - Archival Error. Archiver continuing.
Mon Nov 19 19:54:24 2012
Changing destination 4 from remote to local during archival of log#: 3 sequence#: 4071 thread#: 2
Changing destination 4 from remote to local during archival of log#: 3 sequence#: 4071 thread#: 2
ARC6: LGWR is actively archiving destination LOG_ARCHIVE_DEST_2
ARC6: Archive log rejected (thread 2 sequence 4071) at host 'CDPMT'
Errors in file /data/oracle/app/oracle/diag/rdbms/cdpmtsb/CDPMTSB/trace/CDPMTSB_arc6_9571.trc:
ORA-16401: archivelog rejected by RFS
Errors in file /data/oracle/app/oracle/diag/rdbms/cdpmtsb/CDPMTSB/trace/CDPMTSB_arc6_9571.trc:
ORA-16014: log 3 sequence# 4071 not archived, no available destinations
ORA-00312: online log 3 thread 2: '+FRA_DG_01/cdpmtsb/onlinelog/group_3.291.799379949'
ARCH: Archival error occurred on a closed thread. Archiver continuing
ORACLE Instance CDPMTSB - Archival Error. Archiver continuing.
Mon Nov 19 19:59:24 2012
Changing destination 4 from remote to local during archival of log#: 3 sequence#: 4071 thread#: 2
Changing destination 4 from remote to local during archival of log#: 3 sequence#: 4071 thread#: 2
ARC6: LGWR is actively archiving destination LOG_ARCHIVE_DEST_2
ARC6: Archive log rejected (thread 2 sequence 4071) at host 'CDPMT'
Errors in file /data/oracle/app/oracle/diag/rdbms/cdpmtsb/CDPMTSB/trace/CDPMTSB_arc6_9571.trc:
ORA-16401: archivelog rejected by RFS
Errors in file /data/oracle/app/oracle/diag/rdbms/cdpmtsb/CDPMTSB/trace/CDPMTSB_arc6_9571.trc:
ORA-16014: log 3 sequence# 4071 not archived, no available destinations
ORA-00312: online log 3 thread 2: '+FRA_DG_01/cdpmtsb/onlinelog/group_3.291.799379949'
ARCH: Archival error occurred on a closed thread. Archiver continuing
ORACLE Instance CDPMTSB - Archival Error. Archiver continuing.
Mon Nov 19 20:00:00 2012
Errors in file /data/oracle/app/oracle/diag/rdbms/cdpmtsb/CDPMTSB/trace/CDPMTSB_j001_17473.trc:
ORA-12012: error on auto execute of job 72620
ORA-06502: PL/SQL: numeric or value error: character to number conversion error
ORA-06512: at "CD_ADMIN.UTDCD_SURVEY_PKG", line 4926
Standby Alert Log:
ORA-16401: archivelog rejected by RFS
Mon Nov 19 19:32:15 2012
RFS[6]: Assigned to RFS process 4248
RFS[6]: Identified database type as 'physical standby': Client is ARCH pid 9561
Mon Nov 19 19:32:22 2012
RFS[1]: Selected log 6 for thread 1 sequence 4073 dbid 1629723947 branch 769881773
Mon Nov 19 19:32:22 2012
Archived Log entry 1097 added for thread 1 sequence 4072 ID 0x62e7f5cf dest 1:
Archived Log entry 1098 added for thread 1 sequence 4072 ID 0x62e7f5cf dest 3:
Mon Nov 19 19:34:23 2012
Errors in file /opt/app/oracle/diag/rdbms/cdpmt/CDPMT1/trace/CDPMT1_rfs_24994.trc:
ORA-16401: archivelog rejected by RFS
Mon Nov 19 19:38:12 2012
RFS[1]: Selected log 5 for thread 1 sequence 4074 dbid 1629723947 branch 769881773
Mon Nov 19 19:38:12 2012
Archived Log entry 1099 added for thread 1 sequence 4073 ID 0x62e7f5cf dest 1:
Archived Log entry 1100 added for thread 1 sequence 4073 ID 0x62e7f5cf dest 3:
Mon Nov 19 19:39:23 2012
Errors in file /opt/app/oracle/diag/rdbms/cdpmt/CDPMT1/trace/CDPMT1_rfs_24994.trc:
ORA-16401: archivelog rejected by RFS
Mon Nov 19 19:44:24 2012
Errors in file /opt/app/oracle/diag/rdbms/cdpmt/CDPMT1/trace/CDPMT1_rfs_24994.trc:
ORA-16401: archivelog rejected by RFS
Mon Nov 19 19:49:24 2012
Errors in file /opt/app/oracle/diag/rdbms/cdpmt/CDPMT1/trace/CDPMT1_rfs_24994.trc:
ORA-16401: archivelog rejected by RFS
Mon Nov 19 19:54:24 2012
Errors in file /opt/app/oracle/diag/rdbms/cdpmt/CDPMT1/trace/CDPMT1_rfs_24994.trc:
ORA-16401: archivelog rejected by RFS
Mon Nov 19 19:59:24 2012
Errors in file /opt/app/oracle/diag/rdbms/cdpmt/CDPMT1/trace/CDPMT1_rfs_24994.trc:
ORA-16401: archivelog rejected by RFS
Primary Parameters:
NAME TYPE VALUE
log_archive_config string DG_CONFIG=(CDPMT,CDPMTSB)
log_archive_dest string
log_archive_dest_1 string LOCATION=USE_DB_RECOVERY_FILE_
DEST VALID_FOR=(ONLINE_LOGFIL
ES,ALL_ROLES) DB_UNIQUE_NAME=C
DPMTSB
log_archive_dest_10 string
log_archive_dest_2 string SERVICE=CDPMT VALID_FOR=(ONLIN
E_LOGFILES,PRIMARY_ROLE) DB_UN
IQUE_NAME=CDPMT
log_archive_dest_3 string location="+FRA_DG_01/cdpmtsb/s
tandbylog", valid_for=(STANDB
Y_LOGFILE,STANDBY_ROLE)
log_archive_dest_4 string
log_archive_dest_5 string
log_archive_dest_6 string
log_archive_dest_7 string
log_archive_dest_8 string
log_archive_dest_9 string
log_archive_dest_state_1 string enable
log_archive_dest_state_10 string enable
log_archive_dest_state_2 string ENABLE
log_archive_dest_state_3 string ENABLE
log_archive_dest_state_4 string defer
log_archive_dest_state_5 string enable
log_archive_dest_state_6 string enable
log_archive_dest_state_7 string enable
log_archive_dest_state_8 string enable
log_archive_dest_state_9 string enable
log_archive_duplex_dest string
log_archive_format string %t_%s_%r.dbf
log_archive_local_first boolean TRUE
log_archive_max_processes integer 7
log_archive_min_succeed_dest integer 2
log_archive_start boolean FALSE
log_archive_trace integer 0
Standby Parameters:
NAME TYPE VALUE
log_archive_config string dg_config=(CDPMT,CD PMTSB)
log_archive_dest string
log_archive_dest_1 string location="USE_DB_RE COVERY_FILE
_DEST", valid_for= (ALL_LOGFIL
ES,ALL_ROLES)
log_archive_dest_10 string
log_archive_dest_2 string SERVICE=cdpmtsb LGW R ASYNC VAL
ID_FOR=(ONLINE_LOGF ILES,PRIMAR
Y_ROLE) DB_UNIQUE_N AME=cdpmtsb
log_archive_dest_3 string LOCATION=+FRA_DG_01 /CDPMT/STAN
DBYLOG VALID_FOR=( STANDBY_LOG
NAME TYPE VALUE
FILES,STANDBY_ROLE) DB_UNIQUE_
NAME=CDPMT
log_archive_dest_4 string
log_archive_dest_5 string
log_archive_dest_6 string
log_archive_dest_7 string
log_archive_dest_8 string
log_archive_dest_9 string
log_archive_dest_state_1 string ENABLE
log_archive_dest_state_10 string enable
log_archive_dest_state_2 string ENABLE
NAME TYPE VALUE
log_archive_dest_state_3 string enable
log_archive_dest_state_4 string enable
log_archive_dest_state_5 string enable
log_archive_dest_state_6 string enable
log_archive_dest_state_7 string enable
log_archive_dest_state_8 string enable
log_archive_dest_state_9 string enable
log_archive_duplex_dest string
log_archive_format string %t_%s_%r.dbf
log_archive_local_first boolean TRUE
log_archive_max_processes integer 30
NAME TYPE VALUE
log_archive_min_succeed_dest integer 1
log_archive_start boolean FALSE
log_archive_trace integer 0
SQL> show parameter log_ar
NAME TYPE VALUE
log_archive_config string dg_config=(CDPMT,CDPMTSB)
log_archive_dest string
log_archive_dest_1 string location="USE_DB_RECOVERY_FILE
_DEST", valid_for=(ALL_LOGFIL
ES,ALL_ROLES)
log_archive_dest_10 string
log_archive_dest_2 string SERVICE=cdpmtsb LGWR ASYNC VAL
ID_FOR=(ONLINE_LOGFILES,PRIMAR
Y_ROLE) DB_UNIQUE_NAME=cdpmtsb
log_archive_dest_3 string LOCATION=+FRA_DG_01/CDPMT/STAN
DBYLOG VALID_FOR=(STANDBY_LOG
NAME TYPE VALUE
FILES,STANDBY_ROLE) DB_UNIQUE_
NAME=CDPMT
log_archive_dest_4 string
log_archive_dest_5 string
log_archive_dest_6 string
log_archive_dest_7 string
log_archive_dest_8 string
log_archive_dest_9 string
log_archive_dest_state_1 string ENABLE
log_archive_dest_state_10 string enable
log_archive_dest_state_2 string ENABLE
NAME TYPE VALUE
log_archive_dest_state_3 string enable
log_archive_dest_state_4 string enable
log_archive_dest_state_5 string enable
log_archive_dest_state_6 string enable
log_archive_dest_state_7 string enable
log_archive_dest_state_8 string enable
log_archive_dest_state_9 string enable
log_archive_duplex_dest string
log_archive_format string %t_%s_%r.dbf
log_archive_local_first boolean TRUE
log_archive_max_processes integer 30
NAME TYPE VALUE
log_archive_min_succeed_dest integer 1
log_archive_start boolean FALSE
log_archive_trace integer 0
SQL>
DGMGRL> show configuration verbose;
Configuration
Name: cdpmtqa
Enabled: YES
Protection Mode: MaxPerformance
Databases:
cdpmtsb - Primary database
cdpmt - Physical standby database
Fast-Start Failover: DISABLED
Current status for "cdpmtqa":
Warning: ORA-16608: one or more databases have warnings
DGMGRL> show database verbose CDPMT
Database
Name: cdpmt
Role: PHYSICAL STANDBY
Enabled: YES
Intended State: APPLY-ON
Instance(s):
CDPMT1
CDPMT2 (apply instance)
Properties:
DGConnectIdentifier = 'cdpmt'
ObserverConnectIdentifier = ''
LogXptMode = 'ASYNC'
DelayMins = '0'
Binding = 'OPTIONAL'
MaxFailure = '0'
MaxConnections = '1'
ReopenSecs = '300'
NetTimeout = '30'
RedoCompression = 'DISABLE'
LogShipping = 'ON'
PreferredApplyInstance = ''
ApplyInstanceTimeout = '0'
ApplyParallel = 'AUTO'
StandbyFileManagement = 'AUTO'
ArchiveLagTarget = '0'
LogArchiveMaxProcesses = '4'
LogArchiveMinSucceedDest = '1'
DbFileNameConvert = ''
LogFileNameConvert = ''
FastStartFailoverTarget = ''
StatusReport = '(monitor)'
InconsistentProperties = '(monitor)'
InconsistentLogXptProps = '(monitor)'
SendQEntries = '(monitor)'
LogXptStatus = '(monitor)'
RecvQEntries = '(monitor)'
HostName(*)
SidName(*)
StaticConnectIdentifier(*)
StandbyArchiveLocation(*)
AlternateLocation(*)
LogArchiveTrace(*)
LogArchiveFormat(*)
LatestLog(*)
TopWaitEvents(*)
(*) - Please check specific instance for the property value
Current status for "cdpmt":
Warning: ORA-16809: multiple warnings detected for the database
Any help would be really appreciated. Thanks!
Edited by: 972075 on Nov 19, 2012 3:09 PMThanks MSEBERG,
Here's what I found. FRA seems to have enough space on ASM and there are other logs there, not sure what the issue is:
14:31:58 SYS: CDPMTSB> show parameter db_recovery
NAME TYPE VALUE
db_recovery_file_dest string +FRA_DG_01
db_recovery_file_dest_size big integer 60G
DGMGRL> show database CDPMTSB logxptstatus;
LOG TRANSPORT STATUS
PRIMARY_INSTANCE_NAME STANDBY_DATABASE_NAME STATUS
CDPMTSB cdpmt
DGMGRL> SHOW DATABASE CDPMTSB InconsistentProperties;
INCONSISTENT PROPERTIES
INSTANCE_NAME PROPERTY_NAME MEMORY_VALUE SPFILE_VALUE BROKER_VALUE
DGMGRL> show database CDPMTSB InconsistentLogXptProps;
INCONSISTENT LOG TRANSPORT PROPERTIES
INSTANCE_NAME STANDBY_NAME PROPERTY_NAME MEMORY_VALUE BROKER_VALUE
DGMGRL> show database CDPMT logxptstatus;
Error: ORA-16757: unable to get this property's value
DGMGRL> SHOW DATABASE CDPMT InconsistentProperties;
INCONSISTENT PROPERTIES
INSTANCE_NAME PROPERTY_NAME MEMORY_VALUE SPFILE_VALUE BROKER_VALUE
CDPMT2 DbFileNameConvert DG_01/cdpmtsb, DG_01/cdpmt
CDPMT2 LogFileNameConvert FRA_DG_01/cdpmtsb, FRA_DG_01/cdpmt, DG_01/cdpmtsb, DG_01/cdpmt
CDPMT1 LogArchiveMaxProcesses 4 30 4
CDPMT1 DbFileNameConvert DG_01/cdpmtsb, DG_01/cdpmt DG_01/cdpmtsb,DG_01/cdpmt
CDPMT1 LogFileNameConvert FRA_DG_01/cdpmtsb, FRA_DG_01/cdpmt, DG_01/cdpmtsb, DG_01/cdpmt FRA_DG_01/cdpmtsb,FRA_DG_01/cdpmt,+DG_01/cdpmtsb,+DG_01/cdpmt
DGMGRL> show database CDPMT InconsistentLogXptProps;
Error: ORA-16757: unable to get this property's value
Errors in the Alert (from Primary):
ARCH: Archival error occurred on a closed thread. Archiver continuing
ORACLE Instance CDPMTSB - Archival Error. Archiver continuing.
Tue Nov 20 14:34:43 2012
Changing destination 4 from remote to local during archival of log#: 3 sequence#: 4071 thread#: 2
Changing destination 4 from remote to local during archival of log#: 3 sequence#: 4071 thread#: 2
ARC6: LGWR is actively archiving destination LOG_ARCHIVE_DEST_2
ARC6: Archive log rejected (thread 2 sequence 4071) at host 'cdpmt'
Errors in file /data/oracle/app/oracle/diag/rdbms/cdpmtsb/CDPMTSB/trace/CDPMTSB_arc6_9571.trc:
ORA-16401: archivelog rejected by RFS
Errors in file /data/oracle/app/oracle/diag/rdbms/cdpmtsb/CDPMTSB/trace/CDPMTSB_arc6_9571.trc:
ORA-16014: log 3 sequence# 4071 not archived, no available destinations
ORA-00312: online log 3 thread 2: '+FRA_DG_01/cdpmtsb/onlinelog/group_3.291.799379949'
ARCH: Archival error occurred on a closed thread. Archiver continuing
ORACLE Instance CDPMTSB - Archival Error. Archiver continuing.
DGMGRL> DGMGRL> show database verbose CDPMT
Database
Name: cdpmt
Role: PHYSICAL STANDBY
Enabled: YES
Intended State: APPLY-ON
Instance(s):
CDPMT1
CDPMT2 (apply instance)
Properties:
DGConnectIdentifier = 'cdpmt'
ObserverConnectIdentifier = ''
LogXptMode = 'ASYNC'
DelayMins = '0'
Binding = 'OPTIONAL'
MaxFailure = '0'
MaxConnections = '1'
ReopenSecs = '300'
NetTimeout = '30'
RedoCompression = 'DISABLE'
LogShipping = 'ON'
PreferredApplyInstance = ''
ApplyInstanceTimeout = '0'
ApplyParallel = 'AUTO'
StandbyFileManagement = 'AUTO'
ArchiveLagTarget = '0'
LogArchiveMaxProcesses = '4'
LogArchiveMinSucceedDest = '1'
DbFileNameConvert = ''
LogFileNameConvert = ''
FastStartFailoverTarget = ''
StatusReport = '(monitor)'
InconsistentProperties = '(monitor)'
InconsistentLogXptProps = '(monitor)'
SendQEntries = '(monitor)'
LogXptStatus = '(monitor)'
RecvQEntries = '(monitor)'
HostName(*)
SidName(*)
StaticConnectIdentifier(*)
StandbyArchiveLocation(*)
AlternateLocation(*)
LogArchiveTrace(*)
LogArchiveFormat(*)
LatestLog(*)
TopWaitEvents(*)
(*) - Please check specific instance for the property value
Current status for "cdpmt":
Warning: ORA-16809: multiple warnings detected for the database
DGMGRL> show database verbose CDPMTSB
Database
Name: cdpmtsb
OEM Name: CDPMTSB_devdb40.utd.com
Role: PRIMARY
Enabled: YES
Intended State: TRANSPORT-ON
Instance(s):
CDPMTSB
Properties:
DGConnectIdentifier = 'cdpmtsb'
ObserverConnectIdentifier = ''
LogXptMode = 'ASYNC'
DelayMins = '0'
Binding = 'OPTIONAL'
MaxFailure = '0'
MaxConnections = '1'
ReopenSecs = '300'
NetTimeout = '30'
RedoCompression = 'DISABLE'
LogShipping = 'ON'
PreferredApplyInstance = ''
ApplyInstanceTimeout = '0'
ApplyParallel = 'AUTO'
StandbyFileManagement = 'AUTO'
ArchiveLagTarget = '0'
LogArchiveMaxProcesses = '7'
LogArchiveMinSucceedDest = '2'
DbFileNameConvert = '+DG_01/cdpmt, +DG_01/cdpmtsb'
LogFileNameConvert = '+FRA_DG_01/cdpmt, FRA_DG_01/cdpmtsb, DG_01/cdpmt, +DG_01/cdpmtsb'
FastStartFailoverTarget = ''
StatusReport = '(monitor)'
InconsistentProperties = '(monitor)'
InconsistentLogXptProps = '(monitor)'
SendQEntries = '(monitor)'
LogXptStatus = '(monitor)'
RecvQEntries = '(monitor)'
HostName = 'devdb40.utd.com'
SidName = 'CDPMTSB'
StaticConnectIdentifier = '(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=devdb40.utd.com)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=CDPMTSB_DGMGRL)(INSTANCE_NAME=CDPMTSB)(SERVER=DEDICATED)))'
StandbyArchiveLocation = '+FRA_DG_01/cdpmtsb/standbylog'
AlternateLocation = ''
LogArchiveTrace = '0'
LogArchiveFormat = '%t_%s_%r.dbf'
LatestLog = '(monitor)'
TopWaitEvents = '(monitor)'
Current status for "cdpmtsb":
SUCCESS
Thanks for your help btw, I'm really at a loss here as to what is going on with this. -
How to switch primary role to one of standby DBs without interruption?
We have a primary database with 2 standby databases running. We would like to switch role of primary to one of the standby with other 2 (one is standby and the other was primary) standby without interruption and rebuild? What is the detail procedure for it?
Thanks a lot!The detailed procedure for anything in Oracle more complex than
SELECT * FROM dualrequires a version number. Since you thought it unimportant to provide that no help is possible.
In this case, in addition to the version number, little things such as:
1. What type of Data Guard implementation? Active? Logical? Snapshot Standby? would be useful information for anyone trying to help you.
2. Is this stand-alone or RAC? Again you provide no information and this is critically important?
3. What is the geographical distance between the primary and the standby?
4. What is the protection mode?
If you are not a student you need to read the Oracle online docs and understand the technology. To ask this question, without providing obviously essential information, indicates you may be a danger to your database: Something I am sure you do not wish to be. -
Adding redo logs for dataguard primary server
Dear all:
i have physical dataguard servers
i want to add new redologs for primary server with big size ..
please advice what will be the action with stand by server.
Thanks ,,Dear all:
i have physical dataguard servers
i want to add new redologs for primary server with
big size ..
please advice what will be the action with stand by
server.
Thanks ,,Most of these information are kept in the control file . You have to recreate your stand by control file after you added the new online redo logs. Transfer this to the standby server , with the the new online redo redo while you standby is down . Your standby system should be able to recognize it when it goes back to stand by mode. -
Hi all
I have created a dataguard on a separate server and shifted the production database to dataguard server in an emergency. Now I want to revert back to the production server.
Please tell me the procefure for the same and tell me that how much data loss will occure?try this solution
On the current primary database, query the SWITCHOVER_STATUS column of the V$DATABASE fixed view
on the primary database to verify it is possible to perform a switchover. For example:
SQL> SELECT SWITCHOVER_STATUS FROM V$DATABASE;
SWITCHOVER_STATUS
TO STANDBY
OR
SQL> SELECT SWITCHOVER_STATUS FROM V$DATABASE;
SWITCHOVER_STATUS
SESSIONS ACTIVE
Initiate the switchover on the primary database
To change the current primary database to a physical standby database role, use the following SQL statement
on the primary database:
If the value in the SWITCHOVER_STATUS column is TO STANDBY
SQL> ALTER DATABASE COMMIT TO SWITCHOVER TO PHYSICAL STANDBY;
If the value in the SWITCHOVER_STATUS column is SESSIONS ACTIVE
SQL> ALTER DATABASE COMMIT TO SWITCHOVER TO PHYSICAL STANDBY WITH SESSION SHUTDOWN;
Shut down the former primary instance, and restart and mount the database and confirm the switch over notification:
SQL> SHUTDOWN IMMEDIATE;
SQL> STARTUP MOUNT;
SQL> SELECT SWITCHOVER_STATUS FROM V$DATABASE;
SWITCHOVER_STATUS
TO_PRIMARY
Switch the target physical standby database role to the primary role.
If switch over status is to primary:
SQL> ALTER DATABASE COMMIT TO SWITCHOVER TO PRIMARY;
If switch over status is active session:
SQL> ALTER DATABASE COMMIT TO SWITCHOVER TO PRIMARY WITH SESSION SHUTDOWN;
Finish the transition of the standby database to the primary role
If standby database has not been opened in read-only mode since the last tiem it was started, issue
SQL> alter database open;
If the physical standby database has been opened in read-only mode since the last time it was stared, you must
issue
SQL>shutdown immediate;
SQL>startup;
Enable the log_archive_dest_state_n parameter for redo transmission
At new Standby database activate media recovery:
SQL> Alter database recover managed standby database disconnect from session;
regards, -
제품 : ORACLE SERVER
작성날짜 : 2002-12-11
DATAGUARD SWITCHOVER 절차
=======================
I. Failover와 Switchover의 차이점
1. Failover
- Unplanned
- Primary는 new standby가 될 수 없고 discard되어야 한다.
- Standby는 "alter database activate standby database" 명령을 사용하여
Primary로서 Open 된다. 이 명령이 수행되는 동안 resetlogs operation이 수행되기
때문에 primary 는 discard될 수 밖에 없다.
- New standby 를 생성하는데 상당한 시간이 걸리므로 그 만큼 risk에 상당시간
노출되게 된다.
- Oracle 9i에서도 incomplete recovery를 위해 여전히 사용 가능하다.
2. Switchover
- Planned
- Primary는 discard되지 않고 new standby가 된다.
- Switchover는 다음과 같은 조건이 만족될 때 가능하다
a) Primary가 graceful shutdown 수행(normal, transactional, immediate)
b) Standby를 primary의 시점과 같게 만들어줄 모든Archive log가 필요하다.
c) Primary의 online redo log가 available해야 한다.
NOTE:
RAC 환경에서는 switchover operation을 위해서 오직 한 instance만이 허용된다.
Switchover operation동안 다른 instance는 반드시 shutdown되어 있어야 한다.
II. DATABASE SWITCHOVER STEPS
Step 1) Switchover를 수행하는 session을 제외한 Primary database와
standby database의 모든 session을 종료한다.
Step 2) Primary database가 standby database로 switchover될 수 있는지를 check한다.
SQL> select switchover_status from v$database;
Switchover_status가 'TO STANDBY' 이면 switchover operation이 가능하다.
그러나 'SESSION ACTIVE'라면 모든 session이 아직 종료되지 않았다는
의미이므로 다시금 session 상태를 check하여 기타 아직 종료되지 않은
session을 종료 시켜야 한다.
Step 3) 다음과 같은 명령을 수행한다
SQL> ALTER DATABASE COMMIT TO SWITCHOVER TO PHYSICAL STANDBY;
이 명령어는 다음과 같은 과정을 수행한다.
- Primary database를 close한다
- Unarchived log file을 archive하고 그것을 standby database에 보낸다
- Archiving되고 있는 마지막 log file에 END-OF-REDO marker를 더함.
- Current controlfile의 backup을 생성하고 current controlfile을 standby
control file로 converion함.
Step 4) Shutdown normal;
Step 5) initSID.ora 안에서 primary role parameter들을 disable하고 standby
parameter를 enable한다.
Step 6) startup nomount;
Step 7) alter database mount standby database;
Step 8) Standby database가 Primary database로 switchover될 수 있는지를 check한다.
SQL> select switchover_status from v$database;
Switchover_status가 'TO PRIMARY' 이면 switchover operation이 가능하다.
그러나 'SESSION ACTIVE'라면 모든 session이 아직 종료되지 않았다는 의미이므로
다시금 session 상태를 check하여 기타 아직 종료되지 않은 session을 종료 시켜야 한다.
Step 9) 다음과 같은 명령을 수행한다.
ALTER DATABASE COMMIT TO SWITCHOVER TO PHYSICAL PRIMARY;
이 명령어는 다음과 같은 과정을 수행한다.
- End-of-redo marker를 포함하고 있는 마지막 redo log를 받아서 적용한 것을
보장한다
- Standby database의 read-only transaction으로 open되어 있으면 close한다.
- Standby control file을 current control file로 conversion한다.
Step 10) Database를 shutdown 한다.
Step 11) initSID.ora 에서 Primary role로 변경한다.
Step 12) Database를 startup한다.
Step 13) Standby database를 managed recovery mode로 바꾼다
SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE;
Step 14) Primary database로부터 Standby database로 log archiving을 시도하여
정상인지 check한다.
Reference Documents
-------------------Hi,
since OCI library is required for TAF (transparent application failover)
you can switchover using JDBC OCI driver, but not the THIN driver.
Andrey -
I have setup the dataguard 10gR2 Physical standby(maximum availability) database, i should stick to this release only.
In case of disaster, this is manual switching. My question is How can I make automate, once happened disaster without knowing effect from user.
thank u.you can switch to primary role when yours standby database is either in mounted state for redo apply mode i.e recovery mode or it is open for read only then
at standby
alter databse commit to switchover to primary
alter database open
Khurram -
Hi
I am planning to implement Dataguard for learning purposes. I have a single box. Has anyone implemented Primary and standby database on same box. Please share any link or guidelines how to proceed.
I am thinking of manually copying the datafiles of my primary DB to new directory and create database with same name.
any suggestions??Hi i did this although it's for windows and i am doing it on OEL4 i modified accordingly
Setup Standby Database on One PC
Building the Data Guard
1. Check the primary database name:
SQL> select name from v$database;
NAME
BSL01LAB
2. Enable Forced logging
--check FORCE LOGGING status
SQL> select force_logging from v$database;
FOR
NO
--eable FORCE LOGGING
SQL> alter database force logging;
Database altered.
--Verify
SQL> select force_logging from v$database;
FOR
YES
3. Create a password file
--To create the password file
D:\oracle\product\10.2.0\db_1\database>orapwd file=PWDbsl01lab.ora password=dow entries=5
--To verify the new password file
D:\oracle\product\10.2.0\db_1\database>sqlplus /nolog
SQL*Plus: Release 10.2.0.1.0 - Production on Tue Jul 25 22:24:41 2006
Copyright (c) 1982, 2005, Oracle. All rights reserved.
SQL> connect sys/dow as sysdba
Connected to an idle instance.
4. Configure a Standby Redo Log
Step 1 Ensure log file sizes are identical on the primary and standby database
SQL> select group#,thread#,bytes/1024/1024,members from v$log;
GROUP# THREAD# BYTES/1024/1024 MEMBERS
1 1 50 1
2 1 50 1
3 1 50 1
Step 2 Determine the appropriate number of standby redo log file groups
The minimal number should be 3+1=4
Step 3 Verify related database parameters and settings
Maxlogfiles
Maxlogmembers
Step 4 Create standby redo log file groups
SQL> alter database add standby logfile ('D:\ORACLE\PRODUCT\10.2.0\ORADATA\BSL01LAB\redo01d.log') size 50M;
Database altered.
SQL> alter database add standby logfile ('D:\ORACLE\PRODUCT\10.2.0\ORADATA\BSL01LAB\redo02d.log') size 50M;
Database altered.
SQL> alter database add standby logfile ('D:\ORACLE\PRODUCT\10.2.0\ORADATA\BSL01LAB\redo03d.log') size 50M;
Database altered.
Step 5 Verify the standby redo log file groups were created
SQL> select group#,thread#,sequence#,archived,status from v$standby_log;
GROUP# THREAD# SEQUENCE# ARC STATUS
4 0 0 YES UNASSIGNED
5 0 0 YES UNASSIGNED
6 0 0 YES UNASSIGNED
5. Set Primary Database Initialization Parameters
--Content of pfilebsl01lab.ora
bsl01lab.__db_cache_size=79691776
bsl01lab.__java_pool_size=4194304
bsl01lab.__large_pool_size=4194304
bsl01lab.__shared_pool_size=75497472
bsl01lab.__streams_pool_size=0
*.audit_file_dest='D:\oracle\product\10.2.0/admin/bsl01lab/adump'
*.background_dump_dest='D:\oracle\product\10.2.0/admin/bsl01lab/bdump'
*.compatible='10.2.0.1.0'
*.control_files='D:\oracle\product\10.2.0/oradata/bsl01lab/\control01.ctl','D:\oracle\product\10.2.0/oradata/bsl01lab/\control02.ctl','D:\oracle\product\10.2.0/oradata/bsl01lab/\control03.ctl'
*.core_dump_dest='D:\oracle\product\10.2.0/admin/bsl01lab/cdump'
*.db_block_size=8192
*.db_domain=''
*.db_file_multiblock_read_count=16
*.db_recovery_file_dest='D:\oracle\product\10.2.0/flash_recovery_area'
*.db_recovery_file_dest_size=2147483648
*.dispatchers='(PROTOCOL=TCP) (SERVICE=bsl01labXDB)'
*.job_queue_processes=10
*.nls_length_semantics='CHAR'
*.open_cursors=300
*.pga_aggregate_target=16777216
*.processes=150
*.remote_login_passwordfile='EXCLUSIVE'
*.sga_target=167772160
*.undo_management='AUTO'
*.undo_tablespace='UNDOTBS1'
*.user_dump_dest='D:\oracle\product\10.2.0/admin/bsl01lab/udump'
db_name='bsl01lab'
db_unique_name=bsl01lab
log_archive_config='DG_CONFIG=(bsl01lab,bsl01labdg)'
control_files='D:\ORACLE\PRODUCT\10.2.0\ORADATA\BSL01LAB\CONTROL01.CTL','D:\ORACLE\PRODUCT\10.2.0\ORADATA\BSL01LAB\CONTROL02.CTL','D:\ORACLE\PRODUCT\10.2.0\ORADATA\BSL01LAB\CONTROL03.CTL'
log_archive_dest_1=
'LOCATION=D:\oracle\product\10.2.0\arch
VALID_FOR=(all_logfiles,all_roles)
DB_UNIQUE_NAME=bsl01lab'
log_archive_dest_2=
'SERVICE=bsl01labdg LGWR ASYNC
VALID_FOR=(online_logfiles,primary_role)
DB_UNIQUE_NAME=bsl01labdg'
LOG_ARCHIVE_DEST_STATE_1=enable
LOG_ARCHIVE_DEST_STATE_2=enable
REMOTE_LOGIN_PASSWORDFILE=EXCLUSIVE
LOG_ARCHIVE_FORMAT=%t_%s_%r.arc
LOG_ARCHIVE_MAX_PROCESSES=30
FAL_SERVER=bsl01labdg
FAL_CLIENT=bsl01lab
DB_FILE_NAME_CONVERT='C:\data_guard\bsl01lab','D:\oracle\product\10.2.0\oradata\bsl01lab'
LOG_FILE_NAME_CONVERT=
'C:\data_guard\bsl01lab','D:\oracle\product\10.2.0\oradata\bsl01lab'
STANDBY_FILE_MANAGEMENT=auto
STANDBY_ARCHIVE_DEST='C:\temp\priarch'
--create spfile
SQL> create spfile from pfile='d:\pfilebsl01lab.ora';
File created.
6. Enable the primary DB Archiving
SQL> startup mount;
ORACLE instance started.
Total System Global Area 167772160 bytes
Fixed Size 1247900 bytes
Variable Size 83887460 bytes
Database Buffers 79691776 bytes
Redo Buffers 2945024 bytes
Database mounted.
SQL> alter database archivelog;
Database altered.
SQL> alter database open;
Database altered.
7. Create a Backup Copy of the Standby Database
--Shutdown DB
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
--Copy data files from “D:\oracle\product\10.2.0\oradata\bsl01lab” to “C:\data guard\bsl01lab”
8. Create a Control File for the Standby Database
SQL> startup mount
ORACLE instance started.
Total System Global Area 167772160 bytes
Fixed Size 1247900 bytes
Variable Size 83887460 bytes
Database Buffers 79691776 bytes
Redo Buffers 2945024 bytes
Database mounted.
SQL> alter database create standby controlfile as 'd:\bsl01labdg.ctl';
Database altered.
SQL> alter database open;
Database altered.
9. Create the parameter file for Standby Database
Contents of the parameter file:
bsl01lab.__db_cache_size=79691776
bsl01lab.__java_pool_size=4194304
bsl01lab.__large_pool_size=4194304
bsl01lab.__shared_pool_size=75497472
bsl01lab.__streams_pool_size=0
*.audit_file_dest='C:\data_guard\dump'
*.background_dump_dest='C:\data_guard\dump'
*.compatible='10.2.0.1.0'
*.core_dump_dest='C:\data_guard\dump'
*.db_block_size=8192
*.db_domain=''
*.db_file_multiblock_read_count=16
*.db_recovery_file_dest='C:\data_guard\dump'
*.db_recovery_file_dest_size=2147483648
*.dispatchers='(PROTOCOL=TCP) (SERVICE=bsl01labXDB)'
*.job_queue_processes=10
*.nls_length_semantics='CHAR'
*.open_cursors=300
*.pga_aggregate_target=16777216
*.processes=150
*.remote_login_passwordfile='EXCLUSIVE'
*.sga_target=167772160
*.undo_management='AUTO'
*.undo_tablespace='UNDOTBS1'
*.user_dump_dest='C:\data_guard\dump'
db_name='bsl01lab'
db_unique_name=bsl01labdg
log_archive_config='DG_CONFIG=(bsl01lab,bsl01labdg)'
control_files='C:\data_guard\bsl01lab\control01.ctl','C:\data_guard\bsl01lab\control02.ctl','C:\data_guard\bsl01lab\control03.ctl'
log_archive_dest_1=
'LOCATION=C:\data_guard\arch
VALID_FOR=(all_logfiles,all_roles)
DB_UNIQUE_NAME=bsl01labdg'
log_archive_dest_2=
'SERVICE=bsl01lab LGWR ASYNC
VALID_FOR=(online_logfiles,primary_role)
DB_UNIQUE_NAME=bsl01lab'
LOG_ARCHIVE_DEST_STATE_1=enable
LOG_ARCHIVE_DEST_STATE_2=enable
REMOTE_LOGIN_PASSWORDFILE=EXCLUSIVE
LOG_ARCHIVE_FORMAT=%t_%s_%r.arc
LOG_ARCHIVE_MAX_PROCESSES=30
FAL_SERVER=bsl01lab
FAL_CLIENT=bsl01labdg
DB_FILE_NAME_CONVERT='D:\oracle\product\10.2.0\oradata\bsl01lab','C:\data_guard\bsl01lab'
LOG_FILE_NAME_CONVERT=
'D:\oracle\product\10.2.0\oradata\bsl01lab','C:\data_guard\bsl01lab'
STANDBY_FILE_MANAGEMENT=auto
STANDBY_ARCHIVE_DEST='C:\temp\stdarch'
10. Setup the Environment to Support the Standby Database
Step 1 Create a windows-based service
D:\oracle\product\10.2.0\db_1>oradim -new -sid bsl01labdg -intpwd dow -startmode manual
Instance created.
Step 2 create a password file
D:\oracle\product\10.2.0\db_1>set oracle_sid=bsl01labdg
C:\data guard\database>orapwd file=PWDbsl01labdg.ora password=dow entries=5
Step 3 configure listeners for the primary and standby database
Step 4 create Oracle Net Service names
Step 5 create a server parameter file for the standby database
D:\oracle\product\10.2.0\db_1\database>set oracle_sid=bsl01labdg
D:\oracle\product\10.2.0\db_1\database>sqlplus /nolog
SQL*Plus: Release 10.2.0.1.0 - Production on Wed Jul 26 03:11:04 2006
Copyright (c) 1982, 2005, Oracle. All rights reserved.
SQL> connect sys/dow as sysdba
Connected to an idle instance.
SQL> create spfile from pfile='d:\pfilebsl01labdg.ora';
File created.
--Verify the new spfile
SQL> show parameter spfile
NAME TYPE VALUE
spfile string D:\ORACLE\PRODUCT\10.2.0\DB_1\DATABASE\SPFILEBSL01LABDG.ORA
11. Mount the standby DB
SQL> startup mount
ORACLE instance started.
Total System Global Area 167772160 bytes
Fixed Size 1247900 bytes
Variable Size 62915940 bytes
Database Buffers 100663296 bytes
Redo Buffers 2945024 bytes
Database mounted.
12. Start Redo Apply
SQL> alter database recover managed standby database disconnect from session;
Database altered.
13. Verify the status of primary and standby database
--bsl01lab window
D:\oracle\product\10.2.0\db_1\database>set oracle_sid=bsl01lab
D:\oracle\product\10.2.0\db_1\database>sqlplus /nolog
SQL*Plus: Release 10.2.0.1.0 - Production on Wed Jul 26 03:24:41 2006
Copyright (c) 1982, 2005, Oracle. All rights reserved.
SQL> connect / as sysdba
Connected.
SQL> select instance_name, status from v$instance;
INSTANCE_NAME STATUS
bsl01lab OPEN
--bsl01labdg window
D:\oracle\product\10.2.0\db_1\database>set oracle_sid=bsl01labdg
D:\oracle\product\10.2.0\db_1\database>sqlplus /nolog
SQL*Plus: Release 10.2.0.1.0 - Production on Wed Jul 26 03:34:15 2006
Copyright (c) 1982, 2005, Oracle. All rights reserved.
SQL> connect / as sysdba
Connected.
SQL> select instance_name,status from v$instance;
INSTANCE_NAME STATUS
bsl01labdg MOUNTED
Both instance status are OK
14. Verify archived log transport and applying service
--bsl01lab window
SQL> select name,sequence# from v$archived_log order by 2;
NAME SEQUENCE#
D:\ORACLE\PRODUCT\10.2.0\ARCH\1_80_595473116.ARC 80
bsl01labdg 80
D:\ORACLE\PRODUCT\10.2.0\ARCH\1_81_595473116.ARC 81
bsl01labdg 81
D:\ORACLE\PRODUCT\10.2.0\ARCH\1_82_595473116.ARC 82
bsl01labdg 82
--bsl01labdg
SQL> select name,sequence# from v$archived_log order by 2;
NAME SEQUENCE#
C:\DATA_GUARD\ARCH\1_80_595473116.ARC 80
C:\DATA_GUARD\ARCH\1_81_595473116.ARC 81
C:\DATA_GUARD\ARCH\1_82_595473116.ARC 82
--On the primary DB, switch log file by force
--bsl01lab window
SQL> alter system switch logfile;
System altered.
Elapsed: 00:00:05.21
SQL> /
System altered.
Elapsed: 00:00:01.14
SQL> /
System altered.
Elapsed: 00:00:06.01
--Check the archived log again
--bsl01lab window
SQL> select name,sequence# from v$archived_log order by 2;
NAME SEQUENCE#
D:\ORACLE\PRODUCT\10.2.0\ARCH\1_84_595473116.ARC 84
bsl01labdg 84
D:\ORACLE\PRODUCT\10.2.0\ARCH\1_85_595473116.ARC 85
NAME SEQUENCE#
bsl01labdg 85
--bsl01labdg window
SQL> select name,sequence# from v$archived_log order by 2;
NAME SEQUENCE#
C:\DATA_GUARD\ARCH\1_84_595473116.ARC 84
C:\DATA_GUARD\ARCH\1_85_595473116.ARC 85
--To check whether the new archived logs have been applied
--bsl01labdg window
SQL> select sequence#,applied
2 from v$archived_log
3 order by sequence#;
SEQUENCE# APP
80 YES
81 YES
82 YES
83 YES
84 YES
85 YES
35 rows selected.
The archived logs are applied successfully on the standby database
Switch-over Testing
1. Verify it is possible to perform a switchover.
--bsl01lab window
SQL> SELECT SWITCHOVER_STATUS FROM V$DATABASE;
SWITCHOVER_STATUS
SESSIONS ACTIVE
SQL> SHOW PARAMETER JOB_QUEUE_PROCESSES;
NAME TYPE VALUE
job_queue_processes integer 10
SQL> ALTER SYSTEM SET JOB_QUEUE_PROCESSES=0;
System altered.
SQL> SELECT SID, PROCESS, PROGRAM FROM V$SESSION
2 WHERE TYPE = 'USER'
3 AND SID <> (SELECT DISTINCT SID FROM V$MYSTAT);
SID PROCESS PROGRAM
86 1404:3172 emagent.exe
89 1234 OMS
90 1234OMS
93 1404:1768 emagent.exe
95 1234 OMS
98 1988 ORACLE.EXE (J000)
6 rows selected.
--To stop ‘emagent’ and ‘OMS’, open another window, and in OS run
S:\>set oracle_sid=bsl01lab
S:\>emctl stop agent
Oracle Enterprise Manager 10g Database Control Release 10.2.0.1.0
Copyright (c) 1996, 2005 Oracle Corporation. All rights reserved.
This will stop the Oracle Enterprise Manager 10g Database Control process. Conti
nue [y/n] :y
The OracleDBConsolebsl01lab service is stopping............
The OracleDBConsolebsl01lab service was stopped successfully.
--Common Processes That Prevent Switchover
Type of Process Process Description Corrective Action
CJQ0 Job Queue Scheduler Process Change the JOB_QUEUE_PROCESSES dynamic parameter to the value 0. The change will take effect immediately without having to restart the instance.
QMN0 Advanced Queue Time Manager Change the AQ_TM_PROCESSES dynamic parameter to the value 0. The change will take effect immediately without having to restart the instance.
DBSNMP Oracle Enterprise Manager Management Agent Issue the emctl stop agent command from the operating system prompt.
SQL> SELECT SID, PROCESS, PROGRAM FROM V$SESSION
2 WHERE TYPE = 'USER'
3 AND SID <> (SELECT DISTINCT SID FROM V$MYSTAT);
no rows selected
SQL> SELECT SWITCHOVER_STATUS FROM V$DATABASE;
SWITCHOVER_STATUS
TO STANDBY
Now it is ready to switch to standby
2. Initiate the switchover on the primary database.
SQL> ALTER DATABASE COMMIT TO SWITCHOVER TO PHYSICAL STANDBY;
Database altered.
Elapsed: 00:02:57.73
3. Shut down and restart the former primary instance.
SQL> shutdown immediate
ORA-01507: database not mounted
ORACLE instance shut down.
SQL> startup mount
ORACLE instance started.
Total System Global Area 167772160 bytes
Fixed Size 1247900 bytes
Variable Size 88081764 bytes
Database Buffers 75497472 bytes
Redo Buffers 2945024 bytes
Database mounted.
4. Verify the switchover status on the standby database
--bsl01labdg window
SQL> SELECT SWITCHOVER_STATUS FROM V$DATABASE;
SWITCHOVER_STATUS
TO PRIMARY
5. Switch the target physical standby database role to the primary role
--bsl01labdg window
SQL> ALTER DATABASE COMMIT TO SWITCHOVER TO PRIMARY;
Database altered.
6. Finish the transition of the standby database to the primary role.
--bsl01labdg window
SQL> alter database open;
Database altered.
Elapsed: 00:00:33.56
7. Verify the status of primary and standby database
--bsl01labdg now is the primary database
SQL> select instance_name,status from v$instance;
INSTANCE_NAME STATUS
bsl01labdg OPEN
--bsl01lab now is the standby database
SQL> select instance_name,status from v$instance;
INSTANCE_NAME STATUS
bsl01lab MOUNTED
--start archived log applying on bsl01lab
SQL> alter database recover managed standby database disconnect from session;
Database altered.
--bsl01labdg window
SQL> alter system switch logfile;
System altered.
SQL> /
System altered.
SQL> /
System altered.
--bsl01lab window
SQL> select sequence#,applied from v$archived_log order by 1;
SEQUENCE# APP
90 YES
91 YES
92 YES
successfully switched-over!Upto Point 13 it's fine but after that on 14
when i do
SQL> select name,sequence# from v$archived_log;
no rows selectedwhat is the problem... -
Switching between Primary and Standby database
Hi,
I managed to setup a standby database that is updated by the primary db either when doing a log file switch or when changing the role of the primary db to standby.
Now I want to put the standby database (that was in primary role for a short period) back into its standby role. I entered
"Alter database commit to switchover to physical standby with session shutdown;"
The archived redo logs as well as the control file are updated on the primary database (which was in standby role for the same short period). When I enter
"Alter database commit to switchover to primary" I am receiving the following error message:
SQL> alter database commit to switchover to primary;
alter database commit to switchover to primary
ERROR at line 1:
ORA-16139: media recovery required
After issuing the recovery statement I get this message:
SQL> recover database
ORA-00283: recovery session canceled due to errors
ORA-01610: recovery using the BACKUP CONTROLFILE option must be done
At the same time this log entry is written into the alert log:
Database not available for switchover
End-Of-REDO archived log file has been received
Archived log files detected beyond End-Of-REDO
Incomplete recovery SCN:0:962365 archive SCN:0:977340
Switchover: Media recovery required - standby not in limbo
ORA-16139 signalled during: alter database commit to switchover to primary...
But when I try to use the BACKUP CONTROLFILE statement during recovery I get this error message:
SQL> recover database using backup controlfile;
ORA-00283: recovery session canceled due to errors
ORA-01666: control file is for a standby database
Although being quite a newbie it's obvious that the primary database (which was standby for a short period) is worried that there are older archived redo logs than online logs. I guess this happens because of the log_archive_dest definition on the standby database :
*.LOG_ARCHIVE_DEST_3='SERVICE=ORAMPPRD REOPEN=60 MAX_FAILURE=3 LGWR SYNC
VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=ORAMPPRD'
Changes are applied immediately and only written to the archive.
But how can it be managed that the online redo logs on the primary system are also updated when switching back from standby ???
Thanks,
Philipp.Thanks, it's working now.
I think it's important to explizitely follow the steps to switchover standby and primary for it to work. I maybe shutdown the standby to early.
Cheers,
Philipp. -
BP search for General and Company Code roles
Hi
On the modify Money Market Transactions (TM_52) (and some similar to it for other products TS02, TM32, TO02), if i go to the Partner Assignment Tab and I try to assign a bp for the General or the Company Code roles, the bp search program give me no results.
If i try to do the search for the Counterparty role it gives me the results I expect.
Is there any reason for do not give any result when these roles are the primary roles that, of course, the bp I choose has? Is it a program problem (this program has returned me some dumps and I implemented some Notes on it before)? If so, is there any solution?
I want to assign these roles because I hope that these assignments with these roles modify the payment data or the master data of the transaction.
ThanksHi
This is a very common topic.
look at this thread:
Authorization in reports
Here's a starting point ...
http://help.sap.com/saphelp_bw33/helpdata/en/72/eeb23b94c6e54be10000000a11402f/frameset.htm
Outline steps...
In RSSM:
Create authorization object
Make authorization object applicable to relevant InfoProviders
In PFCG:
Add authorization object to new or existing Roles with appropriate field assignments
Make User/Role assignments
Reg's
Edan -
HR-ORG - Indirect Role Assignment
Hello
We are designing the role & security strategy in a new implementation project. The best security strategy seems to be an indirect role assignment via SAP organizational structure. We've looked for some information about that, but we have some doubts about it (we have downloaded "HR-ORG - Indirect Role Assignment" and "User & Roles" files from SAPNet).
The organizational structure will have a lot of leaves named "explotacion". Every leaf will have a different company code, sales organization, sector and so on... On the other hand, it's a requirement that a user obtains automatically its roles when its moved through organizational structure.
Our plan consists in create several primary roles (for example, sales manager). Then we will create a lot of derivate roles which will inherit all authorizations from the parent role. However, it shouldn't inherit organization field values... Then, when this role is assigned to a position, this role should obtain all organizational field values (company code, sector, ...) from our organizational structure.
Is it possible? How can we do that?
Best regards,As mentioned previously, the indirect role assignment may work in this case since it assigns complete roles to positions rather than inheriting the properties of that position.
Structural authorisations however, do have specific authorisation values assigned directly to the organisational positions.
I have not had much experience in implementing these but that maybe worth a look.
Simon -
Mass Role Import -- 9000 derived roles with 9 org Levels, how to get TXT
Hello,
I hava a problem.
I want to use the (Mass Role Import) Bulk Role Import element in the ERM (SAP GRC AC 5.3 )for importing SAP roles (I only found that way to import roles from SAP).
I have 100 primary roles and more or less 9000 derived roles with 9 org Levels.
Is there a way to get this 9000 derived roles with their 9 org Levels in a TXT file?. Or do I have to do it manually this part to insert it in the "Bulk Role Import ".
Can someone help me?
Thank you in advance.
Pablo Mortera.Hi Mike,
what kind of TA´s are in your role. Is it possible to integrate a "dummy" TA (without conflicting
your SOD)?
In my example I have CO TA´s bundled in a role:
Role: ZXXXX_O:CO_ORDERMANAGER_CRE - CO Order Manager Pflege
with
KO01 Create Internal Order ...
KO02 Change Order ...
KO04 Order Manager ...
KOK2 Collective Proc. Internal Orders ...
KOK4 Aut. Collect. Proc. Internal Orders
update this role with TA KO01 and KOKRS will be available for derivation.
Done this manually without import in ERM.
Reg,
Ulrich -
hi all!
I have following question:
We have development database which is frequently deleted and recreated from production base. Now we will implement logical standby for this development base, where we will create some additional objects.
What will happen when primary database will be deleted? Will it be possible to "link" existing logical standby to newly created primary?
Would be this possible or there is some other solution ? Creating one more database for primary role is the last option.hi,
We have development database which is frequently deleted and recreated from production base. Now we will implement logical standby for this development base, where we will create some additional objects.for better option create database using RMAN cloning, because its for development,. stating that often you are deleting it,.. if you create Logical standby. and if drop the standby, then again u have to configure another standby. it will affect production DB.
What will happen when primary database will be deleted? Will it be possible to "link" existing logical standby to newly created primary?
Would be this possible or there is some other solution ? Creating one more database for primary role is the last option.yes, you can link with newly created primary.
its best option for DR for your condition cloning is the best option
regards,
Deepak -
Running scripts on primary and secondary instances.
Hello,
I created an AlwaysOn Availability group with 4 instances and I added 1 database to the availability group. On every instance the database is readable.
When I run sp_updatestats, on one of the secondary instances, I get this error message.
Msg 15635, Level 16, State 1, Procedure sp_updatestats, Line 21
Cannot execute 'sp_updatestats' because the database is in read-only access mode.
When I run
SELECT
name,
is_read_only FROM
sys.databases
where name
= 'mydb' I get
Name
is_read_only
mydb
0
That probably makes sense because I am looking at a copy of the database on the primary instance and the database on the primary instance
is not read only? Or am I looking at a bug? Should the availability group change is_read_only to 1 on the secondary instances?
Is it possible to detect that a database is synchronizing or is read only and that you should not update statistics or rebuild indexes?
It has to be dynamic. I do not want to have to exclude and include database when the primary instance changes.
Something like
If (database is on primary availability group instance == true)
Exec task
Else
Forget about it
Greetings,
ErikHi hcv,
Each availability group defines a set of two or more failover partners known as availability replicas.
Every availability replica is assigned an initial role—either the primary role or the secondary role. The role of a given replica determines whether it hosts read-write databases or read-only databases. One replica, known as the primary replica, is assigned
the primary role and hosts read-write databases, which are known as primary databases. At least one other replica, known as a secondary replica, is assigned the secondary role. A secondary replica hosts read-only databases, known as secondary databases. So
once a database is set to READ ONLY, Statistics will not be automatically updated
and we will not be able to create indexes and so on. If you change the original secondary replica resolves to the primary role, its databases become the primary databases, then you can execute sp_updatestats on the read-write databases.
For more information, see:
Overview of AlwaysOn Availability Groups (SQL Server)
Regards,
Sofiya Li
If you have any feedback on our support, please click here.
Sofiya Li
TechNet Community Support
Maybe you are looking for
-
What are the Master data that should be uploaded for Go live
Can any one tell me what are the SD master data that should be uploaded during GO live
-
How to change Object Stroke Color and fill Color?
Hi to all i need to change fillcolor & stroke color of Object here i wrote code that tried but it is not myDoc = app.activeDocument; var dd = myDoc.colors.add({name:"PANTONE Black C", model:ColorModel.spot, colorValue:[0, 13, 49, 98]}); app.findObjec
-
Infinity is coming to my area very soon and the cabinet is 160 metres line distance from me, is I likely to receive the full speed on the 80/20 package?
-
Treeview Manu word Wrap property
Hi Friend I am develping tree view menu input thr XML. so my (tree node label)Text length vary. some times it is too length how can i set word wrap pls help Thanks
-
Iterating through ArrayList backwards
I'm trying to use a ListIterator to iterate through the contents of an ArrayList backwards, but I'm having trouble doing so. I can iterate forwards without a problem using .next() and .hasNext(), but I'm not sure how to start iterating at the "end" o