freetds AT lists.ibiblio.org
Subject: FreeTDS Development Group
List archive
Re: [freetds] freebcp transaction isolation level when 'bcp out'
- From: matthew.green AT datamartcomputing.com
- To: "FreeTDS Development Group" <freetds AT lists.ibiblio.org>
- Subject: Re: [freetds] freebcp transaction isolation level when 'bcp out'
- Date: Tue, 28 Apr 2015 11:02:21 +0000
Hi Ed,
I think adding an option could be a useful for some people. A work around
would be to use a login script to set the isolation level.
Coming back to adding a flag for this I think the processing would be similar
to the text size flag, just without a value... if that helps.
Cheers,
Matthew.
April 28 2015 12:17 PM, "Ed Avis" <eda AT waniasset.com> wrote:
> I run freebcp to make scheduled hourly backups of some tables. These are not
> a replacement for the normal database backup, but can be handy as a way to
> quickly recover from minor screwups or as a way to grep the history of a
> table
> over time.
>
> The tables being dumped are usually small and append-only - so new rows are
> added to them from time to time but rows are not updated and rarely deleted.
>
> Sometimes I find that the freebcp process gets blocked by some other process
> adding rows to one of these tables. I would be quite happy to do
>
> set transaction isolation level read uncommitted
>
> That would stop freebcp being blocked (or blocking anything else). It means
> that you can see rows which have been added by some other process and not
> yet
> committed, but for this particular application this is not an issue. I am
> happy to make that tradeoff in order to make the hourly dumps not get in the
> way of anything else.
>
> So I would like a way to tell freebcp what transaction isolation level to
> use.
> I see in bcp.c that it simply works by
>
> tds_submit_queryf(tds, "select * from %s", dbproc->bcpinfo->tablename)
>
> in other words there is no special magic for 'bcp out' - really it is just
> a convenience to dump the rows in the same format that can later be 'bcp
> in'.
>
> Could freebcp have an option to run some extra SQL before the 'select'?
>
> freebcp database..table out outfile -c \
> -q 'set transaction isolation level read uncommitted'
>
> I think I could hack this up; would the patch be accepted?
>
> --
> Ed Avis <eda AT waniasset.com>
>
> _______________________________________________
> FreeTDS mailing list
> FreeTDS AT lists.ibiblio.org
> http://lists.ibiblio.org/mailman/listinfo/freetds
-
[freetds] freebcp transaction isolation level when 'bcp out',
Ed Avis, 04/28/2015
- Re: [freetds] freebcp transaction isolation level when 'bcp out', matthew . green, 04/28/2015
- Re: [freetds] freebcp transaction isolation level when 'bcp out', Frediano Ziglio, 04/29/2015
Archive powered by MHonArc 2.6.24.