Being junub does not obstruct fasting.
According to the Quran, being junub which is the state of needing major ablution (ghusl) is only an obstacle to offering the prayer (salat), but not to fasting:
“Oh you who believe! Do not approach the prayer when you are intoxicated until you know what you are saying, nor while you are in the need of major ablution (junub) until you perform major ablution (ghusl)…” (An-Nisa 4:43)
Wives of our Prophet Aisha and Umm Salama narrated that Prophet Muhammad (p.b.u.h) also woke up as junub and then continued fasting by performing major ablution (Bukhari, Sawm, 22)
According to Islamic rulings, a person who is junub because of any reason, can wait until the next prayer (salat) time without performing major ablution. It is not permissible to wait more than that because offering every prayer within its specified time period is an obligation to all Muslims , and it cannot be offered without major ablution (ghusl). You may go to sleep while you need to take major ablution at night. However, fajr prayer is an obligation upon you, so you have to wake up in its time period and have to perform major ablution (ghusl) in order to offer the prayer (salat). If you had fallen asleep, the first thing you need to do when you wake up is performing the major ablution and offering the fajr prayer that you missed.
You can fast the day. The only thing to be careful is avoiding to swallow water while performing the major ablution.