SQL Server >> How to migrate/expand the physical database files which is nearing disk capacity

by Muraly » Mon, 20 Sep 2004 10:19:27 GMT

Hi All,

One of our customers MSSQL 2000 database has grown to the
maximum disk size, now they wish to expand/migrate the
database to another physical disk.

Could someone advice me on how to achieve the above?

Thanks in advance
Regards
Muraly


SQL Server >> How to migrate/expand the physical database files which is nearing disk capacity

by Muraly » Mon, 20 Sep 2004 11:01:58 GMT


Hi All,

One of our customers MSSQL 2000 database has grown to the
maximum disk size, now they wish to expand/migrate the
database to another physical disk.

Could someone advice me on how to achieve the above?

Thanks in advance
Regards
Muraly






SQL Server >> How to migrate/expand the physical database files which is nearing disk capacity

by Dan Guzman » Mon, 20 Sep 2004 11:32:48 GMT

To move database files:

1) detach the database using sp_detach_db
2) move files as desired
3) attach the database files from the new locations using sp_attach_db

You can also add additional files using ALTER DATABASE. For example:

ALTER DATABASE MyDatabase
ADD FILE(NAME='MyDatabase_Data2',
FILENAME='C:\MyDatabase_Data2.ndf',
SIZE=1GB,
FILEGROWTH=100MB,
MAXSIZE=UNLIMITED)

See the Books Online for more information.

--
Hope this helps.

Dan Guzman
SQL Server MVP







How to migrate/expand the physical database files which is nearing disk capacity

by Muraly » Mon, 20 Sep 2004 13:43:24 GMT

Dear Dan Guzman,

Thanks a lot for the solution, i will test this out.

Best Regards
Muraly
using sp_attach_db
For example:
message

the


Similar Threads

1. Physical Disk : % Disk Time - SQL Server

2. physical disk vs logical disk perf counters

When does one use logical disk perf counters. Theres always reference to
physical disk
Also where can i find a good article on understanding Disk IO such as from
the RAID controller and its channels and the SCSI bus ..btw..Are SCSI
controllers the same as RAID controllers , througput on the bus and the
channel


3. Moving physical disks with database inside?

4. Automating Capacity planning of the disks

I will like to write a short code to automate the 
procedure of checking the total space available on the 
disks on the server toavoid running out of space and to 
avoid manual intervention. Any help please.

5. Disk capacity and CPU/memory utilisation question? - SQL Server

6. Query to list disk drives and capacity

I need a query to list all my disk drives, total disk capacity and free 
space.. similar to what i would see in disk management.

I tried xp_fixeddrives and it just gives me the drives and free space, but 
not total disk capacity

Thank you 


7. Database server will not expand mdf or ndf files

8. Shrink / expand database file

Shall I manually shrink the database file after I purge a huge
database table? After purging, there will be only 500,000 records left
in the table (from 52 million records before the purging).

If the answer is yes, after I manually shrink the database file, what
if many records are inserted into the table and it expands into a huge
table again? Will the size of the database file be expanded
automatically, or will I need to expand it manually?