Below is the circuit for backup power from BAT2 when BAT1 is missing. BAT1 in my case is the LD1117 regulator.
Suppose only two situations are possible: (1) BAT1 and BAT2 both exists, (2) BAT1 missing. Can I exclude D2?
UPD. "BAT1 missing" mean LD1117 still exists in the circuit, but its input voltage missing.