Showing posts with label space. Show all posts
Showing posts with label space. Show all posts

Wednesday, March 21, 2012

moving SSAS 2005 database to another drive

Hello,

how can I move the SSAS 2005 database to another drive ? The reason is, I′m running out of space on the current drive.

Thanks a lot for an answer.

Hi,

You can change the Data folder for AS2005, to move all the databases to another location (you cannot have separate locations for databases on the same AS2005 instance). To do that:

1. use the server's properties dialog to specify the new path (from SQL Management Studio, connect to AS2005, right click on the server, Properties, DataDir property) (the change will not become effective immediately, no actual data will be moved)

2. stop AS2005

3. move the Data directory to the drive you want

4. restart AS2005

sql

Monday, March 12, 2012

moving SQL data and then shrinking file

I have added a new drive to a server and want to move one of the databases to
this drive to alleviate space problems on the original drive. I wanted to do
this with as little downtime to the system as possible and the size of the
original database file is almost 100 GB. I created a second file (NDF) on
the new drive. I think did a shrinkfile to empty the original mdf file. It
appears that most of the data has been moved, but I cannot reduce the size of
the mdf file even though it says it is only using 5 GB of the 100 GB. I
would rather copy a 5 GB file rather than a 100 GB file. Can you reduce the
size of a mdf file?
Thanks.
Danne
> Can you reduce the
> size of a mdf file?
Yes. You might need to do a few SHRINKFILEs, and make sure you don't specify the NOTRUNCATE option.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi
"Danne" <Danne@.discussions.microsoft.com> wrote in message
news:84C00DB8-5491-405C-B9EA-72D2D9521D2B@.microsoft.com...
>I have added a new drive to a server and want to move one of the databases to
> this drive to alleviate space problems on the original drive. I wanted to do
> this with as little downtime to the system as possible and the size of the
> original database file is almost 100 GB. I created a second file (NDF) on
> the new drive. I think did a shrinkfile to empty the original mdf file. It
> appears that most of the data has been moved, but I cannot reduce the size of
> the mdf file even though it says it is only using 5 GB of the 100 GB. I
> would rather copy a 5 GB file rather than a 100 GB file. Can you reduce the
> size of a mdf file?
> Thanks.
> --
> Danne

moving SQL data and then shrinking file

I have added a new drive to a server and want to move one of the databases to
this drive to alleviate space problems on the original drive. I wanted to do
this with as little downtime to the system as possible and the size of the
original database file is almost 100 GB. I created a second file (NDF) on
the new drive. I think did a shrinkfile to empty the original mdf file. It
appears that most of the data has been moved, but I cannot reduce the size of
the mdf file even though it says it is only using 5 GB of the 100 GB. I
would rather copy a 5 GB file rather than a 100 GB file. Can you reduce the
size of a mdf file?
Thanks.
--
Danne> Can you reduce the
> size of a mdf file?
Yes. You might need to do a few SHRINKFILEs, and make sure you don't specify the NOTRUNCATE option.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi
"Danne" <Danne@.discussions.microsoft.com> wrote in message
news:84C00DB8-5491-405C-B9EA-72D2D9521D2B@.microsoft.com...
>I have added a new drive to a server and want to move one of the databases to
> this drive to alleviate space problems on the original drive. I wanted to do
> this with as little downtime to the system as possible and the size of the
> original database file is almost 100 GB. I created a second file (NDF) on
> the new drive. I think did a shrinkfile to empty the original mdf file. It
> appears that most of the data has been moved, but I cannot reduce the size of
> the mdf file even though it says it is only using 5 GB of the 100 GB. I
> would rather copy a 5 GB file rather than a 100 GB file. Can you reduce the
> size of a mdf file?
> Thanks.
> --
> Danne

moving SQL data and then shrinking file

