I Kings - Chapter 8
Solomon's Prayer
Solomon gathered the various leaders of the country in Jerusalem, bringing the Ark from the Tent where David had kept it. The entire nation joined them; this was before the holiday of Succos and the people made the requisite pilgrimage to Jerusalem. The Kohanim brought in the Ark and the Leviim (Levites) brought the Tabernacle and all of its vessels. Solomon offered numerous sacrifices.
The Ark was placed in the Holy of Holies, under the cherubim. The poles of the Ark could be seen pushing upon the partition, but they did not extend outside of it. (The Navi tells us that the Ark is there "until this day," but that doesn't mean until the 21st century. It means until the time of Jeremiah, when that sentence was written.) When the Kohanim left the Holy, the Temple filled with the glory of G-d's Presence. Solomon recognized this cloud as a sign of favor, as the same thing happened when Moses assembled the Tabernacle way back in Exodus chapter 40.
Solomon blessed the nation and praised G-d for allowing him to build the Temple, fulfilling the wishes of his father, David. Solomon asked that just as the promise that he would build the Temple was fulfilled, so should G-d also fulfill the promise to safeguard the Davidic dynasty. He also recognized that G-d wasn't literally "in" the Temple, as such a thing is not possible. Rather, the Temple is a place for people, where their prayers will be given special attention. If one person wrongs another, Solomon prayed that G-d would judge between them. If the people are unworthy and G-d permits an enemy power to overrun them, may He forgive them and return them to the land. If the people sin and are punished with drought, may they repent so that G-d will forgive them and send rain. Similarly, in the case of famine, pestilence, locusts, or other disasters, whenever the people cry out to G-d from the Temple, may Hashem forgive them and act accordingly, for He alone knows the inner thoughts of mankind.
Non-Jews were also welcome in the Temple. They would travel to Jerusalem to pray there, so Solomon asked that Hashem also grant their prayers, helping the whole world to recognize G-d. (Solomon actually asked G-d to be more generous with non-Jews than with Jews. He asked that G-d grant all of a non-Jew's prayers, but he only asked that Jews be granted what they merit.)
Solomon continued his prayer with a plea for military success. He then added that no one is without sin, so would G-d please please accept repentance and forgive His people. He asked for all this because Israel is G-d's nation that He took out from Egypt.
When Solomon finished his prayer, he stood up and spread his hands out toward Heaven. He blessed the gathered crowd that Hashem had granted them rest from their enemies and fulfilled all of His promises to Moses. Solomon asked that G-d be with them as He was with their ancestors and that the people should turn their hearts to G-d, to walk in His ways and to follow His laws. He asked that G-d grant his prayer appropriately so that the whole world would recognize the One G-d.
Solomon offered 22,000 head of cattle and 120,000 sheep as a sacrifice to G-d. The Temple was dedicated and the courtyard was sanctified for use, because that's where certain offerings were made. Solomon made a week-long celebration, that led straight into the holiday of Succos. (Yes, that means that the week-long party included Yom Kippur. There is a difference of opinion as to whether they celebrated while fasting or whether G-d suspended the fast that year. The Talmud in Moed Katan, page 9a, says that the fast was actually suspended.) After Shemini Atzeres (the holiday on the eighth day, immediately after Succos), the people went home, full of joy over all of G-d's blessings to them.