(covers information from several alternate timelines)
The historical database or historical records or historical archives were a database stored within Federation Starfleet computers which held a record of historical subjects for later reference. It provided detailed information on past events as well as records on those historical figures who shaped those events.
In 2151, Ensign Travis Mayweather accessed the historical archives for information about the Terra Nova Expedition and found tons of data there including crew manifests, survey photos, and weekly status reports. (ENT: "Terra Nova")
When the USS Defiant was pulled from 2268 of our universe into 2155 of the mirror universe, Jonathan Archer searched the historical database for a reference to the Terran Empire. He was disappointed to find that the Terrans of this universe had joined with other alien races to form the United Federation of Planets. When Hoshi Sato asked if she and Archer existed in the alternate universe, Archer used the database to find the historical record for her counterpart in our universe, after which she returned the favor by bring up his counterpart's profile. The database ultimately proved to be troublesome for Archer when it served as a catalyst for T'Pol's rise against him, with the Vulcan seeking the equality present in our universe. After defeating T'Pol's rebellion, Archer ordered that the Defiant's historical archive be erased. (ENT: "In a Mirror, Darkly, Part II")
When the Dramen star system was visited by the USS Enterprise in 2270, Spock noted that "the historical records of this solar system are spotty, at best, going back 19 years. Mostly, they're technical data, meteor showers, auroras, radiation reports." (TAS: "Albatross")
Captain Jean-Luc Picard and his crew of the USS Enterprise-D referred to the historical database when they were infected with the polywater intoxication virus. Commander William T. Riker had remembered reading about a similar incident; his memory proved correct when a search revealed that the crew of the first Enterprise, under the command of James T. Kirk, had also come into contact with the virus a century earlier. The database also provided the crew with the cure for the virus, although it had to be modified before it could become effective. (TNG: "The Naked Now"; TOS: "The Naked Time")
When Benjamin Sisko and members of his crew from Deep Space 9 were caught up in the events of the Bell Riots in 2024, Sisko was forced to assume the identity of riot leader Gabriel Bell in order to preserve history. Upon their return to 2371, access to the historical database revealed that history had recorded the image of Bell to be that of Sisko. Of the image, Sisko remarked that he was "not looking forward to explaining this to Starfleet Command." (DS9: "Past Tense, Part II") Nog later noticed the similarity of Sisko and Bell, but Quark dismissed it, noting that all Humans looked the same. (DS9: "Little Green Men")