Uploaded sketches question

When you upload a sketch to the arduino uno board, where does the actual sketch get uploaded to.

Is it the Atmega IC chip or another chip on the board.

The reason I ask is because I have a sketch on one arduino where the power supply socket has gone faulty for some reason, and I have to position the plug in just the right place before it powers up. The said arduino has being running continuosly for about 18 months now with a 9v supply, and is used to run a 5mtr lenght led strip at certain times of the day.

I have a spare Arduino Uno, and was wondering if I could just swap the Atmega chip over from the faulty one to the good one, and get the sketch running again.

Thanks

The program is saved to the Atmega328 chip and, yes, you can swap programmed chips between Uno boards

Thanks, just what I wanted to know.