Switchover_Status = Sessions Active
Hi All,
I have configure the Physical standby database and now i want to test the
Switch over , but when i check SWITCHOVER_STATUS colunm of V$database view it is showing me sessions active. How cany i get the value "To Standby" for this column to start the switch over process.
On Primary,
SQL> conn sys@prod as sysdba
Enter password:
Connected.
SQL> select SWITCHOVER_STATUS from v$database ;
SWITCHOVER_STATUS
SESSIONS ACTIVE
SQL> select SID,SERIAL#,USERNAME from v$SESSION;
SID SERIAL# USERNAME
1 1
2 1
3 1
4 1
5 1
6 1
7 1
8 1
9 1
10 1
11 44 SYS
SID SERIAL# USERNAME
12 66 SYS
12 rows selected.On Standby
SQL> conn sys@stdby as sysdba
Enter password:
Connected.
SQL> select SWITCHOVER_STATUS,OPEN_MODE from v$database ;
SWITCHOVER_STATUS OPEN_MODE
SESSIONS ACTIVE MOUNTED
SQL> select SID,SERIAL#,USERNAME from v$SESSION;
SID SERIAL# USERNAME
1 1
2 1
3 1
4 1
5 1
6 1
7 1
8 1
9 1
10 1
11 5 SYS
SID SERIAL# USERNAME
14 1
12 rows selected.
SQL>can you please tell me, where am i wrong and why i am getting "sessions active" and why "To standby" it not there?
Thanks for your help.
Akshay
In order to perform a switchover all sessions to the database need to be
disconnected. In version 901 this was a manual process. In version 9.2.0
this process has been automated with the with session shutdown clause
that has been added to the alter database commit to switchover command.
If SWITCHOVER_STATUS returns SESSIONS ACTIVE then you should either
disconnect all sessions manually or when performing step 2 you should append
the with session shutdown clause. For example:
SQL> alter database commit to switchover to standby with session shutdown;
Read manuls before you do and also metalink note 232240.1
Jaffar
Similar Messages
-
Long sys session active after rman backup completed
Hi all,
We use Oracle DB 11g in RAC and the Rman backups running on SLES 11 SP1.
All days the backup jobs are executed normally, but, sometimes some SYS sessions (used during the backup, i think) remains ACTIVE by hours (day, weeks...)
At this moment, we have 3 sessions running (actives) since Nov, 04. Their LOGON_TIME is the same backup job start time.
The current statement is empty. I think that is relationed with the backup Job. The processes are ORAOxxx and there are sessions in ASM instance with the same LOGON_TIME.
What can we DO? Kill these sessions?
The last time we restarted the Oracle DB instance, but the "zombies" sessions came back soon, after a backup job. :(
Thanks!Thanks,
but I know how to query the sessions, I use Gv$session because it´s an oracle cluster.
I Want to Know: What do we have to do with the long sessions? To kill? Simply?
--> Below the query to see the sessions:
'ACTIVE' or 'INACTIVE':
SELECT 'kill -9 '
|| b.spid
|| ' # '
|| a.inst_id
|| ' - '
|| a.username
|| ' - '
|| a.program
|| ' - '
|| TO_CHAR (a.logon_time, 'DD-MM-YYYY HH24:MI:SS')
|| ' - '
|| TRUNC (a.last_call_et / 60 / 60, 0)
|| ' horas - '
|| a.status
FROM gv$session a, gv$process b
WHERE a.username IS NOT NULL
AND a.last_call_et / 60 / 60 > 4
AND a.status = 'INACTIVE'
AND a.paddr = b.addr
AND a.inst_id = 1
ORDER BY a.last_call_et DESC
---------- The result is:
kill -9 20516 # 3 - SYS - oracle@art (O003) - 04-11-2011 01:07:51 - 88 horas - ACTIVE
kill -9 26562 # 3 - SYS - oracle@art (O003) - 04-11-2011 01:07:51 - 88 horas - ACTIVE
kill -9 13213 # 3 - SYS - oracle@art (O004) - 05-11-2011 01:02:12 - 64 horas - ACTIVE
kill -9 26021 # 3 - SYS - oracle@art (O004) - 05-11-2011 01:02:12 - 64 horas - ACTIVE
kill -9 21749 # 3 - SYS - oracle@art (O004) - 05-11-2011 01:02:12 - 64 horas - ACTIVE
kill -9 1844 # 3 - SYS - oracle@art (O005) - 05-11-2011 01:02:12 - 64 horas - ACTIVE
kill -9 2214 # 3 - SYS - oracle@art (O005) - 05-11-2011 01:02:12 - 64 horas - ACTIVE
kill -9 21759 # 3 - SYS - oracle@art (O005) - 05-11-2011 01:02:12 - 64 horas - ACTIVE -
Problem with keeping session active in WEB
Hi,
We are using only web repoting and when these web reports are excuted and left idle for some time then any further operation on the report output after 10 mins give out a error and doesnt proceed further.
As i understnd this has got something to do with the parameter in RZ10.
To mention a few we have rdisp/max_wprun_time is set as 600.
Is this the value responsible for that. If yes then can we increase this?
Else pelase suggest the exact parameter?
Can i have any SAP recomeneded values documentation.
Thanks,
Naveen.A1. icm/keep_alive_timeout - set the timeperiod here for max idle time - also check out the documentation of this param from RZ11
2. you can also set the session time out at transaction SICF
default_host/sap/bw/bex
double click on bex, there you can set the session time out (stateful connections)
Regards
Raja -
TAB keystroke is inactive in one session, active in the other
This is a problem I've been experiencing with Tiger, but it is still present with Leopard :
for some reason, the TAB keystroke (the one above the Permanent-Maj-CAPS keystroke, on the left side of the keyboard) is inactive in one session.
On the other user session, it works just right. So it is not a "keyboard-hardware" problem (at least...).
please, help me.... Using a computer with no TAB keystroke is really upsetting...
thanks.Open the Speech pane of System Preferences and check whether either the speech key or the listening key has become set to tab; if so, change the setting.
(25832) -
When ever I boot up my mac mini it re-opens all of my activity from my previous use of it. This happens even if I quit all the running programes before I turned it off. It does not effect the computer when its running but it is bugging the crap out of me. Any help would be much appreiciated.
Try going to System Preferences > General > and uncheck Restore windows when quitting and re-opening apps
See if that helps.
Also when you say you quit all running programs, do you just click on the red X ballon in the top left or do you actually CMD + Quit? -
Switchover_status in standby database showing NOT ALLOWED
Hi All,
My oracle database version is Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bit on windows platform.
I need to perform switchover activity with dg_broker=TRUE.
When I checked the status of DR database I found that switchover_status is NOT ALLOWED rather than SESSION ACTIVE or TO PRIMARY.I have doubt whether switchover can be done successfully or not with this configuration?
*Parameters from spfile in production database
=======================================
maxprod.__db_cache_size=2046820352
maxprod.__java_pool_size=16777216
maxprod.__large_pool_size=16777216
maxprod.__shared_pool_size=352321536
maxprod.__streams_pool_size=0
*.audit_file_dest='C:\oracle\product\10.2.0\admin\maxprod\adump'
*.background_dump_dest='C:\oracle\product\10.2.0\admin\maxprod\bdump'
*.compatible='10.2.0.1.0'
*.control_files='D:\MaximoData\oradata\maxprod\CONTROL01.CTL','D:\MaximoData\oradata\maxprod\CONTROL02.CTL','D:\MaximoData\oradata\maxprod\CONTROL03.CTL'
*.core_dump_dest='C:\oracle\product\10.2.0\admin\maxprod\cdump'
*.cursor_sharing='EXACT'
*.db_block_size=8192
*.db_domain=''
*.db_file_multiblock_read_count=16
*.db_name='maxprod'
*.db_recovery_file_dest='D:\MaximoData\flash_recovery_area'
*.db_recovery_file_dest_size=2147483648
*.dg_broker_start=TRUE
*.dispatchers='(PROTOCOL=TCP) (SERVICE=maxprodXDB)'
*.fal_client='MAXPROD'
*.fal_server='EAMDR'
*.job_queue_processes=10
*.log_archive_config='DG_CONFIG=(MAXPROD,EAMDR)'
*.log_archive_dest_1='location=D:\MaximoData\Archive_Log valid_for=(all_logfiles,all_roles)'
*.log_archive_dest_2='SERVICE=EAMDR VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) db_unique_name=EAMDR'
*.log_archive_dest_state_2='ENABLE'
*.log_archive_max_processes=30
*.log_archive_start=true
*.log_buffer=100000000
*.nls_language='AMERICAN'
*.open_cursors=8000
*.pga_aggregate_target=848297984
*.processes=300
*.remote_login_passwordfile='EXCLUSIVE'
*.session_cached_cursors=20
*.sga_max_size=4294967296
*.sga_target=2550136832
*.sql92_security=TRUE
*.standby_archive_dest='D:\MaximoData\Archive_Log\standby'
*.standby_file_management='auto'
*.undo_management='AUTO'
*.undo_tablespace='UNDOTBS1'
*.user_dump_dest='C:\oracle\product\10.2.0\admin\maxprod\udump'*
*Parameters from spfile in DR database
============================
maxprod.__db_cache_size=3187671040
eamdr.__db_cache_size=1073741824
maxprod.__java_pool_size=16777216
eamdr.__java_pool_size=16777216
maxprod.__large_pool_size=16777216
eamdr.__large_pool_size=16777216
maxprod.__shared_pool_size=1056964608
eamdr.__shared_pool_size=486539264
maxprod.__streams_pool_size=0
eamdr.__streams_pool_size=0
*.audit_file_dest='C:\oracle\product\10.2.0\admin\EAMDR\adump'
*.background_dump_dest='C:\oracle\product\10.2.0\admin\EAMDR\bdump'
*.compatible='10.2.0.1.0'
*.control_files='D:\MAXIMODATA\ORADATA\MAXPROD\CONTROL01.CTL','D:\MAXIMODATA\ORADATA\MAXPROD\CONTROL02.CTL','D:\MAXIMODATA\ORADATA\MAXPROD\CONTROL03.CTL'#Restore Controlfile
*.core_dump_dest='C:\oracle\product\10.2.0\admin\EAMDR\cdump'
*.db_block_size=8192
*.db_domain=''
*.db_file_multiblock_read_count=16
*.db_name='maxprod'
*.db_recovery_file_dest_size=10737418240
*.db_recovery_file_dest='D:\MaximoData\flash_recovery_area'
*.DB_UNIQUE_NAME='EAMDR'
*.dg_broker_start=TRUE
*.dispatchers='(PROTOCOL=TCP) (SERVICE=maxprodXDB)'
*.fal_client='EAMDR'
*.fal_server='MAXPROD'
*.job_queue_processes=10
*.log_archive_config='DG_CONFIG=(MAXPROD,EAMDR)'
*.log_archive_dest_1='LOCATION=D:\MaximoData\Archive_Log VALID_FOR=(ALL_LOGFILES,ALL_ROLES) DB_UNIQUE_NAME=EAMDR'
*.log_archive_dest_2='service=maxprod valid_for=(online_logfiles,primary_role) db_unique_name=MAXPROD'
*.log_archive_dest_state_2='ENABLE'
*.log_archive_max_processes=30
*.nls_language='AMERICAN'
*.open_cursors=8000
*.pga_aggregate_target=194967296
*.processes=150
*.remote_login_passwordfile='EXCLUSIVE'
*.sga_max_size=4294967296
*.sga_target=1594967296
*.standby_archive_dest='D:\MaximoData\Archive_Log\standby'
*.standby_file_management='AUTO'
*.undo_management='AUTO'
*.undo_tablespace='UNDOTBS1'
*.user_dump_dest='C:\oracle\product\10.2.0\admin\EAMDR\udump'*
I didn't find any DG_BROKER_CONFIG_FILE1, DG_BROKER_CONFIG_FILE2 parameters from spfile in both production and DR db?
Is anything missing in spfile?
When I am trying to connect with dgmgrl
DGMGRL>connect sys;
connected
DGMGRL>show configuration;
Error: ORA-16532: Data Guard broker configuration does not exist
what does it mean when dgmgrl is set to true?
I have attached PRODUCTION and DR queries outputs for better understanding.
IN PRIMARY DATABASE
SQL>select database_role from v$database;
DATABASE_ROLE
PRIMARY
SQL> select switchover_status from v$database;
SWITCHOVER_STATUS
SESSIONS ACTIVE
SQL> select db_unique_name,database_role,open_mode,log_mode,protection_mode from v$database;
DB_UNIQUE_NAME DATABASE_ROLE OPEN_MODE LOG_MODE PROTECTION_MODE
maxprod PRIMARY READ WRITE ARCHIVELOG MAXIMUM PERFORMANCE
SQL> select process,status,client_process,sequence# from v$managed_standby;
PROCESS STATUS CLIENT_P SEQUENCE#
ARCH CLOSING ARCH 7820
ARCH CLOSING ARCH 7835
ARCH CLOSING ARCH 7835
ARCH CLOSING ARCH 7821
ARCH CLOSING ARCH 7822
ARCH CLOSING ARCH 7822
ARCH CLOSING ARCH 7793
ARCH CLOSING ARCH 7823
ARCH CLOSING ARCH 7824
ARCH CLOSING ARCH 7824
ARCH CLOSING ARCH 7825
ARCH CLOSING ARCH 7825
ARCH CLOSING ARCH 7826
ARCH CLOSING ARCH 7826
ARCH CLOSING ARCH 7827
ARCH CLOSING ARCH 7827
ARCH CLOSING ARCH 7828
ARCH CLOSING ARCH 7828
ARCH CLOSING ARCH 7829
ARCH CLOSING ARCH 7829
ARCH CLOSING ARCH 7830
ARCH CLOSING ARCH 7830
ARCH CLOSING ARCH 7831
ARCH CLOSING ARCH 7831
ARCH CLOSING ARCH 7832
ARCH CLOSING ARCH 7832
ARCH CLOSING ARCH 7833
ARCH CLOSING ARCH 7833
ARCH CLOSING ARCH 7834
ARCH CLOSING ARCH 7834
30 rows selected.
SQL> sho parameter log_archive_config
NAME TYPE VALUE
log_archive_config string DG_CONFIG=(MAXPROD,EAMDR)
SQL> spool off
IN SECONDARY DATABASE
SQL> select database_role from v$database;
DATABASE_ROLE
PHYSICAL STANDBY
SQL> select switchover_status from v$database;
SWITCHOVER_STATUS --------------------
NOT ALLOWED
SQL> select db_unique_name,database_role,open_mode,log_mode,protection_mode from v$database;
DB_UNIQUE_NAME DATABASE_ROLE OPEN_MODE LOG_MODE PROTECTION_MODE
EAMDR PHYSICAL STANDBY MOUNTED ARCHIVELOG MAXIMUM PERFORMANCE
SQL> select process,status,client_process,sequence# from v$managed_standby;
PROCESS STATUS CLIENT_P SEQUENCE#
ARCH CLOSING ARCH 7809
ARCH CLOSING ARCH 7810
ARCH CLOSING ARCH 7812
ARCH CLOSING ARCH 7813
ARCH CLOSING ARCH 7814
ARCH CLOSING ARCH 7815
ARCH CLOSING ARCH 7816
ARCH CLOSING ARCH 7817
ARCH CLOSING ARCH 7818
ARCH CLOSING ARCH 7819
ARCH CLOSING ARCH 7820
ARCH CLOSING ARCH 7821
ARCH CLOSING ARCH 7822
ARCH CLOSING ARCH 7823
ARCH CLOSING ARCH 7824
ARCH CLOSING ARCH 7825
ARCH CLOSING ARCH 7826
ARCH CLOSING ARCH 7827
ARCH CLOSING ARCH 7828
ARCH CLOSING ARCH 7829
ARCH CLOSING ARCH 7830
ARCH CLOSING ARCH 7831
ARCH CLOSING ARCH 7832
ARCH CLOSING ARCH 7833
ARCH CLOSING ARCH 7835
ARCH CLOSING ARCH 7804
ARCH CLOSING ARCH 7805
ARCH CLOSING ARCH 7806
ARCH CLOSING ARCH 7807
ARCH CLOSING ARCH 7808
MRP0 WAIT_FOR_LOG N/A 7836
RFS IDLE UNKNOWN 0
RFS IDLE UNKNOWN 0
RFS IDLE UNKNOWN 0
RFS IDLE UNKNOWN 0
RFS IDLE UNKNOWN 0
RFS IDLE UNKNOWN 0
RFS IDLE UNKNOWN 0
RFS IDLE UNKNOWN 0
RFS IDLE UNKNOWN 0
RFS IDLE UNKNOWN 0
RFS IDLE UNKNOWN 0
RFS IDLE UNKNOWN 0
RFS IDLE UNKNOWN 0
RFS IDLE UNKNOWN 0
RFS IDLE UNKNOWN 0
RFS IDLEMeenakshy singh wrote:
Hi All,
My oracle database version is Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bit on windows platform.
I need to perform switchover activity.When I checked the status of DR database I found that switchover_status is NOT ALLOWED rather than SESSION ACTIVE or TO PRIMARY.I have doubt whether switchover can be done successfully or not?
I have attached PRODUCTION and DR queries outputs for better understanding.
IN PRIMARY DATABASE
SQL>select database_role from v$database;
DATABASE_ROLE
PRIMARY
SQL> select switchover_status from v$database;
SWITCHOVER_STATUS
SESSIONS ACTIVE
SQL> select db_unique_name,database_role,open_mode,log_mode,protection_mode from v$database;
DB_UNIQUE_NAME DATABASE_ROLE OPEN_MODE LOG_MODE PROTECTION_MODE
maxprod PRIMARY READ WRITE ARCHIVELOG MAXIMUM PERFORMANCE
SQL> select process,status,client_process,sequence# from v$managed_standby;
PROCESS STATUS CLIENT_P SEQUENCE#
ARCH CLOSING ARCH 7820
ARCH CLOSING ARCH 7835
ARCH CLOSING ARCH 7835
ARCH CLOSING ARCH 7821
ARCH CLOSING ARCH 7822
ARCH CLOSING ARCH 7822
ARCH CLOSING ARCH 7793
ARCH CLOSING ARCH 7823
ARCH CLOSING ARCH 7824
ARCH CLOSING ARCH 7824
ARCH CLOSING ARCH 7825
ARCH CLOSING ARCH 7825
ARCH CLOSING ARCH 7826
ARCH CLOSING ARCH 7826
ARCH CLOSING ARCH 7827
ARCH CLOSING ARCH 7827
ARCH CLOSING ARCH 7828
ARCH CLOSING ARCH 7828
ARCH CLOSING ARCH 7829
ARCH CLOSING ARCH 7829
ARCH CLOSING ARCH 7830
ARCH CLOSING ARCH 7830
ARCH CLOSING ARCH 7831
ARCH CLOSING ARCH 7831
ARCH CLOSING ARCH 7832
ARCH CLOSING ARCH 7832
ARCH CLOSING ARCH 7833
ARCH CLOSING ARCH 7833
ARCH CLOSING ARCH 7834
ARCH CLOSING ARCH 7834
30 rows selected.
SQL> sho parameter log_archive_config
NAME TYPE VALUE
log_archive_config string DG_CONFIG=(MAXPROD,EAMDR)
SQL> spool off
IN SECONDARY DATABASE
SQL> select database_role from v$database;
DATABASE_ROLE
PHYSICAL STANDBY
SQL> select switchover_status from v$database;
SWITCHOVER_STATUS --------------------
NOT ALLOWED
SQL> select db_unique_name,database_role,open_mode,log_mode,protection_mode from v$database;
DB_UNIQUE_NAME DATABASE_ROLE OPEN_MODE LOG_MODE PROTECTION_MODE
EAMDR PHYSICAL STANDBY MOUNTED ARCHIVELOG MAXIMUM PERFORMANCE
SQL> select process,status,client_process,sequence# from v$managed_standby;
PROCESS STATUS CLIENT_P SEQUENCE#
ARCH CLOSING ARCH 7809
ARCH CLOSING ARCH 7810
ARCH CLOSING ARCH 7812
ARCH CLOSING ARCH 7813
ARCH CLOSING ARCH 7814
ARCH CLOSING ARCH 7815
ARCH CLOSING ARCH 7816
ARCH CLOSING ARCH 7817
ARCH CLOSING ARCH 7818
ARCH CLOSING ARCH 7819
ARCH CLOSING ARCH 7820
ARCH CLOSING ARCH 7821
ARCH CLOSING ARCH 7822
ARCH CLOSING ARCH 7823
ARCH CLOSING ARCH 7824
ARCH CLOSING ARCH 7825
ARCH CLOSING ARCH 7826
ARCH CLOSING ARCH 7827
ARCH CLOSING ARCH 7828
ARCH CLOSING ARCH 7829
ARCH CLOSING ARCH 7830
ARCH CLOSING ARCH 7831
ARCH CLOSING ARCH 7832
ARCH CLOSING ARCH 7833
ARCH CLOSING ARCH 7835
ARCH CLOSING ARCH 7804
ARCH CLOSING ARCH 7805
ARCH CLOSING ARCH 7806
ARCH CLOSING ARCH 7807
ARCH CLOSING ARCH 7808
MRP0 WAIT_FOR_LOG N/A 7836
RFS IDLE UNKNOWN 0
RFS IDLE UNKNOWN 0
RFS IDLE UNKNOWN 0
RFS IDLE UNKNOWN 0
RFS IDLE UNKNOWN 0
RFS IDLE UNKNOWN 0
RFS IDLE UNKNOWN 0
RFS IDLE UNKNOWN 0
RFS IDLE UNKNOWN 0
RFS IDLE UNKNOWN 0
RFS IDLE UNKNOWN 0
RFS IDLE UNKNOWN 0
RFS IDLE UNKNOWN 0
RFS IDLE UNKNOWN 0
RFS IDLE UNKNOWN 0
RFS IDLE UNKNOWN 0
RFS IDLE UNKNOWN 0
RFS IDLE UNKNOWN 0
RFS IDLE UNKNOWN 0
RFS IDLE UNKNOWN 0
RFS IDLE UNKNOWN 0
RFS IDLE UNKNOWN 0
RFS IDLE UNKNOWN 0
RFS IDLE UNKNOWN 0
RFS IDLE UNKNOWN 0
56 rows selected.
SQL> sho parameter log_archive_config
NAME TYPE VALUE
log_archive_config string DG_CONFIG=(MAXPROD,EAMDR)
SQL> spool off
1.In this case,is switchover is possible?No
2.If not possible then what will be the next step?If the value in the SWITCHOVER_STATUS column is SESSIONS ACTIVE, identify and terminate active user or SQL sessions that might prevent a switchover from being processed.
If, after performing these steps, the SWITCHOVER_STATUS column still displays SESSIONS ACTIVE, you can successfully perform a switchover by appending the WITH SESSION SHUTDOWN clause to the
ALTER DATABASE COMMIT TO SWITCHOVER TO PHYSICAL STANDBY statement.
3.Is this will impact to our production database when switchover is not successfully perform?
4.In DR RFS is idle,why?Can you paste here log_archive_dest_n paramete which is you are using for transport?
Did you using DELAY attribute in log_archive_dest_n parameter?
Mahir -
Standby database SWITCHOVER_STATUS field is always NOT ALLOWED
standby database:
SQL> select switchover_status from v$database;
SWITCHOVER_STATUS
NOT ALLOWED
select db_unique_name,database_role,open_mode,log_mode,protection_mode from v$database;
DB_UNIQUE_NAME DATABASE_ROLE OPEN_MODE LOG_MODE PROTECTION_MODE
omu0 PHYSICAL STANDBY MOUNTED ARCHIVELOG MAXIMUM AVAILABILITY
select process,status,client_process,sequence# from v$managed_standby;
PROCESS STATUS CLIENT_P SEQUENCE#
ARCH CONNECTED ARCH 0
ARCH CONNECTED ARCH 0
ARCH CONNECTED ARCH 0
ARCH CLOSING ARCH 539
ARCH CONNECTED ARCH 0
ARCH CLOSING ARCH 540
ARCH CONNECTED ARCH 0
ARCH CONNECTED ARCH 0
ARCH CONNECTED ARCH 0
ARCH CONNECTED ARCH 0
ARCH CONNECTED ARCH 0
ARCH CONNECTED ARCH 0
ARCH CONNECTED ARCH 0
ARCH CONNECTED ARCH 0
ARCH CONNECTED ARCH 0
ARCH CONNECTED ARCH 0
ARCH CONNECTED ARCH 0
ARCH CONNECTED ARCH 0
ARCH CONNECTED ARCH 0
ARCH CONNECTED ARCH 0
ARCH CONNECTED ARCH 0
ARCH CONNECTED ARCH 0
ARCH CONNECTED ARCH 0
ARCH CONNECTED ARCH 0
ARCH CONNECTED ARCH 0
ARCH CONNECTED ARCH 0
ARCH CONNECTED ARCH 0
ARCH CONNECTED ARCH 0
ARCH CONNECTED ARCH 0
ARCH CONNECTED ARCH 0
MRP0 APPLYING_LOG N/A 541
RFS IDLE LGWR 541
RFS IDLE ARCH 0
RFS IDLE N/A 0primary datase:
SQL> select switchover_status from v$database;
SWITCHOVER_STATUS
SESSIONS ACTIVE
select db_unique_name,database_role,open_mode,log_mode,protection_mode from v$database;
DB_UNIQUE_NAME DATABASE_ROLE OPEN_MODE LOG_MODE PROTECTION_MODE
omu2 PRIMARY READ WRITE ARCHIVELOG MAXIMUM AVAILABILITY
select process,status,client_process,sequence# from v$managed_standby;
PROCESS STATUS CLIENT_P SEQUENCE#
ARCH CONNECTED ARCH 0
ARCH CONNECTED ARCH 0
ARCH CONNECTED ARCH 0
ARCH CONNECTED ARCH 0
ARCH CONNECTED ARCH 0
ARCH CLOSING ARCH 541
ARCH CLOSING ARCH 542
ARCH CLOSING ARCH 543
ARCH CLOSING ARCH 544
ARCH CLOSING ARCH 545
ARCH CLOSING ARCH 546
ARCH CLOSING ARCH 547
ARCH CLOSING ARCH 548
ARCH CONNECTED ARCH 0
ARCH CONNECTED ARCH 0
ARCH CONNECTED ARCH 0
ARCH CONNECTED ARCH 0
ARCH CONNECTED ARCH 0
ARCH CLOSING ARCH 540
ARCH CONNECTED ARCH 0
ARCH CONNECTED ARCH 0
ARCH CONNECTED ARCH 0
ARCH CONNECTED ARCH 0
ARCH CONNECTED ARCH 0
ARCH CONNECTED ARCH 0
ARCH CONNECTED ARCH 0
ARCH CONNECTED ARCH 0
ARCH CONNECTED ARCH 0
ARCH CONNECTED ARCH 0
ARCH CONNECTED ARCH 0
LGWR WRITING LGWR 549
31 rows selected. -
Get error ORA-20505 and ORA-01403 when UPDATING record
Hi,
I'm running APEX 3.2.1, on Oracle XE 10.2.0.1, on Sun Ultra20 (Intel-based) running Windows Server 2003.
I created a small, department database - to keep track of contacts, equipment, etc.
Initially, I used a NUMBER as the PRIMARY KEY in both the CONTACTS table and EQUIPMENT tables. I created a CONTACTS interactive report and a CONTACT DETAILS form, where the EDIT button on a row in the CONTACTS report brings up the individual record to modify. Same thing for EQUIPMENT - interactive report page and form page.
This all worked fine!
Then, I decided to change the PRIMARY KEY for the CONTACTS table to a STRING - with CONTACT_FIRST_NAME and CONTACT_LAST_NAME as the primary key. I figured I this would prevent duplicate entries. After the change, inserts work. Updates work, IF a change is made to ANY field EXCEPT first name or last name.
UPDATES fail - if user modifies EITHER the first name or last name - in APEX. But, update SUCCEEDS if done in SQL Developer. Obviously, I missing a subtle nuance in APEX, but I can't figure it out.
I've included DEBUG trace and version information below.
Thanks,
Andy
ORA-20505: Error in DML: p_rowid=Adam1, p_alt_rowid=CONTACT_FIRST_NAME, p_rowid2=Adam, p_alt_rowid2=CONTACT_LAST_NAME. ORA-01403: no data found
0.02: A C C E P T: Request="SAVE"
0.02: Metadata: Fetch application definition and shortcuts
0.02: NLS: wwv_flow.g_flow_language_derived_from=FLOW_PRIMARY_LANGUAGE: wwv_flow.g_browser_language=en-us
0.02: alter session set nls_language="AMERICAN"
0.02: alter session set nls_territory="AMERICA"
0.02: NLS: CSV charset=WE8MSWIN1252
0.02: ...NLS: Set Decimal separator="."
0.02: ...NLS: Set NLS Group separator=","
0.02: ...NLS: Set date format="DD-MON-RR"
0.02: ...Setting session time_zone to -06:00
0.02: Setting NLS_DATE_FORMAT to application date format: DD-MON-YYYY
0.02: ...NLS: Set date format="DD-MON-YYYY"
0.03: Fetch session state from database
0.03: ...Check session 1896858759858984 owner
0.03: Setting NLS_DATE_FORMAT to application date format: DD-MON-YYYY
0.03: ...NLS: Set date format="DD-MON-YYYY"
0.03: ...Check for session expiration:
0.03: ...Metadata: Fetch Page, Computation, Process, and Branch
0.03: Session: Fetch session header information
0.03: ...Metadata: Fetch page attributes for application 101, page 21
0.05: ...Validate item page affinity.
0.05: ...Validate hidden_protected items.
0.05: ...Check authorization security schemes
0.05: Session State: Save form items and p_arg_values
0.05: ...Session State: Save "P21_CONTACT_FIRST_NAME" - saving same value: "Adam"
0.06: ...Session State: Saved Item "P21_CONTACT_LAST_NAME" New Value="Adam Jr"
0.06: ...Session State: Save "P21_CONTACT_COMPANY" - saving same value: "Atempo"
0.06: ...Session State: Save "P21_CONTACT_JOB_TITLE" - saving same value: "Sr Sw Engr"
0.06: ...Session State: Save "P21_CONTACT_JOB_ROLE" - saving same value: "Engineering"
0.06: ...Session State: Save "P21_CONTACT_STATUS" - saving same value: "Active"
0.06: ...Session State: Save "P21_CONTACT_PRODUCT" - saving same value: ""
0.06: ...Session State: Save "P21_CONTACT_PHONE" - saving same value: "222-333-4444"
0.06: ...Session State: Save "P21_CONTACT_MOBILE" - saving same value: ""
0.06: ...Session State: Save "P21_CONTACT_FAX" - saving same value: ""
0.06: ...Session State: Save "P21_CONTACT_EMAIL" - saving same value: ""
0.06: ...Session State: Save "P21_CONTACT_STREET" - saving same value: ""
0.06: ...Session State: Save "P21_CONTACT_CITY" - saving same value: ""
0.06: ...Session State: Save "P21_CONTACT_STATE" - saving same value: "CO"
0.06: ...Session State: Save "P21_CONTACT_ZIP" - saving same value: ""
0.06: ...Session State: Save "P21_CONTACT_COUNTRY" - saving same value: "United States"
0.06: ...Session State: Save "P21_CONTACT_NOTES" - saving same value: ""
0.06: Processing point: ON_SUBMIT_BEFORE_COMPUTATION
0.06: Branch point: BEFORE_COMPUTATION
0.06: Computation point: AFTER_SUBMIT
0.06: Tabs: Perform Branching for Tab Requests
0.06: Branch point: BEFORE_VALIDATION
0.06: Perform validations:
0.08: ...Item in validation equals expression 2: P21_CONTACT_JOB_ROLE
0.08: ...Item in validation equals expression 2: P21_CONTACT_STATUS
0.08: ...Item Not Null Validation: P21_CONTACT_PHONE
0.08: ...Item in validation equals expression 2: P21_CONTACT_STATE
0.08: ...Item in validation equals expression 2: P21_CONTACT_COUNTRY
0.08: Branch point: BEFORE_PROCESSING
0.08: Processing point: AFTER_SUBMIT
0.08: ...Process "Process Row of ISR_CONTACTS": DML_PROCESS_ROW (AFTER_SUBMIT) #OWNER#:ISR_CONTACTS:P21_CONTACT_FIRST_NAME:CONTACT_FIRST_NAME:P21_CONTACT_LAST_NAME:CONTACT_LAST_NAME|IU
0.08: Show ERROR page...
0.08: Performing rollback...
Oracle Database 10g Express Edition Release 10.2.0.1.0 - Product
PL/SQL Release 10.2.0.1.0 - Production
CORE 10.2.0.1.0 Production
TNS for 32-bit Windows: Version 10.2.0.1.0 - Production
NLSRTL Version 10.2.0.1.0 - Production
Database
NAME XE
CREATED 06/08/2010 05:22:50 PM
RESETLOGS_TIME 07/09/2010 10:09:59 AM
PRIOR_RESETLOGS_CHANGE# 193066
PRIOR_RESETLOGS_TIME 06/08/2010 05:22:52 PM
LOG_MODE ARCHIVELOG
CHECKPOINT_CHANGE# 4436025
ARCHIVE_CHANGE# 4387159
OPEN_RESETLOGS NOT ALLOWED
VERSION_TIME 07/09/2010 10:08:44 AM
OPEN_MODE READ WRITE
PROTECTION_MODE MAXIMUM PERFORMANCE
PROTECTION_LEVEL MAXIMUM PERFORMANCE
REMOTE_ARCHIVE ENABLED
DATABASE_ROLE PRIMARY
ARCHIVELOG_CHANGE# 4458138
SWITCHOVER_STATUS SESSIONS ACTIVE
DATAGUARD_BROKER DISABLED
GUARD_STATUS NONE
FORCE_LOGGING NO
CGI Environment
PLSQL_GATEWAY WebDb
GATEWAY_IVERSION 2
SERVER_SOFTWARE Oracle Embedded PL/SQL Gateway/10.2.0.1.0
GATEWAY_INTERFACE CGI/1.1
SERVER_PORT 8080
SERVER_NAME XDB HTTP Server
REQUEST_METHOD GET
QUERY_STRING p=4500:36:1896858759858984:::::
PATH_INFO /f
SCRIPT_NAME /apex
REMOTE_ADDR 10.135.65.180
SERVER_PROTOCOL HTTP/1.1
REQUEST_PROTOCOL tcp
REMOTE_USER ANONYMOUS
HTTP_USER_AGENT Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.19) Gecko/2010031422 Firefox/3.0.19 (.NET CLR 3.5.30729)
HTTP_HOST isr-si-project:8080Maybe because you're changing primary key...and then updating record with primary key that doesn't exist.
-
Some queries on Data Guard design
Hi, I have some basic questions around Data Guard design
Q1. Looking at the Oracle instructions for creating a logical standby, it firstly advocates creating a physical standby and then converting it to a logical standby. However I thought a logical standby could have a completely different physical structure from the primary. How can this be the case if a logical standby first starts its life as a physical standby ( where structure needs to be identical ) ?
Q2. Is it normal practice to backup your standby database as well – if so why ?
Q3. Can RMAN backup a Standby Database whilst it is in the mounted state ( rather than open ) ?
Q4. What's the point of Cascaded Redo Apply rather than simply getting the Primary to ship to each Standby ?
I guess you could be trying to reduce node to node latency if some of the standby were quite distant from the primary
Q5. Is it possible to convert a Logical Standby back to a Physical one ?
Q6. What the maximium number of standbys you can have - Oracle suggests 30 but I thought I remember reading somewhere in relation to 11gR2 that this limit has now been increased ?
thanks,
JimHi,
Q5 . Is it possible to convert a Logical Standby back to a Physical one ? --- Yes it is possible .
-- Primary
select switchover_status from v$database;
SWITCHOVER_STATUS
SESSIONS ACTIVE
2) switch operation
-- Primary - starat database switch
alter database commit to switchover to physical standby with session shutdown;
-- see alertlog.
Switchover: Complete - Database shutdown required
Completed: alter database commit to switchover to physical standby with session shutdown
-- database role ve switchover_status
select NAME,OPEN_MODE,DATABASE_ROLE,SWITCHOVER_STATUS,PROTECTION_MODE,PROTECTION_LEVEL from v$database;
NAME OPEN_MODE DATABASE_ROLE SWITCHOVER_STATUS PROTECTION_MODE PROTECTION_LEVEL
TESTCRD READ WRITE PHYSICAL STANDBY RECOVERY NEEDED MAXIMUM AVAILABILITY UNPROTECTED
-- Primary
shutdown abort
-- standby - switch to primary
alter database commit to switchover to primary with session shutdown;
-- alert log
Completed: alter database commit to switchover to primary with session shutdown
alter database open
3) Old Primary open
sqlplus / as sysdba
startup nomount
alter database mount standby database
-- database role ve switchover_status
select NAME,OPEN_MODE,DATABASE_ROLE,SWITCHOVER_STATUS,PROTECTION_MODE,PROTECTION_LEVEL from v$database;
NAME OPEN_MODE DATABASE_ROLE SWITCHOVER_STATUS PROTECTION_MODE PROTECTION_LEVEL
TESTCRD READ WRITE PHYSICAL STANDBY RECOVERY NEEDED MAXIMUM AVAILABILITY UNPROTECTED
recover managed standby database using current logfile disconnect from session;
4) Old standby
SQL> select NAME,OPEN_MODE,DATABASE_ROLE,SWITCHOVER_STATUS,PROTECTION_MODE,PROTECTION_LEVEL from v$database;
NAME OPEN_MODE DATABASE_ROLE SWITCHOVER_STATUS PROTECTION_MODE PROTECTION_LEVEL
AZKKDB READ WRITE PRIMARY TO STANDBY MAXIMUM PERFORMANCE MAXIMUM PERFORMANCE
Q2 . . Is it normal practice to backup your standby database as well – if so why ?
Hence you only have to backup one of the both (you can decide to only backup the standby though, if you want to remove load on the primary). But if you are confident with the backup of the primary, there is no need for backing up the standby. (Since you can recreate the standby with the backup from primary).
Please see link : http://blog.dbvisit.com/rman-backups-on-your-standby-database-yes-it-is-easy/
Thank you -
After switchover to standby as primary, now how to switch back
Hello DG experts:
I'm running Oracle 11.2 on Linux 5.8.
I am in the process of (trying) to mimic our existing production DG environment for testing purposes.
So far...
I've managed to set up a primary and standby database and ensured all logs apply properly.
My database name is DGTEST (on both primary and standby).
My db_unique_name is DGTEST_DG1 on primary, and DGTEST_DG2 on standby.
I performed a switchover from primary to standby, and opened the standby database as primary.
But, first thing is that when I check the switchover_status from v$database, it says: NOT ALLOWED.
Okay, so now what? Do I need to have another pfile to set specifically for when I am in primary or standby modes?
Here are relevant commands I have checked already:
on new Primary (db_unique_name = DGTEST_DG2)
SQL> select switchover_status from v$database;
SWITCHOVER_STATUS
NOT ALLOWED
SQL> select sequence#, applied from v$archived_log order by 1;
SEQUENCE# APPLIED
291 YES
292 YES
293 YES
398 YES
399 NO
400 NO
401 NO
402 NO
112 rows selected.
SQL> select destination, status, error from v$archive_dest;
DESTINATION STATUS ERROR
/arch/DGTEST/archivelogs VALID
/arch/DGTEST_STBY VALID
INACTIVE
INACTIVE
INACTIVE
31 rows selected.
on new Standby (db_unique_name = DGTEST_DG1)
SQL> select switchover_status from v$database;
SWITCHOVER_STATUS
TO PRIMARY
1 row selected.
SQL> select sequence#, applied from v$archived_log order by 1;
SEQUENCE# APPLIED
276 YES
277 YES
278 YES
397 NO
397 YES
398 YES
398 NO
231 rows selected.
SQL> select destination, status, error from v$archive_dest;
DESTINATION STATUS ERROR
/arch/DGTEST VALID
DGTEST_DG2 VALID
/arch/DGTEST_STBY DEFERRED
INACTIVE
INACTIVE
. . .Please keep in mind that I have made this test environment as close as possible (I think) to our production environment.
One of the objectives is to confirm we can switchover and back in our production environment.
So if there is something seriously wrong with this environment and it is the same in our production environment, that would be one of my primary objectives to find out about.
Only significant difference is that we are also using DGBroker in production and I did create configuration yet until I got the switchover working manually first.Hi,
Follow This Steps:
How to Switchover from Primary to Standby Database?
MY Configuration:
RAC is configured on dcpdb1(node1) and dcpdb2(node2).
DB Name: dcpdb
db_unique_name: dcpdb
Instance Name: dcpdb1 on node1
Instance Name: dcpdb2 on node2
Active Data Guard is configured on drpdb1
DB Name: dcpdb
db_unique_name: drpdb
Instance Name: drpdb
Process:
On the primary server, check the latest archived redo log and force a log switch.
*########### Login dcpdb1 as Oracle user #########*
SQL> SELECT sequence#, first_time, next_time
FROM v$archived_log
ORDER BY next_time;
SQL> ALTER SYSTEM SWITCH LOGFILE;
Check the new archived redo log has arrived at the standby server and been applied.
*########### Login drpdb1 as Oracle user #########*
SQL> SELECT sequence#, first_time, next_time, applied
FROM v$archived_log
ORDER BY next_time ;
*########### Login dcpdb2 as Oracle user #########*
SQL> SELECT sequence#, first_time, next_time
FROM v$archived_log
ORDER BY next_time ;
SQL> ALTER SYSTEM SWITCH LOGFILE;
Check the new archived redo log has arrived at the standby server and been applied.
*########### Login drpdb1 as Oracle user #########*
SQL> SELECT sequence#, first_time, next_time, applied
FROM v$archived_log
ORDER BY next_time ;
*########### Login dcpdb1 as Oracle user #########*
SQL> SELECT SWITCHOVER_STATUS FROM V$DATABASE;
SWITCHOVER_STATUS
TO STANDBY
*########### Login dcpdb2 as Oracle user #########*
SQL> SELECT SWITCHOVER_STATUS FROM V$DATABASE;
SWITCHOVER_STATUS
TO STANDBY
*########### Login drpdb1 as Oracle user #########*
SQL> SELECT SWITCHOVER_STATUS FROM V$DATABASE;
SWITCHOVER_STATUS
NOT ALLOWED
*########### Login dcpdb2 as Oracle user #########*
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL>
*########### Login dcpdb1 as Oracle user #########*
SQL> ALTER DATABASE COMMIT TO SWITCHOVER TO PHYSICAL STANDBY WITH SESSION SHUTDOWN;
Database altered.
SQL>
SQL> shutdown immediate
ORA-01507: database not mounted
ORACLE instance shut down.
SQL>
SQL> startup mount
ORACLE instance started.
Total System Global Area 1.5400E+10 bytes
Fixed Size 2184872 bytes
Variable Size 7751076184 bytes
Database Buffers 7616856064 bytes
Redo Buffers 29409280 bytes
Database mounted.
SQL> SELECT SWITCHOVER_STATUS FROM V$DATABASE;
SWITCHOVER_STATUS
TO PRIMARY
SQL>
*########### Login drpdb1 as Oracle user #########*
SQL> SELECT SWITCHOVER_STATUS FROM V$DATABASE;
SWITCHOVER_STATUS
SESSIONS ACTIVE
SQL> alter database commit to switchover to primary with session shutdown;
Database altered.
SQL> shutdown immediate
ORA-01109: database not open
Database dismounted.
ORACLE instance shut down.
SQL>
SQL> startup
ORACLE instance started.
Total System Global Area 1.5400E+10 bytes
Fixed Size 2184872 bytes
Variable Size 7717521752 bytes
Database Buffers 7650410496 bytes
Redo Buffers 29409280 bytes
Database mounted.
Database opened.
*########### Login dcpdb1 as Oracle user #########*
SQL> alter database open read only;
Database altered.
SQL> alter database recover managed standby database using current logfile disconnect;
Database altered.
*########### Login dcpdb2 as Oracle user #########*
SQL> startup mount
ORACLE instance started.
Total System Global Area 1.5400E+10 bytes
Fixed Size 2184872 bytes
Variable Size 7751076184 bytes
Database Buffers 7616856064 bytes
Redo Buffers 29409280 bytes
Database mounted.
SQL> alter database open read only;
Database altered.
SQL> alter database recover managed standby database using current logfile disconnect ;
Database altered.
SQL> SELECT SWITCHOVER_STATUS FROM V$DATABASE;
SWITCHOVER_STATUS
NOT ALLOWED
SQL>
*########### Login drpdb1 as Oracle user #########*
SQL> SELECT SWITCHOVER_STATUS FROM V$DATABASE;
SWITCHOVER_STATUS
TO STANDBY
*########### Login dcpdb1 as Oracle user #########*
SQL> SELECT SWITCHOVER_STATUS FROM V$DATABASE;
SWITCHOVER_STATUS
NOT ALLOWED
SQL>
*########### Login dcpdb2 as Oracle user #########*
SQL> SELECT SWITCHOVER_STATUS FROM V$DATABASE;
SWITCHOVER_STATUS
NOT ALLOWED
SQL>
*############### End of Switchover from Primary to Standby Database ##########*
How to Switchback from New Primary(drpdb) to old Standby(drdb) Database and New Standby(dcpdb to Old Primary(dcpdb)?
Process:
On the New primary server, check the latest archived redo log and force a log switch.
*########### Login drpdb1 as Oracle user #########*
SQL> SELECT sequence#, first_time, next_time
FROM v$archived_log
ORDER BY next_time ;
SQL>ALTER SYSTEM SWITCH LOGFILE;
Check the new archived redo log has arrived at the standby server and been applied.
*########### Login dcpdb1 as Oracle user #########*
SQL> SELECT sequence#, first_time, next_time, applied
FROM v$archived_log
ORDER BY next_time ;
*########### Login dcpdb2 as Oracle user #########*
SQL> SELECT sequence#, first_time, next_time, applied
FROM v$archived_log
ORDER BY next_time ;
*########### Login drpdb1 as Oracle user #########*
SQL> SELECT SWITCHOVER_STATUS FROM V$DATABASE;
SWITCHOVER_STATUS
TO STANDBY
*########### Login dcpdb1 as Oracle user #########*
SQL> SELECT SWITCHOVER_STATUS FROM V$DATABASE;
SWITCHOVER_STATUS
NOT ALLOWED
*########### Login dcpdb2 as Oracle user #########*
SQL> SELECT SWITCHOVER_STATUS FROM V$DATABASE;
SWITCHOVER_STATUS
NOT ALLOWED
*########### Login drpdb1 as Oracle user #########*
SQL> ALTER DATABASE COMMIT TO SWITCHOVER TO PHYSICAL STANDBY WITH SESSION SHUTDOWN;
Database altered.
SQL> shutdown immediate
ORA-01507: database not mounted
ORACLE instance shut down.
SQL> startup mount
ORACLE instance started.
Total System Global Area 1.5400E+10 bytes
Fixed Size 2184872 bytes
Variable Size 7717521752 bytes
Database Buffers 7650410496 bytes
Redo Buffers 29409280 bytes
Database mounted.
SQL>
SQL> SELECT SWITCHOVER_STATUS FROM V$DATABASE;
SWITCHOVER_STATUS
TO PRIMARY
SQL>
*########### Login dcpdb2 as Oracle user #########*
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL>
*########### Login dcpdb1 as Oracle user #########*
SQL> SELECT SWITCHOVER_STATUS FROM V$DATABASE;
SWITCHOVER_STATUS
SESSIONS ACTIVE
OR
SWITCHOVER_STATUS
SWITCHOVER PENDING
SQL> alter database commit to switchover to primary with session shutdown;
Database altered.
SQL>
SQL> shutdown immediate
ORA-01109: database not open
Database dismounted.
ORACLE instance shut down.
SQL> startup
ORACLE instance started.
Total System Global Area 1.5400E+10 bytes
Fixed Size 2184872 bytes
Variable Size 7751076184 bytes
Database Buffers 7616856064 bytes
Redo Buffers 29409280 bytes
Database mounted.
Database opened.
SQL>
SQL> SELECT SWITCHOVER_STATUS FROM V$DATABASE;
SWITCHOVER_STATUS
TO STANDBY
SQL>
*########### Login dcpdb2 as Oracle user #########*
SQL> startup
ORACLE instance started.
Total System Global Area 1.5400E+10 bytes
Fixed Size 2184872 bytes
Variable Size 7751076184 bytes
Database Buffers 7616856064 bytes
Redo Buffers 29409280 bytes
Database mounted.
Database opened.
SQL> SELECT SWITCHOVER_STATUS FROM V$DATABASE;
SWITCHOVER_STATUS
TO STANDBY
SQL>
*########### Login drpdb1 as Oracle user #########*
SQL> alter database open read only;
Database altered.
SQL> alter database recover managed standby database using current logfile disconnect;
Database altered.
SQL>
*####### End of Switchback from New Primary(drpdb) to old Standby(drdb) Database and New Standby(dcpdb to Old Primary(dcpdb) #########*
Thanks
Solaiman
Edited by: 876149 on Apr 1, 2013 11:56 AM -
Hi,
We have dataguard on Oracle 10g. The logs are shipped from primary to physical stand by but when I look at "Last Applied Log" under EM on the primary db, I see 0. The logs are shipping but not applied to physical stand by.
I restarted the standby to mount stage.
I can tnsping both the database from other servers
***** on primary *****
SELECT name, value FROM gv$parameter WHERE name = 'log_archive_dest_state_1';
NAME
VALUE
log_archive_dest_state_1
enable
SELECT name, value FROM gv$parameter WHERE name = 'log_archive_dest_state_2';
NAME
VALUE
log_archive_dest_state_2
ENABLE
SELECT name, value FROM gv$parameter WHERE name = 'standby_archive_dest';
NAME
VALUE
standby_archive_dest
select status, error from v$archive_dest where dest_id=2;
STATUS ERROR
VALID
select switchover_status from v$database;
SWITCHOVER_STATUS
SESSIONS ACTIVE
select protection_mode, protection_level, database_role from v$database;
PROTECTION_MODE PROTECTION_LEVEL DATABASE_ROLE
MAXIMUM PERFORMANCE MAXIMUM PERFORMANCE PRIMARY
SELECT MAX(SEQUENCE#), THREAD# FROM V$ARCHIVED_LOG GROUP BY THREAD#;
MAX(SEQUENCE#) THREAD#
4483 1
SELECT dest_id, valid_type, valid_role, valid_now FROM gv$archive_dest;
DEST_ID VALID_TYPE VALID_ROLE VALID_NOW
1 ONLINE_LOGFILE ALL_ROLES YES
2 ONLINE_LOGFILE PRIMARY_ROLE YES
***** on physical stand by *****
select protection_mode, protection_level, database_role from v$database;
PROTECTION_MODE PROTECTION_LEVEL DATABASE_ROLE
MAXIMUM PERFORMANCE MAXIMUM PERFORMANCE PHYSICAL STANDBY
SELECT MAX(SEQUENCE#), THREAD# FROM V$ARCHIVED_LOG GROUP BY THREAD#;
MAX(SEQUENCE#) THREAD#
4483 1
Can anyone advise what can I check and how can I get the logs to apply on the standy by. The stand by is in mount stage. ThanksThe alert log for primary does not show any errors:
LNS: Standby redo logfile selected for thread 1 sequence 4520 for destination LOG_ARCHIVE_DEST_2
This is in the alert log for standby
Primary database is in MAXIMUM PERFORMANCE mode
RFS[11]: Successfully opened standby log 5: '/u02/oradata/prd1/stby_redo_g5_m1.dbf'
On standby I have the MRP process running:
$ ps -ef|grep mrp
oracle 10957 1 0 15:26:48 ? 0:01 ora_mrp0_prd1
SELECT RECOVERY_MODE FROM V$ARCHIVE_DEST_STATUS WHERE DEST_ID=2 ;
RECOVERY_MODE
MANAGED REAL TIME APPLY
This is from v$dataguard_status
Remote File Server Warning 0 167 0 NO 20-DEC-07
RFS[11]: Successfully opened standby log 5: '/u02/oradata/prd1/stby_redo_g5_m1.dbf'
should I try this as first suggested ?
alter database recover managed standby database parallel 2 using current logfile disconnect; -
Dataguard Broker - Swithover failed
I have a two node RAC(n1,n2) with one physical standby(n3)
I have enabled dataguard broker and did a swithover with one instance up in RAC(n1 up)
Swithover and switchback have worked fine.
But when trying to do a swithover from the second RAC(n2 up) node it failed and now all the db's are in standby mode.
When tyring to bring up the RAC instances, alert log shows as standby instances.
Physical Standby Database mounted.
Completed: ALTER DATABASE MOUNT
ALTER DATABASE OPEN
From sql:
SQL> select switchover_status from v$database;
SWITCHOVER_STATUS
SESSIONS ACTIVE
On standby:
SQL> select switchover_status from v$database;
SWITCHOVER_STATUS
TO PRIMARY
Has anyone come accross this situation? How to bring it back to the Primary instance mode?On-Standby
1. alter database commit to switchover to physical standby with session shutdown;
2. shutdown immediate;
3. startup nomount;
4. alter database mount standby database;
5. alter system set log_archive_dest_state_2=defer;
6. recover managed standby database disconnect;
On-Primary
1. alter database commit to switchover to primary;
2. alter system set log_archive_dest_stat_2=enable;
3. shutdown immediate;
4. startup; -
Post switch over in oracle dataguard 11g
Dear Guru,
Switch over has been completed successfully from primary database to standby database.
new primaray database is open and accessible but its showing his satus in v$database as below.
database_role = primary
switchover_status = not allowed
db_unique_name = dg1_stdby
old primaray database which is now standby showing his satus in v$database as below.
database_role = physical standby
switchover_status = session active
db_unique_name = dg1_primy
when check status in data guard broker its
for both the databases - dg1_primy and dg1_stdby its showing error ORA-16810: multiple errors or warnings detected for the database.
when checked dataguard log file on new primary server its showing
ORA-16816: incorrect database role
ORA-16700: the standby database has diverged from the primary database
Please guide me how to resolved issue.
Thanks & Regards,
Nikunj ThakerHi Nikunj,
You can find the scenario, in the "Problem : Data Guard Broker Switchover fails With ORA-16665 using Active Data Guard", on metalink.oracle.com
First of all manually complete the Switchover, ie. restart the Databases in its new Role. Note that the final Role Change has not been recognized by the Broker, so you have to rebuild the Data Guard Broker Configuration when the Databases have been restarted:
DGMGRL> remove configuration;
DGMGRL> create configuration ...
DGMGRL> add database ...
DGMGRL> enable configuration;
Best regards,
Orkun Gedik -
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, -
Switchover between primary RAC and standby single instance
Hello All,
I am using Oracle 11gR2.
I am trying to do a switch over between primary database (RAC 2 nodes) and physical standby (single instance)
If my Primary is single instance i was following the below steps:
On the standby
ALTER DATABASE RECOVER MANAGED STANDBY DATABASE USING CURRENT LOGFILE DISCONNECT;
On the primary database:
alter database commit to switchover to standby with session shutdown;
shutdown immediate;
startup nomount;
alter database mount standby database;
On the standby again:
alter database commit to switchover to primary WITH SESSION SHUTDOWN;
On the new standby:
ALTER DATABASE RECOVER MANAGED STANDBY DATABASE USING CURRENT LOGFILE DISCONNECT FROM SESSION;now, and since my primary is RAC when i am trying switch over I am getting the below error:
SQL> alter database commit to switchover to standby with session shutdown;
alter database commit to switchover to standby with session shutdown
ERROR at line 1:
ORA-01105: mount is incompatible with mounts by other instancesPlus that when I want to apply the remaining steps (below step), should I do it on each instance alone? or is there anyway to do it using the srvctl command:
alter database mount standby database;Regards,Hi,
Since You are using 2 node RAc as primary, so for switchover operation you need to shutdown
one database instance( Suppose instance 2).
Suppose your node1:
hostname is dcpdb1
and node 2:
hostname is dcpdb2
and standby hostname is drpdb1
So follow this steps for switchover .
How to Switchover from Primary to Standby Database?
Process:
On the primary server, check the latest archived redo log and force a log switch.
*########### Login dcpdb1 as Oracle user #########*
SQL> SELECT sequence#, first_time, next_time
FROM v$archived_log
ORDER BY next_time;
SQL> ALTER SYSTEM SWITCH LOGFILE;
Check the new archived redo log has arrived at the standby server and been applied.
*########### Login drpdb1 as Oracle user #########*
SQL> SELECT sequence#, first_time, next_time, applied
FROM v$archived_log
ORDER BY next_time ;
*########### Login dcpdb2 as Oracle user #########*
SQL> SELECT sequence#, first_time, next_time
FROM v$archived_log
ORDER BY next_time ;
SQL> ALTER SYSTEM SWITCH LOGFILE;
Check the new archived redo log has arrived at the standby server and been applied.
*########### Login drpdb1 as Oracle user #########*
SQL> SELECT sequence#, first_time, next_time, applied
FROM v$archived_log
ORDER BY next_time ;
*########### Login dcpdb1 as Oracle user #########*
SQL> SELECT SWITCHOVER_STATUS FROM V$DATABASE;
SWITCHOVER_STATUS
TO STANDBY
*########### Login dcpdb2 as Oracle user #########*
SQL> SELECT SWITCHOVER_STATUS FROM V$DATABASE;
SWITCHOVER_STATUS
TO STANDBY
*########### Login drpdb1 as Oracle user #########*
SQL> SELECT SWITCHOVER_STATUS FROM V$DATABASE;
SWITCHOVER_STATUS
NOT ALLOWED
*########### Login dcpdb2 as Oracle user #########*
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL>
*########### Login dcpdb1 as Oracle user #########*
SQL> ALTER DATABASE COMMIT TO SWITCHOVER TO PHYSICAL STANDBY WITH SESSION SHUTDOWN;
Database altered.
SQL>
SQL> shutdown immediate
ORA-01507: database not mounted
ORACLE instance shut down.
SQL>
SQL> startup mount
ORACLE instance started.
Total System Global Area 1.5400E+10 bytes
Fixed Size 2184872 bytes
Variable Size 7751076184 bytes
Database Buffers 7616856064 bytes
Redo Buffers 29409280 bytes
Database mounted.
SQL> SELECT SWITCHOVER_STATUS FROM V$DATABASE;
SWITCHOVER_STATUS
TO PRIMARY
SQL>
*########### Login drpdb1 as Oracle user #########*
SQL> SELECT SWITCHOVER_STATUS FROM V$DATABASE;
SWITCHOVER_STATUS
SESSIONS ACTIVE
SQL> alter database commit to switchover to primary with session shutdown;
Database altered.
SQL> shutdown immediate
ORA-01109: database not open
Database dismounted.
ORACLE instance shut down.
SQL>
SQL> startup
ORACLE instance started.
Total System Global Area 1.5400E+10 bytes
Fixed Size 2184872 bytes
Variable Size 7717521752 bytes
Database Buffers 7650410496 bytes
Redo Buffers 29409280 bytes
Database mounted.
Database opened.
*########### Login dcpdb1 as Oracle user #########*
SQL> alter database open read only;
Database altered.
SQL> alter database recover managed standby database using current logfile disconnect;
Database altered.
*########### Login dcpdb2 as Oracle user #########*
SQL> startup mount
ORACLE instance started.
Total System Global Area 1.5400E+10 bytes
Fixed Size 2184872 bytes
Variable Size 7751076184 bytes
Database Buffers 7616856064 bytes
Redo Buffers 29409280 bytes
Database mounted.
SQL> alter database open read only;
Database altered.
SQL> alter database recover managed standby database using current logfile disconnect;
Database altered.
SQL> SELECT SWITCHOVER_STATUS FROM V$DATABASE;
SWITCHOVER_STATUS
NOT ALLOWED
SQL>
*########### Login drpdb1 as Oracle user #########*
SQL> SELECT SWITCHOVER_STATUS FROM V$DATABASE;
SWITCHOVER_STATUS
TO STANDBY
*########### Login dcpdb1 as Oracle user #########*
SQL> SELECT SWITCHOVER_STATUS FROM V$DATABASE;
SWITCHOVER_STATUS
NOT ALLOWED
SQL>
*########### Login dcpdb2 as Oracle user #########*
SQL> SELECT SWITCHOVER_STATUS FROM V$DATABASE;
SWITCHOVER_STATUS
NOT ALLOWED
SQL>
*####################### Finish SwitchOver ########################*
Check
*########### Login drpdb1 as Oracle user #########*
SQL> alter system switch logfile;
SQL>
SELECT sequence#, first_time, next_time
FROM v$archived_log
ORDER BY sequence#;
SQL> archive log list
*########### Login dcpdb1 as Oracle user #########*
SQL>
SELECT sequence#, first_time, next_time, applied
FROM v$archived_log
ORDER BY sequence#;
SQL> archive log list
*########### Login dcpdb2 as Oracle user #########*
SQL>
SELECT sequence#, first_time, next_time, applied
FROM v$archived_log
ORDER BY sequence#;
SQL> archive log list
Thanks
Solaiman
Edited by: 876149 on Apr 12, 2013 11:51 AM
Maybe you are looking for
-
Get error message when trying to open a file in Adobe Indesign
Hi, I would appreciate some help here. Just installed ID, and want to get started. When I try to open any file (pdf. jpg etc) I get the following message: "Can´t open file. It might be that Adobe ID don´t support the file format, that the plug-in-mod
-
I think when my contract expires on 01/26/2013 that I will not renew my contract with VZW. I'll still remain with VZW, I'll pay the full-retail price for whatever glitzy device is all the rage. I figure, $800 FRP, without the threat of an ETF is well
-
Best Practice of Maximum number of InfoCube Supported in a MultiCube
Hi Experts, I would kindly like to ask what is the maximum number of InfoCubes that should be added in a MultiCube that will not hamper the performance of the query? can you kindly provide some link if possible? MultiCube is Union of all InfoCubes ri
-
JSTL + Javascript array for dhtml menu??? any ideas
Hi, I am using the Tigra menu within creator. I have this working fine, but I need to generate a dynamic menu list based on a session bean string array . The javascript variable I use in the jsp file is: var MENU_ITEMS = [ ['Humanities', null], ['Art
-
Ipod won't recognise, sync, or charge!
the other day, i realised my ipod was flat out of battery, so i plugged it into my computer and then left it, assuming that it would charge.. like usual! so i checked up on it 5 minutes later.. and to my horror, the ipod had heated up, it wasnt on, n