Showing posts with label logs. Show all posts
Showing posts with label logs. Show all posts

Tuesday, March 20, 2012

removing the logs

does anyone know if there is a way to remove transaction
logs applied to database that was restored in a standby
mode ? i want to be able to read data from a database
restored from a full db backup before the tran logs were
applied.
Thanks very much,
Natasa
Restores only go forward, not backward. You will have to restore the
databas to an earlier point in time.
Geoff N. Hiten
Microsoft SQL Server MVP
Senior Database Administrator
Careerbuilder.com
I support the Professional Association for SQL Server
www.sqlpass.org
"natasa" <anonymous@.discussions.microsoft.com> wrote in message
news:041a01c4dc6f$a4b59260$a601280a@.phx.gbl...
> does anyone know if there is a way to remove transaction
> logs applied to database that was restored in a standby
> mode ? i want to be able to read data from a database
> restored from a full db backup before the tran logs were
> applied.
> Thanks very much,
> Natasa

removing the logs

does anyone know if there is a way to remove transaction
logs applied to database that was restored in a standby
mode ? i want to be able to read data from a database
restored from a full db backup before the tran logs were
applied.
Thanks very much,
NatasaRestores only go forward, not backward. You will have to restore the
databas to an earlier point in time.
--
Geoff N. Hiten
Microsoft SQL Server MVP
Senior Database Administrator
Careerbuilder.com
I support the Professional Association for SQL Server
www.sqlpass.org
"natasa" <anonymous@.discussions.microsoft.com> wrote in message
news:041a01c4dc6f$a4b59260$a601280a@.phx.gbl...
> does anyone know if there is a way to remove transaction
> logs applied to database that was restored in a standby
> mode ? i want to be able to read data from a database
> restored from a full db backup before the tran logs were
> applied.
> Thanks very much,
> Natasa

Friday, March 9, 2012

Removing out of hours time

Hello Chaps,

Just a little sounding on removing out of hours from some datetime
date that I have.
Basically we have a helpdesk that logs calls when they are entered and
when they are resolved. Now, if this happens during the day we just
subtract one date from the other to give the time it took to resolve
the issue. If it is not solved during the day we have an additional 11
hours to add due to people going home and not worrying about peoples
printers which is good but it buggers up stats that I'm trying to
produce.

I haven't got anywhere with this at the mo and am looking at a routine
that compares the resolved time and see's is there is more that 24
hours difference and if so remove 11 hours but wondered if you bright
sparks had any ideas
(also once I write something I tend to find the answer straight after
to confirm me stoppidity).
Any ideas let us know.

GintersJohn McGinty wrote:
> Hello Chaps,
> Just a little sounding on removing out of hours from some datetime
> date that I have.
> Basically we have a helpdesk that logs calls when they are entered and
> when they are resolved. Now, if this happens during the day we just
> subtract one date from the other to give the time it took to resolve
> the issue. If it is not solved during the day we have an additional 11
> hours to add due to people going home and not worrying about peoples
> printers which is good but it buggers up stats that I'm trying to
> produce.
> I haven't got anywhere with this at the mo and am looking at a routine
> that compares the resolved time and see's is there is more that 24
> hours difference and if so remove 11 hours but wondered if you bright
> sparks had any ideas
> (also once I write something I tend to find the answer straight after
> to confirm me stoppidity).
> Any ideas let us know.
> Ginters

Have you looked at the DATEDIFF() and DATEADD() functions, they seem to
be just what you need. :D

Zach|||Cheers Zach your right with the datediff and here's how I think yon
remove out of hours time (there is few issues if you can spot them!)

1. Helpdesk opens at 9am and closes at 6pm

select issue_name, date_submitted, date_resolved,
-- so we display the issue name, the time it was added and the time it
was resolved. Not interested in ones not resolved.

datediff(minute, date_submitted, date_resolved) as 'Diff_Min',
--difference in minutes. Shows me the time to resolve in minutes

datediff(day, date_submitted, date_resolved) as 'Diff_Day',
--number of days before resolution.

datediff(day, date_submitted, date_resolved) * (15*60) as 'Difference',
--This takes the total number of days and subtracts the dead time which
in this case is 15 hours and then multiplies this by 60 to get the
minutes. This is the total dead time in minutes.

datediff(minute, date_submitted, date_resolved)-datediff(day,
date_submitted, date_resolved) * (13*60) as 'DiffTo_min',
--subtracting the total minutes by the dead time minutes gives me the
total 'live minutes'

(datediff(minute, date_submitted, date_resolved)-datediff(day,
date_submitted, date_resolved) * (13*60))/60 as 'DiffTo_hrs'
-- this is the same as above but in hours.
from test_table2

What dya think?

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!|||John McGinty wrote:
> Cheers Zach your right with the datediff and here's how I think yon
> remove out of hours time (there is few issues if you can spot them!)
> <snipped>
> What dya think?

Heh, I think that without DDL and sample data reading that makes my head
hurt. :D

Zach

removing logs

I have over 200 log files with a date and timestamp in the filename in the
Reporting Services\LogFiles folder that are 33MB each. This is a development
machine. How do I get rid of them? Can I just delete them?
Thanks,
--
Dan D.You can delete, it creates again, but I dont think you require this much log
files for your development server. For production yes you need to have a
backup. Before deleting keep a backup or Zip all the log files and keep it in
a seperate place.
If it is so important, you can run a program which is available in the
samples to read the log files and reporting.
and ofcourse schedule it to remove. default it keeps it for 60 days.
Amarnath
"Dan D." wrote:
> I have over 200 log files with a date and timestamp in the filename in the
> Reporting Services\LogFiles folder that are 33MB each. This is a development
> machine. How do I get rid of them? Can I just delete them?
> Thanks,
> --
> Dan D.|||I never thought about log files for reportserver. Most of the files are
small, under 50K. I don't know what was in the files that were so large.
I removed them.
Thanks,
--
Dan D.
"Amarnath" wrote:
> You can delete, it creates again, but I dont think you require this much log
> files for your development server. For production yes you need to have a
> backup. Before deleting keep a backup or Zip all the log files and keep it in
> a seperate place.
> If it is so important, you can run a program which is available in the
> samples to read the log files and reporting.
> and ofcourse schedule it to remove. default it keeps it for 60 days.
> Amarnath
> "Dan D." wrote:
> > I have over 200 log files with a date and timestamp in the filename in the
> > Reporting Services\LogFiles folder that are 33MB each. This is a development
> > machine. How do I get rid of them? Can I just delete them?
> >
> > Thanks,
> > --
> > Dan D.

Wednesday, March 7, 2012

Removing Extra Transaction Logs

I created some extra transaction logs for a database because of a lack of space however I want to now get rid of those and only have one primary transaction log. I cannot move data into other files like you can with a filegroup, how do I get rid of the files ?Originally posted by yorkie
Q1 I created some extra transaction logs for a database because of a lack of space however I want to now get rid of those and only have one primary transaction log. I cannot move data into other files like you can with a filegroup, how do I get rid of the files ?

-- A1 First empty the TL file(s) then remove it (them) from the DB. For example:

dbcc ShrinkFile('TL_FileName', EmptyFile)
Go

-- Then alter the DB to remove it

Alter Database DBName
Remove File TL_FileName
Go|||Thanks, worked a treat.