I have added a new drive to a server and want to move one of the databases t
o
this drive to alleviate space problems on the original drive. I wanted to d
o
this with as little downtime to the system as possible and the size of the
original database file is almost 100 GB. I created a second file (NDF) on
the new drive. I think did a shrinkfile to empty the original mdf file. It
appears that most of the data has been moved, but I cannot reduce the size o
f
the mdf file even though it says it is only using 5 GB of the 100 GB. I
would rather copy a 5 GB file rather than a 100 GB file. Can you reduce the
size of a mdf file?
Thanks.
--
Danne> Can you reduce the
> size of a mdf file?
Yes. You might need to do a few SHRINKFILEs, and make sure you don't specify
the NOTRUNCATE option.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi
"Danne" <Danne@.discussions.microsoft.com> wrote in message
news:84C00DB8-5491-405C-B9EA-72D2D9521D2B@.microsoft.com...
>I have added a new drive to a server and want to move one of the databases
to
> this drive to alleviate space problems on the original drive. I wanted to
do
> this with as little downtime to the system as possible and the size of the
> original database file is almost 100 GB. I created a second file (NDF) on
> the new drive. I think did a shrinkfile to empty the original mdf file.
It
> appears that most of the data has been moved, but I cannot reduce the size
of
> the mdf file even though it says it is only using 5 GB of the 100 GB. I
> would rather copy a 5 GB file rather than a 100 GB file. Can you reduce t
he
> size of a mdf file?
> Thanks.
> --
> Danne

Wednesday, March 7, 2012

Moving replicated databases

I have to move a SQL Server 2000 database from drive to another on the
same server because we are running out of space. I know the easiest
way to accomplish this is to detach the database, move the .mdf & .ldf
files, and reattach the database. However, this database is being
replicated, which is creating a problem. Due to both the size of the
database, and multiple off site locations, and replication takes
approximately 2-3 days, which is not an option... Does anyone know of
a easier way to restart replication without starting it all from
scratch? Thanks in advance for you help...
I think the easiest way is to script out the replication setup, prevent
access to the system, synchronize, drop the publications, move the databases
then do a nosync initialization to reinitialize.
HTH,
Paul Ibison
|||use master
go
sp_detach_db 'myDB'
go
-- Server: Msg 3724, Level 16, State 1, Line 1
-- Cannot drop the database 'mydb' because it is being used for replication.
-- STEP 1
-- find your database like 'myDB' with value 4
SELECT name, category
FROM master..sysdatabases
GO
-- Output
NAME Category
distribution16
master0
model0
msdb0
Northwind0
pubs0
myDB4 -- remember to note this value of your replicated database
tempdb0
-- STEP 2
EXEC sp_configure 'allow updates', 1
RECONFIGURE WITH OVERRIDE
GO
-- STEP 3
-- Update replication bitmap to remove Distributor flag for that DB
-- current database mydb category value is 4 ,it means replicated
-- Reset with Zero (0) to
UPDATE master.dbo.sysdatabases
SET category = 0
WHERE name = 'myDB'
GO
-- STEP 4
use master
go
sp_detach_db 'myDB'
go
-- Move the files MDF/NDF/LDF
-- STEP 5
sp_attach_db myDB
'D:\MSSQL\Data\myDB_Data.MDF',
'E:\MSSQL\Data\myDB_Log.LDF' ,
'E:\MSSQL\Data\FGmsmerge_genhistory.ndf',
'E:\MSSQL\Data\myDB_Data2.NDF' , -- moved from D: to E:
'D:\MSSQL\Data\myDB_Data3.NDF'
go
-- STEP 6
UPDATE master.dbo.sysdatabases
SET category = 4
WHERE name = 'myDB'
GO
-- STEP 6
EXEC sp_configure 'allow updates', 0
RECONFIGURE WITH OVERRIDE
Good luck
Cheers
Ponnu MCDBA

moving primary log file

