Vous êtes sur la page 1sur 3

Tech2Tech_ask the experts

Steve wilmes Steve savoye


Founder and CEO Senior DBA for Blue Cross and

The ‘lazy’ DBA


of Cerulium Corp., Blue Shield of North Carolina,
Teradata Certified Master Teradata Certified Master

Automating processes, documenting procedures and implementing


standards are smart ideas for time-pressed administrators.

T
he best DBA is a “lazy”
DBA. However, this does
not imply laziness in a lit-
eral sense. On the contrary,
it means being extremely
efficient by using technol-
ogy to its fullest advantage. The more knowl-
edge administrators gain and use, the more
valuable they become.
In the end, that isn’t being lazy at all. It’s
just plain smart.
What does it take to be “lazy” and suc-
cessful at it? Let’s explore several strate-
gies to assist in rapid adoption of efficient
approaches to solving many data warehouse
deployments today.

Learn
First, working smarter means expanding one’s
knowledge. This can be obtained from several
avenues: Take classes, attend the PARTNERS
Conference along with regional Teradata
User Group meetings, and absolutely—get
certified. The certification process promotes
systematic learning on a broad spectrum of
topics. Becoming a Teradata Certified Master
provides access to an elite group to share
information, knowledge and experiences.

Automate
Automate everything possible by develop-
ing proficiency with SQL, macros, stored
procedures and dynamic SQL. Most repeti-
tive tasks can be automated to some degree,
if not completely. If you haven’t already, it
is time to stop manually running reports. >>
PAGE 1 l Teradata Magazine l Q2/2010 l ©2010 Teradata Corporation l AR-6151
Tech2Tech_ask the experts

There are many tools such as Teradata Query Test fixing existing defects. This implies the neces-
Scheduler, Teradata Manager, business intel- A proper performance benchmark should sity for diligent and thorough testing every
ligence (BI) tools and UNIX cron jobs that be one of the first automation exercises. time the system is upgraded. Lastly, every
can help set up and execute these processes. At a minimum, this process should be run event that causes problems or system restarts
Considerable time will be invested initially before and after every major and patch should be captured and added to the patch
to create automated processes, but this will upgrade so that there is a baseline to test plan or process.
quickly free up more time later on to enable compare relative performance. This process
efficient and immediate response when should also be implemented on a scheduled Establish conventions
requests come in. basis in order to measure performance and standards
impacts on data volumes, new features, It may not be obvious, but simple things like
Communicate and document functions, hardware, etc. establishing standards and conventions early
Documenting and publicizing a service Extensive regression testing needs to be on will save tremendous amounts of time and
catalog for DBA activities will benefit both automated as well, because it will be required headaches later. For example, implementing
the DBA team as well as client organizations. for every upgrade, patch application, third- naming conventions for databases, tables and
These documents provide a checklist to con- party software upgrade, etc. Minor patch columns will foster the automation of many
sider during project planning and help to set releases have been known to enforce features processes and procedures.
clear expectations. that were never enforced before in addition to Mind you, this is not the only result by
far. Everyone benefits by naming standards
and conventions. Imagine the nightmare
when some tables and columns use the
A word about fallback word PARENT and others use PRNT or
PAR. Just writing SQL to accommodate

F
allback provides the automatic recovery from certain failure scenarios. It manages such inconsistencies is difficult enough.
redundant copies of data objects within a single database instance, which minimizes
Standards should not only be set at the
the impact of major failures. When implemented, fallback requires twice the storage
capacity for those tables as shown in the figure. application level, but at the enterprise or
corporate level.
It’s also important to establish a gov-
ernance committee at the enterprise level
to institute and enforce modeling and
architecture standards. This committee
would be responsible for holding each
corporate project accountable to the estab-
lished standards. It should be composed
of architects, developers and DBAs, as well
as logical and physical data modelers. This
will greatly improve the ability of different
systems to talk with and play nice with one
Albeit rare, Teradata systems are susceptible to incidents that could bring down an AMP, another. A common vocabulary is priceless
cause data corruption or cause a failure in a particular RAID device. Here are just a few pos-
when it comes to porting data from source
sible failure scenarios where fallback would be a valuable alternative:
> Dual fault. When a disk device fails and the redundant device is running in degraded systems to the enterprise data warehouse.
mode waiting for the hot standby to sync up or the original to be replaced, the redun- Rules can be established and simple automa-
dant device also fails. tion used to enforce and report on them when:
> Unrecoverable bit error. During the reconstruction of a redundant array of indepen- >N  o database or object name can
dent disks pair, both disks could experience a fail-fast event and the I/O subsystem will
be greater than 25 characters (fewer
be rendered unavailable, causing the system to come to a halt.
> Pilot error. There are other rare occurrences, such as human error, cabling issues and is better).
disk controllers that write corrupted I/Os before being detected. >P  roject-related and production tables
These failures can, and do, occur. In addition, the cumulative probability of a failure event require names for indexes and establish
occurring in larger systems is significantly higher because of the sheer number of compo- a naming convention for them.
nents involved. Excessive down time will have obvious implications to the business.
The governance committee needs to
DBAs need to make sure that management is fully aware of what’s involved in terms of
technology. And in the event of a failure, they need to weigh the cost of implementing fall- develop and sign off on such rules in advance.
back versus restoring. Once this is done, the DBA can start automat-
—S.S. and S.W. ing processes. The following macro validates

