Showing posts with label log. Show all posts
Showing posts with label log. Show all posts

Friday, March 30, 2012

How do I apply a LDF log file to a restored database?

I only have the ldf file and the bak file.

My bak file was current to 3/2/2007

My ldf file was current to 3/25/2007

I do not have the mdf file.

How to I apply the transaction from the ldf file to my resotred database?

Hello David,

According to my knowledge it not is possible to apply a .ldf file but if you are using some external tool like Logexplorer then you can atleast view the transactions in that .ldf file.

|||If this is the case it would seem to negate the purpose of having a log file?|||

The purposes of the log file are:

To facilitate rollback/rollforward when a database is brought online after an unusual shutdown|||

you said you have a .bak file and a log file. My gut feeling is that , this bak file is a full backup of your database. In that case you can restore the database from this back file as on the bak file is created.

YOu have mentioned that you have a ldf file. is it physical file or is it a bakup file. confirm this

run the following command to know what all are the contents inside the bak file

RESTORE FILELISTONLY FROM DISK = 'D:\your bak filename.bak'

if it is a full backup use restore command to restore it. Read about Restore command in BOL

Madhu

|||

No David ,

It would not negate the use of a log file. if you had a .mdf file then you could attach the log file with the .mdf file. .trn files are the log back up file not the .ldf files.

How do I apply a LDF log file to a restored database?

I only have the ldf file and the bak file.

My bak file was current to 3/2/2007

My ldf file was current to 3/25/2007

I do not have the mdf file.

How to I apply the transaction from the ldf file to my resotred database?

Hello David,

According to my knowledge it not is possible to apply a .ldf file but if you are using some external tool like Logexplorer then you can atleast view the transactions in that .ldf file.

|||If this is the case it would seem to negate the purpose of having a log file?|||

The purposes of the log file are:

To facilitate rollback/rollforward when a database is brought online after an unusual shutdown|||

you said you have a .bak file and a log file. My gut feeling is that , this bak file is a full backup of your database. In that case you can restore the database from this back file as on the bak file is created.

YOu have mentioned that you have a ldf file. is it physical file or is it a bakup file. confirm this

run the following command to know what all are the contents inside the bak file

RESTORE FILELISTONLY FROM DISK = 'D:\your bak filename.bak'

if it is a full backup use restore command to restore it. Read about Restore command in BOL

Madhu

|||

No David ,

It would not negate the use of a log file. if you had a .mdf file then you could attach the log file with the .mdf file. .trn files are the log back up file not the .ldf files.

How do I allow users to see reports

Hi,
I know I am being thick here, and should probably just read the manual, but
how do enable users to log on and view reports. I have gone in to the
Properties of the report folder where the report I want a user to see is
located. I then set the security options to add a user, assigning them the
browser role. The report then inherits that role of the folder. However,
when the user logs in to the site their homepage is completely blank. They
don't get all the buttons and the top and definitely no reports. What do I
still need to do? Please help.
TIA,
JarrydHi,
Nevermind this post. Sussed it out. I was being stupid.
TIA,
Jarryd
"Jarryd" <jarryd@.community.nospam> wrote in message
news:%23MRFbAMvHHA.3660@.TK2MSFTNGP06.phx.gbl...
> Hi,
> I know I am being thick here, and should probably just read the manual,
> but how do enable users to log on and view reports. I have gone in to the
> Properties of the report folder where the report I want a user to see is
> located. I then set the security options to add a user, assigning them
> the browser role. The report then inherits that role of the folder.
> However, when the user logs in to the site their homepage is completely
> blank. They don't get all the buttons and the top and definitely no
> reports. What do I still need to do? Please help.
> TIA,
> Jarryd
>

Wednesday, March 28, 2012

How do I "apply" a log to a database? Urgent...

Hello!
The database is giving the torn page error.
I have yesterday's backup and today's log file ldf.
How do I apply the log file to database? We didn't backup today's log...
Thanks for your help and attention.
Jorge C.
rdc02271@.yahoo.com
You don't. If you want to recover to a point in time which is between database backups, then you
should have proper operating measures for that requirement. I.e., do log backups. This is what log
backups are for.
What is the recovery mode for your database? If it is simple, then the information needed to recover
is most probably not in the ldf file anymore. If it is full or bulk logged, then you can give any of
the log reader tools a try. I have listed some on my links page.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Jorge C" <rdc02271@.yahoo.com> wrote in message news:uLIyLmbRFHA.204@.TK2MSFTNGP15.phx.gbl...
> Hello!
> The database is giving the torn page error.
> I have yesterday's backup and today's log file ldf.
> How do I apply the log file to database? We didn't backup today's log...
> Thanks for your help and attention.
> Jorge C.
> rdc02271@.yahoo.com
>
>
|||Jorge,
- Backup current transaction log WITH NO_TRUNCATE
- Restore full backup using NORECOVERY clause
- Restore transaction log backup WITH RECOVERY
See "Restoring a Database to a Prior State" in BOL.
AMB
"Jorge C" wrote:

> Hello!
> The database is giving the torn page error.
> I have yesterday's backup and today's log file ldf.
> How do I apply the log file to database? We didn't backup today's log...
> Thanks for your help and attention.
> Jorge C.
> rdc02271@.yahoo.com
>
>
|||Oops. Perhaps I didn't read the OP close enough. Assuming that you do indeed perform regular
transaction log backups as well as regular database backups, see Alejandro's post. (I read it as you
didn't perform transaction log backups *at all*, which is a big difference from not performed
*today's* transaction log backup yet.
You might want to check out:
http://www.karaszi.com/SQLServer/inf...suspect_db.asp
http://www.karaszi.com/SQLServer/inf...eral_times.asp
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in message
news:uDMBL2bRFHA.3880@.tk2msftngp13.phx.gbl...
> You don't. If you want to recover to a point in time which is between database backups, then you
> should have proper operating measures for that requirement. I.e., do log backups. This is what log
> backups are for.
> What is the recovery mode for your database? If it is simple, then the information needed to
> recover is most probably not in the ldf file anymore. If it is full or bulk logged, then you can
> give any of the log reader tools a try. I have listed some on my links page.
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
>
> "Jorge C" <rdc02271@.yahoo.com> wrote in message news:uLIyLmbRFHA.204@.TK2MSFTNGP15.phx.gbl...
>

How do I "apply" a log to a database? Urgent...

Hello!
The database is giving the torn page error.
I have yesterday's backup and today's log file ldf.
How do I apply the log file to database? We didn't backup today's log...
Thanks for your help and attention.
Jorge C.
rdc02271@.yahoo.comYou don't. If you want to recover to a point in time which is between databa
se backups, then you
should have proper operating measures for that requirement. I.e., do log bac
kups. This is what log
backups are for.
What is the recovery mode for your database? If it is simple, then the infor
mation needed to recover
is most probably not in the ldf file anymore. If it is full or bulk logged,
then you can give any of
the log reader tools a try. I have listed some on my links page.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Jorge C" <rdc02271@.yahoo.com> wrote in message news:uLIyLmbRFHA.204@.TK2MSFTNGP15.phx.gbl...

> Hello!
> The database is giving the torn page error.
> I have yesterday's backup and today's log file ldf.
> How do I apply the log file to database? We didn't backup today's log...
> Thanks for your help and attention.
> Jorge C.
> rdc02271@.yahoo.com
>
>|||Jorge,
- Backup current transaction log WITH NO_TRUNCATE
- Restore full backup using NORECOVERY clause
- Restore transaction log backup WITH RECOVERY
See "Restoring a Database to a Prior State" in BOL.
AMB
"Jorge C" wrote:

