A suspect was shot at before being taken into custody in a large police operation after a teacher was stabbed in the stomach in western Germany.