Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Other SQL Server Topics (2005)
 what would you do first?

Author  Topic 

jar21

51 Posts

Posted - 2008-09-23 : 10:02:17
This is really just a general inquiry

If you are hired as a DBA to a company that has never had a DBA before nor had any work on their databases yet what are the first steps you would take considering best practices and improving performance (assuming they had automatic full backups and transaction logs configured already)



Enjoy Life This Is Not A Rehearsal.

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2008-09-23 : 13:20:59
verify them if they can restore ok.

_______________________________________________
Causing trouble since 1980
Blog: http://weblogs.sqlteam.com/mladenp
Speed up SSMS development: www.ssmstoolspack.com <- version 1.0 out!
Go to Top of Page

blindman
Master Smack Fu Yak Hacker

2365 Posts

Posted - 2008-09-23 : 14:14:02
I'd look for, and remove, junk tables that had accumulated over the years and that were not part of the application.
I'd set up proper production/QA/text/development environments, with policies for how rollouts would be handled.

Boycotted Beijing Olympics 2008
Go to Top of Page

homebrew
Posting Yak Master

114 Posts

Posted - 2008-09-30 : 16:15:52
Run something like this to confrm that all DBs are getting backed up:

SELECT B.name as Database_Name, ISNULL(STR(ABS(DATEDIFF(day, GetDate(),MAX(backup_finish_date)))), 'NEVER') as DaysSinceLastBackup,
ISNULL(Convert(char(19), MAX(backup_finish_date), 100), 'NEVER') as LastBackupDate,
case
when type='D' then '** FULL **'
when type='I' then 'DIFFERENTIAL'
when type='L' then 'LOG'
end as Backup_Type
FROM master.dbo.sysdatabases B LEFT OUTER JOIN msdb.dbo.backupset A ON A.database_name = B.name --AND A.type = 'D'
GROUP BY B.name , a.type
ORDER BY B.name , LastBackupDate desc,a.type

Then start looking at security. is 'sa' password complex ?, who knows it ?, what other logins have sysadmin rights ? ....
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2008-09-30 : 16:18:32
Second, lock down the databases as much as possible, minimize the surface.
Change password for SA account.



E 12°55'05.63"
N 56°04'39.26"
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2008-09-30 : 16:28:27

  • Remove all maintenance plans, replace with custom procedures

  • Get all SQL Servers to the latest build for the SQL Server version

  • Work with the server team to get the OS patched

  • Review who has server level permissions, remove people from local admin on the database servers

  • Review who has sysadmin, fix if necessary

  • Review who has db_owner, fix if possible

  • Educate developers on best practices

  • Send out DBA naming and coding standards

  • Get familiar with application performance by running SQL Profiler/SQL Trace and Performance Monitor

  • Check for missing indexes on foreign keys and by viewing the Performance Dashboard reports

  • Add SQL Jobs as necessary




Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2008-09-30 : 17:26:26
Tara, I think this will be an excellent material for an in-depth article or blog post!



E 12°55'05.63"
N 56°04'39.26"
Go to Top of Page

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2008-10-01 : 01:32:22
now she just has to make time to write it

_______________________________________________
Causing trouble since 1980
Blog: http://weblogs.sqlteam.com/mladenp
Speed up SSMS development: www.ssmstoolspack.com <- version 1.0 out!
Go to Top of Page

blindman
Master Smack Fu Yak Hacker

2365 Posts

Posted - 2008-10-01 : 01:45:30
quote:
Originally posted by tkizer

Remove all maintenance plans, replace with custom procedures

Oh, come on Tara. There's nothing wrong with using the maintenance plans. You should definitely verify that existing backup and recovery strategies are working as intended, but if they are then there is no reason to make replacing them at the top of your to-do list.

Boycotted Beijing Olympics 2008
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2008-10-01 : 12:59:37
Perhaps it's not at the top of your list, but it's definitely at the top of mine especially for things like defragmenting indexes.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

sodeep
Master Smack Fu Yak Hacker

7174 Posts

Posted - 2008-10-01 : 13:49:41
I completely agree with Tara regarding maintenance plan for Defrag and Reorg index? I am using maintenance plan for Backups and integrity checks? but with defrag indexes and online stuff, it sucks.
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2008-10-01 : 13:57:35
The maintenance plan does not make intelligent decisions for defragmenting (rebuild/reorganize) indexes like a custom script can. Even the script in Books Online is bad.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

blindman
Master Smack Fu Yak Hacker

2365 Posts

Posted - 2008-10-01 : 14:03:54
I agree. I have my own script for reindexing as well. But applying such a script does require scrapping entire existing maintenance plans, and fixing something that ain't broke would not be at the top of my list.
I would take issue with your statement, because it implies that any use of maintenance plans is bad practice. I disagree.

Boycotted Beijing Olympics 2008
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2008-10-01 : 14:29:41
We scrap all maintenance plans due to the large number of databases, servers, and instances that we have. Maintenance plans don't make intelligent decisions when performing backups, but it's not as bad as the defragment issue. An example of an intelligent decision in a custom backup script is when a database is newly created, doesn't have a full backup yet, the transaction log backup runs for the instance, and does a one-off full backup to prevent the job failure. The maintenance plan job will error in this scenario. It becomes an issue when you've got a few hundred SQL Server instances to support.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

blindman
Master Smack Fu Yak Hacker

2365 Posts

Posted - 2008-10-01 : 16:30:16
That is NOT the scenario outlined by the original poster.

Boycotted Beijing Olympics 2008
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2008-10-01 : 16:33:04
Yes it is. It asked what we would do. I've posted what I would do according to what my best practices are.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

blindman
Master Smack Fu Yak Hacker

2365 Posts

Posted - 2008-10-02 : 01:09:04
I highly doubt that poster was imagining a scenario where he walks into a company with
quote:
Originally posted by tkizer
a few hundred SQL Server instances to support.

, but which
quote:
Originally posted by rabino67
has never had a DBA before nor had any work on their databases yet
That would certainly be a messed up company.

But he did say to assume
quote:
Originally posted by rabino67
they had automatic full backups and transaction logs configured already
, and I contend you would be doing your new employer a disservice if your first action was to dismantle and rewrite the one aspect of the system that was working. Surely, there would be higher priorities, despite your distaste for maintenance plans.

Boycotted Beijing Olympics 2008
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2008-10-02 : 12:47:21
That would be your opinion. What I would do is obviously different than what you would do.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

jar21

51 Posts

Posted - 2008-10-07 : 12:02:51
thanks for all of the input, and I was looking for general practices... currently that is sortof whats happening at my current job, except there is no DBA... I'm the SA and have had to dive into learning as much about DBA as possible.... and I must say I'm beginning to like it :-)
Go to Top of Page
   

- Advertisement -