Upgrading From Shimano 8 Sp Alivio To Shimano 9 Sp Altus
A 9 speed cassette will fit on an 8 speed hub. The extra gear is accommodated using thinner cogs and spacers.  You will also need a new shifter as its the shifter that provides the indexing for the gears. If you also increase the range of gears (increase the largest cassette cog), you may need a new rear deraileur. 

Its possible to run 8 speed chain rings with a 9 speed chain, but you will get better shifting upgrading the chain-rings. In this case, replacing the entire crank set might be cheaper. 

There would be little advantage replacing the deraileurs (especially the front) unless they are worn out.