Top
Enterprise Postgres 17 Operation Guide

17.6.2 Replacing the Disk with a Larger Capacity Disk

Before replacing the disk with a larger capacity disk, migrate resources at the data storage destination using the backup and recovery features.

There are two methods of performing backup and recovery:

The following sections describe procedures that use each of these methods to replace the disk and migrate resources at the data storage destination.

Point

It is recommended that you back up the database cluster following recovery. Backup deletes obsolete archive logs (transaction logs copied to the backup data storage destination), freeing up disk space and reducing the recovery time.

17.6.2.1 Using WebAdmin

Follow the procedure below to replace the disk and migrate resources at the data storage destination by using WebAdmin.

  1. Back up files

    If the disk at the data storage destination contains any required files, back up the files. It is not necessary to back up the data storage destination.

  2. Stop applications

    Stop applications that are using the database.

  3. Back up the database cluster

    Back up the latest resources at the data storage destination. Refer to "3.2.1 Using WebAdmin" for details.

  4. Stop the instance

    Stop the instance. Refer to "2.1.1 Using WebAdmin" for information on how to stop an instance.

  5. Replace with a larger capacity disk

    Replace the disk. Then, recover the volume configuration information.

  6. Recover the database cluster

    Log in to WebAdmin, and perform recovery operations. Refer to steps 4 ("Create a tablespace directory ") to 7 ("Run recovery") under "If failure occurred in the data storage disk or the transaction log storage disk" in "17.1.1 Using WebAdmin" for information on the procedure. An instance is automatically started when recovery is successful.

  7. Resume applications

    Resume applications that are using the database.

  8. Restore the files

    Restore the files backed up in step 1.

17.6.2.2 Using Server Commands

Follow the procedure below to replace the disk and migrate resources at the data storage destination by using server commands.

  1. Back up files

    If the disk at the data storage destination contains any required files, back up the files. It is not necessary to back up the data storage destination.

  2. Stop applications

    Stop applications that are using the database.

  3. Back up the database cluster

    Back up the latest resources at the data storage destination. Refer to "3.2.2 Using Server Commands" for details.

  4. Stop the instance

    After backup is complete, stop the instance. Refer to "2.1.2 Using Server Commands" for information on how to stop an instance.

    If the instance fails to stop, refer to "17.11 Actions in Response to Failure to Stop an Instance".

  5. Replace with a larger capacity disk

    Replace the disk. Then, recover the volume configuration information.

  6. Create a data storage destination

    Create a data storage destination. If a tablespace was defined, also create a directory for it.

    Example
    $ mkdir /database/inst1
    $ chown fsepuser:fsepuser /database/inst1
    $ chmod 700 /database/inst1
  7. Recover the keystore, and enable automatic opening of the keystore

    When the data in the database has been encrypted, restore the keystore to its state at the time of the database backup. Configure automatic opening of the keystore as necessary.

  8. Recover the database cluster

    Use the pgx_rcvall command to recover the database cluster.

    • Specify the data storage destination in the -D option. If the -D option is omitted, the value of the PGDATA environment variable is used by default.

    • Specify the backup storage directory in the -B option.

    Example
    > pgx_rcvall -D /database/inst1 -B /backup/inst1

    Note

    If recovery fails, remove the cause of the error in accordance with the displayed error message and then re-execute the pgx_rcvall command.

    If the message "pgx_rcvall: an error occurred during recovery" is displayed, then the log recorded when recovery was executed is output after this message. The cause of the error is output in around the last fifteen lines of the log, so remove the cause of the error in accordance with the message and then re-execute the pgx_rcvall command.

    The following message displayed during recovery is output as part of normal operation of pgx_rcvall (therefore the user does not need not be concerned).

    FATAL: the database system is starting up

    See

    Refer to "pgx_rcvall" in the Reference for information on the pgx_rcvall command.

  9. Start the instance

    Start the instance.

    Refer to "2.1.2 Using Server Commands" for information on how to start an instance.

  10. Resume applications

    Resume applications that are using the database.

  11. Restore files

    Restore the files backed up in step 1.