PAGE 2 l Teradata Magazine l Q2/2010 l ©2010 Teradata Corporation l AR-6151


data definition language (DDL) against the about automating the rules that are put in > If the tables are large enough, are the
rules mentioned previously. place. Again, a little time invested up front to source files backed up instead?
develop validation scripts will have tremen- > If so, how long are files retained?
dous payoffs down the road. > Are we receiving incremental changes
REPLACE MACRO VALIDATE_STAN- or full data refreshes?
DARDS (DB_IN CHAR(30)) While many organizations deal with these
/* This reports on General Naming Stan-
dards for a given Database */
EXEC VALIDATE_STANDARDS(‘CSQL_ issues themselves, some rely on third-party
AS ( CLASS’); vendors that can address off-site records stor-
age management, retention and protection
/* Checks Database Names are 25 charac-
requirements.
ters or less. */
SELECT DBAs will need to create their own, more
d.DatabaseName (Title ‘Conflict//DB// comprehensive, knowledge book of data
Name’) (FORMAT ‘X(24)’),
CHAR(TRIM(d.DatabaseName)) (Title
‘Length of DBNM > 25’)
modeling, which should cover enterprise-
wide conventions and guidelines, as well
Through proper
FROM DBC.DataBases d
WHERE (CHAR(TRIM(d.DatabaseName))
as conceptual, logical and physical designs;
database standards for different database
automation and
> 25)
AND d.DatabaseName = :DB_IN
platforms; a dictionary of terms, including utilization of tools,
ORDER BY 1; abbreviations and reserved words; and so on.
The governance committee should be tasked
DBAs can make
/* Checks Object Names are 25 characters
or less. */
with making sure the rest of the enterprise
follows these standards and guidelines.
their lives much
SELECT
TableName (Title ‘Conflict//Object// Just remember that, while guidelines and more pleasant.
Name’) (FORMAT ‘X(24)’), rules are important, it’s not always a good
DatabaseName (Title ‘From Dbase/
idea to apply them globally. A friend once
User’) (FORMAT ‘X(24)’) ,
CASE TableKind said, “Any rule applied globally and absolutely Work smart
WHEN ‘T’ THEN ‘TABLE’
WHEN ‘V’ THEN ‘VIEW’
WHEN ‘M’ THEN ‘MACRO’
is absolutely applied wrong!”

Implement Backup
T he “lazy” DBA is really about being
anything but lazy. It is about being pro-
active, efficient, working smarter and gaining
WHEN ‘P’ THEN ‘PROCEDURE’
WHEN ‘X’ THEN ‘TRIGGER’ and recovery knowledge. Through proper automation and
WHEN ‘J’ THEN ‘INDEX’ Every database platform and application utilization of tools, DBAs can make their
ELSE TableKind
needs a well-documented and tested plan or lives much more pleasant. However, there
END (Title ‘Object Type’) (FORMAT
‘X(24)’), strategy for how databases will be backed up are some up-front costs, because time needs
CHAR(TRIM(TableName)) (Title ‘Length and restored in the case of failure. This process to be invested in education and automation,
of TableName > 25’)
should not only meet your business require- but the rewards are soon reaped. Eventually,
FROM DBC.Tables
WHERE (CHAR(TRIM(TableName)) > 25) ments, but also be efficient on both the backup there will be even more time to be proactive
AND DatabaseName = :DB_IN and recovery ends. Make sure consensus and for the business. T
AND TableKind NOT IN (‘J’) sign-off is obtained from management so if
ORDER BY 1;
/* Lists all Tables, Indices etc. with Null
something goes awry, all parties will be involved Steve Wilmes, founder and CEO of Cerulium
Names. */ in resolving the problem in a timely manner. Corp., has more than 20 years of experience
SELECT DatabaseName, TableName, Decisions will need to be discussed, agreed in the computer industry and is a Teradata
IndexName,
upon, and documented for such topics as Certified Master.
IndexType AS “Type”, UniqueFlag
AS “Unique” retention, purge criteria, off-site storage with Steve Savoye is a senior DBA for Blue Cross
FROM DBC.Indices full, cluster, partial or partition backups, and Blue Shield of North Carolina, an indepen-
WHERE DatabaseName = :DB_IN backup to disk or tape, and backup windows. dent licensee of the Blue Cross and Blue Shield
AND IndexName IS NULL
ORDER BY 1,2,3; );
The actual plan may be a hybrid of some or Association. A Teradata Certified Master, he
all of the above. has nearly 20 years of experience in IT.
Real-time processing and intraday loads This article is taken from Wilmes and
pose more challenges than, say, monthly Savoye’s book, “Teradata Toolbox: Providing
The execution macro demonstrates how batch-loaded systems. A few of the many Dynamic Solutions for Today’s Challenges,”
to automate the rules that are put in place. questions that need to be addressed are: published by Cerulium Corp.
The SQL from this example can be written > Are tables backed up weekly, daily, or
in many ways; this just illustrates how to go more often?

PAGE 3 l Teradata Magazine l Q2/2010 l ©2010 Teradata Corporation l AR-6151

Vous aimerez peut-être aussi