Showing posts with label files. Show all posts
Showing posts with label files. Show all posts

Tuesday, March 27, 2012

BackUp SQLEXPRESS mdf files

Hi All,

I searched the archives but I could not find any useful stuff for me.

I can backup a database on SQLExpress like

USE master
EXEC sp_addumpdevice 'disk', 'Store_1', 'c:\Store_1.dat'
BACKUP DATABASE Store TO Store_1

Here is my problem:

If I use logins,roles etc. in an application automatically a mdf file is created. Or I can create a new sql database. SQLExpress dynamically use the mdf file when connection string defined.

This mdf file is not defined as a database on SQLExpress. Because SQLExpress has not a gui, I cannot see the registered database.

How can I backup any sqlexpress mdf file without deattaching or attaching?

Thanks

That has changed there is now a Management tool now download it install it and use the backup and restore wizard or modify the code in the thread below and use it. Hope this helps.

http://forums.asp.net/thread/1049663.aspx
http://msdn.microsoft.com/vstudio/express/sql/compare/default.aspx

Backup SQL Server to another server - abnormal termination

I have just changed some SQL Server database backups to back up files
directly to another server (other than where SQL Server resides), and
I'm getting an 'abnormal termination' message. But it looks like the
backups have been completed. I'm able to restore the database from the
backup created and there appears to be no problem. Does anyone know
why the abnormal termination message is appearing? If I'm able to
restore successfully from the backup, is there something else I should
be looking for to verify that the backup really did complete?
ThanksHere is the checklist:
HowTo: Backup to UNC name using Database Maintenance Wizard
http://support.microsoft.com/?kbid=555128
--
Geoff N. Hiten
Senior Database Administrator
Microsoft SQL Server MVP
<innis1@.sbcglobal.net> wrote in message
news:1163024266.615317.129380@.f16g2000cwb.googlegroups.com...
>I have just changed some SQL Server database backups to back up files
> directly to another server (other than where SQL Server resides), and
> I'm getting an 'abnormal termination' message. But it looks like the
> backups have been completed. I'm able to restore the database from the
> backup created and there appears to be no problem. Does anyone know
> why the abnormal termination message is appearing? If I'm able to
> restore successfully from the backup, is there something else I should
> be looking for to verify that the backup really did complete?
> Thanks
>|||I've checked out the requirements and all have been met, yet I'm still
getting the message that the backup is failing. The backup files are
created, and I'm able to restore from them, but I'm concerned that
something still isn't happening properly and once a production database
needs to be restored I will have problems.
Geoff N. Hiten wrote:
> Here is the checklist:
> HowTo: Backup to UNC name using Database Maintenance Wizard
> http://support.microsoft.com/?kbid=555128
> --
> Geoff N. Hiten
> Senior Database Administrator
> Microsoft SQL Server MVP
>
>
> <innis1@.sbcglobal.net> wrote in message
> news:1163024266.615317.129380@.f16g2000cwb.googlegroups.com...
> >I have just changed some SQL Server database backups to back up files
> > directly to another server (other than where SQL Server resides), and
> > I'm getting an 'abnormal termination' message. But it looks like the
> > backups have been completed. I'm able to restore the database from the
> > backup created and there appears to be no problem. Does anyone know
> > why the abnormal termination message is appearing? If I'm able to
> > restore successfully from the backup, is there something else I should
> > be looking for to verify that the backup really did complete?
> >
> > Thanks
> >|||The only other thing I have seen is if you are doing a Backup with verify,
the SQL server can ask for the file to be opened faster than the file server
can close and reopen it. Try removing the verify option (your restore tests
are the only true verification anyway) and see if that helps.
--
Geoff N. Hiten
Senior Database Administrator
Microsoft SQL Server MVP
<innis1@.sbcglobal.net> wrote in message
news:1163702473.811707.94770@.h54g2000cwb.googlegroups.com...
> I've checked out the requirements and all have been met, yet I'm still
> getting the message that the backup is failing. The backup files are
> created, and I'm able to restore from them, but I'm concerned that
> something still isn't happening properly and once a production database
> needs to be restored I will have problems.
>
> Geoff N. Hiten wrote:
>> Here is the checklist:
>> HowTo: Backup to UNC name using Database Maintenance Wizard
>> http://support.microsoft.com/?kbid=555128
>> --
>> Geoff N. Hiten
>> Senior Database Administrator
>> Microsoft SQL Server MVP
>>
>>
>> <innis1@.sbcglobal.net> wrote in message
>> news:1163024266.615317.129380@.f16g2000cwb.googlegroups.com...
>> >I have just changed some SQL Server database backups to back up files
>> > directly to another server (other than where SQL Server resides), and
>> > I'm getting an 'abnormal termination' message. But it looks like the
>> > backups have been completed. I'm able to restore the database from the
>> > backup created and there appears to be no problem. Does anyone know
>> > why the abnormal termination message is appearing? If I'm able to
>> > restore successfully from the backup, is there something else I should
>> > be looking for to verify that the backup really did complete?
>> >
>> > Thanks
>> >
>

backup SQL server databases

Hi,
At the moment I use a SQL job to make dumps of SQL server databases to
the file system. A few hours later I backup these files to tape.
Now I want to connect both processes. In the backup program I can
start .bat files and catch the error level of the batch file. But is
it possible to start a SQL server job from command line and to catch
the outcome of the SQL backup process (so that the backup to tape only
starts when the backup to disk succeeds)?
Many thanks in advance,
Stijn.
You can start a job using sp_start_job. But jobs are executed asynchronously. This means that you
cannot reliably "wait" until end of execution and then report back the error. So, I suggest you grab
whatever TSQL you have in your job, put it in a script file and execute that using SQLCMD.EXE (or
OSQL.EXE depending on version of SQL Server).
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi
<stijn.calders@.gmail.com> wrote in message
news:1183967597.475367.257660@.o61g2000hsh.googlegr oups.com...
> Hi,
> At the moment I use a SQL job to make dumps of SQL server databases to
> the file system. A few hours later I backup these files to tape.
> Now I want to connect both processes. In the backup program I can
> start .bat files and catch the error level of the batch file. But is
> it possible to start a SQL server job from command line and to catch
> the outcome of the SQL backup process (so that the backup to tape only
> starts when the backup to disk succeeds)?
> Many thanks in advance,
> Stijn.
>

backup SQL server databases