> Hello!
> The database is giving the torn page error.
> I have yesterday's backup and today's log file ldf.
> How do I apply the log file to database? We didn't backup today's log...
> Thanks for your help and attention.
> Jorge C.
> rdc02271@.yahoo.com
>
>|||Oops. Perhaps I didn't read the OP close enough. Assuming that you do indeed
perform regular
transaction log backups as well as regular database backups, see Alejandro's
post. (I read it as you
didn't perform transaction log backups *at all*, which is a big difference f
rom not performed
*today's* transaction log backup yet.
You might want to check out:
http://www.karaszi.com/SQLServer/in..._suspect_db.asp
http://www.karaszi.com/SQLServer/in...veral_times.asp
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in
message
news:uDMBL2bRFHA.3880@.tk2msftngp13.phx.gbl...
> You don't. If you want to recover to a point in time which is between data
base backups, then you
> should have proper operating measures for that requirement. I.e., do log b
ackups. This is what log
> backups are for.
> What is the recovery mode for your database? If it is simple, then the inf
ormation needed to
> recover is most probably not in the ldf file anymore. If it is full or bul
k logged, then you can
> give any of the log reader tools a try. I have listed some on my links pag
e.
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
>
> "Jorge C" <rdc02271@.yahoo.com> wrote in message news:uLIyLmbRFHA.204@.TK2MS
FTNGP15.phx.gbl...
>sql

How do I "apply" a log to a database? Urgent...

Hello!
The database is giving the torn page error.
I have yesterday's backup and today's log file ldf.
How do I apply the log file to database? We didn't backup today's log...
Thanks for your help and attention.
Jorge C.
rdc02271@.yahoo.comYou don't. If you want to recover to a point in time which is between database backups, then you
should have proper operating measures for that requirement. I.e., do log backups. This is what log
backups are for.
What is the recovery mode for your database? If it is simple, then the information needed to recover
is most probably not in the ldf file anymore. If it is full or bulk logged, then you can give any of
the log reader tools a try. I have listed some on my links page.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Jorge C" <rdc02271@.yahoo.com> wrote in message news:uLIyLmbRFHA.204@.TK2MSFTNGP15.phx.gbl...
> Hello!
> The database is giving the torn page error.
> I have yesterday's backup and today's log file ldf.
> How do I apply the log file to database? We didn't backup today's log...
> Thanks for your help and attention.
> Jorge C.
> rdc02271@.yahoo.com
>
>|||Jorge,
- Backup current transaction log WITH NO_TRUNCATE
- Restore full backup using NORECOVERY clause
- Restore transaction log backup WITH RECOVERY
See "Restoring a Database to a Prior State" in BOL.
AMB
"Jorge C" wrote:
> Hello!
> The database is giving the torn page error.
> I have yesterday's backup and today's log file ldf.
> How do I apply the log file to database? We didn't backup today's log...
> Thanks for your help and attention.
> Jorge C.
> rdc02271@.yahoo.com
>
>|||Oops. Perhaps I didn't read the OP close enough. Assuming that you do indeed perform regular
transaction log backups as well as regular database backups, see Alejandro's post. (I read it as you
didn't perform transaction log backups *at all*, which is a big difference from not performed
*today's* transaction log backup yet.
You might want to check out:
http://www.karaszi.com/SQLServer/info_corrupt_suspect_db.asp
http://www.karaszi.com/SQLServer/info_restore_log_several_times.asp
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in message
news:uDMBL2bRFHA.3880@.tk2msftngp13.phx.gbl...
> You don't. If you want to recover to a point in time which is between database backups, then you
> should have proper operating measures for that requirement. I.e., do log backups. This is what log
> backups are for.
> What is the recovery mode for your database? If it is simple, then the information needed to
> recover is most probably not in the ldf file anymore. If it is full or bulk logged, then you can
> give any of the log reader tools a try. I have listed some on my links page.
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
>
> "Jorge C" <rdc02271@.yahoo.com> wrote in message news:uLIyLmbRFHA.204@.TK2MSFTNGP15.phx.gbl...
>> Hello!
>> The database is giving the torn page error.
>> I have yesterday's backup and today's log file ldf.
>> How do I apply the log file to database? We didn't backup today's log...
>> Thanks for your help and attention.
>> Jorge C.
>> rdc02271@.yahoo.com
>>
>

How do auto rename datafiles on a multiple restore?

Hello,
i have a SQL 2005 question.
I create multiple databases from a specific backup file.
I want the database to rename the data & log files automatically if
they already exist (due to the prior creation). I know it is possible,
I do not know how to configure it.
YanivYaniv,shalom
Take a look at
ms-help://MS.SQLCC.v9/MS.SQLSVR.v9.en/tsqlref9/html/15f8affd-8f39-4021-b092-
0379fc6983da.htm
"ALTER DATABASE" topic in the BOL
<yaniv.harpaz@.gmail.com> wrote in message
news:1153657523.137164.319050@.i42g2000cwa.googlegroups.com...
> Hello,
> i have a SQL 2005 question.
> I create multiple databases from a specific backup file.
> I want the database to rename the data & log files automatically if
> they already exist (due to the prior creation). I know it is possible,
> I do not know how to configure it.
> Yaniv
>|||Hi Uri, thanks for the answer.
Could you gimme a focus (which option are you referring to)?
Shouldn't that be on the instance level?
Yaniv
Uri Dimant wrote:[vbcol=seagreen]
> Yaniv,shalom
> Take a look at
> ms-help://MS.SQLCC.v9/MS.SQLSVR.v9.en/tsqlref9/html/15f8affd-8f39-4021-b09
2-0379fc6983da.htm
> "ALTER DATABASE" topic in the BOL
>
>
> <yaniv.harpaz@.gmail.com> wrote in message
> news:1153657523.137164.319050@.i42g2000cwa.googlegroups.com...|||<yaniv.harpaz@.gmail.com> wrote in message
news:1153657523.137164.319050@.i42g2000cwa.googlegroups.com...
> Hello,
> i have a SQL 2005 question.
> I create multiple databases from a specific backup file.
> I want the database to rename the data & log files automatically if
> they already exist (due to the prior creation). I know it is possible,
> I do not know how to configure it.
>
Check out RESTORE DATABASE ... WITH MOVE in BOL
David|||That's what I am using currently.
I want to be able automatically restore any file I get,
without manually rename each logical file into a new physical one.
David Browne wrote:
> <yaniv.harpaz@.gmail.com> wrote in message
> news:1153657523.137164.319050@.i42g2000cwa.googlegroups.com...
>
> Check out RESTORE DATABASE ... WITH MOVE in BOL
>
> David|||<yaniv.harpaz@.gmail.com> wrote in message
news:1153673350.370810.24470@.s13g2000cwa.googlegroups.com...
> That's what I am using currently.
> I want to be able automatically restore any file I get,
> without manually rename each logical file into a new physical one.
Not clear then exactly what you're missing then.
Build the string for the file name and use dynamic SQL to execute it.

> David Browne wrote:
>|||I wanted to know if I can manage without it.
Restore and let the server generate the data & log files automatically
on the default locations.
Greg D. Moore (Strider) wrote:[vbcol=seagreen]
> <yaniv.harpaz@.gmail.com> wrote in message
> news:1153673350.370810.24470@.s13g2000cwa.googlegroups.com...
> Not clear then exactly what you're missing then.
> Build the string for the file name and use dynamic SQL to execute it.
>|||<yaniv.harpaz@.gmail.com> wrote in message
news:1153739359.238308.167670@.m73g2000cwd.googlegroups.com...
> I wanted to know if I can manage without it.
> Restore and let the server generate the data & log files automatically
> on the default locations.
No. The restore process restores the database to the location indicated
within the backup.
The only way I'm aware of changing this is the WITH MOVE option.

> Greg D. Moore (Strider) wrote:
if[vbcol=seagreen]
possible,[vbcol=seagreen]
>|||I am trying this on one of my servers and it is working and on the
other it doesn't. how come?
I am using the same backup file.
create database "George_1Month001"
go
restore database "George_1Month001" from
disk='c:\MSSQL\BackupFiles\Ver141-Sample' with replace
go
-- Restore into a new database
create database "George_1Month002"
go
restore database "George_1Month002" from
disk='c:\MSSQL\BackupFiles\Ver141-Sample' with replace
go
-- Restore into a new database
create database "George_1Month003"
go
restore database "George_1Month003" from
disk='c:\MSSQL\BackupFiles\Ver141-Sample' with replace
go
Greg D. Moore (Strider) wrote:[vbcol=seagreen]
> <yaniv.harpaz@.gmail.com> wrote in message
> news:1153739359.238308.167670@.m73g2000cwd.googlegroups.com...
> No. The restore process restores the database to the location indicated
> within the backup.
> The only way I'm aware of changing this is the WITH MOVE option.
>
> if
> possible,|||yaniv.harpaz@.gmail.com wrote:
> I am trying this on one of my servers and it is working and on the
> other it doesn't. how come?
> I am using the same backup file.
> create database "George_1Month001"
> go
> restore database "George_1Month001" from
> disk='c:\MSSQL\BackupFiles\Ver141-Sample' with replace
> go
> -- Restore into a new database
> create database "George_1Month002"
> go
> restore database "George_1Month002" from
> disk='c:\MSSQL\BackupFiles\Ver141-Sample' with replace
> go
> -- Restore into a new database
> create database "George_1Month003"
> go
> restore database "George_1Month003" from
> disk='c:\MSSQL\BackupFiles\Ver141-Sample' with replace
> go
>
>
Could you post the error message(s) you get ?
Regards
Steen Schlter Persson
Databaseadministrator / Systemadministrator

How do auto rename datafiles on a multiple restore?

Hello,
i have a SQL 2005 question.
I create multiple databases from a specific backup file.
I want the database to rename the data & log files automatically if
they already exist (due to the prior creation). I know it is possible,
I do not know how to configure it.
YanivYaniv,shalom
Take a look at
ms-help://MS.SQLCC.v9/MS.SQLSVR.v9.en/tsqlref9/html/15f8affd-8f39-4021-b092-0379fc6983da.htm
"ALTER DATABASE" topic in the BOL
<yaniv.harpaz@.gmail.com> wrote in message
news:1153657523.137164.319050@.i42g2000cwa.googlegroups.com...
> Hello,
> i have a SQL 2005 question.
> I create multiple databases from a specific backup file.
> I want the database to rename the data & log files automatically if
> they already exist (due to the prior creation). I know it is possible,
> I do not know how to configure it.
> Yaniv
>|||Hi Uri, thanks for the answer.
Could you gimme a focus (which option are you referring to)?
Shouldn't that be on the instance level?
Yaniv
Uri Dimant wrote:
> Yaniv,shalom
> Take a look at
> ms-help://MS.SQLCC.v9/MS.SQLSVR.v9.en/tsqlref9/html/15f8affd-8f39-4021-b092-0379fc6983da.htm
> "ALTER DATABASE" topic in the BOL
>
>
> <yaniv.harpaz@.gmail.com> wrote in message
> news:1153657523.137164.319050@.i42g2000cwa.googlegroups.com...
> > Hello,
> > i have a SQL 2005 question.
> > I create multiple databases from a specific backup file.
> >
> > I want the database to rename the data & log files automatically if
> > they already exist (due to the prior creation). I know it is possible,
> > I do not know how to configure it.
> >
> > Yaniv
> >|||<yaniv.harpaz@.gmail.com> wrote in message
news:1153657523.137164.319050@.i42g2000cwa.googlegroups.com...
> Hello,
> i have a SQL 2005 question.
> I create multiple databases from a specific backup file.
> I want the database to rename the data & log files automatically if
> they already exist (due to the prior creation). I know it is possible,
> I do not know how to configure it.
>
Check out RESTORE DATABASE ... WITH MOVE in BOL
David|||That's what I am using currently.
I want to be able automatically restore any file I get,
without manually rename each logical file into a new physical one.
David Browne wrote:
> <yaniv.harpaz@.gmail.com> wrote in message
> news:1153657523.137164.319050@.i42g2000cwa.googlegroups.com...
> > Hello,
> > i have a SQL 2005 question.
> > I create multiple databases from a specific backup file.
> >
> > I want the database to rename the data & log files automatically if
> > they already exist (due to the prior creation). I know it is possible,
> > I do not know how to configure it.
> >
>
> Check out RESTORE DATABASE ... WITH MOVE in BOL
>
> David|||<yaniv.harpaz@.gmail.com> wrote in message
news:1153673350.370810.24470@.s13g2000cwa.googlegroups.com...
> That's what I am using currently.
> I want to be able automatically restore any file I get,
> without manually rename each logical file into a new physical one.
Not clear then exactly what you're missing then.
Build the string for the file name and use dynamic SQL to execute it.
> David Browne wrote:
> > <yaniv.harpaz@.gmail.com> wrote in message
> > news:1153657523.137164.319050@.i42g2000cwa.googlegroups.com...
> > > Hello,
> > > i have a SQL 2005 question.
> > > I create multiple databases from a specific backup file.
> > >
> > > I want the database to rename the data & log files automatically if
> > > they already exist (due to the prior creation). I know it is possible,
> > > I do not know how to configure it.
> > >
> >
> >
> > Check out RESTORE DATABASE ... WITH MOVE in BOL
> >
> >
> > David
>|||I wanted to know if I can manage without it.
Restore and let the server generate the data & log files automatically
on the default locations.
Greg D. Moore (Strider) wrote:
> <yaniv.harpaz@.gmail.com> wrote in message
> news:1153673350.370810.24470@.s13g2000cwa.googlegroups.com...
> > That's what I am using currently.
> > I want to be able automatically restore any file I get,
> > without manually rename each logical file into a new physical one.
> Not clear then exactly what you're missing then.
> Build the string for the file name and use dynamic SQL to execute it.
>
> >
> > David Browne wrote:
> > > <yaniv.harpaz@.gmail.com> wrote in message
> > > news:1153657523.137164.319050@.i42g2000cwa.googlegroups.com...
> > > > Hello,
> > > > i have a SQL 2005 question.
> > > > I create multiple databases from a specific backup file.
> > > >
> > > > I want the database to rename the data & log files automatically if
> > > > they already exist (due to the prior creation). I know it is possible,
> > > > I do not know how to configure it.
> > > >
> > >
> > >
> > > Check out RESTORE DATABASE ... WITH MOVE in BOL
> > >
> > >
> > > David
> >|||<yaniv.harpaz@.gmail.com> wrote in message
news:1153739359.238308.167670@.m73g2000cwd.googlegroups.com...
> I wanted to know if I can manage without it.
> Restore and let the server generate the data & log files automatically
> on the default locations.
No. The restore process restores the database to the location indicated
within the backup.
The only way I'm aware of changing this is the WITH MOVE option.
> Greg D. Moore (Strider) wrote:
> > <yaniv.harpaz@.gmail.com> wrote in message
> > news:1153673350.370810.24470@.s13g2000cwa.googlegroups.com...
> > > That's what I am using currently.
> > > I want to be able automatically restore any file I get,
> > > without manually rename each logical file into a new physical one.
> >
> > Not clear then exactly what you're missing then.
> >
> > Build the string for the file name and use dynamic SQL to execute it.
> >
> >
> > >
> > > David Browne wrote:
> > > > <yaniv.harpaz@.gmail.com> wrote in message
> > > > news:1153657523.137164.319050@.i42g2000cwa.googlegroups.com...
> > > > > Hello,
> > > > > i have a SQL 2005 question.
> > > > > I create multiple databases from a specific backup file.
> > > > >
> > > > > I want the database to rename the data & log files automatically
if
> > > > > they already exist (due to the prior creation). I know it is
possible,
> > > > > I do not know how to configure it.
> > > > >
> > > >
> > > >
> > > > Check out RESTORE DATABASE ... WITH MOVE in BOL
> > > >
> > > >
> > > > David
> > >
>|||I am trying this on one of my servers and it is working and on the
other it doesn't. how come?
I am using the same backup file.
create database "George_1Month001"
go
restore database "George_1Month001" from
disk='c:\MSSQL\BackupFiles\Ver141-Sample' with replace
go
-- Restore into a new database
create database "George_1Month002"
go
restore database "George_1Month002" from
disk='c:\MSSQL\BackupFiles\Ver141-Sample' with replace
go
-- Restore into a new database
create database "George_1Month003"
go
restore database "George_1Month003" from
disk='c:\MSSQL\BackupFiles\Ver141-Sample' with replace
go
Greg D. Moore (Strider) wrote:
> <yaniv.harpaz@.gmail.com> wrote in message
> news:1153739359.238308.167670@.m73g2000cwd.googlegroups.com...
> > I wanted to know if I can manage without it.
> > Restore and let the server generate the data & log files automatically
> > on the default locations.
> No. The restore process restores the database to the location indicated
> within the backup.
> The only way I'm aware of changing this is the WITH MOVE option.
>
> >
> > Greg D. Moore (Strider) wrote:
> > > <yaniv.harpaz@.gmail.com> wrote in message
> > > news:1153673350.370810.24470@.s13g2000cwa.googlegroups.com...
> > > > That's what I am using currently.
> > > > I want to be able automatically restore any file I get,
> > > > without manually rename each logical file into a new physical one.
> > >
> > > Not clear then exactly what you're missing then.
> > >
> > > Build the string for the file name and use dynamic SQL to execute it.
> > >
> > >
> > > >
> > > > David Browne wrote:
> > > > > <yaniv.harpaz@.gmail.com> wrote in message
> > > > > news:1153657523.137164.319050@.i42g2000cwa.googlegroups.com...
> > > > > > Hello,
> > > > > > i have a SQL 2005 question.
> > > > > > I create multiple databases from a specific backup file.
> > > > > >
> > > > > > I want the database to rename the data & log files automatically
> if
> > > > > > they already exist (due to the prior creation). I know it is
> possible,
> > > > > > I do not know how to configure it.
> > > > > >
> > > > >
> > > > >
> > > > > Check out RESTORE DATABASE ... WITH MOVE in BOL
> > > > >
> > > > >
> > > > > David
> > > >
> >|||yaniv.harpaz@.gmail.com wrote:
> I am trying this on one of my servers and it is working and on the
> other it doesn't. how come?
> I am using the same backup file.
> create database "George_1Month001"
> go
> restore database "George_1Month001" from
> disk='c:\MSSQL\BackupFiles\Ver141-Sample' with replace
> go
> -- Restore into a new database
> create database "George_1Month002"
> go
> restore database "George_1Month002" from
> disk='c:\MSSQL\BackupFiles\Ver141-Sample' with replace
> go
> -- Restore into a new database
> create database "George_1Month003"
> go
> restore database "George_1Month003" from
> disk='c:\MSSQL\BackupFiles\Ver141-Sample' with replace
> go
>
>
Could you post the error message(s) you get ?
Regards
Steen Schlüter Persson
Databaseadministrator / Systemadministrator|||for Example -
Msg 1834, Level 16, State 1, Line 1
The file 'c:\MSSQL\data\CleanDB_1001371.mdf' cannot be overwritten. It
is being used by database 'Cyprus_1Month002'.
Msg 3156, Level 16, State 4, Line 1
File 'CleanDB_1001371' cannot be restored to
'c:\MSSQL\data\CleanDB_1001371.mdf'. Use WITH MOVE to identify a valid
location for the file.
Msg 1834, Level 16, State 1, Line 1
The file 'c:\MSSQL\data\CleanDB_1001371_log.LDF' cannot be overwritten.
It is being used by database 'Cyprus_1Month002'.
Msg 3156, Level 16, State 4, Line 1
File 'CleanDB_1001371_log' cannot be restored to
'c:\MSSQL\data\CleanDB_1001371_log.LDF'. Use WITH MOVE to identify a
valid location for the file.
Msg 3119, Level 16, State 1, Line 1
Problems were identified while planning for the RESTORE statement.
Previous messages provide details.
Msg 3013, Level 16, State 1, Line 1
RESTORE DATABASE is terminating abnormally.
Steen Persson (DK) wrote:
> yaniv.harpaz@.gmail.com wrote:
> > I am trying this on one of my servers and it is working and on the
> > other it doesn't. how come?
> > I am using the same backup file.
> >
> > create database "George_1Month001"
> > go
> >
> > restore database "George_1Month001" from
> > disk=3D'c:\MSSQL\BackupFiles\Ver141-Sample' with replace
> > go
> >
> > -- Restore into a new database
> > create database "George_1Month002"
> > go
> >
> > restore database "George_1Month002" from
> > disk=3D'c:\MSSQL\BackupFiles\Ver141-Sample' with replace
> > go
> >
> > -- Restore into a new database
> > create database "George_1Month003"
> > go
> >
> > restore database "George_1Month003" from
> > disk=3D'c:\MSSQL\BackupFiles\Ver141-Sample' with replace
> > go
> >
> >
> >
> Could you post the error message(s) you get ?
>
> --
> Regards
> Steen Schl=FCter Persson
> Databaseadministrator / Systemadministrator|||yaniv.harpaz@.gmail.com wrote:
> for Example -
> Msg 1834, Level 16, State 1, Line 1
> The file 'c:\MSSQL\data\CleanDB_1001371.mdf' cannot be overwritten. It
> is being used by database 'Cyprus_1Month002'.
> Msg 3156, Level 16, State 4, Line 1
> File 'CleanDB_1001371' cannot be restored to
> 'c:\MSSQL\data\CleanDB_1001371.mdf'. Use WITH MOVE to identify a valid
> location for the file.
> Msg 1834, Level 16, State 1, Line 1
> The file 'c:\MSSQL\data\CleanDB_1001371_log.LDF' cannot be overwritten.
> It is being used by database 'Cyprus_1Month002'.
> Msg 3156, Level 16, State 4, Line 1
> File 'CleanDB_1001371_log' cannot be restored to
> 'c:\MSSQL\data\CleanDB_1001371_log.LDF'. Use WITH MOVE to identify a
> valid location for the file.
> Msg 3119, Level 16, State 1, Line 1
> Problems were identified while planning for the RESTORE statement.
> Previous messages provide details.
> Msg 3013, Level 16, State 1, Line 1
> RESTORE DATABASE is terminating abnormally.
>
But then you have the solution in the error message - use the MOVE
option. SQL server tries to restore to the original files but those
files are in use by another database.
Look up RESTORE command in Books On Line - that will give you all the
options and syntax you need.
Regards
Steen Schlüter Persson
Databaseadministrator / Systemadministrator|||have a look at one of the prior posts I wrote.
I want it to take place automatically, without manually telling the SQL
Server which physical path the data files should have.
there is one server in which I can do it, but I do not know what is the
difference in the configuration. this one works:
create database "George_1Month001"
go
restore database "George_1Month001" from
disk=3D'c:\MSSQL\BackupFiles\Ver141-Sample' with replace
go
-- Restore into a new database
create database "George_1Month002"
go
restore database "George_1Month002" from
disk=3D'c:\MSSQL\BackupFiles\Ver141-Sample' with replace
go
Steen Persson (DK) wrote:
> yaniv.harpaz@.gmail.com wrote:
> > for Example -
> > Msg 1834, Level 16, State 1, Line 1
> > The file 'c:\MSSQL\data\CleanDB_1001371.mdf' cannot be overwritten. It
> > is being used by database 'Cyprus_1Month002'.
> > Msg 3156, Level 16, State 4, Line 1
> > File 'CleanDB_1001371' cannot be restored to
> > 'c:\MSSQL\data\CleanDB_1001371.mdf'. Use WITH MOVE to identify a valid
> > location for the file.
> > Msg 1834, Level 16, State 1, Line 1
> > The file 'c:\MSSQL\data\CleanDB_1001371_log.LDF' cannot be overwritten.
> > It is being used by database 'Cyprus_1Month002'.
> > Msg 3156, Level 16, State 4, Line 1
> > File 'CleanDB_1001371_log' cannot be restored to
> > 'c:\MSSQL\data\CleanDB_1001371_log.LDF'. Use WITH MOVE to identify a
> > valid location for the file.
> > Msg 3119, Level 16, State 1, Line 1
> > Problems were identified while planning for the RESTORE statement.
> > Previous messages provide details.
> > Msg 3013, Level 16, State 1, Line 1
> > RESTORE DATABASE is terminating abnormally.
> >
> >
> But then you have the solution in the error message - use the MOVE
> option. SQL server tries to restore to the original files but those
> files are in use by another database.
> Look up RESTORE command in Books On Line - that will give you all the
> options and syntax you need.
>
> --
> Regards
> Steen Schl=FCter Persson
> Databaseadministrator / Systemadministrator|||yaniv.harpaz@.gmail.com wrote:
> have a look at one of the prior posts I wrote.
> I want it to take place automatically, without manually telling the SQL
> Server which physical path the data files should have.
> there is one server in which I can do it, but I do not know what is the
> difference in the configuration. this one works:
> create database "George_1Month001"
> go
> restore database "George_1Month001" from
> disk='c:\MSSQL\BackupFiles\Ver141-Sample' with replace
> go
> -- Restore into a new database
> create database "George_1Month002"
> go
> restore database "George_1Month002" from
> disk='c:\MSSQL\BackupFiles\Ver141-Sample' with replace
> go
>
There must be a difference in these 2 servers. The errormessage you
posted, says that the mdf file can't be overwritten because it's used by
another database. Try to check if any other database on that server, is
using that mdf file. What about the disk an directory layout - is that
the same on both servers?
Regards
Steen Schlüter Persson
Databaseadministrator / Systemadministrator

how data file and log file grow?

Greetings,

The following shows how the Properties of a database look like:

Data Files:

File Name: student_dat
Location: e:\data\MSSQL\Data\student.mdf
Space allocated (MB): 62
'Automatically grow file' checked
File growth: 'By percent 10%' checked
Maximum file size: 'Unrestricted file growth' checked

Transaction Log:

File Name: student_log
Location: e:\data\MSSQL\Data\student.ldf
Space allocated (MB): 52
'Automatically grow file' checked
File growth: 'By percent 10%' checked
Maximum file size: 'Unrestricted file growth' checked

The physical files look like this:

Name Size Type Modified
---------------
student.ldf 52,416 KB Database File 2/11/2004 10:34PM
student.mdf 63,424 KB Database File 2/11/2004 10:34PM

My question is now that it has been specified 'Unrestricted file growth'
for both the data and the log file, why both haven't increased any in
size since 2/11/2004? Actually, the modified timestamps of some other
databases files are also '2/11/2004 10:34PM'. That's weird.

I found the following message that's relevent to the above timestamp in
the SQL Server Logs:

=====
2004-02-11 22:34:10.12 server SQL Server terminating because of
system shutdown.
=====

I'm pretty sure there have been a lot updates taking place on this
database. We don't hear any complaints from the customers that they
have had any problems (such as, no space left) with the databases.
Did the SQL server write the data and log somewhere else?

Any insight on what's going on would be appreciated.

BingBing Du (bdu@.iastate.edu) writes:
> The physical files look like this:
> Name Size Type Modified
> ---------------
> student.ldf 52,416 KB Database File 2/11/2004 10:34PM
> student.mdf 63,424 KB Database File 2/11/2004 10:34PM
> My question is now that it has been specified 'Unrestricted file growth'
> for both the data and the log file, why both haven't increased any in
> size since 2/11/2004? Actually, the modified timestamps of some other
> databases files are also '2/11/2004 10:34PM'. That's weird.

If the files are said to be modified in November this year, then there
is something fishy.

> I found the following message that's relevent to the above timestamp in
> the SQL Server Logs:
>=====
> 2004-02-11 22:34:10.12 server SQL Server terminating because of
> system shutdown.
>=====

But if the date is supposed to be in February, then it seems that files
has not been touched since. Either the files were detached, or the
databases has not been set to autoclose. Or the entire SQL Server instance
has not been running since then.

On my machine, about all my databases has a last modified date of
2004-03-01. I started SQL Server today, but I have not visited all
databases. But on startup, SQL Server performs recovery of all databases,
and thus writes to them.

--
Erland Sommarskog, SQL Server MVP, sommar@.algonet.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp|||Thanks for the instant response!

No, not November. The files were last modified on 2/11/2004. That's
Feb. 11, 2004. If the files were detached, the users would not be able
to access the databases, right? But we have not heard any complaints.
I don't think those databases haven't been touched since 2/11/2004.
These databases are in production. A lot updates are going on every
day. From my understanding, any updates (insert, update, delete) should
trigger the modified timestamp change on the files. Also, the SQL
server instance has been running fine since then. The only thing I'm
not sure is 'databases has not been set to autoclose' you mentioned.
Where can I find that setting?

Bing

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!|||I've checked the sysdatabases table. The 'status' is 16 for all our
user databases. Per SQL Server Online Book, '1 = autoclose, set with
sp_dboption' and
'16 = torn page detection, set with sp_dboption'. Do I need to change
'status'?

Another thing was the SQL Server Agent was not set to start
automatically whenever the SQL Server instance is started. Our server
instance terminated and started on 2/11/2004. We started the SQL Server
Agent manually on 2/15/2004. Would this have done anything to make the
database files not been changed since 2/11/2004?

Bing

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!|||I've checked the sysdatabases table. The 'status' is 16 for all our
user databases. Per SQL Server Online Book, '1 = autoclose, set with
sp_dboption' and
'16 = torn page detection, set with sp_dboption'. Do I need to change
'status'?

Another thing was the SQL Server Agent was not set to start
automatically whenever the SQL Server instance is started. Our server
instance terminated and started on 2/11/2004. We started the SQL Server
Agent manually on 2/15/2004. Would this have done anything to make the
database files not been changed since 2/11/2004?

Bing

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!|||comp.databases.ms-sqlserver (anonymous@.devdex.com) writes:
> No, not November. The files were last modified on 2/11/2004. That's
> Feb. 11, 2004.

Not in any date format I would use. :-)

