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

Thursday, March 29, 2012

database in simple mode yet txn log file can be out of diskspace ?

Hi ,

I have set up my database to be using "Simple" mode. This will not log any
txns ?

I have got the err message saying the log file is full and i need to do a
txn log backup

i do not understand why , could anyone kindly advise ?

tks & rdgs

--
Message posted via SQLMonster.com
http://www.sqlmonster.com/Uwe/Forum...eneral/200510/1Having you database in SIMPLE recovery mode does NOT mean that
transactions are not logged. All it means is that all committed
transactions are removed from the T-log when a checkpoint occurs. So if
you run lot's of and especially longrunning transactions, it still can
happen that your T-log grows out of space.

M

Tuesday, March 27, 2012

Database has grown too big (5 GB)

Hello
My database should have a normal size on about 500-1000 mb, but it now has
the size of 5 gb. I am talking about the MDF file, not the log file.
I think it is because of a wrong setup of the maintenance plan. Now I have
altered the optimization and checked "remove unused space from database
files", so it is set to shrink database when it grows beyond 50 Mb.
So do you think that next time the maintenance plan runs the Optimization,
the database size will be set to normal ?
I use MSSQL 2000, service pack 3, MDAC 2.8
\AndersIt depends on how much space is being used. Run a sp_spaceused inside the
database name. The reserved number (which equals data + log+ unused) is
roughly how much space to expect from shrinking, which can also be
accomplished by running dbcc shrinkfile (<data name>, 0) -- see SQL Server
Books online for details (which can be downloaded for free from Microsoft's
SQL site -- http://www.microsoft.com/sql)
--
*******************************************************************
Andy S.
MCSE NT/2000, MCDBA SQL 7/2000
andymcdba1@.NOMORESPAM.yahoo.com
Please remove NOMORESPAM before replying.
Always keep your antivirus and Microsoft software
up to date with the latest definitions and product updates.
Be suspicious of every email attachment, I will never send
or post anything other than the text of a http:// link nor
post the link directly to a file for downloading.
This posting is provided "as is" with no warranties
and confers no rights.
*******************************************************************
"anders" <a.vindal@.techotel.dk> wrote in message
news:%23hSDU9I$DHA.2636@.TK2MSFTNGP09.phx.gbl...
> Hello
> My database should have a normal size on about 500-1000 mb, but it now has
> the size of 5 gb. I am talking about the MDF file, not the log file.
> I think it is because of a wrong setup of the maintenance plan. Now I have
> altered the optimization and checked "remove unused space from database
> files", so it is set to shrink database when it grows beyond 50 Mb.
> So do you think that next time the maintenance plan runs the Optimization,
> the database size will be set to normal ?
> I use MSSQL 2000, service pack 3, MDAC 2.8
>
>
> \Anders
>|||If after shrinking the DB, you see the same problem, then try the following:
Do you have clustered index on your tables? If not, add and see if you see
the change.
"anders" <a.vindal@.techotel.dk> wrote in message
news:%23hSDU9I$DHA.2636@.TK2MSFTNGP09.phx.gbl...
> Hello
> My database should have a normal size on about 500-1000 mb, but it now has
> the size of 5 gb. I am talking about the MDF file, not the log file.
> I think it is because of a wrong setup of the maintenance plan. Now I have
> altered the optimization and checked "remove unused space from database
> files", so it is set to shrink database when it grows beyond 50 Mb.
> So do you think that next time the maintenance plan runs the Optimization,
> the database size will be set to normal ?
> I use MSSQL 2000, service pack 3, MDAC 2.8
>
>
> \Anders
>

Database has grown too big (5 GB)

Hello
My database should have a normal size on about 500-1000 mb, but it now has
the size of 5 gb. I am talking about the MDF file, not the log file.
I think it is because of a wrong setup of the maintenance plan. Now I have
altered the optimization and checked "remove unused space from database
files", so it is set to shrink database when it grows beyond 50 Mb.
So do you think that next time the maintenance plan runs the Optimization,
the database size will be set to normal ?
I use MSSQL 2000, service pack 3, MDAC 2.8
\AndersIt depends on how much space is being used. Run a sp_spaceused inside the
database name. The reserved number (which equals data + log+ unused) is
roughly how much space to expect from shrinking, which can also be
accomplished by running dbcc shrinkfile (<data name>, 0) -- see SQL Server
Books online for details (which can be downloaded for free from Microsoft's
SQL site -- http://www.microsoft.com/sql)
****************************************
***************************
Andy S.
MCSE NT/2000, MCDBA SQL 7/2000
andymcdba1@.NOMORESPAM.yahoo.com
Please remove NOMORESPAM before replying.
Always keep your antivirus and Microsoft software
up to date with the latest definitions and product updates.
Be suspicious of every email attachment, I will never send
or post anything other than the text of a http:// link nor
post the link directly to a file for downloading.
This posting is provided "as is" with no warranties
and confers no rights.
****************************************
***************************
"anders" <a.vindal@.techotel.dk> wrote in message
news:%23hSDU9I$DHA.2636@.TK2MSFTNGP09.phx.gbl...
> Hello
> My database should have a normal size on about 500-1000 mb, but it now has
> the size of 5 gb. I am talking about the MDF file, not the log file.
> I think it is because of a wrong setup of the maintenance plan. Now I have
> altered the optimization and checked "remove unused space from database
> files", so it is set to shrink database when it grows beyond 50 Mb.
> So do you think that next time the maintenance plan runs the Optimization,
> the database size will be set to normal ?
> I use MSSQL 2000, service pack 3, MDAC 2.8
>
>
> \Anders
>|||If after shrinking the DB, you see the same problem, then try the following:
Do you have clustered index on your tables? If not, add and see if you see
the change.
"anders" <a.vindal@.techotel.dk> wrote in message
news:%23hSDU9I$DHA.2636@.TK2MSFTNGP09.phx.gbl...
> Hello
> My database should have a normal size on about 500-1000 mb, but it now has
> the size of 5 gb. I am talking about the MDF file, not the log file.
> I think it is because of a wrong setup of the maintenance plan. Now I have
> altered the optimization and checked "remove unused space from database
> files", so it is set to shrink database when it grows beyond 50 Mb.
> So do you think that next time the maintenance plan runs the Optimization,
> the database size will be set to normal ?
> I use MSSQL 2000, service pack 3, MDAC 2.8
>
>
> \Anders
>

Sunday, March 25, 2012

Database goes into Supect or Loading state after Restore

This is the scenario:
I am do log shipping from one server to another. I have 9 databases
that I am shipping. 8 of them work flawlessly. I have one that for
some reason either always goes into a Suspect state or into a Loading
state. It just stays there until I do a manual restore. I have
created all of the store procedures exactly the same. The weird thing
is that I can do a manual restore of the exact same file that the
store procedure is trying to restore and it does it perfectly. The
only difference between this database and the others is the size. It
is a little over 6 gig versus 3 gig or less on the others.
I am stumped and not quite sure what to do. It is almost like the
stored procedure is either timing out or the job is advancing to the
next step before the restore is complete. Oh, one other thing, the
job is showing a status of completed successfully. The following is
the stored procedure I am using to restore the database:
CREATE PROCEDURE Restore_Database_W3Data_Backups AS
RESTORE DATABASE W3Data
FROM DISK = 'e:\sqlbackups\W3Data\W3Data.bak'
WITH
REPLACE,
STANDBY = 'e:\sqlbackups\W3Data\undo_W3Data.ldf',
MOVE 'w3data_dat' TO 'E:\SQL Data\MSSQL\Data\w3data_data.mdf',
MOVE 'w3data_log' TO 'E:\SQL Data\MSSQL\Data\w3data_log.ldf'
WAITFOR DELAY '00:00:05'
EXEC sp_dboption 'W3Data', 'single user', true
GO
Does Anyone have any ideas?
TIA!
Neil Mowatt
Network Administrator
The Nottingham Company
Hi
The restore fails if you run out of disk space on the Undo drive. How much
free space do you have on E:?
Regards
"Neil Mowatt" wrote:

> This is the scenario:
> I am do log shipping from one server to another. I have 9 databases
> that I am shipping. 8 of them work flawlessly. I have one that for
> some reason either always goes into a Suspect state or into a Loading
> state. It just stays there until I do a manual restore. I have
> created all of the store procedures exactly the same. The weird thing
> is that I can do a manual restore of the exact same file that the
> store procedure is trying to restore and it does it perfectly. The
> only difference between this database and the others is the size. It
> is a little over 6 gig versus 3 gig or less on the others.
> I am stumped and not quite sure what to do. It is almost like the
> stored procedure is either timing out or the job is advancing to the
> next step before the restore is complete. Oh, one other thing, the
> job is showing a status of completed successfully. The following is
> the stored procedure I am using to restore the database:
> CREATE PROCEDURE Restore_Database_W3Data_Backups AS
> RESTORE DATABASE W3Data
> FROM DISK = 'e:\sqlbackups\W3Data\W3Data.bak'
> WITH
> REPLACE,
> STANDBY = 'e:\sqlbackups\W3Data\undo_W3Data.ldf',
> MOVE 'w3data_dat' TO 'E:\SQL Data\MSSQL\Data\w3data_data.mdf',
> MOVE 'w3data_log' TO 'E:\SQL Data\MSSQL\Data\w3data_log.ldf'
> WAITFOR DELAY '00:00:05'
> EXEC sp_dboption 'W3Data', 'single user', true
> GO
>
> Does Anyone have any ideas?
> TIA!
> Neil Mowatt
> Network Administrator
> The Nottingham Company
>
|||I have over 140 Gig free. I don't think that is the problem. Thank
You though. Any other suggestions or ideas?
"Mike Epprecht (SQL MVP)" <mike@.epprecht.net> wrote in message news:<41C9445C-7C5E-4A5A-94BB-A698ED1BE18E@.microsoft.com>...[vbcol=seagreen]
> Hi
> The restore fails if you run out of disk space on the Undo drive. How much
> free space do you have on E:?
> Regards
> "Neil Mowatt" wrote:
|||neil@.ncfunds.com (Neil Mowatt) wrote in message news:<fbbc61a6.0409240644.a6ad096@.posting.google.c om>...[vbcol=seagreen]
> I have over 140 Gig free. I don't think that is the problem. Thank
> You though. Any other suggestions or ideas?
> "Mike Epprecht (SQL MVP)" <mike@.epprecht.net> wrote in message news:<41C9445C-7C5E-4A5A-94BB-A698ED1BE18E@.microsoft.com>...
Any other suggestions or ideas?

Database gets detatched from the Database Group

Hi everybody,

Everyday at 11pm my database gets detatched from the database group. In the event log I get this message:

Event ID: 17052

Description: Error 17803, Severity: 20, State:14

Insufficient memory available.

After a reboot, everything is fine. But this happens everyday. Any suggestions on what I should do?

comadmin

What applications are running at this time of the day? You can monitor your server for any activity that might be causing thissql

Thursday, March 22, 2012

database File size problem

Hi,
I have a database which is 10 GB big but on disk it shows 20GB. I did
backup and shrinkdb but it doesn't shrink. I could shrink log but not
the actual db. Any hints why I cannot do this? Also weird thing is that
when I run DBCC shrinkdb I don't get any error message.
Here is the exact command I run:
DBCC SHRINKDATABASE (MYDB, 5, TRUNCATEONLY)
GO
Tnank you,
hjHi
DBCC SHRINKDATABASE will not shrink a file smaller than it's initial size,
which may be the issue in your case. Use DBCC SHRINKFILE to shrink the
individual file, but if you are will be expanding to 20GB at some time, then
you may not want to shrink it at all. Your log file should be a reasonably
constant size, if you backup the log regularly (in FULL recovery mode).
John
"Hitesh" wrote:

> Hi,
> I have a database which is 10 GB big but on disk it shows 20GB. I did
> backup and shrinkdb but it doesn't shrink. I could shrink log but not
> the actual db. Any hints why I cannot do this? Also weird thing is that
> when I run DBCC shrinkdb I don't get any error message.
> Here is the exact command I run:
> DBCC SHRINKDATABASE (MYDB, 5, TRUNCATEONLY)
> GO
> Tnank you,
> hj
>|||DBCC SHRINKDATABASE will not shrink a file smaller than its shrinkpoint.
The shrinkpoint starts out at the initial size of the file, but once you use
DBCC SHRINKFILE, that can set a new shrinkpoint, and subsequent DBCC
SHRINKDATABASE operations can shrink to that new smaller size.
Also, Hitesh, make sure you're aware what the parameters to DBCC
SHRINKDATABASE mean. The 5 parameter means to shrink so that there is 5%
free space in the file. If there is already more than 5% free space, no
shrinking will take place.
When you run DBCC SHRINKFILE, then the number is the size in MB to which you
want to shrink the file.
Why do you think you might get an error message?
--
HTH
Kalen Delaney, SQL Server MVP
"John Bell" <jbellnewsposts@.hotmail.com> wrote in message
news:79C1DC8D-4BB0-4D11-BBED-A98A9BA35A2C@.microsoft.com...[vbcol=seagreen]
> Hi
> DBCC SHRINKDATABASE will not shrink a file smaller than it's initial size,
> which may be the issue in your case. Use DBCC SHRINKFILE to shrink the
> individual file, but if you are will be expanding to 20GB at some time,
> then
> you may not want to shrink it at all. Your log file should be a reasonably
> constant size, if you backup the log regularly (in FULL recovery mode).
> John
> "Hitesh" wrote:
>|||Thank you John & Kalean.
When I used DBCC SHRINKFILE on indivisual database files, it worked.
Kalean is right I might be using wrong free space percentage.
Thank you both for your help.
hj
Kalen Delaney wrote:[vbcol=seagreen]
> DBCC SHRINKDATABASE will not shrink a file smaller than its shrinkpoint.
> The shrinkpoint starts out at the initial size of the file, but once you u
se
> DBCC SHRINKFILE, that can set a new shrinkpoint, and subsequent DBCC
> SHRINKDATABASE operations can shrink to that new smaller size.
> Also, Hitesh, make sure you're aware what the parameters to DBCC
> SHRINKDATABASE mean. The 5 parameter means to shrink so that there is 5%
> free space in the file. If there is already more than 5% free space, no
> shrinking will take place.
> When you run DBCC SHRINKFILE, then the number is the size in MB to which y
ou
> want to shrink the file.
> Why do you think you might get an error message?
> --
> HTH
> Kalen Delaney, SQL Server MVP
>
> "John Bell" <jbellnewsposts@.hotmail.com> wrote in message
> news:79C1DC8D-4BB0-4D11-BBED-A98A9BA35A2C@.microsoft.com...

database File size problem

Hi,
I have a database which is 10 GB big but on disk it shows 20GB. I did
backup and shrinkdb but it doesn't shrink. I could shrink log but not
the actual db. Any hints why I cannot do this? Also weird thing is that
when I run DBCC shrinkdb I don't get any error message.
Here is the exact command I run:
DBCC SHRINKDATABASE (MYDB, 5, TRUNCATEONLY)
GO
Tnank you,
hjHi
DBCC SHRINKDATABASE will not shrink a file smaller than it's initial size,
which may be the issue in your case. Use DBCC SHRINKFILE to shrink the
individual file, but if you are will be expanding to 20GB at some time, then
you may not want to shrink it at all. Your log file should be a reasonably
constant size, if you backup the log regularly (in FULL recovery mode).
John
"Hitesh" wrote:
> Hi,
> I have a database which is 10 GB big but on disk it shows 20GB. I did
> backup and shrinkdb but it doesn't shrink. I could shrink log but not
> the actual db. Any hints why I cannot do this? Also weird thing is that
> when I run DBCC shrinkdb I don't get any error message.
> Here is the exact command I run:
> DBCC SHRINKDATABASE (MYDB, 5, TRUNCATEONLY)
> GO
> Tnank you,
> hj
>|||DBCC SHRINKDATABASE will not shrink a file smaller than its shrinkpoint.
The shrinkpoint starts out at the initial size of the file, but once you use
DBCC SHRINKFILE, that can set a new shrinkpoint, and subsequent DBCC
SHRINKDATABASE operations can shrink to that new smaller size.
Also, Hitesh, make sure you're aware what the parameters to DBCC
SHRINKDATABASE mean. The 5 parameter means to shrink so that there is 5%
free space in the file. If there is already more than 5% free space, no
shrinking will take place.
When you run DBCC SHRINKFILE, then the number is the size in MB to which you
want to shrink the file.
Why do you think you might get an error message?
--
HTH
Kalen Delaney, SQL Server MVP
"John Bell" <jbellnewsposts@.hotmail.com> wrote in message
news:79C1DC8D-4BB0-4D11-BBED-A98A9BA35A2C@.microsoft.com...
> Hi
> DBCC SHRINKDATABASE will not shrink a file smaller than it's initial size,
> which may be the issue in your case. Use DBCC SHRINKFILE to shrink the
> individual file, but if you are will be expanding to 20GB at some time,
> then
> you may not want to shrink it at all. Your log file should be a reasonably
> constant size, if you backup the log regularly (in FULL recovery mode).
> John
> "Hitesh" wrote:
>> Hi,
>> I have a database which is 10 GB big but on disk it shows 20GB. I did
>> backup and shrinkdb but it doesn't shrink. I could shrink log but not
>> the actual db. Any hints why I cannot do this? Also weird thing is that
>> when I run DBCC shrinkdb I don't get any error message.
>> Here is the exact command I run:
>> DBCC SHRINKDATABASE (MYDB, 5, TRUNCATEONLY)
>> GO
>> Tnank you,
>> hj
>>|||Thank you John & Kalean.
When I used DBCC SHRINKFILE on indivisual database files, it worked.
Kalean is right I might be using wrong free space percentage.
Thank you both for your help.
hj
Kalen Delaney wrote:
> DBCC SHRINKDATABASE will not shrink a file smaller than its shrinkpoint.
> The shrinkpoint starts out at the initial size of the file, but once you use
> DBCC SHRINKFILE, that can set a new shrinkpoint, and subsequent DBCC
> SHRINKDATABASE operations can shrink to that new smaller size.
> Also, Hitesh, make sure you're aware what the parameters to DBCC
> SHRINKDATABASE mean. The 5 parameter means to shrink so that there is 5%
> free space in the file. If there is already more than 5% free space, no
> shrinking will take place.
> When you run DBCC SHRINKFILE, then the number is the size in MB to which you
> want to shrink the file.
> Why do you think you might get an error message?
> --
> HTH
> Kalen Delaney, SQL Server MVP
>
> "John Bell" <jbellnewsposts@.hotmail.com> wrote in message
> news:79C1DC8D-4BB0-4D11-BBED-A98A9BA35A2C@.microsoft.com...
> > Hi
> >
> > DBCC SHRINKDATABASE will not shrink a file smaller than it's initial size,
> > which may be the issue in your case. Use DBCC SHRINKFILE to shrink the
> > individual file, but if you are will be expanding to 20GB at some time,
> > then
> > you may not want to shrink it at all. Your log file should be a reasonably
> > constant size, if you backup the log regularly (in FULL recovery mode).
> >
> > John
> >
> > "Hitesh" wrote:
> >
> >> Hi,
> >>
> >> I have a database which is 10 GB big but on disk it shows 20GB. I did
> >> backup and shrinkdb but it doesn't shrink. I could shrink log but not
> >> the actual db. Any hints why I cannot do this? Also weird thing is that
> >> when I run DBCC shrinkdb I don't get any error message.
> >> Here is the exact command I run:
> >>
> >> DBCC SHRINKDATABASE (MYDB, 5, TRUNCATEONLY)
> >>
> >> GO
> >>
> >> Tnank you,
> >> hj
> >>
> >>

Database File Size

I have a Database which when I Right Click and go to Properties size is 52 GB

But the Size of MDF + NDF Files is 25 + 7 = 32 GB. Log file Size is 20 GB. So I am thinking -- Properties Size of DB includes size of Log Files too -- is that correct?

But when I do a Full Backup the .bak File Size is 26 GB -- does the Full Backup Shrink a DB ?

I thot Full Backup only Shrink the Log Files and could not find anywhere in BOL where it says BACKUP shrinks the empty space in Database -- can somebody confirm this?

Hi JaguarRDA,

Its because backup is always lower than original size of database, because backup copy only used pages.

|||

Yeah -- also Backups dont touch the Log Files -- that was a wrong statement on my behalf that they shrunk the log files

|||

JaguarRDA283361 wrote:

Yeah -- also Backups dont touch the Log Files --

Depends on the type of "recovery model", see

sql

Database file and log

Hi,

I am just about to get familiar with SQL-Server 2005. Since I created a database and played a little with it I recognized that the database file has grown up to 150 MB as well as the log file.

I used the shrink task to resize the database file. After doing so the .ldf remained as it was (150 MB). Since I would not need log information stored there, is it possible to shrink the ldf-file as well?

Thanks for your help!

Hi,

have a look here: http://www.aspfaq.com/show.asp?id=2471

HTH, Jens Suessmeyer.

http://www.sqlserver2005.de

|||rather than shrink the log file every single time, you can set the recovery model to SIMPLE for the database, which uses minimal disk space for the log file. See ALTER DATABASE on books online.|||

Hi,

but keep in mind that with your setting backup mode to simple you might loose some features of your implemented database backpup strategy. Read more about this in the BOL under "Rovery models".

HTH, Jens Suessmeyer.

http://www.sqlserver2005.de

|||Thanks to both of you I could finally learn something about the log files and also resolve my problem.

Database file and log

Hi,

I am just about to get familiar with SQL-Server 2005. Since I created a database and played a little with it I recognized that the database file has grown up to 150 MB as well as the log file.

I used the shrink task to resize the database file. After doing so the .ldf remained as it was (150 MB). Since I would not need log information stored there, is it possible to shrink the ldf-file as well?

Thanks for your help!

Hi,

have a look here: http://www.aspfaq.com/show.asp?id=2471

HTH, Jens Suessmeyer.

http://www.sqlserver2005.de

|||rather than shrink the log file every single time, you can set the recovery model to SIMPLE for the database, which uses minimal disk space for the log file. See ALTER DATABASE on books online.|||

Hi,

but keep in mind that with your setting backup mode to simple you might loose some features of your implemented database backpup strategy. Read more about this in the BOL under "Rovery models".

HTH, Jens Suessmeyer.

http://www.sqlserver2005.de

|||Thanks to both of you I could finally learn something about the log files and also resolve my problem.

Wednesday, March 21, 2012

Database Engine Tuning Advisor Error

I have a very irritating error with Database Engine Tuning Advisor. While processing traces from Sql Profiler I keep getting trace log full of syntax error of most of queries - some of them very simple and ALL of them perfectly correct ( I check them separatly in QueryAnaliser ) - program gives recomendtation when I enter queries one by one - in that case the syntax is correct for Database Engine Tuning Advisor, but I just can't imagine why quries given to analysis in the set aren't correct? I dont' want to enter trace query by query (while I have thousends of them) !

It all seem like a Database Engine Tuning Advisor bug, any ideas about this problem?

Joanna

try and do one of the following:

1. make your trace little bit smaller by filtering on databaseid number.

2. make your trace for 1 hour + or so.

3. may b you have 2 many records there and its inufficient for the advisor.

tomer

Friday, February 17, 2012

Database data file redesign

I have a database that is over 200GB on one data file and on the same drive
with the log and tempdb. I want to move this to a new server that is better
designed and organized - multiple data files, files and filegroups, etc. I
want to keep my developers working or keep the developers down time to a
minimum while I move this data over to the new server. What ideas do you
have for accomplishing this while keeping down time to a minimum? I have
several developers using this database that I cannot afford to have not
working.
Hi,
DBCC SHRINFILE(FILENAME, EMPTYFILE)
GO
This command move all data the especified filename for another file in the
same filegroup.
ALTER DATABASE DBNAME
ADD FILEGROUP new_filegroup
GO
ALTER DATABASE DBNAME
ADD FILE (parameters) TO new_filegroup
GO
CREATE NONCLUSTERED INDEX index_name
ON tabela (columns) ON new_filegroup
GO
Change the filegroup for table use the ALTER TABLE statement.
Any things post ou send e-mail.
** * Esta msg foi útil pra você ? Ent?o marque-a como tal. ***
Regards,
Rodrigo Fernandes
lobo-fernandes@.hotmail.com
"spoons" wrote:

> I have a database that is over 200GB on one data file and on the same drive
> with the log and tempdb. I want to move this to a new server that is better
> designed and organized - multiple data files, files and filegroups, etc. I
> want to keep my developers working or keep the developers down time to a
> minimum while I move this data over to the new server. What ideas do you
> have for accomplishing this while keeping down time to a minimum? I have
> several developers using this database that I cannot afford to have not
> working.

Database data file redesign

I have a database that is over 200GB on one data file and on the same drive
with the log and tempdb. I want to move this to a new server that is better
designed and organized - multiple data files, files and filegroups, etc. I
want to keep my developers working or keep the developers down time to a
minimum while I move this data over to the new server. What ideas do you
have for accomplishing this while keeping down time to a minimum? I have
several developers using this database that I cannot afford to have not
working.Hi,
DBCC SHRINFILE(FILENAME, EMPTYFILE)
GO
This command move all data the especified filename for another file in the
same filegroup.
ALTER DATABASE DBNAME
ADD FILEGROUP new_filegroup
GO
ALTER DATABASE DBNAME
ADD FILE (parameters) TO new_filegroup
GO
CREATE NONCLUSTERED INDEX index_name
ON tabela (columns) ON new_filegroup
GO
Change the filegroup for table use the ALTER TABLE statement.
Any things post ou send e-mail.
** * Esta msg foi útil pra você ? Ent?o marque-a como tal. ***
Regards,
Rodrigo Fernandes
lobo-fernandes@.hotmail.com
"spoons" wrote:

> I have a database that is over 200GB on one data file and on the same driv
e
> with the log and tempdb. I want to move this to a new server that is bett
er
> designed and organized - multiple data files, files and filegroups, etc.
I
> want to keep my developers working or keep the developers down time to a
> minimum while I move this data over to the new server. What ideas do you
> have for accomplishing this while keeping down time to a minimum? I have
> several developers using this database that I cannot afford to have not
> working.

Database data file redesign

I have a database that is over 200GB on one data file and on the same drive
with the log and tempdb. I want to move this to a new server that is better
designed and organized - multiple data files, files and filegroups, etc. I
want to keep my developers working or keep the developers down time to a
minimum while I move this data over to the new server. What ideas do you
have for accomplishing this while keeping down time to a minimum? I have
several developers using this database that I cannot afford to have not
working.Hi,
DBCC SHRINFILE(FILENAME, EMPTYFILE)
GO
This command move all data the especified filename for another file in the
same filegroup.
ALTER DATABASE DBNAME
ADD FILEGROUP new_filegroup
GO
ALTER DATABASE DBNAME
ADD FILE (parameters) TO new_filegroup
GO
CREATE NONCLUSTERED INDEX index_name
ON tabela (columns) ON new_filegroup
GO
Change the filegroup for table use the ALTER TABLE statement.
Any things post ou send e-mail.
** * Esta msg foi útil pra você ? Então marque-a como tal. ***
Regards,
Rodrigo Fernandes
lobo-fernandes@.hotmail.com
"spoons" wrote:
> I have a database that is over 200GB on one data file and on the same drive
> with the log and tempdb. I want to move this to a new server that is better
> designed and organized - multiple data files, files and filegroups, etc. I
> want to keep my developers working or keep the developers down time to a
> minimum while I move this data over to the new server. What ideas do you
> have for accomplishing this while keeping down time to a minimum? I have
> several developers using this database that I cannot afford to have not
> working.

Database creation

I downloaded the sample database AdventureWorks from microsoft . When I run the download it created the data and log files under data folder in MSQLalong with other data and log files of master databases etc. However I do not see this database in SQLserver management studio. Can some one help me how to fix this so that I will be able to see this database in management studio.

I am downloading this for SQL server reporting purpose

Hi Kash,

The sample database installation delivers the database files to your machine, but does not "attach" the database to a specific SQL instance.

To attach the database you could do one of the following:

(1) Execute the following query:

USE master
GO
EXEC sp_attach_db 'AdventureWorksDW', '<path to your MDF file>AdventureWorksDW_Data.mdf', '<path to your LDF file>AdventureWorksDW_Log.ldf'

(you could use whatever name you like and also - make sure the MDF and LDF file names are correct, too)

(2) In SQL Management Studio, right-click the Databases folder, select "Attach". Navigate to the folder where the MDF file is installed and select it.

With either steps, the database is attached, recovered and comes online. BTW - this is a good way to move or rename a database: detach, move, attach (possibly under different name).

HTH,

Jivko Dobrev - MSFT
--
This posting is provided "AS IS" with no warranties, and confers no rights.