The global variable @@ recovery_state determines if SAP ASE is in recovery.
The values that @@ recovery_state can have are:
NOT_IN_RECOVERY – SAP ASE is not in start-up recovery or in failover recovery. Recovery has been completed and all databases that can be online are brought online.
RECOVERY_TUNING – SAP ASE is in recovery (either start-up or failover) and is tuning the optimal number of recovery tasks.
BOOTIME_RECOVERY – SAP ASE is in start-up recovery and has completed tuning the optimal number of tasks. Not all databases have been recovered.
FAILOVER_RECOVERY – SAP ASE is in recovery during an HA failover and has completed tuning the optimal number of recovery tasks. All databases are not brought online yet.
@@recovery_state can be used by applications to determine when all the databases are recovered and brought online.