Logical Standby & Primary site Time Diiference
Hi,
I have the one primary site over RAC configuration and one Logical standby
Site.We have configured the Logical standby for archived files. We would like to
know, how can we compute the time difference between Primary Site and Logical
Site ex. IF suppose some SCN XYZ is applying on logical standby site so when
the same SCN (XYZ) generate (time) on the primary site. We need exact time
difference between Primary site and Logical Site.
If there is any query or other method pls suggest to find out this information.
Thanks, Dewan
Hi,
From memory, I use this:SELECT
TO_CHAR(MIN(TIME),'YYYY-MM-DD HH24:MI:SS') OLDEST,
TO_CHAR(MAX(TIME),'YYYY-MM-DD HH24:MI:SS') NEWEST,
MAX(TIME)-MIN(TIME) DELTA FROM
SELECT L.SEQUENCE# SEQ, L.FIRST_TIME TIME,
(CASE WHEN L.NEXT_CHANGE# < P.READ_SCN THEN 'YES'
WHEN L.FIRST_CHANGE# < P.APPLIED_SCN THEN 'CURRENT'
ELSE 'NO' END) APPLIED
FROM DBA_LOGSTDBY_LOG L, DBA_LOGSTDBY_PROGRESS P
ORDER BY SEQUENCE#
WHERE APPLIED != 'YES';Regards,
Yoann.
PS: This does not work for Archived Redo Logs not yet sent to Logical Standby:
Message was edited by:
Yoann Mainguy
Similar Messages
-
Resynchronization in primary and logical standby db
Hi,
I have implemented logical standby successfully first time.for testing i had shutdown logical standby server for last 60 hours.
when i start standby db and execute command
"ALTER DATABASE START LOGICAL STANDBY APPLY IMMEDIATE;"
but it is not synchronized data for last 3 days
Please help me
Vaibhav Dixiti suppossed that you did : alter database open resetlog; right?
In first place, try to see any error in redo transport:
alter system switch logfile;
select status, error from v$archive_dest where dest_id = 2;
any error?
for more information, please check:
http://www.idevelopment.info/data/Oracle/DBA_tips/Data_Guard/DG_45.shtml -
[Logical Standby] Which table/SQL caused paging-out
We have a Primary-Logical DR configuration.
Recently, it has a problem with the logical: it's continuously paging out data from some transactions:
SELECT SUBSTR(name, 1, 40) AS NAME, SUBSTR(value,1,32) AS VALUE FROM GV$LOGSTDBY_STATS;
number of preparers 3
number of appliers 18
maximum SGA for LCR cache 4095
parallel servers in use 24
maximum events recorded 1000000
preserve commit order TRUE
transaction consistency FULL
record skip errors Y
record skip DDL Y
record applied DDL N
record unsupported operations Y
coordinator state IDLE
transactions ready 7
transactions applied 0
coordinator uptime 9646
realtime logmining Y
apply delay 0
Log Miner session ID 1
txns delivered to client 1068651
DML txns delivered 1017135
DDL txns delivered 15
CTAS txns delivered 0
Recursive txns delivered 51501
Rolled back txns seen 23463
LCRs delivered to client 11682189
bytes of redo processed 14475529508
bytes paged out 1482524624
seconds spent in pageout 8922
bytes checkpointed 0
seconds spent in checkpoint 0
bytes rolled back 7500032
seconds spent in rollback 90
seconds system is idle 0
SELECT SID, SERIAL#, SPID, TYPE, HIGH_SCN, STATUS_CODE, STATUS
FROM GV$LOGSTDBY_PROCESS
ORDER BY TYPE, SPID;
ANALYZER 16116 ORA-16116: no work available
APPLIER 16116 ORA-16116: no work available
APPLIER 16116 ORA-16116: no work available
APPLIER 16116 ORA-16116: no work available
APPLIER 16116 ORA-16116: no work available
APPLIER 16116 ORA-16116: no work available
APPLIER 16116 ORA-16116: no work available
APPLIER 16116 ORA-16116: no work available
APPLIER 16116 ORA-16116: no work available
APPLIER 16116 ORA-16116: no work available
APPLIER 16116 ORA-16116: no work available
APPLIER 16116 ORA-16116: no work available
APPLIER 16116 ORA-16116: no work available
APPLIER 16116 ORA-16116: no work available
APPLIER 16116 ORA-16116: no work available
APPLIER 16116 ORA-16116: no work available
APPLIER 16116 ORA-16116: no work available
APPLIER 16116 ORA-16116: no work available
APPLIER 16116 ORA-16116: no work available
BUILDER 16243 ORA-16243: paging out 4752 bytes of memory to disk
COORDINATOR 16116 ORA-16116: no work available
PREPARER 16127 ORA-16127: stalled waiting for additional transactions to be applied
PREPARER 16127 ORA-16127: stalled waiting for additional transactions to be applied
PREPARER 16127 ORA-16127: stalled waiting for additional transactions to be applied
READER 16127 ORA-16127: stalled waiting for additional transactions to be applied
select xidusn, xidslt, xidsqn, count(*) from system.logmnr_spill$
group by xidusn, xidslt, xidsqn;
996 46 249 254
710 37 838 825
623 3 706 254
478 7 42564 254
765 38 649 824
42 6 415494 3729
264 35 4817 3738
How can we identify the table/SQL to skip & instantiate it later so the logical DB will not being lag far behind.
Thank you.Hi,
Best way to find SQL is to mine the current archive log getting applied on standby and check for the SQL, you might not get the exact SQL, but you will get the object which is getting updated.
Or
You can use AWR report from logical standby of this time to find the update statement which is resource extensive.
There is no way to find the exact SQL on primary which is causing the issue on standby.
Regards
Anudeep -
Can a physical standby propagate data to a logical standby?
Here is my situation. I have a RAC database that currently has a physical standby (also RAC cluster) for disaster recovery (DR) and I am about to create an additional logical standby for real-time reporting. My customer is asking if I can also create a logical standby for reporting that resides in the DR environment that would be available in a disaster. My question is can a physical standby propagate data to a logical standby? Is there any special configuration that would be required and what might it be if this is possible?
Thanks.Hi,
Welcome. Yes it's possible, example in 11.2 :
A cascading standby database can cascade primary database redo to up to 30 cascaded destinations, each of which can be a physical, logical, or snapshot standby database.
http://download.oracle.com/docs/cd/E11882_01/server.112/e17022/log_transport.htm#SBYDB5122
Best regards
Phil -
Best Way to setup a disaster Recovery site for a logical standby database
I have a logical standby DB (L1DB) as a reporting db on the same machine as the primary (P1DB). We are planning on building a disaster recovery site with similar hardware and potentially have disk mirroring of atleast the redo log files.
The DR site can hold an additional physical standby (S1DB) for the primary (P1DB). I am trying to understand what would be the best way to setup the Disaster Recovery site for the L1DB logical stdby. Ideally, when the disaster happens, and I no longer have P1DB and L1DB, I should be able to switch to S1DB as the new primary. But how do I setup to have a L2DB that takes the place of L1DB and has its contents and can be setup as a logical standby of S1DB?If you already setup one logical standby, then you know how it works, so not sure what question you are asking ?
Personally I would setup L2DB as a standby of the original primary P1DB. Having downstream standby databases complicates things, and adds additional lag between primary transaction time and L2DB apply. -
Real time apply for logical standby
Hi
Oracle 11.2.0.3.0
I have a primary database orcl and logical standby database orcl_std.
Real time apply is enabled. I have standby redologs in both primary and standby sides and I`ve started recovery with below command:
ALTER DATABASE START LOGICAL STANDBY APPLY IMMEDIATE;
When I create a new table in primary database, I am unable to see it on standby database (Although real time apply is enabled)
However, when I switch log in primary, I can see the new table in standby database.
My question is, why realtime apply is not working in my scenerio ? I was expecting to see the new table immediately in standby database once it is created in primary database. Why am I supposed to wait for log switch in real time apply ?Using Real-Time Apply to Apply Redo Data Immediately
http://docs.oracle.com/cd/E11882_01/server.112/e25608/log_apply.htm#i1022881
1.What is compatible parameter, it should be 11.1
2.Try to check parameters mentioned in below link:
http://easyoradba.com/2011/01/10/real-time-apply-in-oracle-data-guard-10g/
Regards
Girish Sharma
Edited by: Girish Sharma on Nov 15, 2012 12:37 PM -
Creating logical standby from non primary backup
We want to test creation for logical standby in our test enviroment.
Here is the plan we are
1. Backup Prod.
2. Restore Test Primary (T1) and Restore test standby (T2) from Prod backup.
3. Setup standby between T1 and T2.
Plan is to save the time for backup and restore process. I have not doe it before. Will this process work or T2 restore needs to be done from backup of T1 as that would be primary.
Manuj969257 wrote:
Thanks Tobi.
I will try this. The test system is very large about 16TB and the backup/restore process takes days. I just wanted to be sure if the same backup would work for creating the primary and standby at the same time.
So in this case, I will just have to restore from backup and move forward with archivelogs. Will I have to use the control-file from Prod or from T1.
Use the control file from T1(test primary)
I would like to use the backup COPY.
General steps to follow:
1. restore T1 as the (test)primary DB.
2. recover/apply the T1 using the redo log.
3. restore T2 but do not apply redo to prevent it from divergence from T1. i mean, let T2 scn be behind T1 scn.
4. following the general steps as it apply to you in preparing and creating primary and standby DB
http://docs.oracle.com/cd/B19306_01/server.102/b14239/create_ps.htm
5. make sure T2 can receive and apply redo data from T1
6.covert T2 to logical standby DB
http://docs.oracle.com/cd/B19306_01/server.102/b14239/create_ls.htm
HTH
Tobi -
Real-time apply cascaded logical standby database
Hi
I have a primary database orcl
Pysical standby database orcl_std
Cascaded logical standby database orcl_tri which receives archivelogs from orcl_std
Real time apply is enabled both in orcl_std (physical standby) and orcl_tri (logical standby)
When I create a table in primary orcl, I am unable to see it on orcl_tri (Although real time apply is enabled)
However, when I switch log in primary, I can see the new table on orcl_tri.
My question is, why realtime apply is not working in my scenerio ?
orcl_std : ALTER DATABASE RECOVER MANAGED STANDBY DATABASE DISCONNECT FROM SESSION USING CURRENT LOGFILE;
orcl_tri: ALTER DATABASE START LOGICAL STANDBY APPLY IMMEDIATE;
Oracle 11.2.0.3.0Hi mseberg,
Thanks for your reply.
There is no load or network issue as I`ve just created these databases for the experiement.
I have the same output from standby and primary databases.
SQL> select bytes/1024/1024 from v$standby_log;
BYTES/1024/1024
10
10
10I can see below output in standby alertlog
Fri Nov 16 08:39:51 2012
ALTER DATABASE START LOGICAL STANDBY APPLY IMMEDIATE
ALTER DATABASE START LOGICAL STANDBY APPLY (orcl)
with optional part
IMMEDIATE
Attempt to start background Logical Standby process
Fri Nov 16 08:39:51 2012
LSP0 started with pid=37, OS id=16141
Completed: ALTER DATABASE START LOGICAL STANDBY APPLY IMMEDIATE
LOGMINER: Parameters summary for session# = 1
LOGMINER: Number of processes = 3, Transaction Chunk Size = 201
LOGMINER: Memory Size = 30M, Checkpoint interval = 150M
LOGMINER: SpillScn 1953318, ResetLogScn 995548
LOGMINER: summary for session# = 1
LOGMINER: StartScn: 0 (0x0000.00000000)
LOGMINER: EndScn: 0 (0x0000.00000000)
LOGMINER: HighConsumedScn: 1955287 (0x0000.001dd5d7)
LOGMINER: session_flag: 0x1
LOGMINER: Read buffers: 16
Fri Nov 16 08:39:55 2012
LOGMINER: session#=1 (Logical_Standby$), reader MS00 pid=30 OS id=16145 sid=49 started
Fri Nov 16 08:39:55 2012
LOGMINER: session#=1 (Logical_Standby$), builder MS01 pid=39 OS id=16149 sid=44 started
Fri Nov 16 08:39:55 2012
LOGMINER: session#=1 (Logical_Standby$), preparer MS02 pid=40 OS id=16153 sid=50 started
LOGMINER: Turning ON Log Auto Delete
LOGMINER: Begin mining logfile during commit scan for session 1 thread 1 sequence 202, +DATA/orcl_std/archivelog/2012_11_15/thread_1_seq_202.349.799450179
LOGMINER: End mining logfiles during commit scan for session 1
LOGMINER: Turning ON Log Auto Delete
LOGMINER: Begin mining logfile for session 1 thread 1 sequence 202, +DATA/orcl_std/archivelog/2012_11_15/thread_1_seq_202.349.799450179
LOGMINER: End mining logfile for session 1 thread 1 sequence 202, +DATA/orcl_std/archivelog/2012_11_15/thread_1_seq_202.349.799450179
Fri Nov 16 08:40:04 2012
LOGSTDBY Analyzer process AS00 started with server id=0 pid=41 OS id=16162
Fri Nov 16 08:40:05 2012
LOGSTDBY Apply process AS03 started with server id=3 pid=45 OS id=16175
Fri Nov 16 08:40:05 2012
LOGSTDBY Apply process AS04 started with server id=4 pid=46 OS id=16179
Fri Nov 16 08:40:05 2012
LOGSTDBY Apply process AS01 started with server id=1 pid=42 OS id=16167
Fri Nov 16 08:40:05 2012
LOGSTDBY Apply process AS05 started with server id=5 pid=47 OS id=16183
Fri Nov 16 08:40:05 2012
LOGSTDBY Apply process AS02 started with server id=2 pid=44 OS id=16171Do you think real-time apply wasnt setup properly ? -
When to use Real Time Apply for Logical standby..!!
Hello All,
I have been trying many ways to speed up the archival on primary and improve sql apply on logical standby, but still we are getting about 45-50 mins of delay between primary and logical standby.
We wanted to have our transactions applied on logical standby within couple minutes. Which i guess wont be possible in async mode.
That's why i am planning to implement Real Time apply between primary and logical standby.
Now since both our databases are too far away from each other (Primary is in US and logical is in India) would it be recommended to implement real time apply in such scenario? And if implemented would it affect Primary DB Performance?
Also if there might be some packet loss or network hitch would Primary will try again and keep logical DB in Sync with Primary?
Any help or suggestions would be great.
Thanks.yes, real time apply is recommended in your scenario.
however due to the geographical distance between your primary and standby; I would suggest to keep your standby in current mode - max performance ; ASYNC- itself. It would not affect the performace of the primary.
As long as you set the FAL parameters and configure tnsnames properly and ensure proper deletion policy for archivelog cleanup in primary ( so that it's not deleted before shipping if need be), you shouldn't find any problem with primary & standby synching.
Good Luck.
Cheers. -
Primary Archivelog Management When Using Logical Standby
I was wondering if anyone has seen or created a script to do archivelog management when using standby databases. We recently had an experience where our standby database and primary database got out of sync and we had to recreate the standby....I had hope to advoid this but it was easier than trying to recall tapes to retrieve the backups of the archivelogs from the primary.
Management on the logical side is fine. I know of the ability to delete log files on the logcial standby after they have been applied to the database. However, this does not address the issue of the management of archivelogs on the primary site. Does anyone have a script that only deletes the archivelogs from the primary site after they have been applied to the logical standby? Now this is a LOGICAL standby not a physical standby....RMAN has the capability of doing this for a physical standby but I don't know of any commands ro setup to allow it to do it for a logical standby.
Regards
TimEven with 1 TB of space I only have room enough for about 3 days worth of archivelogs. Working in the environment that I do, there is another group in charge of the ESAN which serves many different systems. They were wanting detail reasoning and justification why I needed 3 days worth of space when I requested it.
It is not truly a problem, there are always work arounds. I can restore from the backups, I can put in scripts to send out email notification when the standby falls to far behind the OE. However even with all that, I wanted to write a script that someone could run without having to check the system to delete the archivelogs if space becomes an issue on the production side.
I was just hoping to see if anyone had a script to do it already.
Thanks for all the input.
Regards
Tim -
Logical standby problem on primary DB updates
Hi all!
I am quite new to standby databases, but I managed to sucessfully setup logical standby (11g on linux).
However, I got some problem - when I try to insert some data into Primary DB using simple JDBC statements, I sometimes get exception:
java.sql.SQLException: ORA-16224: Database Guard is enabled
And this happens not all the time - sometimes I can insert and commit, but sometimes I get exception.
This never happens when I am trying to insert data directly from sqlplus or TOAD.
looks to me like java application sometimes is connecting to standby database.
any suggestions?
ThanksCheck for example, whether both DBs present the same service and whether you have an oracle net configuration like
myservice =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = host_A)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = host_B)(PORT = 1521))
(LOAD_BALANCE = yes)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = myservice)
)You should make sure that the productive service is only presented by the primary database. See this explanation:
http://prutser.files.wordpress.com/2008/12/client_connectivity.pdf
Kind regards
Uwe
http://uhesse.wordpress.com -
Time difference between physical and logical standby
Hi,
I have just been tasked on getting some info and setting up dataguard for some users for read-only/reporting purpose.
The 3 questions I am being asked are:
1. What is the time difference in applying changes from primary to physical standby compare to logical standby
2. What is the overhead maintenance of having a standby database?
3.What latency is involved?
I will be glad to have your input on this.
ThanksHi,
Physical Standy where its a read only DB.
Logs are applied.
Logical Standy where it can be Read / Write DB and the logs are applied in terms of SQL Statements.
Thanks & Regards,
Pavan Kumar N -
How to convert a Logical Standby DB to a Primary
Hi,
I have an issue with our Data Guarded cluster (two nodes, one Primary and one Logical Standby Oracle 10i DBs running on HP-UX 11.23)
The issue is that for some reasons the Primary and the Standby are out of sync in terms of archive log sequences.
For instance the primary shows:
Date: Feb-27-2009 14:02:33
ID DESTINATION STATUS ARCHIVED_THREAD# ARCHIVED_SEQ#
1 /db05/oradata/NSMS/archive/ VALID 1 864
2 stdby VALID 1 10
3 /db05/oradata/NSMS/archive/DR/ VALID 1 11
11 /db05/oradata/NSMS/archive/DR/ VALID 1 864
Report on Redo Log Gaps between Primary and Standby.
Date : Feb-27-2009 14:02:33
LAST_SEQ_RECD LAST_SEQ_SENT
863 864
But the STANDBY shows in the alert log:
LOGMINER: Begin mining logfile: /db05/oradata/NSMS/archive/DR/arch673877647_1_304.log
Fri Feb 27 12:51:36 2009
LOGMINER: End mining logfile: /db05/oradata/NSMS/archive/DR/arch673877647_1_304.log
Fri Feb 27 12:51:36 2009
LOGMINER: Begin mining logfile: /db05/oradata/NSMS/archive/DR/arch673877647_1_305.log
Fri Feb 27 12:51:39 2009
LOGMINER: End mining logfile: /db05/oradata/NSMS/archive/DR/arch673877647_1_305.log
since the DBA_LOGSTDBY_LOG contains on the STANDBY:
$ is_db_apply_current.sh
1 300 595040838 595042886 YES
1 301 595042886 595042919 YES
1 302 595042919 595096418 CURRENT
1 303 595096418 595127201 CURRENT
1 304 595127201 595159342 CURRENT
1 305 595159342 595207457 CURRENT
At this point I don't know how to cleanup the situation on the Standby.
I tried to resync completely form primary copying all datafiles and archives but still cannot reset the archive sequence on the STANDBY, so that it keeps looking for the wrong archives.
Thanks in advance !
MikeHi
Problem seems different then post heading."How to convert a logical standby to primary" stepts are follow.
On primary site.
1.On primary site "alter database prepare to switchover to logical standby".
2.On standby site "alter database prepare to switchover to parimary;
3.Check "select switchover_status from v$database to both sites.
4.At primary site When status becomes to_standby then "alter database commit to switchover to logical stanedby".
5.At stndby site "alter database commit to switchover to parimary".
6.After successfully switchover at new logical standby site "alter database stard logical standby apply".
For you problem ,Can you paste following from standby site.
1.select applied_sequence#,last_sequence# V$logstdby_progress.
2.select * from V$logstdby_stats
3.select * from v$archived_log
Also from primary site,
1.select * from v$log.
hope this will help U.
Tinku
Edited by: Tinku on Feb 27, 2009 8:39 PM -
Logical standby and Primary keys
Hi All,
Why primary keys are essential for creating logical standby database? I have created a logical standby database on testing basis without having primary keys on most of the tables and it's working fine. I have not event put my main DB in force logging mode.I have not event put my main DB in force logging mode. This is because, redo log files or standby redo logfiles transforms into set of sql statements to update logical standby.
Have you done any DML operations with nologging options and do you notice any errors in the alert.log? I just curious to know.
But I wanted to know that, while system tablespace in hot backup mode,In the absence of both a primary key and a nonnull unique constraint/index, all columns of bounded size are logged as part of the UPDATE statement to identify the modified row. In other words, all columns except those with the following types are logged: LONG, LOB, LONG RAW, object type, and collections.
Jaffar -
Doubt regarding switchover from logical standby to primary
I am using Oracle 10g databases on Linux environment
I was trying creating a data guard configuration and once I was successfully done I created a logical standby database from the physical standby . Then I was trying to do a switchover .
By mistake I gave the prepare switchover command in the logical standby before executing it in the primary . And then when I gave it in the primary both the status turned to be "PREPARING SWITCHOVER"
In logical standby
SQL> ALTER DATABASE PREPARE TO SWITCHOVER TO PRIMARY;
Database altered.
SQL> SELECT SWITCHOVER_STATUS FROM V$DATABASE;
SWITCHOVER_STATUS
PREPARING SWITCHOVER
In primary
SQL> ALTER DATABASE PREPARE TO SWITCHOVER TO LOGICAL STANDBY;
Database altered.
SQL> select switchover_status from v$database;
SWITCHOVER_STATUS
PREPARING SWITCHOVERNow I am not able to commit any of them to primary or logical standby
In primary
SQL> ALTER DATABASE COMMIT TO SWITCHOVER TO LOGICAL STANDBY;
ALTER DATABASE COMMIT TO SWITCHOVER TO LOGICAL STANDBY
ERROR at line 1:
ORA-16217: prepare to switchover has not completed
ORA-06512: at line 1
In logical standby
SQL> ALTER DATABASE COMMIT TO SWITCHOVER TO PRIMARY;
ALTER DATABASE commit TO SWITCHOVER TO PRIMARY
ERROR at line 1:
ORA-16109: failed to apply log data from previous primaryLet me know what should be done now ? Is there anyway to solve this issue ?Can you try using the following first on Primary and then on Standby?
ALTER DATABASE PREPARE TO SWITCHOVER CANCEL;
Maybe you are looking for
-
Macbook keyboard left/right arrow keys don't work
Hello everyone, First time here and first time to touch a Macbook - I'm in IT but on the other side of the fence. My partner's laptop is a Core2-Duo @ 2GHz which I've stuck 4GB of RAM and a newer SATA HDD into, I've also updated the firmware just in
-
Sales Information System (SIS) Reporting- Alternative Units of Measure
Guys, Does anyone know how can we view SIS Reports (either using Standard or Flexible Analysis) in Alternative Units of Measure? Currently, all the quantities (example Order Quantity) are displayed in Base Unit of Measure . Thanks a Lot
-
16:9 in Premiere???
Hallo, folgende Frage: Kann ich Filmmaterial, welches in 16:9 produziert wurde auch 16:9 in Premiere einlesen? Zwar kann ich die Widescreen-Einstellung auf 16:9 stellen, aber die Framegröße bleibt dennoch bei 720 x 576 ...und das Framegrößenfeld ist
-
Questions about iMac Core i7 Photoshop and Capture One performance.
Hello Everyone, I am in the market for a new Mac and was thinking about the iMac Core i7. Now my question is, how the performance in Photoshop is for that machine ? I work on 24 Mpix raws and occasionaly on 30-40+ Mpix raws from Medium Format cameras
-
Cache Mode 5 - BLOB/ Cluster Enhanced - Variables
Hello, I have a very large query that I need to cache for performance. I'm using cache mode 5 - BLOB/Cluster Enhanced. I see that for variables in Char Restrictions area, it creates a new entry in RSRCACHE under my query under new Variables/Hierarchi