Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

I have a few dozen tables, that have data in them, both for the core set of data, and then the company specific data.

I can never delete the core set of data, that is global for all companies.

But i want to be able to help identify orphan data.

Data that is inactive, but hasn't been deleted.

I do not need a query, I can figure that out myself.

Just some ideas on best practices, to help identify then get rid of orphan data, which hopefully will trim the database size down.

Thanks

share|improve this question
2  
hmm... if you already "know" wich data is irrelevant just backup and start deleting, can't think of anything else. If someone has a better way, please, speak up, I would love to know. –  eiefai Mar 9 '11 at 21:10
add comment

2 Answers

up vote 2 down vote accepted

I would suggest duplicating the table structure in a different schema (backup) and move the data from the one table to the other. That way it can be managed effectively. But if you know what's orphaned, then why would you keep it? What purpose will it serve?

share|improve this answer
add comment

You can DELETE FROM table; safely if you foreign keys prevent deletion of still referenced rows.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.