Rescue of Montgomery Scott

Scotty is found alive on a Dyson sphere

In 2369 the Enterprise-D found the wreck of the USS Jenolan on a Dyson sphere and rescued Montgomery Scott, who had survived for 75 years in its transporter buffer.

In 2369 the Enterprise-D answered a distress signal and found a huge Dyson sphere enclosing a star. On its surface lay the USS Jenolan, which had crashed there in 2294. Montgomery Scott had kept himself alive by suspending himself in the transporter pattern buffer, and the Enterprise crew brought him back after 75 years.
When the Enterprise was pulled inside the sphere, Scott and Geordi La Forge used the Jenolan to hold open the sphere's entrance so the Enterprise could escape. Picard then gave Scott the use of a shuttlecraft for his retirement.