I don't remember fighting Nightmare in Devil May Cry 2. He is only fought in the first Devil May Cry for 3 times.
Tips on fighting Nightmare:
1. Let Nightmare 'absorb' you and defeat the Sargassos (the floating skulls) and the weaker versions of the previous bosses. For the first fight, you need to fight a weaker version of Phantom, weaker Griffon for the second fight, and weaker Nelo Angelo for the third fight. By killing this weaker version of previous boss, you will damage Nightmare, a lot.
2. Most Nightmare attacks can be dodged and deflected. If you are good, try deflecting the spikes that Nightmare releases from it's body to stun it and damage the core quickly with your most powerful attacks. You can also deflect the boomerang attack as well. Using Rolling Blaze to deflect it is a good idea.
3. Nightmare can absorb your Devil Trigger runes. He will do this when the core is emitting light waves. Damage the core to stop the process. Once it had enough D.T., Nightmare will trigger it's own Devil Trigger mode, which means you are going to die quickly, and it is nearly impossible to stop it once it had use D.T. form.
4. Nightmare's laser cannon attack can be dodged by using proper jumping. Avoid it all costs, as it is very damaging.
5. Nightmare's machine gun orbs can be destroyed with you firearms. However, it can respawn.
6. Nightmare will send some slugs to attack you when you are far away. Kill them or just avoid them altogether.
7. Make sure you activated the light switches on the walls to make Nightmare show it's true form. You can only damage when it is in solid form.
8. When Nightmare's core is exposed, it will use missiles attack and the spike thing. Use Inferno to destroy the missiles, Rolling Blaze, or just dodge it with Side Roll.
9. Use items when necessary. Dante Must Die mode is a very difficult mode, son don't be afraid or shy using items.
10. Recommended weapons to use are Alastor or Ifrit, plus Ebony and Ivory.
Hope this will help you.