Season 3 Episode 17 - A Hundred Days
During an expedition to a civilized planet, the stargate of that world is hit by a meteor, trapping O'Neil on that world without any apparent hope of rescue. While he slowly gives up his old life and joins in with the relatively primitive civilization of this world, the SG team tries to find a way to reactivate the buried but still-intact stargate and rescue him. The only means to do so is to send Teal'c through on a suicidal one-way mission to tunnel out of the stargate before his air runs out.