Ms sql database id
The best answers are voted up and rise to the top. Any database undocumented on the wiki would be fair game for deletion.
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. I have also seen requests to have data kept available for at least 7 years, and in one case I was told that the data in one system needed to be there forever, even though nobody was using it.
I would simply script out the reattach and instruct my team "if anyone ever asks where it is, run this script". If you have alternative methods that would help as well. Create a free Team Why Teams? Viewed 76k times. I've worked at a place that had a large number of orphaned and semi-orphaned databases.
Use DB_ID() to Return the ID of a Database in SQL Server
Asked 12 years, 4 months ago. If it were up to me, there would be a wiki page per server with contact names for each database and maybe a brief description of what the database is for. It only takes a minute to sign up. I agree with Nic with his advice. Ask Question. It seems to work but I want to know if this information is valid enough to drop databases. Before dropping any database, I would make sure you have at-least 2 or 3 readable backups test them in separate locations.
Is it? No need to keep a profiler trace running, no triggers or auditing required. Connect and share knowledge within a single location that is structured and easy to search. We're looking to decommission a SQL Server instance which has a couple databases still remaining on it.
I found that the detatch worked best for this. Doing this you can leave them in that state for a month or two to check and see if there is occasional usage. The best advice is this: whatever you do to turn off access, make sure you can turn it back on immediately. I found a forum thread which had a T-SQL query you could run to retrieve the last query date.
If you need to be sure, then you would have to go with Profiler Service side trace because some of the SQL queries won't be cached or for any reason the procedure cache could be purged. The next solution shows temporary total, clean and dirty pages in MB for particular databases under your instance found on internet and modified a bit :.
Categories
That gave us the best chance to put things back as quickly as possible. How can I tell if they are still being used by users or a web application? Modified 7 years, 6 months ago. The following query shows DBs which have had no usage since the last restart, without relying on query plans being held in the cache, as it shows user IO against the indexes and heaps. But is a year long enough?
Learn more about Teams. You never know when you need them. For financial data, you have some items run daily, weekly, monthly, quarterly, semi-annual, and annual. The trouble is this: how long do you wait before you are certain that nobody is going to access the data?
Use DB_ID() to Return the ID of a Database in SQL Server
Since the pointy haired boss only was willing to allow "full and complete" documentation, a wiki was expressly forbidden, and staff reductions lead to a dramatic decline in documentation that met the standard. You would have to be concerned with items that have been purged from the cache and that you have missed, or for databases that have infrequent usage.
Stack Overflow for Teams — Start collaborating and sharing organizational knowledge. Sign up to join this community. This is sort of along the lines of using virtual file stats, but the DMV used here excludes IO activity from backups. I would normally check the virtual file stats information also to see if there are any reads or writes happening at the OS file level.