I can't speak of any best practices, but my rule of thumb is always.... Open a database connection (libname) when you need it, close it when your done. I'm very cautious about pre-assigned libraries, especially to RDMBs. If the DB is down when you run you pre-assignment, you Workspace Server will not start and you know how may many clients use a Workspace Server. Also, over time, you find these things accumulate for no good reason, and at some point you have a gazillion pre-assigned libraries and most aren't even used. Idle session also use some resources on both SAS and the database. That's probably why your Teradata DBA is alerting you about these sessions.
So to answer your question, for me it's not a case of ending the alerts, it's not having idle sessions in the first place. Good, clean housekeeping.