Yes, they have a database. Everything up there had to be lifted. Repeat: Everything up there had to be lifted. It had to be stowed (stored) and recorded location and how it fit and its dimensions including weight. This is a considerable effort, and is part of the considerable effort preparing for each flight. They did put barcodes on most of the items specifically to aid in tracking for these purposes. In the Shuttle only days it was easier, because everything that went up came down in the same vehicle - kinda nice that way. Where with ISS, they have to track taking things up on one flight and bringing down in another, sometimes using a Soyuz instead of the Shuttle. Yes, it is a lot of overhead.
Discrete objects (like metal boxes, tools, etc) are easy. Trickier things are things like feces, urine bags, clothing, food containers, etc. These often use things like known sized containers for the return trip. For instance, dirty clothing would be folded or rolled and packed into bags and stuffed full. The full bag can be estimated to weigh (or mass) a certain amount based on measurements on earth of clothing and compaction. I think they have some assumed value which is an average. (Not entirely certain on that part.) Garbage like used food containers are, I believe, put into a trash compactor and mushed flat into known sized containers. Again, an average value is probably used.
Please note that none of this is free-floating in the payload bay. All of it is strapped down into storage lockers, either in the Shuttle Middeck lockers or in the Leonardo Logistics Module (LM) racks or in bags in the airlock of the Shuttle. There is a whole section at NASA that is devoted to collecting mass and stowage information and tracking this stuff.
I’m not aware of any calibrated thruster burns or calculations to determine CM. My impression is that they prerun calculations over a range of possible configurations to establish a comfort zone of behavior. Realize they send up the LM full of racks and are bringing it home full of racks, so the change in mass properties may not be that significant. Also, they plan pretty well what they intend to bring down, so they make some good guesses what is being moved when. And then they rely on the the skill of the pilot to compensate for differences in wind, variations in the CM (as long as it is in a certain band, or rather not past a certain point, it is good), etc. I suppose a calibrated thruster burn could be used in combination with reading the effect on the gyros and use that to calculate center of mass, but I don’t think they do it and it might not have the sensitivity level needed. I think they just rely on a ton of preflight calculations and a wide comfort zone in loading conditions.
And no, they don’t really have any way of weighing things. Some methods could be devised, but so far they haven’t been needed. They rely either on preflight measurements (for static objects) or estimates based on density and dimensions (# full urine bags, clothing storage bags, etc).