“Sunlight alone can breakdown water into hydrogen and oxygen, and there was plenty of surface water in oceans and lakes to give the atmosphere plenty of oxygen.”
Who told you that?
Sorry, my bad. I thought photocatylitic water splitting occured naturally. After you questioned it I researched and learned it only occurs by artificial processes. Mea culp, mea culpa.