In order to clear a sink drain clog in an upstairs bathroom this weekend, I needed to remove the shutoff valves to get clearance to remove the P trap. This entailed turning off valves in the basement for the lines that supplied the upstairs bathroom. Everything went back together again and, after some initial spluttering to rid the air in the lines when I first turned the water back on again, all seemed well. However, sometimes if I open the faucets only part way, a hammering starts in the pipes and the water turns off/on about 4 times per second. If I open the faucets further, the hammering stops. This happens in the sink faucets and the shower, which are fed by the same supply lines and happens in both the hot and cold sides. This never happened before I shut off the water.
Is there anything that I can do to get rid of this problem without having to install water hammer arrestors? Since this never happened before, I don't want to tear into my walls if I don't have to.