Вы находитесь на странице: 1из 13

Module 1: Database Administration and Building the Database Environment

After completing this module, you should be able to: Describe the purpose and function of an administrative user. Differentiate between creators, owners (parents), and children. Describe how to transfer ownership of databases and users.

Database Administration
Some of the functions of a Teradata Database Administrator (DBA) include:

User and Database Management Space Allocation and Usage Access of Objects (e.g., tables, views, etc.) Access Control and Security System Maintenance System Performance Resource Monitoring Data Archives, Restores, and Recovery

Examples of tools available to the Teradata DBA include:


Use of Data Dictionary/Directory tables and views to manage the system Teradata Administrator Windows administration utility Teradata Manager suite of Windows tools Teradata Analyst Toolset Index Wizard, Statistics Wizard, and Teradata SET Teradata Dynamic Query Manager (DQM) Database Console Window and System utilities e.g., dbscontrol, ferret, rebuild, etc. User scripts and 3rd party applications

To do these functions, it is important to understand key concepts such as

Teradata hierarchy and the concepts of ownership (parents and children)

Initial Teradata Database

DBC

All (reserved name) Sys_Calendar


15 MB

Default (reserved name) PUBLIC TDPUSER SystemFE


60 MB

SysAdmin
40 MB

Crashdumps

Current Permanent Space Maximum Permanent Space

1 GB

NO BOX = No Permanent Space

Administrative User
DBC

All Sys_Calendar SysAdmin Default PUBLIC TDPUSER

SystemFE
Crashdumps

SYSDBA
Recommendation: Create a database administrator which owns most of the PERM space.

Current Permanent Space Maximum Permanent Space

Owners, Parents, and Children


DBC

SYSDBA

Human_Resources

Accounting

Personnel

Benefits

Parent or owner Any object above you in the hierarchy Child Any object below you in the hierarchy

PR01

PR02

PR03

Users may own databases and databases may own users.

Creating New Users and Databases


DBC

SYSDBA

GRANT DATABASE ON Human_Resources TO Accounting ;

Human_Resources

Accounting

CREATE USER Payroll FROM Human_Resources AS ;

Personnel

Benefits

Payroll The creator is the user who submits the CREATE statement. Every object has one and only one creator. A user (if authorized) may create databases or other users from someone elses space.

PR01 PR02 PR03

Transfer of Ownership
DBC

SYSDBA

GIVE Payroll TO Accounting;

Human_Resources

Accounting

Personnel

Benefits

Payroll

The GIVE statement is valid to only


transfer databases and users.

PR01

PR02

PR03

PY01

PY02

To give an object, you must have: DROP DATABASE privilege on


the object to transfer.

CREATE DATABASE privilege


on the receiving object.

DELETE / DROP Statements


SYSDBA Human Resources Personnel
Tables Views Macros

DELETE USER Personnel;


SYSDBA

DROP USER Personnel;


SYSDBA

Human Resources
Personnel

Human Resources

Teradata Administrator New System


Teradata Administrator

GUI interface
to Teradata hierarchy and objects.

This example
shows the default users and databases in a newly initialized system.

Which database has the majority of the Perm space? Answer: DBC

Teradata Administrator Hierarchy


Teradata Administrator

This example shows


the hierarchy of a Teradata system and the objects in one of the databases.

This utility also


provides drag and drop capabilities.

The hierarchy of the Teradata database is shown in the left pane. Examples of Teradata Administrator displays and capabilities will be shown in various modules throughout this course.

Who is the immediate parent of Teradata_Factory? Answer: Sysdba

Summary

Initially, system user DBC owns all space in the Teradata Database except that owned by system users and databases SYS_CALENDAR, SYSADMIN, SYSTEMFE, and CRASHDUMPS. The database administrator should create a special administrative user containing most of the space available which will become the owner of all administrator-defined application databases and users. Everyone higher in the hierarchy is a parent or owner. Everyone lower in the hierarchy is a child. Every object has one and only one creator. The creator is the user who executes the CREATE statement. The GIVE statement enables you to transfer a database or user. The following privileges are necessary:

DROP DATABASE on the given object. CREATE DATABASE on the receiving object.

You cannot DROP databases or users that own objects (tables, views, macros, journals or children databases/users). the Teradata RDBMS Data Dictionary.

Teradata Administrator provides an easy-to-use Windows-based graphical interface to

Review Questions
1. True or False. You should use system user DBC to create application users and databases.

2. True or False.

An owner or parent is any object (user or database) above the current/selected object in the hierarchy.

3. True or False.

The GIVE statement transfers a database or user space to a recipient you specify. It does not automatically transfer all child databases, users, tables, views and macros.

Review Questions
1. True or False. You should use system user DBC to create application users and databases. False. You should create and logon as an administrative user to perform these tasks.

2. True or False.

An owner or parent is any object (user or database) above the current/selected object in the hierarchy.

3. True or False.

The GIVE statement transfers a database or user space to a recipient you specify. It does not automatically transfer all child databases, users, tables, views and macros.

False. The GIVE statement automatically transfers all child databases, users, tables, view and macros the transferred object owns.

Вам также может понравиться