How to Use Diode Oring to Switch between Two Power Sources?
It'll work fine if your load can take the reduction in supply voltage due to the diodes' forward voltage drop.

Following is a schematic, and an LTspice circuit list you can use to run a simulation to see how it works.

Basically, if V2 is enough more positive than V1 and the diodes are identical, then D1 will be reverse-biased and V2 will supply all of the current into the load, R1.

Then, when V2 disharges and V2 becomes enough less positive than V1, D2 will become reverse-biased and D1 will supply all the current into R1.

No matter what voltage V2 is, however, if the mains fail and V1 goes to zero volts, V2 will reverse bias D1 and will supply all of the current into R1.

There's a small penalty to be paid, and that's the voltage drop across the diodes, which amounts to about 0.55 volt with 5 amperes through either diode at an ambient temp of 25C. For more info on the diode, the data sheet is here  



Version 4
SHEET 1 880 680
WIRE 224 48 32 48
WIRE 352 48 288 48
WIRE 224 160 144 160
WIRE 352 160 352 48
WIRE 352 160 288 160
WIRE 32 208 32 48
WIRE 144 208 144 160
WIRE 352 208 352 160
WIRE 32 336 32 288
WIRE 144 336 144 288
WIRE 144 336 32 336
WIRE 352 336 352 288
WIRE 352 336 144 336
WIRE 32 400 32 336
FLAG 32 400 0
SYMBOL schottky 224 64 R270
WINDOW 0 32 32 VTop 2
WINDOW 3 0 32 VBottom 2
SYMATTR InstName D1
SYMATTR Value B520C
SYMATTR Description Diode
SYMATTR Type diode
SYMBOL voltage 32 192 R0
WINDOW 0 19 104 Left 2
WINDOW 3 17 8 Invisible 2
WINDOW 123 0 0 Left 2
WINDOW 39 0 0 Left 2
SYMATTR InstName V1
SYMATTR Value PULSE(12 0 15 1u 1u)
SYMBOL res 336 192 R0
SYMATTR InstName R1
SYMATTR Value 6
SYMBOL schottky 224 176 R270
WINDOW 0 32 32 VTop 2
WINDOW 3 0 32 VBottom 2
SYMATTR InstName D2
SYMATTR Value B520C
SYMATTR Description Diode
SYMATTR Type diode
SYMBOL Misc\\battery 144 192 R0
WINDOW 0 10 101 Left 2
WINDOW 3 10 129 Invisible 2
WINDOW 123 0 0 Left 2
WINDOW 39 0 0 Left 2
SYMATTR InstName V2
SYMATTR Value PULSE(13 11 0 20)
TEXT 46 368 Left 2 !.tran 20 startup uic