I didn't know that something other than poop and stinks a hundred times more could come out of my dog's rectum. Last September I visited my dogs in Iloilo City and discovered for the first time their anal sacs. These are two glands just under the skin, at either side of the dog's anus. Squeeze them together using your thumb and index finger, the Animal Doctor instructed over the phone. Lo and behold, a pasty material, pretty much like toothpaste coming out of a tube, oozed before my eyes.
Normally, the anal sacs empty by itself when dogs defecate or do scent marking. When this does not happen for some dogs, their anal sacs become impacted driving them to scoot or incessantly lick their rear in an effort to empty the glands. An abscess can form and rupture and may even bring about an infection.
It was quite a heady experience learning to express the anal glands and relieve my dog of her discomfort. But if you are no fan of Pepe Le Pew, then I guess let the Vet do it.