> If the files were detached, the users would not be able to access the
> databases, right? But we have not heard any complaints. I don't think
> those databases haven't been touched since 2/11/2004. These databases
> are in production. A lot updates are going on every day. From my
> understanding, any updates (insert, update, delete) should trigger the
> modified timestamp change on the files. Also, the SQL server instance
> has been running fine since then. The only thing I'm not sure is
> 'databases has not been set to autoclose' you mentioned. Where can I
> find that setting?

Looks like I spoke too soon when I said that my files had a date that
agreed with my latest startup of SQL Server. I forgot that I rarely to
to bed before midnight, so the times I saw was from the last shutdown
as in your case. So I guess that everything's normal.

As for autogrow not setting in, one has to assume that the number of inserts
vs. the number deletes balances each other fairly well.

--
Erland Sommarskog, SQL Server MVP, sommar@.algonet.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp|||So are you saying the time actually shown for those MDF and LDF files
was the time the Server instance last terminated? Any updates (lke
INSERT, DELETE or UPDATE) won't get the timestamps changed?

Bing

Erland Sommarskog wrote:

> comp.databases.ms-sqlserver (anonymous@.devdex.com) writes:
>>No, not November. The files were last modified on 2/11/2004. That's
>>Feb. 11, 2004.
>
> Not in any date format I would use. :-)
>
>>If the files were detached, the users would not be able to access the
>>databases, right? But we have not heard any complaints. I don't think
>>those databases haven't been touched since 2/11/2004. These databases
>>are in production. A lot updates are going on every day. From my
>>understanding, any updates (insert, update, delete) should trigger the
>>modified timestamp change on the files. Also, the SQL server instance
>>has been running fine since then. The only thing I'm not sure is
>>'databases has not been set to autoclose' you mentioned. Where can I
>>find that setting?
>
> Looks like I spoke too soon when I said that my files had a date that
> agreed with my latest startup of SQL Server. I forgot that I rarely to
> to bed before midnight, so the times I saw was from the last shutdown
> as in your case. So I guess that everything's normal.
> As for autogrow not setting in, one has to assume that the number of inserts
> vs. the number deletes balances each other fairly well.|||Bing Du (bdu@.iastate.edu) writes:
> So are you saying the time actually shown for those MDF and LDF files
> was the time the Server instance last terminated? Any updates (lke
> INSERT, DELETE or UPDATE) won't get the timestamps changed?

