The 31-year-old has played more than 280 games for the Swans and has been on loan at Championship clubs Leeds and Yeovil this season.
The centre-back joins a back four which will be missing the injured Andrew Considine and Clark Robertson for the next few weeks.
Reading defender Michael Hector is also due to return south when his loan spell ends after Aberdeen's Scottish Premiership clash at Kilmarnock on Sunday.
Manager Derek McInnes told the club's official website: "I've made no secret of the fact that, even if Michael does come back, we are pretty short in terms of cover in that department, and I'm delighted to bring in someone with Alan's experience.
"While Alan is predominantly a centre back, he can also play at full back if required, and he'll go straight into the squad for Sunday."