Hi,
At the moment I use a SQL job to make dumps of SQL server databases to
the file system. A few hours later I backup these files to tape.
Now I want to connect both processes. In the backup program I can
start .bat files and catch the error level of the batch file. But is
it possible to start a SQL server job from command line and to catch
the outcome of the SQL backup process (so that the backup to tape only
starts when the backup to disk succeeds)?
Many thanks in advance,
Stijn.You can start a job using sp_start_job. But jobs are executed asynchronously. This means that you
cannot reliably "wait" until end of execution and then report back the error. So, I suggest you grab
whatever TSQL you have in your job, put it in a script file and execute that using SQLCMD.EXE (or
OSQL.EXE depending on version of SQL Server).
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi
<stijn.calders@.gmail.com> wrote in message
news:1183967597.475367.257660@.o61g2000hsh.googlegroups.com...
> Hi,
> At the moment I use a SQL job to make dumps of SQL server databases to
> the file system. A few hours later I backup these files to tape.
> Now I want to connect both processes. In the backup program I can
> start .bat files and catch the error level of the batch file. But is
> it possible to start a SQL server job from command line and to catch
> the outcome of the SQL backup process (so that the backup to tape only
> starts when the backup to disk succeeds)?
> Many thanks in advance,
> Stijn.
>

backup SQL server databases

Hi,
At the moment I use a SQL job to make dumps of SQL server databases to
the file system. A few hours later I backup these files to tape.
Now I want to connect both processes. In the backup program I can
start .bat files and catch the error level of the batch file. But is
it possible to start a SQL server job from command line and to catch
the outcome of the SQL backup process (so that the backup to tape only
starts when the backup to disk succeeds)?
Many thanks in advance,
Stijn.You can start a job using sp_start_job. But jobs are executed asynchronously
. This means that you
cannot reliably "wait" until end of execution and then report back the error
. So, I suggest you grab
whatever TSQL you have in your job, put it in a script file and execute that
using SQLCMD.EXE (or
OSQL.EXE depending on version of SQL Server).
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi
<stijn.calders@.gmail.com> wrote in message
news:1183967597.475367.257660@.o61g2000hsh.googlegroups.com...
> Hi,
> At the moment I use a SQL job to make dumps of SQL server databases to
> the file system. A few hours later I backup these files to tape.
> Now I want to connect both processes. In the backup program I can
> start .bat files and catch the error level of the batch file. But is
> it possible to start a SQL server job from command line and to catch
> the outcome of the SQL backup process (so that the backup to tape only
> starts when the backup to disk succeeds)?
> Many thanks in advance,
> Stijn.
>

backup SQL Server 2005

I want to know how can I make the daily backup of SQL Server on a backup media?

1. what files I should backup?

2. Do I have stop all connections during backup or it's possibel to take it online?

No need to stop the connection or take database offline. SQL Server can take backup online.

Use this query

Backup Database Yourdatabasename To Disk='D:\YourBackupfile.bak'

read more about Backup / Restore Database in BOL (books online - help for sql server)

Madhu

|||Here's a technet article that describes backup and restore in SQL Server 2000.

http://www.microsoft.com/technet/prodtechnol/sql/2000/maintain/sqlbackuprest.mspx

Backup SQL Files

Hi,

We are about to install MSSQL Server 2000, on a Windows XP Home
Machine. However, we have servers we could set routine backups of files
to be done to. What what be the best way of doing this?

Is there functionality in SQL Server 2000, where we can say dump all
data definitions, accounts, and data to files on this drive at regular
intervals?

What other suggestions do you have apart from obviously the usual RAID,
and Tape Drive stuff?

Thanks

DavidDavid (david.goodyear@.gmail.com) writes:
> We are about to install MSSQL Server 2000, on a Windows XP Home
> Machine. However, we have servers we could set routine backups of files
> to be done to. What what be the best way of doing this?
> Is there functionality in SQL Server 2000, where we can say dump all
> data definitions, accounts, and data to files on this drive at regular
> intervals?

You could set up a job that runs from SQL Server Agent that backups
the database to a disk somewhere using the BACKUP command.

--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pr...oads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodin...ions/books.mspx|||What "flavour" of SQL Server 2000 (e.g. Enterprise, Developer) will you
be installing on this machine? I only ask because certain flavours
won't let you install the server components on an XP machine...

Anyway, you can use the Database Maintenance Plan Wizard to set up a
regular full backup of a database. This will preserve all the data in
the database (including the schema), objects such as functions and
stored procedures and the user accounts you have defined in the
database.

In addition to backing up any user defined databases, you should also
consider doing a backup of the system databases (master, msdb, model)
via the Database Maintenance Plan Wizard. Doing this should allow you
to have a backup of the server logins, SQL Server Agent jobs,
maintenance plans etc.

Hope that helps a bit

Sunday, March 25, 2012

backup size and initial database size

SQL server 2000
Hi
How can i find
1. Information about all/current backup files, size of backup file on
server using sql query or a script.
2. Initial size of all databases (when they were installed) and current size
of all databases.
Thanks
ontario, canada
I have information about all database backups for last two years (Including
database size in table Backupset in MSDB.
Does % increase in database backup size reflects the % increase in database
size?
ontario, canada
"db" wrote:
> SQL server 2000
> Hi
> How can i find
> 1. Information about all/current backup files, size of backup file on
> server using sql query or a script.
> 2. Initial size of all databases (when they were installed) and current size
> of all databases.
> Thanks
> ontario, canada
|||I am using
select database_name,database_creation_date,backup_start_ date,backup_size
from backupset order by database_name,backup_size desc
to get the bacup size information. I get the information.
I want to select a subset of records which give me information for backupset
for one day of every month (10-...200?). I.e monthwise backup set
information for 10-jan, 10-feb-10-mar...etc). When I issue FOLLOWING COMMAND
select database_name,database_creation_date,backup_start_ date,backup_size
from backupset WHERE BACKUP_START_DATE LIKE '10-...200?) order by
database_name,backup_size desc
I do not get the desired result. What is correct sql query?
ontario, canada
"db" wrote:
[vbcol=seagreen]
> I have information about all database backups for last two years (Including
> database size in table Backupset in MSDB.
> Does % increase in database backup size reflects the % increase in database
> size?
> --
> ontario, canada
> "db" wrote:
|||Select ...
Where BACKUP_START_DATE >= '20000101' And Day(BACKUP_START_DATE) = 10
Tom
"db" <db@.discussions.microsoft.com> wrote in message
news:BCC341DB-9254-43E5-B4FC-08F90F86A325@.microsoft.com...[vbcol=seagreen]
>I am using
> select database_name,database_creation_date,backup_start_ date,backup_size
> from backupset order by database_name,backup_size desc
> to get the bacup size information. I get the information.
> I want to select a subset of records which give me information for
> backupset
> for one day of every month (10-...200?). I.e monthwise backup set
> information for 10-jan, 10-feb-10-mar...etc). When I issue FOLLOWING
> COMMAND
> select database_name,database_creation_date,backup_start_ date,backup_size
> from backupset WHERE BACKUP_START_DATE LIKE '10-...200?) order by
> database_name,backup_size desc
> I do not get the desired result. What is correct sql query?
>
> --
> ontario, canada
>
> "db" wrote:

