What should a doctor do to start dispensing medicines exclusively to her or his own patients? Is a trade licence necessary?

Is he required to take a drug licence, like any other chemist? Please quote applicable references, laws, rules.