hi,
i'm running out of space on my local drive. the db that i am working on has
one log file. i'd like to move it to a network drive. is that allowed?
i've gotten an error message to the contrary when i tried this w/ a test db.
also, how do a i move a primary log file for a database?
thank you
matthew
I would try sp_detach_db/ sp_attach_db.
"matthew c. harad" <matthewcharad@.discussions.microsoft.com> wrote in
message news:3FD18944-59E5-48EE-A306-A35C93329FD9@.microsoft.com...
> hi,
> i'm running out of space on my local drive. the db that i am working on
has
> one log file. i'd like to move it to a network drive. is that allowed?
> i've gotten an error message to the contrary when i tried this w/ a test
db.
> also, how do a i move a primary log file for a database?
> thank you
> matthew
|||Hi
You can't put it onto a "normal" network drive, but if you have a SAN that
is ok. You may want to detach the database (sp_detach_db) and attach just the
data file to create a new (smaller) log file see sp_attach_single_file_db in
books online. To keep the existing one you can use sp_attach_db specifying
the new location of the log, or backup/restore the database using the MOVE
clause (or changing the location in the Advanced tab in EM).
John
"matthew c. harad" wrote:

> hi,
> i'm running out of space on my local drive. the db that i am working on has
> one log file. i'd like to move it to a network drive. is that allowed?
> i've gotten an error message to the contrary when i tried this w/ a test db.
> also, how do a i move a primary log file for a database?
> thank you
> matthew

moving primary log file

hi,
i'm running out of space on my local drive. the db that i am working on has
one log file. i'd like to move it to a network drive. is that allowed?
i've gotten an error message to the contrary when i tried this w/ a test db.
also, how do a i move a primary log file for a database?
thank you
matthewI would try sp_detach_db/ sp_attach_db.
"matthew c. harad" <matthewcharad@.discussions.microsoft.com> wrote in
message news:3FD18944-59E5-48EE-A306-A35C93329FD9@.microsoft.com...
> hi,
> i'm running out of space on my local drive. the db that i am working on
has
> one log file. i'd like to move it to a network drive. is that allowed?
> i've gotten an error message to the contrary when i tried this w/ a test
db.
> also, how do a i move a primary log file for a database?
> thank you
> matthew|||Hi
You can't put it onto a "normal" network drive, but if you have a SAN that
is ok. You may want to detach the database (sp_detach_db) and attach just th
e
data file to create a new (smaller) log file see sp_attach_single_file_db in
books online. To keep the existing one you can use sp_attach_db specifying
the new location of the log, or backup/restore the database using the MOVE
clause (or changing the location in the Advanced tab in EM).
John
"matthew c. harad" wrote:

> hi,
> i'm running out of space on my local drive. the db that i am working on h
as
> one log file. i'd like to move it to a network drive. is that allowed?
> i've gotten an error message to the contrary when i tried this w/ a test d
b.
> also, how do a i move a primary log file for a database?
> thank you
> matthew

moving primary log file

hi,
i'm running out of space on my local drive. the db that i am working on has
one log file. i'd like to move it to a network drive. is that allowed?
i've gotten an error message to the contrary when i tried this w/ a test db.
also, how do a i move a primary log file for a database?
thank you
matthewI would try sp_detach_db/ sp_attach_db.
"matthew c. harad" <matthewcharad@.discussions.microsoft.com> wrote in
message news:3FD18944-59E5-48EE-A306-A35C93329FD9@.microsoft.com...
> hi,
> i'm running out of space on my local drive. the db that i am working on
has
> one log file. i'd like to move it to a network drive. is that allowed?
> i've gotten an error message to the contrary when i tried this w/ a test
db.
> also, how do a i move a primary log file for a database?
> thank you
> matthew|||Hi
You can't put it onto a "normal" network drive, but if you have a SAN that
is ok. You may want to detach the database (sp_detach_db) and attach just the
data file to create a new (smaller) log file see sp_attach_single_file_db in
books online. To keep the existing one you can use sp_attach_db specifying
the new location of the log, or backup/restore the database using the MOVE
clause (or changing the location in the Advanced tab in EM).
John
"matthew c. harad" wrote:
> hi,
> i'm running out of space on my local drive. the db that i am working on has
> one log file. i'd like to move it to a network drive. is that allowed?
> i've gotten an error message to the contrary when i tried this w/ a test db.
> also, how do a i move a primary log file for a database?
> thank you
> matthew