backup size and initial database size

SQL server 2000
Hi
How can i find
1. Information about all/current backup files, size of backup file on
server using sql query or a script.
2. Initial size of all databases (when they were installed) and current size
of all databases.
Thanks
--
ontario, canadaI have information about all database backups for last two years (Including
database size in table Backupset in MSDB.
Does % increase in database backup size reflects the % increase in database
size'
--
ontario, canada
"db" wrote:
> SQL server 2000
> Hi
> How can i find
> 1. Information about all/current backup files, size of backup file on
> server using sql query or a script.
> 2. Initial size of all databases (when they were installed) and current size
> of all databases.
> Thanks
> ontario, canada|||I am using
select database_name,database_creation_date,backup_start_date,backup_size
from backupset order by database_name,backup_size desc
to get the bacup size information. I get the information.
I want to select a subset of records which give me information for backupset
for one day of every month (10-...200?). I.e monthwise backup set
information for 10-jan, 10-feb-10-mar...etc). When I issue FOLLOWING COMMAND
select database_name,database_creation_date,backup_start_date,backup_size
from backupset WHERE BACKUP_START_DATE LIKE '10-...200?) order by
database_name,backup_size desc
I do not get the desired result. What is correct sql query?
ontario, canada
"db" wrote:
> I have information about all database backups for last two years (Including
> database size in table Backupset in MSDB.
> Does % increase in database backup size reflects the % increase in database
> size'
> --
> ontario, canada
> "db" wrote:
> > SQL server 2000
> > Hi
> > How can i find
> > 1. Information about all/current backup files, size of backup file on
> > server using sql query or a script.
> > 2. Initial size of all databases (when they were installed) and current size
> > of all databases.
> > Thanks
> > ontario, canada|||Select ...
Where BACKUP_START_DATE >= '20000101' And Day(BACKUP_START_DATE) = 10
Tom
"db" <db@.discussions.microsoft.com> wrote in message
news:BCC341DB-9254-43E5-B4FC-08F90F86A325@.microsoft.com...
>I am using
> select database_name,database_creation_date,backup_start_date,backup_size
> from backupset order by database_name,backup_size desc
> to get the bacup size information. I get the information.
> I want to select a subset of records which give me information for
> backupset
> for one day of every month (10-...200?). I.e monthwise backup set
> information for 10-jan, 10-feb-10-mar...etc). When I issue FOLLOWING
> COMMAND
> select database_name,database_creation_date,backup_start_date,backup_size
> from backupset WHERE BACKUP_START_DATE LIKE '10-...200?) order by
> database_name,backup_size desc
> I do not get the desired result. What is correct sql query?
>
> --
> ontario, canada
>
> "db" wrote:
>> I have information about all database backups for last two years
>> (Including
>> database size in table Backupset in MSDB.
>> Does % increase in database backup size reflects the % increase in
>> database
>> size'
>> --
>> ontario, canada
>> "db" wrote:
>> > SQL server 2000
>> > Hi
>> > How can i find
>> > 1. Information about all/current backup files, size of backup file on
>> > server using sql query or a script.
>> > 2. Initial size of all databases (when they were installed) and current
>> > size
>> > of all databases.
>> > Thanks
>> > ontario, canada

Backup set will expire

If I set this option when backing up to the hard disk as 14 days, will
it delete any backup files older than 14 days?
Hi
No. It just writes into the backup set that this backup may be overwritten
by SQL Server in 14 days. It does not delete the file.
In effect, you can have multiple backups in one backup file, and only after
14 days may it throw away the backup within the file.
Regards
Mike Epprecht, Microsoft SQL Server MVP
Zurich, Switzerland
IM: mike@.epprecht.net
MVP Program: http://www.microsoft.com/mvp
Blog: http://www.msmvps.com/epprecht/
<menlo11@.hotmail.com> wrote in message
news:1123707091.519058.272270@.f14g2000cwb.googlegr oups.com...
> If I set this option when backing up to the hard disk as 14 days, will
> it delete any backup files older than 14 days?
>
|||All that being said, I have tons of backup files from 2004 til today
taking up about 50 GB of space on one of our file servers. What is the
best way to handle that situation? Should I just delete most of the
backup files, just keeping the last month or so? Is there a way to
archive the earlier backups? Also, how do I stop this from happening
in the future?
|||Yes, you need to make sure that old backup files are deleted so you don't fill your disks. Easiest
to automate this is to use the Maintenance Wizard do your backups. Or write your own TSQL code to do
this (most name the backup files by code where name include date and time and then delete the files
based on that name).
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
Blog: http://solidqualitylearning.com/blogs/tibor/
<menlo11@.hotmail.com> wrote in message news:1123711188.786027.258880@.f14g2000cwb.googlegr oups.com...
> All that being said, I have tons of backup files from 2004 til today
> taking up about 50 GB of space on one of our file servers. What is the
> best way to handle that situation? Should I just delete most of the
> backup files, just keeping the last month or so? Is there a way to
> archive the earlier backups? Also, how do I stop this from happening
> in the future?
>

Backup set will expire

If I set this option when backing up to the hard disk as 14 days, will
it delete any backup files older than 14 days?Hi
No. It just writes into the backup set that this backup may be overwritten
by SQL Server in 14 days. It does not delete the file.
In effect, you can have multiple backups in one backup file, and only after
14 days may it throw away the backup within the file.
Regards
--
Mike Epprecht, Microsoft SQL Server MVP
Zurich, Switzerland
IM: mike@.epprecht.net
MVP Program: http://www.microsoft.com/mvp
Blog: http://www.msmvps.com/epprecht/
<menlo11@.hotmail.com> wrote in message
news:1123707091.519058.272270@.f14g2000cwb.googlegroups.com...
> If I set this option when backing up to the hard disk as 14 days, will
> it delete any backup files older than 14 days?
>|||All that being said, I have tons of backup files from 2004 til today
taking up about 50 GB of space on one of our file servers. What is the
best way to handle that situation? Should I just delete most of the
backup files, just keeping the last month or so? Is there a way to
archive the earlier backups? Also, how do I stop this from happening
in the future?|||Yes, you need to make sure that old backup files are deleted so you don't fill your disks. Easiest
to automate this is to use the Maintenance Wizard do your backups. Or write your own TSQL code to do
this (most name the backup files by code where name include date and time and then delete the files
based on that name).
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
Blog: http://solidqualitylearning.com/blogs/tibor/
<menlo11@.hotmail.com> wrote in message news:1123711188.786027.258880@.f14g2000cwb.googlegroups.com...
> All that being said, I have tons of backup files from 2004 til today
> taking up about 50 GB of space on one of our file servers. What is the
> best way to handle that situation? Should I just delete most of the
> backup files, just keeping the last month or so? Is there a way to
> archive the earlier backups? Also, how do I stop this from happening
> in the future?
>

Backup set will expire

If I set this option when backing up to the hard disk as 14 days, will
it delete any backup files older than 14 days?Hi
No. It just writes into the backup set that this backup may be overwritten
by SQL Server in 14 days. It does not delete the file.
In effect, you can have multiple backups in one backup file, and only after
14 days may it throw away the backup within the file.
Regards
--
Mike Epprecht, Microsoft SQL Server MVP
Zurich, Switzerland
IM: mike@.epprecht.net
MVP Program: http://www.microsoft.com/mvp
Blog: http://www.msmvps.com/epprecht/
<menlo11@.hotmail.com> wrote in message
news:1123707091.519058.272270@.f14g2000cwb.googlegroups.com...
> If I set this option when backing up to the hard disk as 14 days, will
> it delete any backup files older than 14 days?
>|||All that being said, I have tons of backup files from 2004 til today
taking up about 50 GB of space on one of our file servers. What is the
best way to handle that situation? Should I just delete most of the
backup files, just keeping the last month or so? Is there a way to
archive the earlier backups? Also, how do I stop this from happening
in the future?|||Yes, you need to make sure that old backup files are deleted so you don't fi
ll your disks. Easiest
to automate this is to use the Maintenance Wizard do your backups. Or write
your own TSQL code to do
this (most name the backup files by code where name include date and time an
d then delete the files
based on that name).
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
Blog: http://solidqualitylearning.com/blogs/tibor/
<menlo11@.hotmail.com> wrote in message news:1123711188.786027.258880@.f14g2000cwb.googlegroup
s.com...
> All that being said, I have tons of backup files from 2004 til today
> taking up about 50 GB of space on one of our file servers. What is the
> best way to handle that situation? Should I just delete most of the
> backup files, just keeping the last month or so? Is there a way to
> archive the earlier backups? Also, how do I stop this from happening
> in the future?
>

Thursday, March 22, 2012

Backup retention problem

Hi,
In my full backup maintenance Plan, I configured 1 day in a box 'Remove
files older than : "
The problem is ... sometimes I have 3 or 4 files .BAK in my backup's folder
older than 1 day.
Why the maintenance Plan does'nt remove those files ?
What can cause this ?
How can I be alert by SQL if the maintenance plan is not able to delete the
..BAK files older than 1 day ?
Thanks
http://support.microsoft.com/default...b;en-us;303292
-- Log files don't delete --
http://support.microsoft.com/default...;en-us;Q303292
This is likely to be either a permissions problem or a sharing violation
problem. The maintenance plan is run as a job, and jobs are run by the
SQLServerAgent service.
Permissions:
1. Determine the startup account for the SQLServerAgent service
(Start|Programs|Administrative tools|Services|SQLServerAgent|Startup). This
account is the security context for jobs, and thus the maintenance plan.
2. If SQLServerAgent is started using LocalSystem (as opposed to a domain
account) then skip step 3.
3. On that box, log onto NT as that account. Using Explorer, attempt to
delete an expired backup. If that succeeds then go to Sharing Violation
section.
4. Log onto NT with an account that is an administrator and use Explorer to
look at the Properties|Security of the folder (where the backups reside)
and ensure the SQLServerAgent startup account has Full Control. If the
SQLServerAgent startup account is LocalSystem, then the account to consider
is SYSTEM.
5. In NT, if an account is a member of an NT group, and if that group has
Access is Denied, then that account will have Access is Denied, even if
that account is also a member of the Administrators group. Thus you may
need to check group permissions (if the Startup Account is a member of a
group).
6. Keep in mind that permissions (by default) are inherited from a parent
folder. Thus, if the backups are stored in C:\bak, and if someone had
denied permission to the SQLServerAgent startup account for C:\, then
C:\bak will inherit access is denied.
Sharing violation:
This is likely to be rooted in a timing issue, with the most likely cause
being another scheduled process (such as NT Backup or Anti-Virus software)
having the backup file open at the time when the SQLServerAgent (i.e., the
maintenance plan job) tried to delete it.
1. Download filemon and handle from www.sysinternals.com.
2. I am not sure whether filemon can be scheduled, or you might be able to
use NT scheduling services to start filemon just before the maintenance
plan job is started, but the filemon log can become very large, so it would
be best to start it some short time before the maintenance plan starts.
3. Inspect the filemon log for another process that has that backup file
open (if your lucky enough to have started filemon before this other
process grabs the backup folder), and inspect the log for the results when
the SQLServerAgent agent attempts to open that same file.
4. Schedule the job or that other process to do their work at different
times.
5. You can use the handle utility if you are around at the time when the
job is scheduled to run.
If the backup files are going to a \\share or a mapped drive (as opposed to
local drive), then you will need to modify the above (with respect to where
the tests and utilities are run).
Finally, inspection of the maintenance plan's history report might be
useful.
Thanks,
Bill Hollinshead
Microsoft, SQL Server
Andrew J. Kelly SQL MVP
"Psa555" <Psa555@.discussions.microsoft.com> wrote in message
news:34A86E28-127A-4A50-B857-EF729A401790@.microsoft.com...
> Hi,
> In my full backup maintenance Plan, I configured 1 day in a box 'Remove
> files older than : "
> The problem is ... sometimes I have 3 or 4 files .BAK in my backup's
> folder
> older than 1 day.
> Why the maintenance Plan does'nt remove those files ?
> What can cause this ?
> How can I be alert by SQL if the maintenance plan is not able to delete
> the
> .BAK files older than 1 day ?
> Thanks
|||Hi,
If you have a mapi e-mail you can have a notification when the job fails.
Probably your status is that the job failed. You can install outlook 2000 or
outlook 2003 and create a new account for sending mails as f.e Database Admin.
Additionally, you can go to the maintenance plan properties and in the
Reporting tab you can tick the check box Write report a text file in
directory or any other option.
Hope that helped
Andreas
"Psa555" wrote:

> Hi,
> In my full backup maintenance Plan, I configured 1 day in a box 'Remove
> files older than : "
> The problem is ... sometimes I have 3 or 4 files .BAK in my backup's folder
> older than 1 day.
> Why the maintenance Plan does'nt remove those files ?
> What can cause this ?
> How can I be alert by SQL if the maintenance plan is not able to delete the
> .BAK files older than 1 day ?
> Thanks
|||Because 1 day = 24 hours, exactly. If you job is off schedule or takes a
little longer to run than the prior day, even if by 1 minute, the time
stamps are only 23 hours, 59 minutes, etc., which is NOT 1 day.
I usually code mine to delete anything older than 3 hours. When it runs, it
will run the backup or reorg operation first, then it will check for files
to delete.
Sincerely,
Anthony Thomas

"Psa555" <Psa555@.discussions.microsoft.com> wrote in message
news:34A86E28-127A-4A50-B857-EF729A401790@.microsoft.com...
Hi,
In my full backup maintenance Plan, I configured 1 day in a box 'Remove
files older than : "
The problem is ... sometimes I have 3 or 4 files .BAK in my backup's folder
older than 1 day.
Why the maintenance Plan does'nt remove those files ?
What can cause this ?
How can I be alert by SQL if the maintenance plan is not able to delete the
..BAK files older than 1 day ?
Thanks
sql

Backup retention problem

Hi,
In my full backup maintenance Plan, I configured 1 day in a box 'Remove
files older than : "
The problem is ... sometimes I have 3 or 4 files .BAK in my backup's folder
older than 1 day.
Why the maintenance Plan does'nt remove those files ?
What can cause this ?
How can I be alert by SQL if the maintenance plan is not able to delete the
.BAK files older than 1 day ?
Thankshttp://support.microsoft.com/defaul...kb;en-us;303292
-- Log files don't delete --
http://support.microsoft.com/defaul...b;en-us;Q303292
This is likely to be either a permissions problem or a sharing violation
problem. The maintenance plan is run as a job, and jobs are run by the
SQLServerAgent service.
Permissions:
1. Determine the startup account for the SQLServerAgent service
(Start|Programs|Administrative tools|Services|SQLServerAgent|Startup). This
account is the security context for jobs, and thus the maintenance plan.
2. If SQLServerAgent is started using LocalSystem (as opposed to a domain
account) then skip step 3.
3. On that box, log onto NT as that account. Using Explorer, attempt to
delete an expired backup. If that succeeds then go to Sharing Violation
section.
4. Log onto NT with an account that is an administrator and use Explorer to
look at the Properties|Security of the folder (where the backups reside)
and ensure the SQLServerAgent startup account has Full Control. If the
SQLServerAgent startup account is LocalSystem, then the account to consider
is SYSTEM.
5. In NT, if an account is a member of an NT group, and if that group has
Access is Denied, then that account will have Access is Denied, even if
that account is also a member of the Administrators group. Thus you may
need to check group permissions (if the Startup Account is a member of a
group).
6. Keep in mind that permissions (by default) are inherited from a parent
folder. Thus, if the backups are stored in C:\bak, and if someone had
denied permission to the SQLServerAgent startup account for C:\, then
C:\bak will inherit access is denied.
Sharing violation:
This is likely to be rooted in a timing issue, with the most likely cause
being another scheduled process (such as NT Backup or Anti-Virus software)
having the backup file open at the time when the SQLServerAgent (i.e., the
maintenance plan job) tried to delete it.
1. Download filemon and handle from www.sysinternals.com.
2. I am not sure whether filemon can be scheduled, or you might be able to
use NT scheduling services to start filemon just before the maintenance
plan job is started, but the filemon log can become very large, so it would
be best to start it some short time before the maintenance plan starts.
3. Inspect the filemon log for another process that has that backup file
open (if your lucky enough to have started filemon before this other
process grabs the backup folder), and inspect the log for the results when
the SQLServerAgent agent attempts to open that same file.
4. Schedule the job or that other process to do their work at different
times.
5. You can use the handle utility if you are around at the time when the
job is scheduled to run.
If the backup files are going to a \\share or a mapped drive (as opposed to
local drive), then you will need to modify the above (with respect to where
the tests and utilities are run).
Finally, inspection of the maintenance plan's history report might be
useful.
Thanks,
Bill Hollinshead
Microsoft, SQL Server
Andrew J. Kelly SQL MVP
"Psa555" <Psa555@.discussions.microsoft.com> wrote in message
news:34A86E28-127A-4A50-B857-EF729A401790@.microsoft.com...
> Hi,
> In my full backup maintenance Plan, I configured 1 day in a box 'Remove
> files older than : "
> The problem is ... sometimes I have 3 or 4 files .BAK in my backup's
> folder
> older than 1 day.
> Why the maintenance Plan does'nt remove those files ?
> What can cause this ?
> How can I be alert by SQL if the maintenance plan is not able to delete
> the
> .BAK files older than 1 day ?
> Thanks|||Hi,
If you have a mapi e-mail you can have a notification when the job fails.
Probably your status is that the job failed. You can install outlook 2000 or
outlook 2003 and create a new account for sending mails as f.e Database Admi
n.
Additionally, you can go to the maintenance plan properties and in the
Reporting tab you can tick the check box Write report a text file in
directory or any other option.
Hope that helped
Andreas
"Psa555" wrote:

> Hi,
> In my full backup maintenance Plan, I configured 1 day in a box 'Remove
> files older than : "
> The problem is ... sometimes I have 3 or 4 files .BAK in my backup's folde
r
> older than 1 day.
> Why the maintenance Plan does'nt remove those files ?
> What can cause this ?
> How can I be alert by SQL if the maintenance plan is not able to delete th
e
> .BAK files older than 1 day ?
> Thanks|||Because 1 day = 24 hours, exactly. If you job is off schedule or takes a
little longer to run than the prior day, even if by 1 minute, the time
stamps are only 23 hours, 59 minutes, etc., which is NOT 1 day.
I usually code mine to delete anything older than 3 hours. When it runs, it
will run the backup or reorg operation first, then it will check for files
to delete.
Sincerely,
Anthony Thomas
"Psa555" <Psa555@.discussions.microsoft.com> wrote in message
news:34A86E28-127A-4A50-B857-EF729A401790@.microsoft.com...
Hi,
In my full backup maintenance Plan, I configured 1 day in a box 'Remove
files older than : "
The problem is ... sometimes I have 3 or 4 files .BAK in my backup's folder
older than 1 day.
Why the maintenance Plan does'nt remove those files ?
What can cause this ?
How can I be alert by SQL if the maintenance plan is not able to delete the
.BAK files older than 1 day ?
Thanks

Backup retention problem

Hi,
In my full backup maintenance Plan, I configured 1 day in a box 'Remove
files older than : "
The problem is ... sometimes I have 3 or 4 files .BAK in my backup's folder
older than 1 day.
Why the maintenance Plan does'nt remove those files ?
What can cause this ?
How can I be alert by SQL if the maintenance plan is not able to delete the
.BAK files older than 1 day ?
Thankshttp://support.microsoft.com/default.aspx?scid=kb;en-us;303292
-- Log files don't delete --
http://support.microsoft.com/default.aspx?scid=kb;en-us;Q303292
This is likely to be either a permissions problem or a sharing violation
problem. The maintenance plan is run as a job, and jobs are run by the
SQLServerAgent service.
Permissions:
1. Determine the startup account for the SQLServerAgent service
(Start|Programs|Administrative tools|Services|SQLServerAgent|Startup). This
account is the security context for jobs, and thus the maintenance plan.
2. If SQLServerAgent is started using LocalSystem (as opposed to a domain
account) then skip step 3.
3. On that box, log onto NT as that account. Using Explorer, attempt to
delete an expired backup. If that succeeds then go to Sharing Violation
section.
4. Log onto NT with an account that is an administrator and use Explorer to
look at the Properties|Security of the folder (where the backups reside)
and ensure the SQLServerAgent startup account has Full Control. If the
SQLServerAgent startup account is LocalSystem, then the account to consider
is SYSTEM.
5. In NT, if an account is a member of an NT group, and if that group has
Access is Denied, then that account will have Access is Denied, even if
that account is also a member of the Administrators group. Thus you may
need to check group permissions (if the Startup Account is a member of a
group).
6. Keep in mind that permissions (by default) are inherited from a parent
folder. Thus, if the backups are stored in C:\bak, and if someone had
denied permission to the SQLServerAgent startup account for C:\, then
C:\bak will inherit access is denied.
Sharing violation:
This is likely to be rooted in a timing issue, with the most likely cause
being another scheduled process (such as NT Backup or Anti-Virus software)
having the backup file open at the time when the SQLServerAgent (i.e., the
maintenance plan job) tried to delete it.
1. Download filemon and handle from www.sysinternals.com.
2. I am not sure whether filemon can be scheduled, or you might be able to
use NT scheduling services to start filemon just before the maintenance
plan job is started, but the filemon log can become very large, so it would
be best to start it some short time before the maintenance plan starts.
3. Inspect the filemon log for another process that has that backup file
open (if your lucky enough to have started filemon before this other
process grabs the backup folder), and inspect the log for the results when
the SQLServerAgent agent attempts to open that same file.
4. Schedule the job or that other process to do their work at different
times.
5. You can use the handle utility if you are around at the time when the
job is scheduled to run.
If the backup files are going to a \\share or a mapped drive (as opposed to
local drive), then you will need to modify the above (with respect to where
the tests and utilities are run).
Finally, inspection of the maintenance plan's history report might be
useful.
Thanks,
Bill Hollinshead
Microsoft, SQL Server
--
Andrew J. Kelly SQL MVP
"Psa555" <Psa555@.discussions.microsoft.com> wrote in message
news:34A86E28-127A-4A50-B857-EF729A401790@.microsoft.com...
> Hi,
> In my full backup maintenance Plan, I configured 1 day in a box 'Remove
> files older than : "
> The problem is ... sometimes I have 3 or 4 files .BAK in my backup's
> folder
> older than 1 day.
> Why the maintenance Plan does'nt remove those files ?
> What can cause this ?
> How can I be alert by SQL if the maintenance plan is not able to delete
> the
> .BAK files older than 1 day ?
> Thanks|||Hi,
If you have a mapi e-mail you can have a notification when the job fails.
Probably your status is that the job failed. You can install outlook 2000 or
outlook 2003 and create a new account for sending mails as f.e Database Admin.
Additionally, you can go to the maintenance plan properties and in the
Reporting tab you can tick the check box Write report a text file in
directory or any other option.
Hope that helped
Andreas
"Psa555" wrote:
> Hi,
> In my full backup maintenance Plan, I configured 1 day in a box 'Remove
> files older than : "
> The problem is ... sometimes I have 3 or 4 files .BAK in my backup's folder
> older than 1 day.
> Why the maintenance Plan does'nt remove those files ?
> What can cause this ?
> How can I be alert by SQL if the maintenance plan is not able to delete the
> .BAK files older than 1 day ?
> Thanks|||Because 1 day = 24 hours, exactly. If you job is off schedule or takes a
little longer to run than the prior day, even if by 1 minute, the time
stamps are only 23 hours, 59 minutes, etc., which is NOT 1 day.
I usually code mine to delete anything older than 3 hours. When it runs, it
will run the backup or reorg operation first, then it will check for files
to delete.
Sincerely,
Anthony Thomas
"Psa555" <Psa555@.discussions.microsoft.com> wrote in message
news:34A86E28-127A-4A50-B857-EF729A401790@.microsoft.com...
Hi,
In my full backup maintenance Plan, I configured 1 day in a box 'Remove
files older than : "
The problem is ... sometimes I have 3 or 4 files .BAK in my backup's folder
older than 1 day.
Why the maintenance Plan does'nt remove those files ?
What can cause this ?
How can I be alert by SQL if the maintenance plan is not able to delete the
.BAK files older than 1 day ?
Thanks

Tuesday, March 20, 2012

backup restore database into different filegroup arrangement

Hi,
Is there a way to restore the backup files of a database
which has only one file and one filegroup (primay) into a
database which has multiple files and filegroups? and can
the reverse to be done (multiple files into one file)?
e.g.:
db1, db1_data on primary
restore db1 backup file into
db2 (db2_data1, primary
db2_data2, secondary)
Is there a direct way to use 'backup-restore' method?
We basically want the same data but we want to re-arrange
the file management of the database.
many thanks!
JJ
I'm afraid not. A backup is essentially an image of the database, which is why you need the same amount of
files with each at least the same size and logical filename as when the backup was performed.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
"JJ Wang" <anonymous@.discussions.microsoft.com> wrote in message
news:1569601c415fc$b972b1e0$a401280a@.phx.gbl...
> Hi,
> Is there a way to restore the backup files of a database
> which has only one file and one filegroup (primay) into a
> database which has multiple files and filegroups? and can
> the reverse to be done (multiple files into one file)?
> e.g.:
> db1, db1_data on primary
> restore db1 backup file into
> db2 (db2_data1, primary
> db2_data2, secondary)
> Is there a direct way to use 'backup-restore' method?
> We basically want the same data but we want to re-arrange
> the file management of the database.
> many thanks!
> JJ
>
>
>
|||thanks for the feedback, Tibor.
I will try it out, but I'm pretty sure that it can't be
done like you said. :-)
JJ
>--Original Message--
>I'm afraid not. A backup is essentially an image of the
database, which is why you need the same amount of
>files with each at least the same size and logical
filename as when the backup was performed.
>--
>Tibor Karaszi, SQL Server MVP
>http://www.karaszi.com/sqlserver/default.asp
>
>"JJ Wang" <anonymous@.discussions.microsoft.com> wrote in
message
>news:1569601c415fc$b972b1e0$a401280a@.phx.gbl...
a
can
arrange
>
>.
>