It does not seem like that.

I would guess that if you set the database to autoclose, the date would
be updated each time the database was closed.

--
Erland Sommarskog, SQL Server MVP, sommar@.algonet.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp

Monday, March 26, 2012

how delete Log Shipping?

Hi,
I have Production database that needs to copied over to Developement
envirnoment where our developers can debug the issues we have in production.
I decided to go with log shipping and scheduled it to copy log every night to
Developemnt from Production.It worked fine...but the database was on
developement(seondry server)in read-only mode which when I tried to remove
gave me an error "database is in warm standby mode, alter database option
fails"
How do I do that developer would have full access (Not in Read-Only)to that
database on secondry server.
I tried to delete the log shipping (with the fear if the changes made to
seondry appear in primary database) and delete the log shipping from
maitenance plan but still not able to bring the database on secondry out of
read0only mode.
Thanks
ShanRESTORE DATABASE dbname WITH RECOVERY will bring it to "normal" state. But you won't be able to
restore any further transaction log backups after this.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
http://www.sqlug.se/
"Shan" <Shan@.discussions.microsoft.com> wrote in message
news:73B4BCC5-DED7-48C2-95EA-D289EE3E0BB3@.microsoft.com...
> Hi,
> I have Production database that needs to copied over to Developement
> envirnoment where our developers can debug the issues we have in production.
> I decided to go with log shipping and scheduled it to copy log every night to
> Developemnt from Production.It worked fine...but the database was on
> developement(seondry server)in read-only mode which when I tried to remove
> gave me an error "database is in warm standby mode, alter database option
> fails"
> How do I do that developer would have full access (Not in Read-Only)to that
> database on secondry server.
> I tried to delete the log shipping (with the fear if the changes made to
> seondry appear in primary database) and delete the log shipping from
> maitenance plan but still not able to bring the database on secondry out of
> read0only mode.
> Thanks
> Shan|||Thanks for your reply, It worked. Then what kind of approach I should be
adapting when I have to backup database from one server to another server on
regular bases provided that databases on secondry server available to user
for all activities(Not Read-Only). Through the wizard the only two options I
see is "No Recovery" and "Standby".
Thanks
Shan
"Tibor Karaszi" wrote:
> RESTORE DATABASE dbname WITH RECOVERY will bring it to "normal" state. But you won't be able to
> restore any further transaction log backups after this.
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
> http://www.sqlug.se/
>
> "Shan" <Shan@.discussions.microsoft.com> wrote in message
> news:73B4BCC5-DED7-48C2-95EA-D289EE3E0BB3@.microsoft.com...
> > Hi,
> >
> > I have Production database that needs to copied over to Developement
> > envirnoment where our developers can debug the issues we have in production.
> > I decided to go with log shipping and scheduled it to copy log every night to
> > Developemnt from Production.It worked fine...but the database was on
> > developement(seondry server)in read-only mode which when I tried to remove
> > gave me an error "database is in warm standby mode, alter database option
> > fails"
> >
> > How do I do that developer would have full access (Not in Read-Only)to that
> > database on secondry server.
> >
> > I tried to delete the log shipping (with the fear if the changes made to
> > seondry appear in primary database) and delete the log shipping from
> > maitenance plan but still not able to bring the database on secondry out of
> > read0only mode.
> >
> > Thanks
> >
> > Shan
>
>|||'That is not possible using backup and restore (which is what log shipping is using). How would you
expect to restore a backup based on a prior backup if you have done modifications in the database
since you restored that prior backup? You might want to look at replication instead. I suggest you
read:
http://www.microsoft.com/technet/prodtechnol/sql/2000/deploy/sqlhalp.mspx
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
http://www.sqlug.se/
"Shan" <Shan@.discussions.microsoft.com> wrote in message
news:60664FEF-29FD-4F97-AEC9-F3AA4654586B@.microsoft.com...
> Thanks for your reply, It worked. Then what kind of approach I should be
> adapting when I have to backup database from one server to another server on
> regular bases provided that databases on secondry server available to user
> for all activities(Not Read-Only). Through the wizard the only two options I
> see is "No Recovery" and "Standby".
> Thanks
> Shan
> "Tibor Karaszi" wrote:
>> RESTORE DATABASE dbname WITH RECOVERY will bring it to "normal" state. But you won't be able to
>> restore any further transaction log backups after this.
>> --
>> Tibor Karaszi, SQL Server MVP
>> http://www.karaszi.com/sqlserver/default.asp
>> http://www.solidqualitylearning.com/
>> http://www.sqlug.se/
>>
>> "Shan" <Shan@.discussions.microsoft.com> wrote in message
>> news:73B4BCC5-DED7-48C2-95EA-D289EE3E0BB3@.microsoft.com...
>> > Hi,
>> >
>> > I have Production database that needs to copied over to Developement
>> > envirnoment where our developers can debug the issues we have in production.
>> > I decided to go with log shipping and scheduled it to copy log every night to
>> > Developemnt from Production.It worked fine...but the database was on
>> > developement(seondry server)in read-only mode which when I tried to remove
>> > gave me an error "database is in warm standby mode, alter database option
>> > fails"
>> >
>> > How do I do that developer would have full access (Not in Read-Only)to that
>> > database on secondry server.
>> >
>> > I tried to delete the log shipping (with the fear if the changes made to
>> > seondry appear in primary database) and delete the log shipping from
>> > maitenance plan but still not able to bring the database on secondry out of
>> > read0only mode.
>> >
>> > Thanks
>> >
>> > Shan
>>

