This section describes how to recover an instance when data has been corrupted due to incorrect user operation.
For example, when data has been corrupted due to incorrect user operation, such as data being unintentionally changed or deleted by an application or command, it is necessary to restore the original data on the primary server and resynchronize with the standby server.
Use the following procedure to perform recovery.
Identify the primary server
Execute the mc_ctl command in status mode on each server, and search for a server for which "primary" or "none(inactivated primary)" is displayed.
Stop the applications and commands that caused the incorrect operation to occur
Stop applications and commands that are running on the primary server. This will minimize the impact caused by the incorrect data.
Also, if any applications used for reference by the standby server are running, stop them too.
Stop the instance and Mirroring Controller
Stop the instance and Mirroring Controller on both the primary server and standby server.
Example)
$ mc_ctl stop -a -M D:\mcdir\inst1
Recover the database on the primary server
Recover the database using the recovery method in which the pgx_rcvall command uses the backup data to recover the database to a restore point prior to the time when the incorrect operation was performed.
See
Refer to "Recovering from an Incorrect User Operation" in the Operation Guide for information on using the pgx_rcvall command to recover the database to a restore point, and then perform only the database recovery procedure while the instance is in a stop state.
Start the instance and Mirroring Controller
Start the instance and Mirroring Controller on the primary server.
As the instance administrator user, execute the mc_ctl command in start mode with the -f option specified. This enables automatic switch and disconnection.
If you start Mirroring Controller and the instance without specifying the -f option, automatic switch and disconnection will not be enabled. To enable both, start Mirroring Controller and then execute the mc_ctl command in enable-failover mode, or restart Mirroring Controller with the -f option specified.
Example)
> mc_ctl start -M D:\mcdir\inst1 -w -f
As the instance administrator user, execute the mc_ctl command in start mode.
Example)
> mc_ctl start -M D:\mcdir\inst1 -w
Build the new standby server
Refer to "8.4 Setting up the Standby Server" for information on building (setting up) a standby server from the primary server.
Point
It is not necessary to repeat steps that have already been performed, such as registering to Windows services.