A discussion is presented of the detection and the recovery of deadlock in distributed database systems. A distributed algorithm D**3 is proposed first for deadlock detection, and has the following four features: (1) each site maintains and updates only local information, where no information in other sites is needed; (2) the message to be exchanged among the sites for deadlock detection is of fixed-length and simple; (3) as the ratio of local transactions (access to the data in only one site) is increased, the communication required to detect the deadlock becomes less; (4) the processing in each site is simple and can easily be implemented on hardware. As the next step, time-complexity, area-complexity and communication complexity of D**3 are evaluated. Finally, for the case where D**3 detected a deadlock, the recovery from the deadlock is described.