Sale of available-for-sale securities

I'm having a hard time with this and my book doesn't go into detail. From what I understood, you need to remove the securitie's associated unrealized G/L from the books and move it up to realized G/L (along with any other unrealized you may not have recognized to this point). But the questions on cpareviewforfree.com seem to imply that this change has NO impact on OCI. Should we be removing the full life-time unrealized gain from OCI? Should it be coming from accumulated unrealized?