Backup report file (.rdl)

Can I backup report files (.rdl) from reporting services server? and how to
do it?
Because my disk is broken, the report project also lost.
-_-...
thankshttp://msdn2.microsoft.com/en-us/library/microsoft.wssux.reportingserviceswebservice.rsmanagementservice2005.reportingservice2005.getreportdefinition(SQL.90).aspx|||You can use Reporting Services Scripter to extract all the reports from your
Report Server.
Download here http://www.sqldbatips.com/showarticle.asp?ID=62
--
HTH,
Jasper Smith (SQL Server MVP)
http://www.sqldbatips.com
"HC" <mcmssupereditor@.yahoo.com.hk> wrote in message
news:%23a60VIWWGHA.3848@.TK2MSFTNGP05.phx.gbl...
> Can I backup report files (.rdl) from reporting services server? and how
> to do it?
> Because my disk is broken, the report project also lost.
> -_-...
> thanks
>sql

Backup Question 100234987492874

Hi all,
The database in question uses Full Recovery Model but my maintenance plan
dictates to only keep 2 days of transaction log files. This has always
worked great.
For no obvious reason the backup no longer removes transaction files older
than 2 days so I am quickly running out of disk space. Again, nothing has
changed on this server, we keep detailed change management logs. I am
assuming that if I just blast the old .TRN files I will be fine but am still
puzzled why this behavior started and how to correctly stop it.
ThanksHi,
I have noticed this if the backup/transaction backup job in the schedule
doesn't complete successfully
--
I hope this helps
regards
Greg O MCSD
http://www.ag-software.com/ags_scribe_index.aspx. SQL Scribe Documentation
Builder, the quickest way to document your database
http://www.ag-software.com/ags_SSEPE_index.aspx. AGS SQL Server Extended
Property Extended properties manager for SQL 2000
http://www.ag-software.com/IconExtractionProgram.aspx. Free icon extraction
program
http://www.ag-software.com. Free programming tools
"A" <agarrettbNOSPAM@.hotmail.com> wrote in message
news:O106PHfuDHA.1060@.TK2MSFTNGP12.phx.gbl...
> Hi all,
> The database in question uses Full Recovery Model but my maintenance plan
> dictates to only keep 2 days of transaction log files. This has always
> worked great.
> For no obvious reason the backup no longer removes transaction files older
> than 2 days so I am quickly running out of disk space. Again, nothing has
> changed on this server, we keep detailed change management logs. I am
> assuming that if I just blast the old .TRN files I will be fine but am
still
> puzzled why this behavior started and how to correctly stop it.
> Thanks
>|||Below KB might help:
http://support.microsoft.com/default.aspx?scid=kb;en-us;303292&Product=sql2k
Also, check out below great troubleshooting suggestions from Bill H at MS:
-- Log files don't delete --
This is likely to be either a permissions problem or a sharing violation
problem. The maintenance plan is run as a job, and jobs are run by the
SQLServerAgent service.
Permissions:
1. Determine the startup account for the SQLServerAgent service
(Start|Programs|Administrative tools|Services|SQLServerAgent|Startup). This
account is the security context for jobs, and thus the maintenance plan.
2. If SQLServerAgent is started using LocalSystem (as opposed to a domain
account) then skip step 3.
3. On that box, log onto NT as that account. Using Explorer, attempt to
delete an expired backup. If that succeeds then go to Sharing Violation
section.
4. Log onto NT with an account that is an administrator and use Explorer to
look at the Properties|Security of the folder (where the backups reside)
and ensure the SQLServerAgent startup account has Full Control. If the
SQLServerAgent startup account is LocalSystem, then the account to consider
is SYSTEM.
5. In NT, if an account is a member of an NT group, and if that group has
Access is Denied, then that account will have Access is Denied, even if
that account is also a member of the Administrators group. Thus you may
need to check group permissions (if the Startup Account is a member of a
group).
6. Keep in mind that permissions (by default) are inherited from a parent
folder. Thus, if the backups are stored in C:\bak, and if someone had
denied permission to the SQLServerAgent startup account for C:\, then
C:\bak will inherit access is denied.
Sharing violation:
This is likely to be rooted in a timing issue, with the most likely cause
being another scheduled process (such as NT Backup or Anti-Virus software)
having the backup file open at the time when the SQLServerAgent (i.e., the
maintenance plan job) tried to delete it.
1. Download filemon and handle from www.sysinternals.com.
2. I am not sure whether filemon can be scheduled, or you might be able to
use NT scheduling services to start filemon just before the maintenance
plan job is started, but the filemon log can become very large, so it would
be best to start it some short time before the maintenance plan starts.
3. Inspect the filemon log for another process that has that backup file
open (if your lucky enough to have started filemon before this other
process grabs the backup folder), and inspect the log for the results when
the SQLServerAgent agent attempts to open that same file.
4. Schedule the job or that other process to do their work at different
times.
5. You can use the handle utility if you are around at the time when the
job is scheduled to run.
If the backup files are going to a \\share or a mapped drive (as opposed to
local drive), then you will need to modify the above (with respect to where
the tests and utilities are run).
Finally, inspection of the maintenance plan's history report might be
useful.
Thanks,
Bill Hollinshead
Microsoft, SQL Server
Tibor Karaszi, SQL Server MVP
Archive at: http://groups.google.com/groups?oi=djq&as_ugroup=microsoft.public.sqlserver
"A" <agarrettbNOSPAM@.hotmail.com> wrote in message news:O106PHfuDHA.1060@.TK2MSFTNGP12.phx.gbl...
> Hi all,
> The database in question uses Full Recovery Model but my maintenance plan
> dictates to only keep 2 days of transaction log files. This has always
> worked great.
> For no obvious reason the backup no longer removes transaction files older
> than 2 days so I am quickly running out of disk space. Again, nothing has
> changed on this server, we keep detailed change management logs. I am
> assuming that if I just blast the old .TRN files I will be fine but am still
> puzzled why this behavior started and how to correctly stop it.
> Thanks
>

