In the Bhagavata Purana Shesha is named Sankarshana, the tamasic energy of Lord Narayana himself, and is said to live deep within the inner layers of patala, where there are many serpents with gems on their heads and where Sankarshana is the ruler. He is said to live since before the creation of the universe. When the universe is towards its end, he creates 11 rudras from him to destroy the universe for a new one to be created.
http://lordofsnake.blogspot.com/search/label/Shesha
http://lordofsnake.blogspot.com/search/label/Shesha