{"id":1191,"date":"2007-01-27T12:00:00","date_gmt":"2007-01-27T12:00:00","guid":{"rendered":"http:\/\/orcldoug.com\/blog\/?p=1191"},"modified":"2007-01-27T12:00:00","modified_gmt":"2007-01-27T12:00:00","slug":"dba-documentation-catalogue","status":"publish","type":"post","link":"http:\/\/orcldoug.com\/blog\/2007\/01\/27\/dba-documentation-catalogue\/","title":{"rendered":"DBA Documentation &#8211; Catalogue"},"content":{"rendered":"<p>Prompted by Linda&#8217;s comment on a previous blog, I thought it might be worth writing a couple of postings on DBA documentation.<\/p>\n<p>The first thing you need is a Database Catalogue of some kind.<\/p>\n<p><b>Benefits<\/b><br \/>1) Even an experienced DBA arriving on site won&#8217;t know what servers exist, how to login to them, what versions you are using and so on unless they have a crystal ball. Once they have those details, they can login to the various servers to familiarise themselves with your environment.<\/p>\n<p>2) When you start to support more than a couple of hundred databases, you&#8217;re not going to be able to memorise the details. At Sun, for example, our team supported over 1500 databases and I can&#8217;t be more specific about the number because it was changing all the time.<\/p>\n<p>3) Although I&#8217;m not a manager and don&#8217;t intend to address their requirements in detail here, they are usually keen on having a good overall impression of the team&#8217;s workload and the number of databases. What RDBMS they use and specific patch levels are also crucial. For example, when my manager finds that a version of Oracle is going to be desupported, he&#8217;ll want to know how many databases this will affect, and quickly. He pays the wages, remember &#128521;<\/p>\n<p>There are many benefits and you&#8217;ll come across new ones all the time once you&#8217;ve taken the time to create it.<\/p>\n<p><b>Challenges<\/b><br \/>The difficulty with maintaining an accurate Database Catalogue is that things will change. New servers are deployed, old ones decommissioned and databases are being created all the time for new development and testing requirements.<\/p>\n<p>At the site I&#8217;ve just left, we originally used a spreadsheet to maintain our database catalogue. It was simple and easy to update and yet, despite that, some DBAs were better at keeping it up to date than others. Someone might perform an upgrade and forget to update the spreadsheet. Databases that were completely absent from the spreadsheet were even more frustrating. That seems shabby to me, but I suppose when people are busy, the documentation tasks are the first to be abandoned &#128577;<\/p>\n<p>I think this is one area of documentation where automating the process is the best approach.<\/p>\n<p>However, if the process is automated, how can we decide whether a database is Production (or Live) and critical to the business? Perhaps there&#8217;s some way we can name our databases to indicate so, perhaps by using a P at the end? e.g.<\/p>\n<p>PSOFTP<br \/>PSOFTT<br \/>PSOFTD<\/p>\n<p>For Peoplesoft Production, Test and Development, in that order.<\/p>\n<p>This is a reasonable approach, but what you&#8217;ll find is that you support databases that are &#8216;kind of&#8217; Production. That&#8217;s just one of the trials of DBA life, I&#8217;m afraid. In fact, you have to create a new database to populate with data in advance of the go live date, so you&#8217;re bound to have a database with a P at the end which isn&#8217;t Production <i>yet<\/i>. You&#8217;ll also find that database naming standards have changed over time and you&#8217;ll probably have some old legacy databases that don&#8217;t follow the standard. That&#8217;s just a couple of the reasons that I don&#8217;t think a Database Catalogue can be generated entirely automatically. Well, it can, but you must be able to update it manually.<\/p>\n<p><b>Approach<\/b><br \/>Here&#8217;s one possible approach, based on the site I&#8217;ve just left. It&#8217;s not all my own work and I&#8217;m not going to say exactly what we did in any case, but it&#8217;ll hopefully give you some ideas for your own.<\/p>\n<p>First, in every database, create a table called MYSITE_CATALOGUE (or CATALOG, if that&#8217;s how you spell it). It might look something like this. <\/p>\n<p>DATABASE_NAME<br \/>RDBMS<br \/>VERSION<br \/>DESCRIPTION<br \/>HOST<\/p>\n<p>Then insert a row into that table once, paying particular attention to the DESCRIPTION column, because that gives you the opportunity to express useful information that only a human would understand. e.g.<\/p>\n<p>insert into mysite_catalogue values (NULL, NULL, NULL, &#8216;Peoplesoft Production &#8211; not live yet &#8211; contact Doug Burns&#8217;, NULL);<\/p>\n<p>So what&#8217;s with all the NULLs? Well, most of this information is going to be populated automatically. You&#8217;ll need a server that can access all of your other servers using ssh and, more specifically, scp. (I&#8217;m used to predominantly Unix environments, but those with more Windows knowledge can fill in the blanks.) You write a script and place it on that server where it can be transferred to each of the remote servers and, for each pmon process it finds running there, connect to that instance and retrieve information to populate the MYSITE_CATALOGUE table. For example,<\/p>\n<ul>\n<li>    Query V$VERSION for version information or, even better, run opatch against each ORACLE_HOME to get more detailed information.<\/li>\n<li>    Use uname to get the hostname.<\/li>\n<li>In the script, you will have seperate sections for different RDBMS, to populate that column with Oracle or MySQL or DB\/2.<\/li>\n<\/ul>\n<p>Having retrieved whatever information you choose, you UPDATE the row in the MYSITE_CATALOGUE table but (and this is the important bit) <b>don&#8217;t<\/b> update the description column. That way, you pick up any new information about the database (particularly version and patch level information) but retain the carefully crafted human-generated description. Having updated the row, you return the values to the central server, which moves on to the next server. At the end of the process, the central server will contain a flat file with information about all of the databases. That file can then be loaded into a table in a database, which can be queried using ODBC connection to populate a spreadsheet, or can just be opened in a spreadsheet program, if you prefer.<\/p>\n<p>What happens when the PSOFTP database finally moves to Production status? We issue one update statement to update the DESCRIPTION column to reflect that. If people forget to make the necessary updates, it will be very clear from any global view of the data and can be fixed. Ultimately, if you want some data that contains the human touch, then humans have to do <i>some<\/i> work &#128521;<\/p>\n<p>I hope it&#8217;s obvious that, although this isn&#8217;t a complete solution, it offers a base for you to develop your own preferred solution. Believe me, once you get started, you&#8217;ll find the benefits encourage you to implement minor improvements and your manager won&#8217;t mind the time spent, because they benefit too.<\/p>\n<p>Oh, one final thing. Oracle&#8217;s OEM Grid Control makes this job much more straightforward, so use that if it&#8217;s an option for you.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Prompted by Linda&#8217;s comment on a previous blog, I thought it might be worth writing a couple of postings on DBA documentation. The first thing you need is a Database Catalogue of some kind. Benefits1) Even an experienced DBA arriving on site won&#8217;t know what servers exist, how to login to them, what versions you&hellip; <a class=\"more-link\" href=\"http:\/\/orcldoug.com\/blog\/2007\/01\/27\/dba-documentation-catalogue\/\">Continue reading <span class=\"screen-reader-text\">DBA Documentation &#8211; Catalogue<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-1191","post","type-post","status-publish","format-standard","hentry","category-uncategorized","entry"],"jetpack_featured_media_url":"","jetpack-related-posts":[{"id":875,"url":"http:\/\/orcldoug.com\/blog\/2006\/01\/25\/application-security\/","url_meta":{"origin":1191,"position":0},"title":"Application Security","date":"January 25, 2006","format":false,"excerpt":"Some conversations are a recurring experience of DBA life.DBA [to software vendor] - 'So why does the application schema owner need to have the DBA role privilege?' Vendor - 'The installation procedure requires it' DBA - 'So can we revoke it after the installation?' Vendor - 'It hasn't been tested\u2026","rel":"","context":"With 4 comments","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1011,"url":"http:\/\/orcldoug.com\/blog\/2006\/07\/04\/whats-a-data-warehouse-dba\/","url_meta":{"origin":1191,"position":1},"title":"What&#8217;s a &#8216;Data Warehouse DBA&#8217;?","date":"July 4, 2006","format":false,"excerpt":"I've seen that question asked often in forums and mail groups. It's easy to understand why there's so much confusion because, for most DBAs, if you've seen one database, you've seen them all. Or rather, you haven't seen any of them. What I mean is that every database that lands\u2026","rel":"","context":"With 14 comments","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1042,"url":"http:\/\/orcldoug.com\/blog\/2006\/08\/04\/log-buffer-4\/","url_meta":{"origin":1191,"position":2},"title":"Log Buffer #4","date":"August 4, 2006","format":false,"excerpt":"Welcome to the fourth edition of Log Buffer.Maybe it's the summer holiday season and DBA-land is a little quiet, but navel-gazing seems popular this week. During a conference keynote speech by Ray Lane I attended earlier this year, he highlighted how much the software industry likes to talk about itself\u2026","rel":"","context":"With 7 comments","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":894,"url":"http:\/\/orcldoug.com\/blog\/2005\/12\/13\/in-praise-of-good-trainers\/","url_meta":{"origin":1191,"position":3},"title":"In Praise of Good Trainers","date":"December 13, 2005","format":false,"excerpt":"I've been thinking about training versus DBA work recently since it's been a while since I did any training work. I noticed an entry on Chris Foot's blog that mentions training which got me thinking even more.There was a time in the late 90s when recruitment agencies would look at\u2026","rel":"","context":"With 6 comments","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1028,"url":"http:\/\/orcldoug.com\/blog\/2006\/07\/20\/whats-a-development-dba\/","url_meta":{"origin":1191,"position":4},"title":"What&#8217;s a &#8216;Development DBA&#8217;?","date":"July 20, 2006","format":false,"excerpt":"I theory, this should be a much more straightforward, less contentious question than my previous - 'What's a Data Warehouse DBA?'A development DBA looks after the development (and test) databases. It truly is as simple as that, but depends on the nature of the project you're working on and the\u2026","rel":"","context":"With 2 comments","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1044,"url":"http:\/\/orcldoug.com\/blog\/2006\/08\/04\/tracing-session-activity-over-a-remote-database-link\/","url_meta":{"origin":1191,"position":5},"title":"Tracing session activity over a remote database link","date":"August 4, 2006","format":false,"excerpt":"Yesterday someone asked me how to trace a session that selects from a view in a remote database via a link. If they activated the trace on the local instance, they wouldn't see the bulk of the work which was happening on the remote instance - just a bunch of\u2026","rel":"","context":"With 2 comments","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"_links":{"self":[{"href":"http:\/\/orcldoug.com\/blog\/wp-json\/wp\/v2\/posts\/1191","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/orcldoug.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/orcldoug.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/orcldoug.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/orcldoug.com\/blog\/wp-json\/wp\/v2\/comments?post=1191"}],"version-history":[{"count":0,"href":"http:\/\/orcldoug.com\/blog\/wp-json\/wp\/v2\/posts\/1191\/revisions"}],"wp:attachment":[{"href":"http:\/\/orcldoug.com\/blog\/wp-json\/wp\/v2\/media?parent=1191"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/orcldoug.com\/blog\/wp-json\/wp\/v2\/categories?post=1191"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/orcldoug.com\/blog\/wp-json\/wp\/v2\/tags?post=1191"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}