Backup Question Old Files still attached

I was setting up the backup for a new database last evening and seem
to have created a small problem. Although I was able to create a
backup and restore it, in the process I seem to have left a couple of
other copies of the database files in a state where they cannot be
moved, deleted or copied.
I started by right clicking on the database and selecting Back Up. I
then did a Full Backup of the Database (not the Files and
Filegroups). I then detached the original database (probably a
mistake) and went to the Databases level, right-clicked and selected
Restore Database. I did not find the name of my database in the "To
Database:" list so I typed it in and proceeded to select the From
Database (which did have the name of my database and the correct
backup time) and restored the database.
The database seemed to work fine.
However when I checked the files I found not only my original
DatabaseName_Data.MDF and DatabaseName_Log.LDF files, but two new
ones
DatabaseName.MDF and DatabaseName_1.LDF. These last two files are
the
actual files being used by the restored database.
I would now like to do two things:
1) Move the original DatabaseName_Data.MDF and DatabaseName_Log.LDF
files to a new location, and
2) Rename the files that are actually being used from
DatabaseName.MDF
and DatabaseName_1.LDF to DatabaseName_Data.MDF and
DatabaseName_Log.LDF as they were before.
However I can't seem to do anything with the original files because
they seem to still be attached to the server. How can I SAFELY
accomplish what I want without endangering my good database (with the
wrong file names)?
Thanks.Detach the databases and do whatevery you want. Move them, rename them or
whatever and then reattach whichever one you want to use.
--
Ekrem Önsoy
"ExcelMan" <sfarkas@.sjfcg.com> wrote in message
news:1188538011.871157.326450@.q5g2000prf.googlegroups.com...
> I was setting up the backup for a new database last evening and seem
> to have created a small problem. Although I was able to create a
> backup and restore it, in the process I seem to have left a couple of
> other copies of the database files in a state where they cannot be
> moved, deleted or copied.
> I started by right clicking on the database and selecting Back Up. I
> then did a Full Backup of the Database (not the Files and
> Filegroups). I then detached the original database (probably a
> mistake) and went to the Databases level, right-clicked and selected
> Restore Database. I did not find the name of my database in the "To
> Database:" list so I typed it in and proceeded to select the From
> Database (which did have the name of my database and the correct
> backup time) and restored the database.
>
> The database seemed to work fine.
>
> However when I checked the files I found not only my original
> DatabaseName_Data.MDF and DatabaseName_Log.LDF files, but two new
> ones
> DatabaseName.MDF and DatabaseName_1.LDF. These last two files are
> the
> actual files being used by the restored database.
>
> I would now like to do two things:
>
> 1) Move the original DatabaseName_Data.MDF and DatabaseName_Log.LDF
> files to a new location, and
> 2) Rename the files that are actually being used from
> DatabaseName.MDF
> and DatabaseName_1.LDF to DatabaseName_Data.MDF and
> DatabaseName_Log.LDF as they were before.
>
> However I can't seem to do anything with the original files because
> they seem to still be attached to the server. How can I SAFELY
> accomplish what I want without endangering my good database (with the
> wrong file names)?
>
> Thanks.
>