how delete Log Shipping?

Hi,
I have Production database that needs to copied over to Developement
envirnoment where our developers can debug the issues we have in production.
I decided to go with log shipping and scheduled it to copy log every night t
o
Developemnt from Production.It worked fine...but the database was on
developement(seondry server)in read-only mode which when I tried to remove
gave me an error "database is in warm standby mode, alter database option
fails"
How do I do that developer would have full access (Not in Read-Only)to that
database on secondry server.
I tried to delete the log shipping (with the fear if the changes made to
seondry appear in primary database) and delete the log shipping from
maitenance plan but still not able to bring the database on secondry out of
read0only mode.
Thanks
ShanRESTORE DATABASE dbname WITH RECOVERY will bring it to "normal" state. But y
ou won't be able to
restore any further transaction log backups after this.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
http://www.sqlug.se/
"Shan" <Shan@.discussions.microsoft.com> wrote in message
news:73B4BCC5-DED7-48C2-95EA-D289EE3E0BB3@.microsoft.com...
> Hi,
> I have Production database that needs to copied over to Developement
> envirnoment where our developers can debug the issues we have in productio
n.
> I decided to go with log shipping and scheduled it to copy log every night
to
> Developemnt from Production.It worked fine...but the database was on
> developement(seondry server)in read-only mode which when I tried to remove
> gave me an error "database is in warm standby mode, alter database option
> fails"
> How do I do that developer would have full access (Not in Read-Only)to tha
t
> database on secondry server.
> I tried to delete the log shipping (with the fear if the changes made to
> seondry appear in primary database) and delete the log shipping from
> maitenance plan but still not able to bring the database on secondry out o
f
> read0only mode.
> Thanks
> Shan|||Thanks for your reply, It worked. Then what kind of approach I should be
adapting when I have to backup database from one server to another server on
regular bases provided that databases on secondry server available to user
for all activities(Not Read-Only). Through the wizard the only two options I
see is "No Recovery" and "Standby".
Thanks
Shan
"Tibor Karaszi" wrote:

> RESTORE DATABASE dbname WITH RECOVERY will bring it to "normal" state. But
you won't be able to
> restore any further transaction log backups after this.
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
> http://www.sqlug.se/
>
> "Shan" <Shan@.discussions.microsoft.com> wrote in message
> news:73B4BCC5-DED7-48C2-95EA-D289EE3E0BB3@.microsoft.com...
>
>|||'That is not possible using backup and restore (which is what log shipping i
s using). How would you
expect to restore a backup based on a prior backup if you have done modifica
tions in the database
since you restored that prior backup? You might want to look at replication
instead. I suggest you
read:
http://www.microsoft.com/technet/pr...oy/sqlhalp.mspx
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
http://www.sqlug.se/
"Shan" <Shan@.discussions.microsoft.com> wrote in message
news:60664FEF-29FD-4F97-AEC9-F3AA4654586B@.microsoft.com...[vbcol=seagreen]
> Thanks for your reply, It worked. Then what kind of approach I should be
> adapting when I have to backup database from one server to another server
on
> regular bases provided that databases on secondry server available to user
> for all activities(Not Read-Only). Through the wizard the only two options
I
> see is "No Recovery" and "Standby".
> Thanks
> Shan
> "Tibor Karaszi" wrote:
>

how delete Log Shipping?

Hi,
I have Production database that needs to copied over to Developement
envirnoment where our developers can debug the issues we have in production.
I decided to go with log shipping and scheduled it to copy log every night to
Developemnt from Production.It worked fine...but the database was on
developement(seondry server)in read-only mode which when I tried to remove
gave me an error "database is in warm standby mode, alter database option
fails"
How do I do that developer would have full access (Not in Read-Only)to that
database on secondry server.
I tried to delete the log shipping (with the fear if the changes made to
seondry appear in primary database) and delete the log shipping from
maitenance plan but still not able to bring the database on secondry out of
read0only mode.
Thanks
Shan
RESTORE DATABASE dbname WITH RECOVERY will bring it to "normal" state. But you won't be able to
restore any further transaction log backups after this.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
http://www.sqlug.se/
"Shan" <Shan@.discussions.microsoft.com> wrote in message
news:73B4BCC5-DED7-48C2-95EA-D289EE3E0BB3@.microsoft.com...
> Hi,
> I have Production database that needs to copied over to Developement
> envirnoment where our developers can debug the issues we have in production.
> I decided to go with log shipping and scheduled it to copy log every night to
> Developemnt from Production.It worked fine...but the database was on
> developement(seondry server)in read-only mode which when I tried to remove
> gave me an error "database is in warm standby mode, alter database option
> fails"
> How do I do that developer would have full access (Not in Read-Only)to that
> database on secondry server.
> I tried to delete the log shipping (with the fear if the changes made to
> seondry appear in primary database) and delete the log shipping from
> maitenance plan but still not able to bring the database on secondry out of
> read0only mode.
> Thanks
> Shan
|||Thanks for your reply, It worked. Then what kind of approach I should be
adapting when I have to backup database from one server to another server on
regular bases provided that databases on secondry server available to user
for all activities(Not Read-Only). Through the wizard the only two options I
see is "No Recovery" and "Standby".
Thanks
Shan
"Tibor Karaszi" wrote:

> RESTORE DATABASE dbname WITH RECOVERY will bring it to "normal" state. But you won't be able to
> restore any further transaction log backups after this.
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
> http://www.sqlug.se/
>
> "Shan" <Shan@.discussions.microsoft.com> wrote in message
> news:73B4BCC5-DED7-48C2-95EA-D289EE3E0BB3@.microsoft.com...
>
>
|||'That is not possible using backup and restore (which is what log shipping is using). How would you
expect to restore a backup based on a prior backup if you have done modifications in the database
since you restored that prior backup? You might want to look at replication instead. I suggest you
read:
http://www.microsoft.com/technet/pro...y/sqlhalp.mspx
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
http://www.sqlug.se/
"Shan" <Shan@.discussions.microsoft.com> wrote in message
news:60664FEF-29FD-4F97-AEC9-F3AA4654586B@.microsoft.com...[vbcol=seagreen]
> Thanks for your reply, It worked. Then what kind of approach I should be
> adapting when I have to backup database from one server to another server on
> regular bases provided that databases on secondry server available to user
> for all activities(Not Read-Only). Through the wizard the only two options I
> see is "No Recovery" and "Standby".
> Thanks
> Shan
> "Tibor Karaszi" wrote:

How delete a log file

I have unfortunately create a second log file for a database.
So i have now 1 DataFile.mdf, 1 DataLog1.ldf and 1 DataLog2.ldf
I would delete DataLog2.ldf, but it's now the active log file, and the
operation can't terminate.
Thanks
Try DBCC SHRINKFILE with the EMPTYFILE option.
Hope this helps.
Dan Guzman
SQL Server MVP
"Jean-Paul" <Jean-Paul@.discussions.microsoft.com> wrote in message
news:56283E5B-FB80-46DA-8DEE-D446F940F43C@.microsoft.com...
> I have unfortunately create a second log file for a database.
> So i have now 1 DataFile.mdf, 1 DataLog1.ldf and 1 DataLog2.ldf
> I would delete DataLog2.ldf, but it's now the active log file, and the
> operation can't terminate.
> Thanks
|||Hi Jean-Paul,
Can you try detaching the database, delete the log file and then attach
the database? There are packages available within sqlserver "sp_detach_db"
and
"sp_attach_single_file_db".? Take a backup to be safe before making this
structural change.
Thanks,
Chandan Dutta
"Jean-Paul" wrote:

> I have unfortunately create a second log file for a database.
> So i have now 1 DataFile.mdf, 1 DataLog1.ldf and 1 DataLog2.ldf
> I would delete DataLog2.ldf, but it's now the active log file, and the
> operation can't terminate.
> Thanks
|||Hi Chandan,
sp_attach_single_file_db command might fail if you have multiple LDF files.
As well it is risky to do this command on a production server.
Jean_paul,
You could follow the Dan Guzmans option, I can detail you the steps to
remove 1 LDF file :-
Insted of detaching the database you can empty the second LDF and Remove the
file.
How to check the number of LDF files used by a database:-
sp_helpdb <dbname>
If you have 2 LDF files ,to remove a file , you must first have the data
moved off of the file onto the other members in the data set.
To do this, use the EMPTY FILE parameter in DBCC SHRINKFILE command. This
will empty the file and mark it as unavailable.
See the commands to remove a ldf :-
backup log <dbname> to disk='c:\backup\dbname.trn'
go
use <dbname>
go
dbcc shrinkfile('logical_log_filename_to_delete','empty file')
go
alter database <dbname> remove file 'logical_log_file_name_to_delete'
Thanks
Hari
MCDBA
"Chandan Dutta" <ChandanDutta@.discussions.microsoft.com> wrote in message
news:25EC1FE9-F2AB-4AD4-BE70-48D06165A384@.microsoft.com...
> Hi Jean-Paul,
> Can you try detaching the database, delete the log file and then
attach[vbcol=seagreen]
> the database? There are packages available within sqlserver "sp_detach_db"
> and
> "sp_attach_single_file_db".? Take a backup to be safe before making this
> structural change.
> Thanks,
> Chandan Dutta
>
> "Jean-Paul" wrote:
sql

