Everything returned to normal, after the execution of Pharaoh's chief baker, and Joseph remained in prison ... for another 2 full years.
At the end of the 2 years, Pharaoh one night dreamed.
He dreamed that he was standing next to a river. And, behold, there came up out of the river 7 well favoured oxen and fatfleshed ... and they fed in the meadow.
And, behold, 7 other oxen came up after them out of the river, ill favoured and leanfleshed, and stood by the other oxen upon the brink of the river.
And the ill favoured and leanfleshed oxen did eat up the 7 well favoured and fat oxen. Just then Pharaoh woke up. He went back to sleep and he dreamed for the second time.
And, behold, 7 ears of corn came up upon one stalk, rank and good.
And, behold, 7 thin ears devoured the 7 rank and full ears.
Pharaoh again woke up, and was very glad that it was just a dream.
But when he woke the next morning, he was troubled by the dreams. So he sent for all the magicians in Egypt, as well as all the wise men.
He told them his 2 dreams, but none of them could tell him what it meant.
Suddenly the chief butler spoke unto Pharaoh, saying: 'Pharaoh was angry at me and the chief baker and had put us in prison, two years ago. We dreamed a dream one night, I and he ... we dreamed each man according to the interpretation of his dream.
And there was with us a young man, a Hebrew ... servant to the captain of the guard. We told him, and he interpreted to us our dreams, to each manaccording to his dreams he did interpret ... and it came to pass.'
Pharaoh immediately sent for Joseph ... Joseph shaved himself and changed his rainment, before his meeting with Pharaoh.
Upon their meeting, Pharaoh immediately told Joseph about his 2 dreams.
When Pharaoh finished his story, Joseph answered him:
'The dream of Pharaoh is one. God had shown Pharaoh what He is about to do:
The 7 good oxen are 7 good years, and the 7 good ears are 7 years ... the dream is one.
And the 7 thin and ill favoured oxen and the 7 empty ears shall be 7 years of famine.
Behold, there come 7 years of great plenty thoughout Egypt, and then shall arise after them 7 years of famine.
And the plenty shall not be known in the land by reason of the famine following.'
Joseph then continued: 'Now therefore let Pharaoh look out a man discreet and wise, and set him over the land of Egypt. Let Pharaoh do this, and let him appoint officers over the land, and take up the 5th part of the land of Egypt in the 7 plenteous years.
Let them gather all the food of those good years that come, and lay up corn under the hand of Pharaoh, and let them keep food in the cities.
And that food shall be for store to the land against the 7 years of famine, which shall be in the land of Egypt, that the land perish not through the famine.'
And the thing was good in the eyes of Pharaoh, and in the eyes of all his servants.
Pharaoh was so impressed with Joseph that he made Joseph his overseer over the Egyptians and said to him: 'Thou shalt be over my house, and according to thy word shall all my people be ruled. Only in the throne will I be greater than thou.'
Pharaoh then took of his ring and gave it to Joseph, and from thereon Joseph always rode at Pharaoh's side.
He also called Joseph by the name Zaphnath-Paaneah and gave him a wife called Asenath, the daughter of the priest of On. He had 2 sons and he called them Manasseh and Ephraim. At that time Joseph was 30 years old.
So Joseph made sure that Egypt gather all the food possible in the 7 fat years, and before the famine hit the land.
And when the hunger came all over the earth, Egypt had food ... and all countries came into Egypt to Joseph for to buy corn ... because the famine was so sore in all the countries.
Source: Genesis 41