...Rabbi Ishmael said, the same night that Solomon had completed the Temple, he married the daughter of Pharoah and there was a great celebration in the Temple. And the celebration of the Daughter of Pharaoh rose above the celebration of the Temple. As it is said, “That it is always so that people flatter the king”. In that moment God thought of destroying it [the Temple] as it says (Jeremiah 32:31) “The city has aroused My anger and My wrath from the day it was built until this day; so it must be removed from My sight.” And Rabbi Levi said, regarding the Morning Sacrifice that was coming close to the fourth hour. What did the Daughter of Pharoah do? She made a certain sheet [and placed it above his bed], and placed on it stars and planets, and every time that Solomon would try to wake up, he would see these stars and planets and would return to sleep for another four hours. Rabbi Levi said, on that day the Morning Sacrifice came close to being sacrificed in the fourth hour. [and regarding that hour it was taught: there was a situation in which the Morning Tamid was sacrificed in the fourth hour nad the people of Israel were saddened, for it was the day of the Inaugration of the Temple and they could not carry out the sacrifice because Solomon was asleep, and they were afraid of waking him because of the fear of the Kingship. They went and told Bat-Sheva his mother, and she went and woke him up and rebuked him, as it is written, “rebuke that his mother rebuked him”...
Kingdom of Solomon of Temple
Midrash Mishlei 31:1
(משלי לא א): "דִּבְרֵי לְמוּאֵל מֶלֶךְ מַשָּׂא אֲשֶׁר יִסְּרַתּוּ אִמּוֹ" - אמר רבי יוחנן: מלמד שכפפתו אמו על העמוד ואמרה לו: (משלי לא ב): "מַה בְּרִי וּמַה בַּר בִּטְנִי וּמֶה בַּר נְדָרָי" - אתה בן שנדרתי אותך להקב"ה - (משלי לא ג): "אַל תִּתֵּן לַנָּשִׁים חֵילֶךָ" - למה? שלא יחלישו אותך ויגנבו דעתך'. (משלי לא ד): "אל למלכים למואל אל למלכים שתו יין ולרוזנים אי שכר", (משלי לא ה): "פֶּן יִשְׁתֶּה וְיִשְׁכַּח מְחֻקָּק וִישַׁנֶּה דִּין כָּל בְּנֵי עֹנִי" - מהו מחוקק? אמר רבי סימון: אלו דברי תורה, כמד"א (שמות לב טו): "מזה ומזה הם כתובים". ד"א "משא אשר יסרתו אמו" - אמר רבי ישמעאל: באותו הלילה שהשלים שלמה בית המקדש נטל בת פרעה, והיתה צהלה ושמחה בבית המקדש, ועלתה צהלת בת פרעה מצהלת בית המקדש, דין הוא דאמר מתלא "כוליה עלמא מחניפין למלכא", באותה שעה עלתה מחשבה לפני הקב"ה להחריבה, שנאמר (ירמיהו לב לא): "כי על אפי ועל חמתי היתה וגו'". ואמר רבי לוי: על תמיד של שחר שקרב בארבע שעות. כיצד עשתה בת פרעה? כמין פרוכת [שטחה לו למעלה ממטתו], וקבעה בה כמין כוכבים ומזלות, כל זמן שהיה רוצה שלמה לעמוד - היה רואה את הכוכבים ואת המזלות, והיה ישן לו עד ארבע שעות, אמר רבי לוי: באותו היום נתקרב התמיד בארבע שעות. [ועל אותה שעה שנינו: מעשה היה ונתקרב תמיד של שחר בארבע שעות, והיו ישראל עצבים, שהיה יום חנוכת בית המקדש, ולא היו יכולין לעשות מפני שהיה ישן שלמה, והיו מתיראים להקיצו מפני אימת המלכות, הלכו והודיעו לבת שבע אמו, והלכה היא והקיצתו והוכיחתו, הה"ד "משא אשר יסרתו אמו"].