Moving R/3 Database Files to New Disks 

Use

If your R/3 database or log files are running out of disk space, you have to add new disks to the file system. Depending on the disk configuration currently in use, two different approaches are possible:

The following describes the procedure for moving files to a new disk array. It assumes that you have already configured the array as an NTFS partition according to the instructions provided by the disk vendor.

Procedure

  1. In the Enterprise Manager select the server and choose Tools ® SQL Server Query Analyzer.
  2. The Query window of the SQL Server Query Analyzer opens.

  3. Detach the database from the SQL Server with the following stored procedure:
  4. sp_detach_db '<SAPSID>' 'true'

    Where <SAPSID> is the name of your R/3 database.

  5. Execute the stored procedure with Query ® Execute.
  6. The R/3 database is detached from the SQL Server and is no longer visible in the Enterprise Manager when the display has been refreshed.

  7. Switch to the Windows NT Explorer and copy the R/3 database files to the newly configured disk drive as required.
  8. Do not move the primary data file <SAPSID>DATA1.mdf to the new drive. If you move it, the master database will be modified. As a result, the current backup of the master database will no longer be up to date and you will have to make a new backup immediately.

  9. When you have moved the files to the new drive, re-attach the R/3 database to the SQL Server. To do this, switch to the Query Analyzer and execute the sp_attach_db stored procedure. You must specify the location of all the database files, including the log file:

sp_attach_db <SAPSID>, '<filename>', '<filename>'...

sp_attach_db PRD, 'D:\PRDDATA1\PRDDATA1.mdf', 'N:\PRDDATA2\PRDDATA2.ndf', 'N:\PRDDATA3\PRDDATA3.ndf', 'L:\PRDLOG1\PRDLOG1.ldf'

The R/3 database reappears in the database list of the Enterprise Manager and is again visible and accessible for the SQL Server. The newly configured disk array can now be used by the SQL Server.