The global variable @@ recovery_state determines if Adaptive Server is in recovery. The values that @@ recovery_state can have are:
NOT_IN_RECOVERY – Adaptive Server 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 – Adaptive Server is in recovery (either start-up or failover) and is tuning the optimal number of recovery tasks.
BOOTIME_RECOVERY – Adaptive Server is in start-up recovery and has completed tuning the optimal number of tasks. Not all databases have been recovered.
FAILOVER_RECOVERY – Adaptive Server 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.