Moving the SAP DATA FILES from existed to newly added drive
If your SAP database or log files are running out of disk space, you have to add new disks to the file system.
Security Permissions :
Your Windows user account must be a member of the db_owner fixed server role in the SQL Server instance to detach DQS databases.
Your Windows user account must have CREATE DATABASE, CREATE ANY DATABASE, or ALTER ANY DATABASE permission to attach a database.
You must have the dqs_administrator role on the DQS_MAIN database to terminate any running activities or stop any running processes in DQS.
If an existing device cannot be extended, you have to add an entire new device to your system.
In this case, you first have to configure the new device as an NTFS partition. Then you have to move existing SAP database files have to the new device by detaching from and re-attaching the database to the SQL Server.
Case study - I have taken an instance SM1.
1. Shut down the instance.
2. Detach the Database.
3. Copy the Data files from Existed drive.
4. Paste the copied Data files to newly added drive.
5. Attach the Database.
6. Start the instance.
- Instance has shut down.
- In the SQL Server Management Studio right-click the SAPSM1 database and choose Tasks -->Detach, The Detach Database dialog box appears.
Select the “Drop connections” check box, Choose OK to detach the database.
The SAP database is detached from the SQL Server and is no longer visible in the SQL Server Management Studio.
Copy the required SM1 Data files from Existing device,
Paste the SM1 Data files to newly added drive
In the SQL Server Management Studio, expand the server, right-click Databases and choose Attach. The Attach Database dialog box appears.
Specify the mdf file of the SAPSM1 database by choosing the Add button.
All the files belonging to the SAPSM1 database are listed under Original File Name.
We have to change the path of which one need to change
Now where we have located, it’s assigned that path only. Choose ok to attach the Data base.
Now able to view the SAP Instance in SQL server Management studio, and is again visible and accessible for the SQL Server. The SQL Server can now use the newly added drive.
Started the SAP instance, and Instance is up on running.