If you're leaving, most companies will expect at least a 1-month notice. Two months is common. Even if you're changing jobs that's not too long because the other company (if it's a Japanese company) will understand and actually expect it. On that 1~2 month period you're expected to hand over your tasks to a colleague.
If you're leaving for a reason other than changing to another company (like Patrick), then it's not uncommon to give a longer notice. For instance, many women still leave their jobs after marrying, or after getting pregnant, or when their husbands get transferred etc.
I've heard of key technical staff having a 3-month notice written out in their contract. Nine months is ridiculously long no matter what.
Personally, I would tell the person "Go ahead and go now, and we'll just continue to pay your salary to the end of the contract". If the person is really unhappy with the place, having them around bringing everyone down is going to cost a lot more than paying someone 2 months to not be there IMO.
How do you contract this sort of thing? If I wanted to quit and I had a contract like this, I would just stop coming to work, or I would come to work and do a bad job.
It's something similar in Sweden, though the contract goes both ways. They can't give less notice for firing you than you can for quitting, so it just damps the system somewhat.
Since it's a legal contract violating (by leaving) it could lead to lawsuits.
Although it's in the contract, you are always free to re-negotiate a contract, and if both sides agree, then you have a new contract