Background checks are already required for almost all gun sales, including ones at gun-shows. This whole discussion is a red-herring. And what the f%!# good do you think a "database for guns" is going to do? You think the terrorists buy their guns over the counter, with legit IDs and happily register them with the authorities? You expect the terrorists to register their pressure cookers? Maybe we should have background checks for buying those?
And then what? Background checks for buying nichrome wire, because it can be used as a bridgewire in a detonator? A database of Arduinos, since they can be used as timers for bombs?
Or how about a national database of people who guy gasoline, Drano, nails, ball-bearings, lithium-ion batteries, soldering irons, solder...
Better still, let's implement a Great Firewall of America to keep people from accessing subversive content like Inspire magazine, the Unabomber manifesto, the writings of Timothy McVeigh, the Koran, Cryptome, Wikileaks, Paladin Press, Justin Bieber songs, Anarchist's cookbook, Poor Man's James Bond or the Federalist Papers...