How delete a log file

I have unfortunately create a second log file for a database.
So i have now 1 DataFile.mdf, 1 DataLog1.ldf and 1 DataLog2.ldf
I would delete DataLog2.ldf, but it's now the active log file, and the
operation can't terminate.
ThanksTry DBCC SHRINKFILE with the EMPTYFILE option.
Hope this helps.
Dan Guzman
SQL Server MVP
"Jean-Paul" <Jean-Paul@.discussions.microsoft.com> wrote in message
news:56283E5B-FB80-46DA-8DEE-D446F940F43C@.microsoft.com...
> I have unfortunately create a second log file for a database.
> So i have now 1 DataFile.mdf, 1 DataLog1.ldf and 1 DataLog2.ldf
> I would delete DataLog2.ldf, but it's now the active log file, and the
> operation can't terminate.
> Thanks|||Hi Jean-Paul,
Can you try detaching the database, delete the log file and then attach
the database? There are packages available within sqlserver "sp_detach_db"
and
"sp_attach_single_file_db".? Take a backup to be safe before making this
structural change.
Thanks,
Chandan Dutta
"Jean-Paul" wrote:

> I have unfortunately create a second log file for a database.
> So i have now 1 DataFile.mdf, 1 DataLog1.ldf and 1 DataLog2.ldf
> I would delete DataLog2.ldf, but it's now the active log file, and the
> operation can't terminate.
> Thanks|||Hi Chandan,
sp_attach_single_file_db command might fail if you have multiple LDF files.
As well it is risky to do this command on a production server.
Jean_paul,
You could follow the Dan Guzmans option, I can detail you the steps to
remove 1 LDF file :-
Insted of detaching the database you can empty the second LDF and Remove the
file.
How to check the number of LDF files used by a database:-
sp_helpdb <dbname>
If you have 2 LDF files ,to remove a file , you must first have the data
moved off of the file onto the other members in the data set.
To do this, use the EMPTY FILE parameter in DBCC SHRINKFILE command. This
will empty the file and mark it as unavailable.
See the commands to remove a ldf :-
backup log <dbname> to disk='c:\backup\dbname.trn'
go
use <dbname>
go
dbcc shrinkfile('logical_log_filename_to_dele
te','emptyfile')
go
alter database <dbname> remove file 'logical_log_file_name_to_delete'
Thanks
Hari
MCDBA
"Chandan Dutta" <ChandanDutta@.discussions.microsoft.com> wrote in message
news:25EC1FE9-F2AB-4AD4-BE70-48D06165A384@.microsoft.com...
> Hi Jean-Paul,
> Can you try detaching the database, delete the log file and then
attach[vbcol=seagreen]
> the database? There are packages available within sqlserver "sp_detach_db"
> and
> "sp_attach_single_file_db".? Take a backup to be safe before making this
> structural change.
> Thanks,
> Chandan Dutta
>
> "Jean-Paul" wrote:
>

How delete a log file

I have unfortunately create a second log file for a database.
So i have now 1 DataFile.mdf, 1 DataLog1.ldf and 1 DataLog2.ldf
I would delete DataLog2.ldf, but it's now the active log file, and the
operation can't terminate.
ThanksTry DBCC SHRINKFILE with the EMPTYFILE option.
--
Hope this helps.
Dan Guzman
SQL Server MVP
"Jean-Paul" <Jean-Paul@.discussions.microsoft.com> wrote in message
news:56283E5B-FB80-46DA-8DEE-D446F940F43C@.microsoft.com...
> I have unfortunately create a second log file for a database.
> So i have now 1 DataFile.mdf, 1 DataLog1.ldf and 1 DataLog2.ldf
> I would delete DataLog2.ldf, but it's now the active log file, and the
> operation can't terminate.
> Thanks|||Hi Chandan,
sp_attach_single_file_db command might fail if you have multiple LDF files.
As well it is risky to do this command on a production server.
Jean_paul,
You could follow the Dan Guzmans option, I can detail you the steps to
remove 1 LDF file :-
Insted of detaching the database you can empty the second LDF and Remove the
file.
How to check the number of LDF files used by a database:-
sp_helpdb <dbname>
If you have 2 LDF files ,to remove a file , you must first have the data
moved off of the file onto the other members in the data set.
To do this, use the EMPTY FILE parameter in DBCC SHRINKFILE command. This
will empty the file and mark it as unavailable.
See the commands to remove a ldf :-
backup log <dbname> to disk='c:\backup\dbname.trn'
go
use <dbname>
go
dbcc shrinkfile('logical_log_filename_to_delete','emptyfile')
go
alter database <dbname> remove file 'logical_log_file_name_to_delete'
--
Thanks
Hari
MCDBA
"Chandan Dutta" <ChandanDutta@.discussions.microsoft.com> wrote in message
news:25EC1FE9-F2AB-4AD4-BE70-48D06165A384@.microsoft.com...
> Hi Jean-Paul,
> Can you try detaching the database, delete the log file and then
attach
> the database? There are packages available within sqlserver "sp_detach_db"
> and
> "sp_attach_single_file_db".? Take a backup to be safe before making this
> structural change.
> Thanks,
> Chandan Dutta
>
> "Jean-Paul" wrote:
> > I have unfortunately create a second log file for a database.
> > So i have now 1 DataFile.mdf, 1 DataLog1.ldf and 1 DataLog2.ldf
> > I would delete DataLog2.ldf, but it's now the active log file, and the
> > operation can't terminate.
> >
> > Thanks

Friday, March 23, 2012

How could I reloaction primary transaction log file to another disk.

Hey, All,
Recently, we have installed a new raid disk on server, I want to migrate
transaction log to new disk for improving performance, is this possible and
how can I do it?
Thanks
YifeiOne method is to detach the database, move the log file and attach the
database files from the new location. See sp_detach_db and sp_attach_db in
the Books Online for details.
Hope this helps.
Dan Guzman
SQL Server MVP
"Yifei" <yjiang@.sdg.aust.com> wrote in message
news:%23hbx8Pk3DHA.1908@.TK2MSFTNGP10.phx.gbl...
quote:

> Hey, All,
> Recently, we have installed a new raid disk on server, I want to migrate
> transaction log to new disk for improving performance, is this possible

and
quote:

> how can I do it?
> Thanks
> Yifei
>
|||Hey, Dan,
I think I need to clarify that I only need change transaction log file
location and keep the database file as is.
I have tried detach and attach, it seems not work at this situation.
Any other ideas would be appreciated.
Thanks
Yifei
"Dan Guzman" <danguzman@.nospam-earthlink.net> wrote in message
news:%23jPQCkk3DHA.2144@.TK2MSFTNGP10.phx.gbl...
quote:

> One method is to detach the database, move the log file and attach the
> database files from the new location. See sp_detach_db and sp_attach_db

in
quote:

> the Books Online for details.
> --
> Hope this helps.
> Dan Guzman
> SQL Server MVP
> "Yifei" <yjiang@.sdg.aust.com> wrote in message
> news:%23hbx8Pk3DHA.1908@.TK2MSFTNGP10.phx.gbl...
> and
>
|||Dan is right,,, sp_attach/detach will work..
Do an sp_detachdb dbname,
then copy the log file to the new destination, and remove the orig.
then sp_attachdb dbname, datafilename, logfilename
Wayne Snyder, MCDBA, SQL Server MVP
Computer Education Services Corporation (CESC), Charlotte, NC
www.computeredservices.com
(Please respond only to the newsgroups.)
I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org
"Yifei" <yjiang@.sdg.aust.com> wrote in message
news:eKtOf8k3DHA.556@.TK2MSFTNGP11.phx.gbl...
quote:

> Hey, Dan,
> I think I need to clarify that I only need change transaction log file
> location and keep the database file as is.
> I have tried detach and attach, it seems not work at this situation.
> Any other ideas would be appreciated.
> Thanks
> Yifei
> "Dan Guzman" <danguzman@.nospam-earthlink.net> wrote in message
> news:%23jPQCkk3DHA.2144@.TK2MSFTNGP10.phx.gbl...
> in
migrate[QUOTE]
possible[QUOTE]
>
|||Like Wayne said, you can leave the data file(s) in the original location.
However, you should specify all database data and files when attaching the
database regardless of whether or not they were moved.
Hope this helps.
Dan Guzman
SQL Server MVP
"Yifei" <yjiang@.sdg.aust.com> wrote in message
news:eKtOf8k3DHA.556@.TK2MSFTNGP11.phx.gbl...
quote:

> Hey, Dan,
> I think I need to clarify that I only need change transaction log file
> location and keep the database file as is.
> I have tried detach and attach, it seems not work at this situation.
> Any other ideas would be appreciated.
> Thanks
> Yifei
> "Dan Guzman" <danguzman@.nospam-earthlink.net> wrote in message
> news:%23jPQCkk3DHA.2144@.TK2MSFTNGP10.phx.gbl...
> in
migrate[QUOTE]
possible[QUOTE]
>
|||Thanks Dan and Wayne, It works.
Yifei
"Wayne Snyder" <wsnyder@.computeredservices.com> wrote in message
news:uI5jQ1o3DHA.360@.TK2MSFTNGP12.phx.gbl...
quote:

> Dan is right,,, sp_attach/detach will work..
> Do an sp_detachdb dbname,
> then copy the log file to the new destination, and remove the orig.
> then sp_attachdb dbname, datafilename, logfilename
>
> --
> Wayne Snyder, MCDBA, SQL Server MVP
> Computer Education Services Corporation (CESC), Charlotte, NC
> www.computeredservices.com
> (Please respond only to the newsgroups.)
> I support the Professional Association of SQL Server (PASS) and it's
> community of SQL Server professionals.
> www.sqlpass.org
>
> "Yifei" <yjiang@.sdg.aust.com> wrote in message
> news:eKtOf8k3DHA.556@.TK2MSFTNGP11.phx.gbl...
sp_attach_db[QUOTE]
> migrate
> possible
>

How could I reloaction primary transaction log file to another disk.

Hey, All,
Recently, we have installed a new raid disk on server, I want to migrate
transaction log to new disk for improving performance, is this possible and
how can I do it?
Thanks
YifeiOne method is to detach the database, move the log file and attach the
database files from the new location. See sp_detach_db and sp_attach_db in
the Books Online for details.
--
Hope this helps.
Dan Guzman
SQL Server MVP
"Yifei" <yjiang@.sdg.aust.com> wrote in message
news:%23hbx8Pk3DHA.1908@.TK2MSFTNGP10.phx.gbl...
> Hey, All,
> Recently, we have installed a new raid disk on server, I want to migrate
> transaction log to new disk for improving performance, is this possible
and
> how can I do it?
> Thanks
> Yifei
>|||Hey, Dan,
I think I need to clarify that I only need change transaction log file
location and keep the database file as is.
I have tried detach and attach, it seems not work at this situation.
Any other ideas would be appreciated.
Thanks
Yifei
"Dan Guzman" <danguzman@.nospam-earthlink.net> wrote in message
news:%23jPQCkk3DHA.2144@.TK2MSFTNGP10.phx.gbl...
> One method is to detach the database, move the log file and attach the
> database files from the new location. See sp_detach_db and sp_attach_db
in
> the Books Online for details.
> --
> Hope this helps.
> Dan Guzman
> SQL Server MVP
> "Yifei" <yjiang@.sdg.aust.com> wrote in message
> news:%23hbx8Pk3DHA.1908@.TK2MSFTNGP10.phx.gbl...
> > Hey, All,
> >
> > Recently, we have installed a new raid disk on server, I want to migrate
> > transaction log to new disk for improving performance, is this possible
> and
> > how can I do it?
> >
> > Thanks
> >
> > Yifei
> >
> >
>|||Dan is right,,, sp_attach/detach will work..
Do an sp_detachdb dbname,
then copy the log file to the new destination, and remove the orig.
then sp_attachdb dbname, datafilename, logfilename
Wayne Snyder, MCDBA, SQL Server MVP
Computer Education Services Corporation (CESC), Charlotte, NC
www.computeredservices.com
(Please respond only to the newsgroups.)
I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org
"Yifei" <yjiang@.sdg.aust.com> wrote in message
news:eKtOf8k3DHA.556@.TK2MSFTNGP11.phx.gbl...
> Hey, Dan,
> I think I need to clarify that I only need change transaction log file
> location and keep the database file as is.
> I have tried detach and attach, it seems not work at this situation.
> Any other ideas would be appreciated.
> Thanks
> Yifei
> "Dan Guzman" <danguzman@.nospam-earthlink.net> wrote in message
> news:%23jPQCkk3DHA.2144@.TK2MSFTNGP10.phx.gbl...
> > One method is to detach the database, move the log file and attach the
> > database files from the new location. See sp_detach_db and sp_attach_db
> in
> > the Books Online for details.
> >
> > --
> > Hope this helps.
> >
> > Dan Guzman
> > SQL Server MVP
> >
> > "Yifei" <yjiang@.sdg.aust.com> wrote in message
> > news:%23hbx8Pk3DHA.1908@.TK2MSFTNGP10.phx.gbl...
> > > Hey, All,
> > >
> > > Recently, we have installed a new raid disk on server, I want to
migrate
> > > transaction log to new disk for improving performance, is this
possible
> > and
> > > how can I do it?
> > >
> > > Thanks
> > >
> > > Yifei
> > >
> > >
> >
> >
>|||Like Wayne said, you can leave the data file(s) in the original location.
However, you should specify all database data and files when attaching the
database regardless of whether or not they were moved.
--
Hope this helps.
Dan Guzman
SQL Server MVP
"Yifei" <yjiang@.sdg.aust.com> wrote in message
news:eKtOf8k3DHA.556@.TK2MSFTNGP11.phx.gbl...
> Hey, Dan,
> I think I need to clarify that I only need change transaction log file
> location and keep the database file as is.
> I have tried detach and attach, it seems not work at this situation.
> Any other ideas would be appreciated.
> Thanks
> Yifei
> "Dan Guzman" <danguzman@.nospam-earthlink.net> wrote in message
> news:%23jPQCkk3DHA.2144@.TK2MSFTNGP10.phx.gbl...
> > One method is to detach the database, move the log file and attach the
> > database files from the new location. See sp_detach_db and sp_attach_db
> in
> > the Books Online for details.
> >
> > --
> > Hope this helps.
> >
> > Dan Guzman
> > SQL Server MVP
> >
> > "Yifei" <yjiang@.sdg.aust.com> wrote in message
> > news:%23hbx8Pk3DHA.1908@.TK2MSFTNGP10.phx.gbl...
> > > Hey, All,
> > >
> > > Recently, we have installed a new raid disk on server, I want to
migrate
> > > transaction log to new disk for improving performance, is this
possible
> > and
> > > how can I do it?
> > >
> > > Thanks
> > >
> > > Yifei
> > >
> > >
> >
> >
>|||Thanks Dan and Wayne, It works.
Yifei
"Wayne Snyder" <wsnyder@.computeredservices.com> wrote in message
news:uI5jQ1o3DHA.360@.TK2MSFTNGP12.phx.gbl...
> Dan is right,,, sp_attach/detach will work..
> Do an sp_detachdb dbname,
> then copy the log file to the new destination, and remove the orig.
> then sp_attachdb dbname, datafilename, logfilename
>
> --
> Wayne Snyder, MCDBA, SQL Server MVP
> Computer Education Services Corporation (CESC), Charlotte, NC
> www.computeredservices.com
> (Please respond only to the newsgroups.)
> I support the Professional Association of SQL Server (PASS) and it's
> community of SQL Server professionals.
> www.sqlpass.org
>
> "Yifei" <yjiang@.sdg.aust.com> wrote in message
> news:eKtOf8k3DHA.556@.TK2MSFTNGP11.phx.gbl...
> > Hey, Dan,
> >
> > I think I need to clarify that I only need change transaction log file
> > location and keep the database file as is.
> >
> > I have tried detach and attach, it seems not work at this situation.
> >
> > Any other ideas would be appreciated.
> >
> > Thanks
> >
> > Yifei
> >
> > "Dan Guzman" <danguzman@.nospam-earthlink.net> wrote in message
> > news:%23jPQCkk3DHA.2144@.TK2MSFTNGP10.phx.gbl...
> > > One method is to detach the database, move the log file and attach the
> > > database files from the new location. See sp_detach_db and
sp_attach_db
> > in
> > > the Books Online for details.
> > >
> > > --
> > > Hope this helps.
> > >
> > > Dan Guzman
> > > SQL Server MVP
> > >
> > > "Yifei" <yjiang@.sdg.aust.com> wrote in message
> > > news:%23hbx8Pk3DHA.1908@.TK2MSFTNGP10.phx.gbl...
> > > > Hey, All,
> > > >
> > > > Recently, we have installed a new raid disk on server, I want to
> migrate
> > > > transaction log to new disk for improving performance, is this
> possible
> > > and
> > > > how can I do it?
> > > >
> > > > Thanks
> > > >
> > > > Yifei
> > > >
> > > >
> > >
> > >
> >
> >
>sql

Wednesday, March 21, 2012

How come Im getting error saying transaction log Full?

Hello,

I have a process that failed with the following error message. The SQL server error messages also said the Transaction log was full and there was not enough disc space.

Strangely, when I checked all the drives on the server, there was plenty of free space, the smallest amount free on one drive, where SQL server is located was 20GB. I am confused.

I backed up the DB to another server and deleted a lot of the transaction logs and now the drive has 30GB and is okay.

Does anyone know how the transaction log fills up? Can I change a setting somewhere to increase the maximum size of the transaction log? Or maybe change the location where it is saved to another drive? Or have it automatically cleared out every once in a while?

Any of your input is greatly appreciated.

Thanks.

Rodney

-----------------------
DS-DBMS-E400: UDA driver reported the following on connection 'Data Target
(ODBC)':
DMS-E-DBPARSER, The underlying database detected an error during processing of
the SQL request.
[Microsoft][ODBC SQL Server Driver][SQL Server]The log file for database
'ancosalesdm' is full. Back up the transaction log for the database to free up
some log space.
(for details, see Build_SAL_FA_ShipSKU_0584.log)
[PROGRESS - 00:32:42] Build Node 68 'SAL_FA_ShipSKU'; failed
DS-DBMS-E400: UDA driver reported the following on connection 'ALIAS_00DF1E74':
DMS-E-GENERAL, A general exception has occurred during operation 'execute
immediate'.
The log file for database 'ancosalesdm' is full. Back up the transaction log
for the database to free up some log space.
DMS-E-GENERAL, A general exception has occurred during operation 'execute
immediate'.
General SQL Server error: Check messages from the SQL Server.
DS-DBMS-E400: UDA driver reported the following on connection 'ALIAS_00DF1E74':
DMS-E-GENERAL, A general exception has occurred during operation 'rollback
transaction'.
The ROLLBACK TRANSACTION request has no corresponding BEGIN TRANSACTION.
DMS-E-GENERAL, A general exception has occurred during operation 'rollback
transaction'.
General SQL Server error: Check messages from the SQL Server.
-----------------------In Enterprise Manager, right click the DB and go to Properties. From there you can check to see if your Transaction Log has a size limit, and can adjust it if necessary.|||If you are not doing transaction log backups, you need to set the recovery mode on this database to Simple. This will make sure it doesn't just keep growing until it fills up.|||all this is good, but if a transaction affects a really large amount of data the recovery mode is irrelevant. the log will continue growing (if the setting to allow growth is on) until it reaches the limit specified or the limit of the disk.|||That's true, and if this is the case, you will need to break the transaction into smaller pieces. You can also insert CHECKPOINT at various places in your transaction if you need to, but this would be a pretty rare case.sql

Monday, March 12, 2012

How Can We Restore Database To New Database with Applying Diff. and Log Backup?

Hi,
I have trouble restoring database from backup device set. The device is valid. I want to restore the database to a new database. This step is succeed. The problem is that I only restore for full backup only, but I haven't applied differential and
transactional backup. I also want this set of backup move to new database. If I choose diff backup in restore dialog, then its only give one choice. The error message is I have to restore with norevocery or stanby opotion. I've already try from T-SQL, but
its still fail. My questions are:
1. How do I restore backup device to new database with applying diff and log backup?
2. Can I restore the diif and log backup to new location? (with full backup first)
Thanks.
Rahmadi Aji
When you restore a database and want to restore transaction logs right click on the database in question and in the options tab choose Leave database nonoperational but able to restore additional transaction logs. You can then apply transaction logs.
If you want to restore a backup to a different database than the original create the new database and then choose restore with the 'Force restore over existing database' option ticked.
|||>>If you want to restore a backup to a different database than the original create the new database and then choose[vbcol=seagreen]
In this case, I want to restore database to a new database in the same original database. And I already have tried all of
the alternatives including 'Force restore.... Because I want to restore it on different physical name. None are succeceed.
If I use same physical name it will overwrite the original.
|||<< In this case, I want to restore database to a new database in the same original database.>>
Above seems like a contradiction to me. If you post the RESTORE commands you used for all RESTORE commands
(RESTORE DATABASE ..., REDORE LOG ...) it is much easier to spot what might be the problem.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
"Rahmadi Aji" <anonymous@.discussions.microsoft.com> wrote in message
news:B513D972-EDA8-4823-AC58-ED253E06AC0B@.microsoft.com...[vbcol=seagreen]
choose
> In this case, I want to restore database to a new database in the same original database. And I already have
tried all of
> the alternatives including 'Force restore.... Because I want to restore it on different physical name. None
are succeceed.
> If I use same physical name it will overwrite the original.
|||If you want to restore a Database (from a backup) to a new Database, the 'logical' data and transaction log filenames must be the same and the file locations can be different.
This is how I would do it:
If you want to restore just a full backup to a new database, create the new Database with the SAME logical "Filename" for the data and transaction logs as the original but a different "location". If using EM, right click on the new database and choose
all tasks then restore database. Choose from device, add device and browse out to find the .bak file you want to restore. Back on the options tab, Choose the 'force restore over existing' and specify your new file locations for both the data and tra
nsaction logs under 'move to physical file name' - leave the logical filenames as is - those should be the same as your original database. If you want just to restore a full backup, leave the 'leave database operational' box checked. If you also wan
t to restore transaction log backups, choose one of the other options. if you are restoring more than one transaction log backup, on the LAST transaction log restore you should leave the 'leave database operational' box checked.
Knowledge base article 31456 also explains how to do this using query analyzer as well.
|||I mean in the same machine(server). I want to restore to a new database.
-- Tibor Karaszi wrote: --
<< In this case, I want to restore database to a new database in the same original database.>>
Above seems like a contradiction to me. If you post the RESTORE commands you used for all RESTORE commands
(RESTORE DATABASE ..., REDORE LOG ...) it is much easier to spot what might be the problem.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
"Rahmadi Aji" <anonymous@.discussions.microsoft.com> wrote in message
news:B513D972-EDA8-4823-AC58-ED253E06AC0B@.microsoft.com...[vbcol=seagreen]
choose[vbcol=seagreen]
tried all of
> the alternatives including 'Force restore.... Because I want to restore it on different physical name. None
are succeceed.
> If I use same physical name it will overwrite the original.
|||You're right about that, but I want to restore with differential and log backup. I have tried you're advice, it didn't work. I restore full backup ('leave database nonoperational') and then I add differential backup ('leave database operational'). When I
add diff. backup I use 'force restore over existing' and 'move to physical file name' with same logical name, It doesn't work.
-- jpotucek wrote: --
If you want to restore a Database (from a backup) to a new Database, the 'logical' data and transaction log filenames must be the same and the file locations can be different.
This is how I would do it:
If you want to restore just a full backup to a new database, create the new Database with the SAME logical "Filename" for the data and transaction logs as the original but a different "location". If using EM, right click on the new database and c
hoose all tasks then restore database. Choose from device, add device and browse out to find the .bak file you want to restore. Back on the options tab, Choose the 'force restore over existing' and specify your new file locations for both the data an
d transaction logs under 'move to physical file name' - leave the logical filenames as is - those should be the same as your original database. If you want just to restore a full backup, leave the 'leave database operational' box checked. If you als
o want to restore transaction log backups, choose one of the other options. if you are restoring more than one transaction log backup, on the LAST transaction log restore you should leave the 'leave database operational' box checked.
Knowledge base article 31456 also explains how to do this using query analyzer as well.
|||Again, If you post the RESTORE commands you used for all RESTORE commands (RESTORE DATABASE ..., RESTORE LOG
...) it is much easier to spot what might be the problem.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
"Rahmadi Aji" <anonymous@.discussions.microsoft.com> wrote in message
news:6EE5847B-C35E-42E4-9AD4-93C799F70631@.microsoft.com...
> I mean in the same machine(server). I want to restore to a new database.
> -- Tibor Karaszi wrote: --
> << In this case, I want to restore database to a new database in the same original database.>>
> Above seems like a contradiction to me. If you post the RESTORE commands you used for all RESTORE
commands[vbcol=seagreen]
> (RESTORE DATABASE ..., REDORE LOG ...) it is much easier to spot what might be the problem.
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
>
> "Rahmadi Aji" <anonymous@.discussions.microsoft.com> wrote in message
> news:B513D972-EDA8-4823-AC58-ED253E06AC0B@.microsoft.com...
and then[vbcol=seagreen]
> choose
already have[vbcol=seagreen]
> tried all of
name. None
> are succeceed.
>
>

How Can We Restore Database To New Database with Applying Diff. and Log Backup?

Hi,
I have trouble restoring database from backup device set. The device is vali
d. I want to restore the database to a new database. This step is succeed. T
he problem is that I only restore for full backup only, but I haven't applie
d differential and
transactional backup. I also want this set of backup move to new database. I
f I choose diff backup in restore dialog, then its only give one choice. The
error message is I have to restore with norevocery or stanby opotion. I've
already try from T-SQL, but
its still fail. My questions are:
1. How do I restore backup device to new database with applying diff and log
backup?
2. Can I restore the diif and log backup to new location? (with full backup
first)
Thanks.
Rahmadi AjiWhen you restore a database and want to restore transaction logs right click
on the database in question and in the options tab choose Leave database no
noperational but able to restore additional transaction logs. You can then a
pply transaction logs.
If you want to restore a backup to a different database than the original cr
eate the new database and then choose restore with the 'Force restore over e
xisting database' option ticked.|||>>If you want to restore a backup to a different database than the original create the new
database and then choose
In this case, I want to restore database to a new database in the same origi
nal database. And I already have tried all of
the alternatives including 'Force restore.... Because I want to restore it
on different physical name. None are succeceed.
If I use same physical name it will overwrite the original.|||<< In this case, I want to restore database to a new database in the same or
iginal database.>>
Above seems like a contradiction to me. If you post the RESTORE commands you
used for all RESTORE commands
(RESTORE DATABASE ..., REDORE LOG ...) it is much easier to spot what might
be the problem.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
"Rahmadi Aji" <anonymous@.discussions.microsoft.com> wrote in message
news:B513D972-EDA8-4823-AC58-ED253E06AC0B@.microsoft.com...
choose
> In this case, I want to restore database to a new database in the same original da
tabase. And I already have
tried all of
> the alternatives including 'Force restore.... Because I want to restore it on dif
ferent physical name. None
are succeceed.
> If I use same physical name it will overwrite the original.|||If you want to restore a Database (from a backup) to a new Database, the 'lo
gical' data and transaction log filenames must be the same and the file loca
tions can be different.
This is how I would do it:
If you want to restore just a full backup to a new database, create the new
Database with the SAME logical "Filename" for the data and transaction logs
as the original but a different "location". If using EM, right click on
the new database and choose
all tasks then restore database. Choose from device, add device and brows
e out to find the .bak file you want to restore. Back on the options tab, C
hoose the 'force restore over existing' and specify your new file locations
for both the data and tra
nsaction logs under 'move to physical file name' - leave the logical filena
mes as is - those should be the same as your original database. If you w
ant just to restore a full backup, leave the 'leave database operational' bo
x checked. If you also wan
t to restore transaction log backups, choose one of the other options. if y
ou are restoring more than one transaction log backup, on the LAST transacti
on log restore you should leave the 'leave database operational' box checked
.
Knowledge base article 31456 also explains how to do this using query analyz
er as well.|||I mean in the same machine(server). I want to restore to a new database.
-- Tibor Karaszi wrote: --
<< In this case, I want to restore database to a new database in the same or
iginal database.>>
Above seems like a contradiction to me. If you post the RESTORE commands you
used for all RESTORE commands
(RESTORE DATABASE ..., REDORE LOG ...) it is much easier to spot what might
be the problem.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
"Rahmadi Aji" <anonymous@.discussions.microsoft.com> wrote in message
news:B513D972-EDA8-4823-AC58-ED253E06AC0B@.microsoft.com...
choose[vbcol=seagreen]
tried all of[vbcol=seagreen]
> the alternatives including 'Force restore.... Because I want to restore it on dif
ferent physical name. None
are succeceed.
> If I use same physical name it will overwrite the original.|||You're right about that, but I want to restore with differential and log bac
kup. I have tried you're advice, it didn't work. I restore full backup ('lea
ve database nonoperational') and then I add differential backup ('leave data
base operational'). When I
add diff. backup I use 'force restore over existing' and 'move to physical
file name' with same logical name, It doesn't work.
-- jpotucek wrote: --
If you want to restore a Database (from a backup) to a new Database, the 'lo
gical' data and transaction log filenames must be the same and the file loca
tions can be different.
This is how I would do it:
If you want to restore just a full backup to a new database, create the new
Database with the SAME logical "Filename" for the data and transaction logs
as the original but a different "location". If using EM, right click on
the new database and c
hoose all tasks then restore database. Choose from device, add device and
browse out to find the .bak file you want to restore. Back on the options
tab, Choose the 'force restore over existing' and specify your new file loc
ations for both the data an
d transaction logs under 'move to physical file name' - leave the logical f
ilenames as is - those should be the same as your original database. If
you want just to restore a full backup, leave the 'leave database operationa
l' box checked. If you als
o want to restore transaction log backups, choose one of the other options.
if you are restoring more than one transaction log backup, on the LAST tran
saction log restore you should leave the 'leave database operational' box ch
ecked.
Knowledge base article 31456 also explains how to do this using query analyz
er as well.|||Again, If you post the RESTORE commands you used for all RESTORE commands (
RESTORE DATABASE ..., RESTORE LOG
...) it is much easier to spot what might be the problem.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
"Rahmadi Aji" <anonymous@.discussions.microsoft.com> wrote in message
news:6EE5847B-C35E-42E4-9AD4-93C799F70631@.microsoft.com...
> I mean in the same machine(server). I want to restore to a new database.
> -- Tibor Karaszi wrote: --
> << In this case, I want to restore database to a new database in the
same original database.>>
> Above seems like a contradiction to me. If you post the RESTORE commands you
used for all RESTORE
commands
> (RESTORE DATABASE ..., REDORE LOG ...) it is much easier to spot what
might be the problem.
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
>
> "Rahmadi Aji" <anonymous@.discussions.microsoft.com> wrote in message
> news:B513D972-EDA8-4823-AC58-ED253E06AC0B@.microsoft.com...
and then[vbcol=seagreen]
> choose
already have[vbcol=seagreen]
> tried all of
name. None[vbcol=seagreen]
> are succeceed.
>
>