Archive for the ‘Database’ Category

Советы по обслуживанию серверов баз данных от Paul S. Randal

Several times a week I’m asked for advice on how to effectively maintain a production database. Sometimes the questions come from DBAs who are implementing new solutions and want help
fine-tuning maintenance practices to fit their new databases’ characteristics. More frequently, however, the questions come from people who are not professional DBAs but for one reason or another have been given ownership of and responsibility for a database. I like to call this role the «involuntary DBA.» The focus of this article is to provide a primer of database maintenance best-practices for all the involuntary DBAs out there.
As with the majority of tasks and procedures in the IT world, there isn’t an easy one-size-fits-all solution for effective database maintenance, but there are some key areas that nearly always need to be addressed. My top five areas of concern are (in no particular order of importance):
  • Data and log file management
  • Index fragmentation
  • Statistics
  • Corruption detection
  • Backups
An unmaintained (or poorly maintained) database can develop problems in one or more of these areas, which can eventually lead to poor application performance or even downtime and data loss.
In this article, I’ll explain why these issues matter and show you some simple ways to mitigate the problems. I will base my explanations on SQL Server­® 2005, but I’ll also highlight the major differences that you’ll find in SQL Server 2000 and the upcoming SQL Server 2008.

Тег «Далее»

Рубрики:Database, HOW-TO, MS SQL Метки: ,

Как быстро установить Postgres 8 на RHEL/Centos

I want to share quick and specific instructions for the installation of the Postgres 8 database on Red Hat Enterprise Linux 5 / Centos 5. I am using Yum for this installation. To make sure that you have everything needed do:

yum list | grep postgre

and verify that you see:

postgresql.i386, postgresql-server.i386 and postgres-libs.i386 (i386 if on non-64 bit version)

Centos installation comes with postgresql-lib installed. If it does not, do:

yum install postgresql-libs

Now, the general installation. As root install postgres core:

yum install postgresql

Install postgres server:

yum install postgresql-server

Now create postgres user:

adduser postgres

Create the datafile for the database:

mkdir -p /usr/local/pgsql/data

Change ownership of the data files to the postgres user:

chown postgres /usr/local/pgsql/data

Now assume the role of a postgres user:

su - postgress

Important note: Installation of the postgres executables on Centos 5 / RHEL 5 is /usr/bin not /usr/local as Postgres official documentation suggests.

Initialize the datafiles for the database:

/usr/bin/initdb -D /usr/local/pgsql/data

Start the database with initialized datafiles as the background process ( & ) and log all messages and errors ( 2&1 ) in the logfile:

/usr/bin/postgres -D /usr/local/pgsql/data > logfile 2>&1 &

Create the test database:

/usr/bin/createdb test

Log in to the test database:

/usr/bin/psql test

You should see «Welcome to Postgres 8…» intro message and prompt:


Рубрики:Database, HOW-TO, Unix and Linux Метки: ,