Snapshot Isoation
Hi Everyone,
In the documentation related to snapshot isolation level it is mentioned that for better performance with MVCC
1) larger cache size should be used
2) shorter transacitons should be used.
This question is focused on second aspect.
In my application, There are two types of transactions,
a) first one is normal transaction started without any type of argument. This, we use for all write activities to DB.
b) other type of transaction is opened as snapshot transaction. This is used for all read activities.
I need to implement a couple of use cases, where I need to read full database in a single snapshot transaction. Therefore my question is that when we talk about keeping transactions short, is it write transactions or snapshot transactions. I know that ideally I should keep all the transactions short but this would help me in implementing the abovementioned functionality.
Thanks,
Shishir
Thanks a lot Ashok for this really nice explanation.
This precisely answers my question.
I have another question which is on snapshot isolation again. It will be great if you can answer that.
My application is basically user driven so I don't have much control on number of concurrent operations going on. I am using snapshot and default transactions both.
Few days back, on two different occasions, I had freezer files accumulated and following that database environment became really slow. I increased the cache and restarted environment and its behaving fine now.
My questions is that both the times db_stat -e looked fine (98% cache hit ratio etc). So what is the best way to find that this situtaion is about to happen ?
I know that its possible that there is no simple answer to this question but this will also help me with application footprint sizing. I can send you db_stat -e output for one of these incidents. Am pasting -m part of it here.
Thanks,
Shishir
===============================
512MB Total cache size
1 Number of caches
1 Maximum number of caches
512MB Pool individual cache size
0 Maximum memory-mapped file size
0 Maximum open file descriptors
0 Maximum sequential buffer writes
0 Sleep after writing maximum sequential buffers
0 Requested pages mapped into the process' address space
366M Requested pages found in the cache (98%)
5662872 Requested pages not found in the cache
28885 Pages created in the cache
5662887 Pages read into the cache
212793 Pages written from the cache to the backing file
6115927 Clean pages forced from the cache
1631 Dirty pages forced from the cache
0 Dirty pages written by trickle-sync thread
126503 Current total page count
126314 Current clean page count
189 Current dirty page count
65537 Number of hash buckets used for page location
377M Total number of times hash chains searched for a page (377476452)
10 The longest hash chain searched for a page
787M Total number of hash chain entries checked for page (787470619)
420893 The number of hash bucket locks that required waiting (0%)
6973 The maximum number of times any hash bucket lock was waited for (5%)
90M The number of region locks that required waiting (52%)
9962 The number of buffers frozen
1502 The number of buffers thawed
0 The number of frozen buffers freed
6387030 The number of page allocations
2856M The number of hash buckets examined during allocations (2856267125)
65873 The maximum number of hash buckets examined for an allocation
6117798 The number of pages examined during allocations
13 The max number of pages examined for an allocation
928725 Threads waited on page I/O
Pool File: MetadataDB
4096 Page size
0 Requested pages mapped into the process' address space
366M Requested pages found in the cache (98%)
5662872 Requested pages not found in the cache
28885 Pages created in the cache
5662887 Pages read into the cache
212793 Pages written from the cache to the backing file
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
22049/8823442 File/offset for last checkpoint LSN
Fri Sep 11 13:00:36 2009 Checkpoint timestamp
0x804ed335 Last transaction ID allocated
500000 Maximum number of active transactions configured
295 Active transactions
675 Maximum active transactions
5165877 Number of transactions begun
336 Number of transactions aborted
5165246 Number of transactions committed
4784 Snapshot transactions
34220 Maximum snapshot transactions
0 Number of transactions restored
185MB 24KB Transaction region size
215222 The number of region locks that required waiting (1%)
Similar Messages
-
Can not refresh snapshot changes after importing data of master site
Hello !
I have two database computer,one as master site,one as snapshot site.Because the error of the hard disk of master computer,I use the exporting data file to recover my database.after importing ,I found I can't refresh the refreshgroup on snapshot,who can tell me why?
thinks in advance!
(exp system/manager full=y inctype=complete file='/home/save/backdata/xhsdcomp.dat')
(imp system/manager inctype=system full=Y file='/home/save/backdata/xhsdcomp.dat'
imp system/manager inctype=restore full=Y file='/home/save/backdata/xhsdcomp.dat')
nullYou haven't listed the errors that you're receiving when attempting to refresh your refresh group, but if your snapshots are attempting to fast refresh, I suspect it's because the creation timestamp of the snapshot log on the master site is newer than the creation timestamp of the snapshot. In this case you will need to do a complete refresh of the snapshot (or drop and recreate the snapshot) before you will be able to fash refresh it again.
If this is not the case, please post the errors you are receiving when you attempt to refresh the refresh group.
HTH,
-- Anita
Oracle Support Services
null -
I am trying to print a snapshot taken from a PDF multiple times on one page.
Reader Will not print multiple copies of a snapshot on one page. I read the help files for Acrobat itself and all it said was take the snapshot and print it. Does anyone know if Acrobat can print multiple copies of the snapshot on one page?
From some reading in another forum page it looks like Acrobat can do it by saving the snapshot repeatedly with different names and the printing all of them at once. I really hate that workaround as I need to do this often.
Message was edited by: duckles10I tried to do it using Reader. I have a one page PDF document with a UPS shipping label on one side and a special box label with a barcode on the other. This is designed to print on a standard 8.5 x 11 sheet of paper. There are many times when I need to be able to print the box labels more than once. At home, I do it by taking a snapshot of the box label and printing it to a Label printer as many times as I need it. The distributor who also ships items for me only has a full page printer but he can print 4 on a page labels on UPS provided stock. Reader won’t print a snapshot multiple times, the option is grayed out. What I wanted to know is if Acrobat itself can print that snapshot multiple times. I don’t think it can without being able to cut and save that PDF multiple times as separate files. That would be a slow and cumbersome operation. If it would take a snapshot or a single cut and save and print that PDF 4 times on a page it would be a reason to spend the money to buy the program because we need to perform this operation OVER and OVER on a regular basis. On some shipments we might need to print 12 or more extra box labels. We tape smaller boxes together for one UPS label and need to make sure EACH box gets a separate label. Otherwise they sometimes get lost on the other end.
Doing the save 4 separate PDFs process we might actually need TWO copies of Acrobat unless reader can print 4 on a page if it has 4 PDF’s to work from. I have not yet found a good way to save those snapshots from reader. I have tried since I found that it was possible to cut and save them in other formats but not PDF’s as reader can’t save them. The quality of the saved items in other formats is not acceptable. I recently discovered that Microsoft publisher which I have can save a document as a PDF. I’m going to see if I can import to that program next. -
Creation of Database link and access the same plus Snapshot creation
i want talk between two oracle server. i decided to go for snapshot creation with periodical refresh. For which i am having two oracle server's with different ip address located inside our office setup.
I have created a database link between two servers.
first server name global
userid scott
password tiger
second server name asil
userid scott
password tiger
both the user have been given dba rights.
in both the server the services and listners are all started. i gave the following command to create database link.
from asil server
create public database link global connect by scott identified by tiger using 'global'
the command was successful and the link was created. Now i tried to access a table of the scott user of the global server.
select * from emp@global;
now it is giving error. I want to know how the link can be created and how it can be accessed. i refered the 8i online documentation and done the things based on that. i expect valuble solution from all possible persons
nullA reason for this problem could be that your database is configured that a database link has to have exactly the same name like the global name of the database instance it should connect to.
Can you please provide the oracle error code / message ? With this information there might be more hints I can give you. -
I am using 2008 R2 enterprise
when i tried to take the 2nd snapshot of a database, it says the logical filename doesn't exist in the source database.
any work around ?Can you show us how you take a snapshot?
CREATE DATABASE dbname_morning ON
( NAME = db_Data, FILENAME =
'C:\Program Files\Microsoft SQL Server\MSSQL12.MSSQLSERVER\MSSQL\Data\db_data_morning.ss' )
AS SNAPSHOT OF dbname;
GO
Best Regards,Uri Dimant SQL Server MVP,
http://sqlblog.com/blogs/uri_dimant/
MS SQL optimization: MS SQL Development and Optimization
MS SQL Consulting:
Large scale of database and data cleansing
Remote DBA Services:
Improves MS SQL Database Performance
SQL Server Integration Services:
Business Intelligence -
Can I save data in a snapshot from signal express 2013 LE?
Can I save data (in txt or excel format) from a snapshot from signal express 2013 LE? My data buffer is too larege to export to excel. When I try to take a snapshot, I do not see any data. Are snapshots supported in the LE mode? This is the free version that comes with the USB 6009 ADC.
Yes, the snapshot function is available for SignalExpress 2013 LE. Does the snapshot function as intended when you try other projects?
Daniel P. -
Updateable Snapshot changes not getting propagated
Hi,
I am using Oracle 8.1.7 with Updateable snapshot replication. When I do a dbms_snapshot.refresh as the repadmin user from the snapshot site, the changes I made to the table I am refreshing are not pushed to the master site. Also, the update is actually overwritten by the value that exists on the master site.
Here is the actual refresh call sql:
EXECUTE dbms_snapshot.refresh('scpa.dag', 'F', NULL, TRUE, TRUE, 1, 0, 0, TRUE);
What table can I look in to see whether or not my update on the snapshot site is queued.
I get no errors when I do the refresh.
Thanks,
ChrisTry check deferror view on master site. When you call refresh procedure you set parameter refresh_after_errors to True, so there can be same unresolved replication conflict. In DBA studio it is tab Errors for node
DB->Replication->Administration
If there are no record in deferror on master site, check if you snapshot is a member of snapshot group. If not changes is not propagated. -
Snapshot replication slow during purge of master table
I have basic snapshot/materialized view replication of a big table (around 6 million rows).
The problem that I run into is that when I run a purge of the master table at the master site (delete dml), the snapshot refresh time becomes slower. After the purge the snapshot refresh time goes back to the normal time interval.
I had thought that the snapshot does a simple select so any exclusive lock on the table should not hinder the performance.
Has anyone seen this problem before and if so what has been the workaround?
The master site and the snapshot site both are 8.1.7.4 and are both unix tru64.
I don't know if this has any relevence but the master database is rule based while the snapshot site is cost based.
thanks in advanceHello Alan,
Your problem is, to know inside a table-trigger if the actual DML was caused
by a replication or a normal local DML.
One way (I'm practising) to solve (in Oracle 8.1.7) this is the following:
You can use in the trigger code the functions DBMS_SNAPSHOT.I_AM_A_REFRESH(),
DBMS_REPUTIL.REPLICATION_IS_ON() and DBMS_REPUTIL.FROM_REMOTE()
(For details see oracle documentation library)
For example: a trigger (before insert of each row) at the master side
on a table which is an updatable snapshot:
DECLARE
site_x VARCHAR2(128) := DBMS_REPUTIL.GLOBAL_NAME;
timestamp_x DATE;
value_time_diff NUMBER;
BEGIN
IF (NOT (DBMS_SNAPSHOT.I_AM_A_REFRESH) AND DBMS_REPUTIL.REPLICATION_IS_ON) THEN
IF NOT DBMS_REPUTIL.FROM_REMOTE THEN
IF inserting THEN
:new.info_text := 'Hello table; this entry was caused by local DML';
END IF;
END IF;
END IF;
END;
By the way: I've got here at work nearly the same configuration, now in production since a year.
Kind regards
Steffen Rvckel -
Can a read-only snapshot site be refreshed from a read-only database?
Hi,
Here is the database configuration.
Database 1: master site
Database 2: has materialized views (read-only snapshot site)
If DB1 becomes read-only, is it possible to refresh the materialized views in DB2? I was told that it is not possible because some m$log tables in DB1 need to be updated when the DB2 is refreshed . If it is DB1 is read-only, the meta data tables can not be updated so the refresh will fail.
Does anybody have experience with a scenario like this?
Thanks very much.Why do you need to put the database in read only mode anyway. Why not control "readability" through security, ie roles. Then it won't really matter.
-
Why can't the snapshot be refreshed properly?
I have created a snapshot(read_only) but it can't be refreshed with the master table properly. I found that after I created the snapshot, any change made in the master table was not reflected in the snapshot table.
Here is my SQL statement for creating the snapshot.
CREATE SNAPSHOT testing
TABLESPACE XXX
STORAGE (INITIAL 32K NEXT 32K)
REFRESH NEXT sysdate+1
WITH ROWID
AS SELECT *
from master_table@master_site_database;
The SQL statement is to create the snapshot. and refresh the snapshot with master table every day.By executing the SQL,the snapshot is created successfully,but seem not to be freshed properly. The master_site_database, which the master_table locates, is Oracle version 7. The snapshot site database ,which the snapshot is created in, is Oracle version 8.
Any suggestions will be greatly appreciated. Thanks in advance.
HelenaPlease see our guidelines for accessing remote ejbs from clients in our EJB FAQ :
https://glassfish.dev.java.net/javaee5/ejb/EJB_FAQ.html
--ken -
New rows become deleted from snapshot sites after refresh
Hi buddy
I am facing problem in snapshot at snapshot sites.
I have oracle 8.0.5 4 database server machines.
all servers machines have O.S windows 2000 advance server
all servers machine have same oracle version ( 8.0.5 ).
there is Site A ( Master site ) site B ( snapshot site ) Site C ( snapshot site).
snapshot has been created at all snapshots sites ( B,C and at D)
snapshot log against each table are also present at master site ( Site A )
refresh group is present at snapshot site.
these are working since feb-2002 successfully. now problem occur in these sites if some miner issues comes then it has been resolved successfully.
Replication parameter in init.ora all all sites are as follows
global_names = true
job_queue_processes = 2
job_queue_interval = 60
job_queue_keep_connections = false
distributed_lock_timeout = 60
distributed_transactions = 16
open_links = 4
snapshot_refresh_interval = 60
snapshot_refresh_keep_connections=false
snapshot_refresh_processes = 2
few days ago one problem occurs in master site A. it become crashed. we did its recovery from previous night backup ( cold backup).
Now all branches are working. but my current problem is that we have 20 tables in replication.It is a snapshot replication old version of materialized view.
when site B start refresh procedure then it show message procedure successfully completed.
it show no error message.
but when we check no of rows at snapshot site ( site b )
all new rows which were inserted at snapshot ( site b ) after previous refresh has been deleted.
mean all data which is inserted after previous refresh command has been finished. but data which is inserted at master site is present at snapshot site after refresh.
this problem is present at all the snapshot sites ( site B, Site C and site D).
database link is also present from master to snapshot site anf from snapshot to master. but problem is still suspended.
i have checked at all snapshot site and master site there is no invalid procedure or package.
there is no error message in alert file at all site.
if any body has its solution kindly told me.
thanks in advance
Abdul Hameed
[email protected]This is still going on when the page fails the call to getCurrentRow().refresh(Row.REFRESH_REMOVE_NEW_ROWS) goes out to lunch and stops processing for the rest of the function. I tried adding a try catch around it but nothing is caught and the function still fails.
getSiteMealLogsV().getCurrentRow().refresh(Row.REFRESH_REMOVE_NEW_ROWS);
---Stops working here -----
getSiteMealLogsV().clearCache();
getDBTransaction().commit();
Jim -
One read_only snapshot can not be refreshed?
Hi,
I have created a read_only snapshot in the snapshot site(Oracle 8.1.6). The master table is a view table in the master site( Oracle 7.3.4).The master site has install the replication option and the snapshot site doesn't install the replication option.
Here is my script to create snapshot in snapshot site:
CREATE SNAPSHOT testing
TABLESPACE hyper_d01
STORAGE (INITIAL 32K NEXT 32K)
REFRESH NEXT sysdate + 1
WITH ROWID
AS SELECT *
from testing@mastersite;
/****end **/
The snapshot has been created successfully.
I found this snapshot doesn't refresh everyday after I created it. It doesn't change after I created it.
I can manually refresh it by running this command in snapshot site:
execute dbms_snapshot.refresh('testing');
It did complete refresh and It worked.
I am confused...
Could anyone tell me what could cause the scheduled refresh fail?
-Do I need to ask DBA to give me special privillage to do automaticlally refresh?
-Does the difference between Oracel 7 and Oracle 8 cause the scheduled refresh fail?
One more question:
Does Oracel 7.3.4 support primary key type snapshot?
I tried to create the primary key type snapshot in Oracle 8.3.4 for the master table in oracle 7.3.4, I got error message.
Thanks in advanced,
Helena WangHow did you create the database link?
We were testing it here, and when we had created the database
link using the syntax "create database link mastersite using
'mastersite';", it doesn't work.
It only works when the database link is created using the syntax
"create database link mastersite connect to user identified by
password using 'mastersite';"
The person that realized it was one of the DBAs that works with us.
I hope it helps you.
Regards
Angie -
Server 1 : Oracle 7.3.4 (as a Master site)
Server 2 : Oracle 7.3.4 (as a Snopshot site)
Client PC: SQL*Plus (Oracle 7.3.4 Client)
Step 1: on Client PC, start 2 SQL*Plus dialog Windows,
one(Window A) for <Server 1> , another(Window B) for <Server 2>;
Step 2: on <Window A> do:
SQL>connect scott/tiger@Server1
SQL>CREATE SNAPSHOT LOG ON scott.dept ;
SQL>select * from dept;
DEPTNO DNAME LOC
10 AAAAAA AAAAA
20 BBBBBB AAAAA
30 CCCCCC AAAAA
Step 3: on <Window B> do:
SQL>connect scott/tiger@Server2
SQL>CREATE DATABASE LINK oracle USING 'Server1';
SQL>CREATE SNAPSHOT all_dept REFRESH fast
start with sysdate NEXT SYSDATE+1/(24*60)
AS SELECT * FROM scott.dept@oracle;
-- refresh interval: 1 minute
SQL>select * from all_dept;
DEPTNO DNAME LOC
10 AAAAAA AAAAA
20 BBBBBB AAAAA
30 CCCCCC AAAAA
Step 4: on <Window A> do:
SQL>insert into dept values (50,'MMMMMM','NNNNN');
SQL>commit;
SQL>select * from dept;
DEPTNO DNAME LOC
10 AAAAAA AAAAA
20 BBBBBB AAAAA
30 CCCCCC AAAAA
50 MMMMMM NNNNN
<one or two minutes later ... ... >
Step 5: on <Window B> do:
SQL>select * from all_dept;
DEPTNO DNAME LOC
10 AAAAAA AAAAA
20 BBBBBB AAAAA
30 CCCCCC AAAAA
conclusion: Simple snapshot can not refresh automatically ???????
SQL>exec DBMS_SNAPSHOT.REFRESH( list => 'all_dept',method => 'F');
SQL>select * from all_dept;
DEPTNO DNAME LOC
10 AAAAAA AAAAA
20 BBBBBB AAAAA
30 CCCCCC AAAAA
50 MMMMMM NNNNN
conclusion:Simple snapshot can refresh manually.
How to solve this problem?????
Thank you very much
Zhang Ming-anWhen you are manually refreshing the snapshot as scott/tiger, and your database link was defined with a 'connect to/identified by ' clause, your login credentials will be scott/tiger. When the refresh happens from the job queue, it does not use those credentials, It uses some default set. What you should probably do is:
1. create public database link Oracle using 'server1';
2. as scott/tiger, create database link Oracle connect to scott identified by tiger;
3. your automatic refresh should work now. -
Can not "select" partitioning snapshot ?
I can create partitioning snapshot ( Oracle 8 ) , but I can
issue SELECT statement with partition-extended object name
Ex : Selet * from snapshot_name patition ( par_name )
How to SELECT data from snapshot with partition-extended object
name ?
nullI can create partitioning snapshot ( Oracle 8 ) , but I can
issue SELECT statement with partition-extended object name
Ex : Selet * from snapshot_name patition ( par_name )
How to SELECT data from snapshot with partition-extended object
name ?
null -
I'm having problems backing up a Hyper-V virtualized Exchange 2007 server with DPM 2012. The guest has one VHD for the OS, and two pass-through volumes, one for logs and one for the databases. I have three protection groups:
System State - protects only the system state of the mail server, runs at 4AM every morning
Exchange Databases - protects the Exchange stores, 15 minute syncs with an express full at 6:30PM every day
VM - Protecting the server hosting the Exchange VM. Does an child partition snapshot backup of the Exchange server guest with an express full at 9:30PM every day
The problem I'm experiencing is that every time the VM express full completes I start receiving errors on the Exchange Database synchronizations stating that a log file discontinuity was detected. I did some poking around in the logs on the Exchange server
and sure enough, it looks like the child partition snapshot backup is causing Exchange to truncate the log files even though the logs and databases are on pass-through disks and aren't covered by the child partition snapshot.
What is the correct way to back up an entire virtualized Exchange server, system state, databases, OS drive and all?I just created a new protection group. I added "Backup Using Child Partition Snapshot\MailServer", short-term protection using disk, and automatically create the replica over the network immediately. This new protection group contains only the child partition
snapshot backup. No Exchange backups of any kind.
The replica creation begins. Soon after, the following events show up in the Application log:
=================================
Log Name: Application
Source: MSExchangeIS
Date: 10/23/2012 10:41:53 AM
Event ID: 9818
Task Category: Exchange VSS Writer
Level: Information
Keywords: Classic
User: N/A
Computer: PLYMAIL.mcquay.com
Description:
Exchange VSS Writer (instance 7d26282d-5dec-4a73-bf1c-f55d5c1d1ac7) has been called for "CVssIExchWriter::OnPrepareSnapshot".
=================================
Log Name: Application
Source: ESE
Date: 10/23/2012 10:41:53 AM
Event ID: 2005
Task Category: ShadowCopy
Level: Information
Keywords: Classic
User: N/A
Computer: PLYMAIL.mcquay.com
Description:
Information Store (3572) Shadow copy instance 2051 starting. This will be a Full shadow copy.
=================================
The events continue on, basically snapshotting all of Exchange. From the DPM side, the total amount of data transferred tells me that even though Exhange is trunctating its logs, nothing is actually being sent to the DPM server. So this snapshot operation
seems to be superfluous. ~30 minutes later, when my regularly scheduled Exchange job runs, it fails because of a log file discontinuity.
So, in this case at least, a Hyper-V snapshot backup is definitely causing Exchange to truncate the log files. What can I look at to figure out why this is happening?
Maybe you are looking for
-
I have tried 8 to 10 times to uninstall and reinstall Firefox 4. I have since checked my firewall settings and firefox is allowed. It simply just will not open for me. I previously have had firefox and it was simply an update from the 3.6 version. I
-
What are the settings for Primere Elements 9 if I've filmed with a Canon Powershot sx50 HS?
I just got this camera and I want the best quality possible. Unfortunately, it's hard for me to fully know if the settings I try create that. I get a fuzz or noise on objects like if I'm wearing a black jacket it's like static. When I put the video o
-
Just installed ODT 11.1.0.6.20 but can't find Oracle Explorer
I downloaded and installed the latest ODT but there is no Oracle Explorer under the View menu option of VS2008. Installation went fine with no errors. I could see the new debugging options under the Tools menu option. I even uninstalled just the deve
-
The Error code (-3256)
The fix posted by Apple for being unable to connect to remote speakers, (-3256), is not working for me. With my situation, restarting iTunes allows it to connect. Then it works fine until my computer goes to sleep, after which, it will give me the er
-
Don't know why but the dictionary in my iBooks won't download. Used to work perfectly with the last operating system. Help!