2016-08-25

Moving database device using mirroring

In IT at all one apect doesn't change. This is the need for changes! Even if the location of database devices will be very well designed in the moment, with time it can be discovered that there is too less disk space on the device or file system and the database will beed to be migrated to new device.

This can be done in different ways. One of them is using mirroring. It seems to be quite good as no down time would be required. The idea is:

  • enable mirroring of the old device to the new device located on new file system
  • when devices are mirrored stop mirroring excluding the old device 
  • in that way only the new device will be used!
Here the same in SQL language. Let's suppose we need to migrate all databases stored on MirrorDev1 device from file /opt/sap/databases/alfa/mirrordev1.dat to /opt/sap/databases/alfa/mirrordev2.dat


disk  mirror  name = MirrorDev1, 
              mirror = '/opt/sap/databases/alfa/mirrordev2.dat', 
              writes = serial
GO

disk unmirror name='MirrorDev1', 
              side = 'primary', 
              mode = 'remove'
GO

No comments:

Post a Comment

SAP Adaprive Server Enterprise

SAP Adaprive Server Enterprise
SAP Adaprive Server Enterprise