If you want to know how to optimize dynamic websites then read blog by matt cutt or googlegenie blog.
You would optimize a dynamic site the same as a static site, there is no different really. You will have a harder time making on-page changes to specific web pages since dynamically generated web pages tend to use the same values on all their web pages to make them load faster. You'll probably need to use a database to pull unique title tags, meta tags, heading tags, etc.
Well, it depends of the CMS you use. Optimization is not something like "general advice". There are principles to follow, but it is very different with different CMS. What kind of database and CMS do you use?