Monday, March 19, 2012

Backup question

Using sql server 2000...
We are having issues with growing transaction log files...
Is the following a safe practice ?
Assume you create a "full" backup job using the Database Maintenance plan
wizard... This will create Step 1 in an SQL Job.
Would it be safe to add the following code as a step that was executed "on
success" of the first...
Use DatabaseName
BACKUP LOG DatabaseNameWITH NO_LOG
DBCC SHRINKFILE(DatabaseName_Log,10)
GORob
http://www.karaszi.com/SQLServer/info_dont_shrink.asp
"Rob" <robc1@.yahoo.com> wrote in message
news:ANudneEo7LraMJrbnZ2dnUVZ_segnZ2d@.co
mcast.com...
> Using sql server 2000...
> We are having issues with growing transaction log files...
> Is the following a safe practice ?
> Assume you create a "full" backup job using the Database Maintenance plan
> wizard... This will create Step 1 in an SQL Job.
> Would it be safe to add the following code as a step that was executed
> "on success" of the first...
> Use DatabaseName
> BACKUP LOG DatabaseNameWITH NO_LOG
> DBCC SHRINKFILE(DatabaseName_Log,10)
> GO
>|||Thanks Uri,
But I still need an interpreter...
Left unchecked, the Log file appears to grow and fill up space on the
server. My assumption, is that IF a good full backup has been successful,
then it should be OK to use SHRINKFILE to lose the transaction file. At
that point, there would be no need to restore a transaction log file...
BTW - I never use shrinkdatabase
Rob
"Uri Dimant" <urid@.iscar.co.il> wrote in message
news:uyC4Ho5bHHA.4716@.TK2MSFTNGP02.phx.gbl...
> Rob
> http://www.karaszi.com/SQLServer/info_dont_shrink.asp
>
>
> "Rob" <robc1@.yahoo.com> wrote in message
> news:ANudneEo7LraMJrbnZ2dnUVZ_segnZ2d@.co
mcast.com...
>|||Rob
If you have database is set up withj FULL RECOVERY mode then in order to
control a physical size of the LOG file , you need to BACKUP LOG ...
command, otherwise set up the database with SIMPLE recovery mode and the SQL
Server will take care for it.
If you implement BACKUP LOG file you probably won't lose the data if the
database get corrupted , please make sure what is your/or your boss
requirements.
"Rob" <robc1@.yahoo.com> wrote in message
news:bPidnfI0R4aaK5rbnZ2dnUVZ_hmtnZ2d@.co
mcast.com...
> Thanks Uri,
> But I still need an interpreter...
> Left unchecked, the Log file appears to grow and fill up space on the
> server. My assumption, is that IF a good full backup has been successful,
> then it should be OK to use SHRINKFILE to lose the transaction file. At
> that point, there would be no need to restore a transaction log file...
> BTW - I never use shrinkdatabase
> Rob
>
> "Uri Dimant" <urid@.iscar.co.il> wrote in message
> news:uyC4Ho5bHHA.4716@.TK2MSFTNGP02.phx.gbl...
>|||Hello,
To add on to Uri, perform the transaction log backup in regular intervals
(say 15 minutes), this will make sure that your
log (LDF) file will not grow. Shrinking the LDF life after the log backup is
not a good approch, this will shrino the
LDF file and after each DML operation file will autogrow and this will take
consifderable amount of I/O resources.
One more thing is you can archive all your transaction log backup files
which was taken before the
last full database backup.
Thanks
Hari
"Uri Dimant" <urid@.iscar.co.il> wrote in message
news:eMZ9F$5bHHA.4012@.TK2MSFTNGP03.phx.gbl...
> Rob
> If you have database is set up withj FULL RECOVERY mode then in order to
> control a physical size of the LOG file , you need to BACKUP LOG ...
> command, otherwise set up the database with SIMPLE recovery mode and the
> SQL Server will take care for it.
>
> If you implement BACKUP LOG file you probably won't lose the data if the
> database get corrupted , please make sure what is your/or your boss
> requirements.
>
>
>
> "Rob" <robc1@.yahoo.com> wrote in message
> news:bPidnfI0R4aaK5rbnZ2dnUVZ_hmtnZ2d@.co
mcast.com...
>