广告
广告
CHAPTER 1
Setting Up Your Administrative
Environment: All DBAs
This chapter describes user DBC and provides a brief overview of space management. The chapter also describes these initial administrative tasks:
•
Logging in to the operating system
•
Setting up the database administrator user
•
Creating a spool reserve database
•
Setting up Teradata Administrator
•
Establishing Viewpoint alerts
•
Changing the PasswordExpire parameter
Logging in to the Operating System
Teradata Database administrators who need access to system nodes should log on to the operating system as a user who is a member of the tdtrusted group or as the root user.
About Root Logons
Root access is required to start Teradata Database and install new versions. Users can perform all other Teradata administrative functions, including switching to a new Teradata version once it is installed, as a member of the tdtrusted group.
About Tdtrusted Logons
The tdtrusted group is created automatically at installation of Teradata Database. Tdtrusted access allows nearly all command-line monitoring and administration of Teradata. The advantages of using tdtrusted include greater security because root access is limited and greater accountability because administrative user actions are recorded under each user account rather than as the root user.
Non-root accounts that administer Teradata must be members of the tdtrusted group on all
Teradata Database nodes. Each customer site should determine how to implement this within site-specific account management policies. Tdtrusted logons rely on standard UNIX account management facilities.
Database Administration 27
Chapter 1: Setting Up Your Administrative Environment: All DBAs
About User DBC
For More Information
For more information about the users and groups created automatically during Teradata installation, see “Working with OS-Level Security Options” in the chapter “Setting Up the
Administrative Infrastructure” in Security Administration.
About User DBC
When you first install Teradata Database, it has only one user. This user is called DBC, and from it all other future databases and users in the system are created.
User DBC also initially owns all the space in the entire system. As you create new databases and users, any permanent space you grant them is subtracted from available permanent space in user DBC. Because all space ultimately comes from user DBC, user DBC owns all database objects.
User DBC contains data like a database, but unlike a database it has a password. The usable
(PERM) disk space in DBC initially reflects the entire system hardware capacity, minus space for the following system users, databases, and objects:
•
All the space available for your databases, users, journals, data tables, indexes, stored procedures, functions, and temporary tables. DBC owns all unallocated space.
•
Crashdumps user
•
SysAdmin user
•
Sys_Calendar database
•
TD_SYSFNLIB database
•
SQLJ, SYSLIB, and SYSUDTLIB databases for external routines and user-defined types.
For details, see SQL External Routine Programming.
•
SYSSPATIAL database for geospatial data types. For details, see SQL Geospatial Types.
•
DBCExtension database for Global and Persistent (GLOP) sets. For details, see
“DBCExtension Tables” in Data Dictionary.
•
SystemFE user for field engineers
•
TDPUSER user
•
The system Transient Journal (TJ) which stores the before-change image of every data row involved in a transaction, the row ID of every inserted row, and other control records used by the system to automatically recover data from transaction aborts or to complete transactions.
•
The system catalog tables of the Data Dictionary and the suite of user-accessible views defined on those tables (for details, see Data Dictionary).
This also includes a suite of special system query logging tables used to store query logging rules and data when you enable the DBQL feature. See
Behavior with Database Query Logging: Operational DBAs.”
28 Database Administration
Chapter 1: Setting Up Your Administrative Environment: All DBAs
Setting Up Teradata Administrator
Note: The setting of DefaultCharacterSet in the DBS Control utility determines the default character set for user DBC. For information on changing the character set for user DBC, see
“Default Server Character Set” on page 420 .
Notice:
Never alter the privileges for user DBC. Changing DBC privileges may cause installation, upgrade, maintenance, or archive procedures to end abnormally and consequently require
Teradata Customer Support to correct the problem.
Notice:
If you use MODIFY USER to change the default character set for user DBC, user-defined functions may no longer work for this user without being recompiled, you must rerun the
DIPUDT and DIPDEM scripts, and site-defined functions that use SQL_TEXT must be recompiled.
Setting Up Teradata Administrator
Set Up the Teradata Administrator GUI
1
2
From the principal administrative client, access Teradata Administrator, click
Start>Programs>Teradata Administrator.
The Please Select a Data Source dialog box appears. Do the following:
3
4 a
In the left field, highlight the alias name for your system.
b a
In the Root Database field enter DBC.
c
In What to Load, select All Databases and Users and click OK.
In the Teradata Database Connect dialog box do the following:
In the Username field enter DBC.
b
In the Password field, enter the user DBC password provided by your Teradata
Customer Service representative.
c
Do not change other fields. Click OK.
Set Preview Mode as the default so that SQL statements generated from using the GUI fields and controls will appear in the Query Window before the statement is executed.
a
From the Teradata Administrator menu, click Tools>Options.
b
Click the Confirmation tab.
c
Check the Preview SQL before submitting check box and click OK.
Note: Setting Preview Mode as the default is optional, but it will help new Teradata
Database users to become familiar with Teradata Database SQL statements. You can send generated SQL without previewing it at any time by unchecking the Preview SQL before
submitting check box.
Database Administration 29
Chapter 1: Setting Up Your Administrative Environment: All DBAs
Setting Up the Database Administrator User
Set Up the Data Directory for Teradata Administrator
The Teradata Administrator data directory stores generated SQL for later reference and use.
The default location is:
Documents and Settings\Network_UserId\My Documents\Teradata\Teradata Manager\Data.
If you can use the default location, skip this procedure.
If you want to change the location, use the following procedure to relocate the data directory.
1
2
3
From the Teradata Administrator main window, click Tools>Options.
Click the Directory tab.
Note the following directory display fields:
•
Old Path - The current path to the data directory
•
New Path - The new path to the data directory
Navigate to the desired directory.
The directory path changes automatically in the New Path box.
4
Click OK to save your path changes and exit the dialog box.
Setting Up the Database Administrator User
Create the principal database administrator, user DBADMIN (or the name your site uses), and grant space and privileges to the user before proceeding with database implementation. User
DBADMIN can then create databases, tables, users, and other objects in the space it owns.
Note: For larger systems, you may find it useful to create additional administrative users to share database administration duties. See the sections beginning with “Administrative Users” in Chapter 3 of Security Administration.
Creating the DBADM Profile
1
2
Profiles determine certain system resources available to member users, and can also set password control parameters.
From an administrative client, log on to Teradata Administrator as user DBC.
Create the profile for the database administrator, user DBADMIN:
a
From the menu, click Tools>Create>Profile.
b
Specify values for the following fields and controls:
Note: Do not enter values at this time for fields not listed.
30 Database Administration
Database Administration
Chapter 1: Setting Up Your Administrative Environment: All DBAs
Setting Up the Database Administrator User
Field Description
Profile Name Required. The name of the database administrator profile.
Administrative procedures in this publication use the name DBADM for the administrator profile.
Note: User DBADMIN will be the only member of this profile. Because of space and ownership concerns, you must create a separate profile for other administrative users.
On the General tab...
Account Optional. An account string defines the following characteristics for profile member sessions in the database:
•
Session priority
•
Account ID (to assign charges for system time and resources)
•
Date stamp
•
Time stamp
Recommendation: Define at least one account string per profile. If necessary, you can add an account string later using a MODIFY PROFILE statement.
For more about accounts, see Chapter 1: “Setting Up Your Administrative
Password
Spool Space
Required. The temporary password for DBADMIN.
Recommendation: Create a simple temporary password. Each user is prompted to change the temporary password to a permanent, private password upon first logon to the database.
Optional. The spool space specification is only a limit to the amount of space available for intermediate query results or formatted answer sets to queries and volatile tables. The system borrows spool space for a user from unused permanent space anywhere in the system.
Recommendation: Set this value equal to the amount of space in the
Spool_Reserve database.
Temporary
Space
Not applicable. Required only when using global temporary tables and other advanced features.
Recommendation: Temporary space specification is not normally needed.
Specification of temporary space requires that you develop a strategy for use of the advanced features that need temporary space. If necessary, you can add a temporary space specification later with a MODIFY USER statement.
Comment Optional. Use this space to describe the profile or note contingencies.
On the Password tab...
Expire Required. The number in days until a password expires. Set this value to a positive, non-zero number to cause passwords to expire.
Recommendation: 90 days is a common password expiration interval.
31
Chapter 1: Setting Up Your Administrative Environment: All DBAs
Setting Up the Database Administrator User
Field
Other password controls
Description
Optional.
Recommendation: Set other password controls globally by updating
DBC.SysSecDefaults if required by your site security policy.
Note: Be sure to review the default password control values to determine whether they conform to your site security requirements.
For information on the default password control values and how to change them, see Chapter 6: “Managing Database Passwords,” in Security
Administration.
c d
Do not use the Users in Profile dialog box. You can specify profile membership in
Click the Create button to create the profile. The Query Window displays a generated
CREATE PROFILE statement similar to the following:
CREATE PROFILE "dbadm" AS
SPOOL=spool_space
TEMPORARY=NULL
ACCOUNT=('$H-DBC-MANAGER',' account__str2',' account_str3')
DEFAULT DATABASE="All"
PASSWORD = password
(EXPIRE=90,MINCHAR=NULL,MAXCHAR=NULL,MAXLOGONATTEMPTS=NULL,LOCKEDU
SEREXPIRE=NULL,REUSE=NULL,DIGITS=NULL,RESTRICTWORDS=NULL,SPECCHAR=
NULL)
f e
In the Query Window, click the Run Query button . A Query Complete message appears in the bottom left corner of the main window when the query executes.
Close the Query Window and the Create Profile dialog box.
Reference Information
For step...
Information on...
2 setting up user accounts the default password control values and how to change them
Is available in...
“Creating User Accounts” on page 108 .
Security Administration
Creating User DBADMIN
1
2
From an administrative client, log on to Teradata Administrator as user DBC.
Create the database administrator as follows:
a
From the menu, click Tools>Create>User.
b
Specify values for the following fields and controls:
Note: Do not enter values at this time for fields not listed.
32 Database Administration
Database Administration
Chapter 1: Setting Up Your Administrative Environment: All DBAs
Setting Up the Database Administrator User
Field Description
User Name
Owner
Password
Permanent
Space
Required. The name of the database administrator user.
All administrative procedures in this publication use the name DBADMIN for the principal administrator.
The owner of user DBADMIN, which is DBC.
Required. The temporary password for DBADMIN.
Recommendation: Any simple password will work that follows the default system password controls. Each user is prompted to change the temporary password to a permanent, private password at first logon.
Note: Be sure to review the default password control values to determine whether they conform to your site security requirements.
For information on password control options, see Security Administration.
Required. The space in bytes that contains all objects that user DBADMIN creates or owns.
Perm space can also be specified with a constant expression resulting in a numeric value in bytes. This allows you to specify perm space per AMP, which is useful when porting applications from a smaller test system to a production
system. See the example in step c on page 33 .
Because user DBADMIN will create and own nearly all Teradata databases and tables, assign it the majority of space on the system.
Recommendation: 60-65% of available system (DBC) space.
Spool Space Optional. The spool space specification is only a limit to the amount of space available for intermediate query results or formatted answer sets to queries and volatile tables. The system borrows spool space for a user from unused permanent space anywhere in the system.
Spool space can also be specified with a constant expression resulting in a numeric value in bytes. This allows you to specify spool space per AMP, which is useful when porting applications from a smaller test system to a production
system. See the example in step c on page 33 .
Recommendation: Spool space specification is not normally needed. Spool is already allocated in the DBADM profile.
Default
Database
Profile
Optional. The user or database containing the space in which the Teradata
Database stores or searches for new or target objects unless a different database is specified in the transaction SQL.
Recommendation: Specify DBADMIN.
Required. The name of the profile in which the user has membership. A user can be a member of only one profile.
Recommendation: Enter DBADM, the profile created for user DBADMIN in
33
Chapter 1: Setting Up Your Administrative Environment: All DBAs
Setting Up the Database Administrator User
Field
FALLBACK
Description
Optional. Specification of FALLBACK automatically creates a duplicate of each table stored in the user space, in addition to the duplicates already created by disk mirroring, to which the system can revert in the event of a failure.
Recommendation: Uncheck Fallback. FALLBACK is only recommended for individual mission-critical tables or tables so large that their size prevents timely backup to tape or external disk.
c
Note: You can adjust the space assignments if required, using the Modify User GUI.
Click Create.
The Query Window pops up and displays the generated CREATE USER statement, for example:
CREATE USER "DBADMIN" FROM "DBC"
AS PERM = 2e5 * (hashamp() + 1);
PASSWORD = "temp"
SPOOL = spool_space
PROFILE = DBADM
STARTUP = ''
NO FALLBACK
NO BEFORE JOURNAL
NO AFTER JOURNAL
The hashamp() function is a database built-in function that returns the highest AMP number in the system configuration. Because AMP numbers start from zero,
(hashamp() + 1) returns the total number of AMPs in the system. The example expression: 2e5 * (hashamp() + 1) means allocate 200,000 bytes on each AMP for perm or spool space for the user or database.
Note: Some options appear in the SQL that are not specified in the procedure. These are system defaults and should remain as they are. For example Before Journal and
After Journal are checked No by default.
d
From the Query window, click the Run Query button .
e
Close the Query window and the Create User dialog box.
3
Keep the Teradata Administrator utility open for use in the
“Granting Database Privileges to User DBADMIN” on page 35
, or close the utility by clicking File>Exit.
Note: After you create the administrative user DBADMIN, do not log on as user DBC to perform subsequent administrative activities except during activities that only user DBC can perform.
34 Database Administration
Chapter 1: Setting Up Your Administrative Environment: All DBAs
Setting Up the Database Administrator User
Reference Information
Reference topics are arranged according to the first step in which the topic appears.
For step...
Information on...
1 logon to Teradata Administrator
2 user types and characteristics syntax and options for the
CREATE USER statement guidelines for managing of space
Is available in...
Teradata Administrator User Guide
Chapter 5: “Creating Users and Granting
Privileges,” in Security Administration
SQL Data Definition Language Syntax and
Examples
Chapter 9: “Managing Space: Operational
Chapter 6: “Managing Database Passwords,” in
Security Administration
the default password control values and how to change them
Granting Database Privileges to User DBADMIN
1
2
Log on to Teradata Administrator as user DBC.
Grant object access privileges to system tables and other objects owned by user DBC.
a
From the main window, click Tools>Grant/Revoke>Object Rights.
b
Specify values for the following fields:
Field
Database Name
Object Type
To/From User
Normal
Grant
Description
The name of the user or database that owns the objects on which the privileges are being granted.
Select DBC from the Database Name drop down list.
The object on which the privileges are given.
Select Database from the Object Type drop down list.
The name of the user that receives the privileges.
Select DBADMIN from the To/From User drop down list.
Specifies the privileges granted to the user. Check the following boxes:
•
Execute
•
Select
Specifies that the user is granted the WITH GRANT OPTION privilege so the user can grant the privilege to other users.
Check the Grant box.
c
Click the Grant button.
The Query window appears and displays the generated GRANT statement:
GRANT EXECUTE, SELECT ON "DBC" TO "DBADMIN" WITH GRANT OPTION.
Database Administration 35
Chapter 1: Setting Up Your Administrative Environment: All DBAs
Setting Up the Database Administrator User
3 d
From the Query window, click the Run Query button
Specify values for the following fields:
.
e a
Close the Query window.
Grant object-level database privileges to the database administrator on all objects subsequently created in DBADMIN space.
From the main window, click Tools>Grant/Revoke>Object Rights.
b
Field
Database Name
Object Type
To/From User
All
Grant
Description
The name of the user or database that owns the objects on which the privileges are being granted.
Select DBADMIN from the Database Name drop down list.
The object on which the privileges are given. Includes all databases and all objects created in the database(s).
Select Database from the Object Type drop down list.
The name of the user that receives the privileges.
Select DBADMIN from the To/From User drop down list.
Specifies all rights for all objects created in DBADMIN space.
Check the All box.
Specifies that the user is granted the WITH GRANT OPTION privilege, which means that the user can grant all included privileges to other users.
Check the Grant box.
c
Click the Grant button.
The Query window appears and displays the generated GRANT statement.
GRANT EXECUTE, SELECT, INSERT, UPDATE, DELETE, STATISTICS, DUMP,
RESTORE, CHECKPOINT, SHOW, EXECUTE PROCEDURE, ALTER PROCEDURE,
EXECUTE FUNCTION, ALTER FUNCTION, ALTER EXTERNAL PROCEDURE, CREATE
OWNER PROCEDURE, CREATE TABLE, CREATE VIEW, CREATE MACRO, CREATE
DATABASE, CREATE USER, CREATE TRIGGER, CREATE PROCEDURE, CREATE
FUNCTION, CREATE EXTERNAL PROCEDURE, CREATE AUTHORIZATION, DROP
TABLE, DROP VIEW, DROP MACRO, DROP DATABASE, DROP USER, DROP
TRIGGER, DROP PROCEDURE, DROP FUNCTION, DROP AUTHORIZATION ON
"DBADMIN" TO "DBADMIN" WITH GRANT OPTION;
4 d a
From the Query window, click the Run Query button .
e
Close the Query window.
Grant object-level privileges on DBC tables and views to DBADMIN.
From the main window, click Tools>Grant/Revoke>Object Rights.
36 Database Administration
Database Administration
Chapter 1: Setting Up Your Administrative Environment: All DBAs
Setting Up the Database Administrator User
b
Specify values for the following fields:
Field
Database Name
Object Type
To/From User
Access
Grant
Description
The name of the user or database that owns the objects on which the privileges are being granted.
Select DBC from the Database Name drop down list.
The object on which the privileges are given. Includes all databases and all objects created in the database(s).
Select Database from the Object Type drop down list.
The name of the user that receives the privileges.
Select DBADMIN from the To/From User drop down list.
Specifies privileges for all DBC tables and views.
Check the Access box.
Specifies that the user is granted the WITH GRANT OPTION privilege, which means that the user can grant all included privileges to other users.
Check the Grant box.
c
Click the Grant button.
The GRANT statement generates and automatically submits the following SQL statements without previewing them.
GRANT EXECUTE, SELECT, STATISTICS, SHOW ON "DBC" TO "DBADMIN" WITH
GRANT OPTION
5 d b
From the Query window, click the Run Query button .
e
Close the Query window.
Grant additional system-level privileges not included with the object-level privileges granted in
a
Deselect the Preview Mode button at the top of the main screen. The subprocedure that follows generates a compound SQL statement that cannot be submitted from
Preview Mode.
From the main window, click Tools>Grant/Revoke>System Rights.
c
Specify values for the following fields:
Field
To/From User
Description
The name of the user that receives the privileges.
Select DBADMIN from the To/From User drop down list.
37
Chapter 1: Setting Up Your Administrative Environment: All DBAs
Setting Up the Database Administrator User
38
Field
All
Grant
Description
Specifies all rights for all objects created in DBADMIN space.
Check the ALL box.
Specifies that the user is granted the WITH GRANT OPTION privilege, which means that the user can grant all included privileges to other users.
Check the Grant box.
d
Click the Grant button.
The GRANT statement generates and automatically submits the following SQL statements without previewing them.
GRANT MONRESOURCE, MONSESSION, ABORTSESSION, SETSESSRATE,
SETRESRATE, REPLCONTROL, CREATE PROFILE, CREATE ROLE, DROP PROFILE,
DROP ROLE TO "DBADMIN" WITH GRANT OPTION;
6
GRANT UDTTYPE, UDTMETHOD ON SYSUDTLIB TO DBADMIN WITH GRANT OPTION;
e
Close the Grant/Revoke System dialog box.
Grant additional system-level privileges not covered by GRANT shown in step 5
.
a
Click the Query button, the lowest button on the left edge of the main screen to open the Teradata SQL Assistant query window. This allows you to construct and submit an
SQL statement without using the GUI interface.
b
Enter the following SQL statement:
GRANT CTCONTROL ON "DBADMIN" TO "DBADMIN" WITH GRANT OPTION;
7 c
Click the Run Query button .
Grant privileges on Sys_Calendar, which contains tables and views for date-related system functions.
a
Click the Preview Mode button to enable previewing SQL statements before submitting them.
b
From the main window, click Tools>Grant/Revoke>Object Rights.
c
Specify values for the following fields:
Field
Database Name
Object Type
Description
The name of the user or database that owns the objects on which the privileges are being granted.
Select Sys_Calendar from the Database Name drop down list.
The object on which the privileges are given. Includes all databases and all objects created in the database(s).
Select Database from the Object Type drop down list.
Database Administration
Database Administration
Chapter 1: Setting Up Your Administrative Environment: All DBAs
Setting Up the Database Administrator User
Field
To/From User
Normal
Grant
Description
The name of the user that receives the privileges.
Select DBADMIN from the To/From User list.
Allows specification of rights for the named objects.
Check the Select, Insert, Update, and Delete boxes.
Specifies that the user is granted the WITH GRANT OPTION privilege, that is the user can grant all included privileges to other users.
Check the Grant box.
d
Click the Grant button. The Query window appears and displays the generated SQL statement.
GRANT SELECT, INSERT, UPDATE, DELETE ON "Sys_Calendar" TO "DBADMIN"
WITH GRANT OPTION;
8 e a
From the Query window, click the Run Query button .
f
Close the Query window and the Grant/Revoke Object dialog box.
Click File>Define Data Source. The ODBC Data Source Administrator box appears.
On the System DSN tab select the data source, that is, the system name.
b
Click on the Configure button. The ODBC Driver Setup for Teradata Database dialog box appears.
c
Change the value of the Username parameter to DBADMIN.
d
Change the value of the password to the temporary password for DBADMIN specified
Note: User DBADMIN will be prompted to change the temporary password to a permanent, private password at first logon.
e
Click Yes to store the password, then click OK.
f
Click OK to exit the ODBC Data Source Administrator dialog box.
9
10
Click File>Exit to close Teradata Administrator.
Immediately reopen Teradata Administrator, which logs on to Teradata Database as
DBADMIN using the temporary password specified in step d
.
Note: You do not need to execute a GRANT LOGON statement for user DBADMIN or any other user created in the database. All users automatically have the right to log on to the database from any connected client, unless a REVOKE LOGON statement is issued.
11
When prompted, create a private password for user DBADMIN. This client is now configured for use by user DBADMIN. Conduct all future administrative tasks as user
DBADMIN or the administrative username used at your site
12
Exit Teradata Administrator by entering File>Exit.
39
Chapter 1: Setting Up Your Administrative Environment: All DBAs
Creating a Spool Reserve Database
Reference Information
Reference topics are arranged according to the first step in which the topic appears.
Creating a Spool Reserve Database
Teradata strongly recommends that you give sufficient space under user DBC to be used as spool. There are two ways to do this: set aside permanent space to remain unused or create an empty database to hold the space. The advantage of allocating space under DBC to be used for spool is that the space will also be available for other system uses. However, there is also a risk that you may forget to maintain this reserved space and inadvertently assign it to other users and databases for PERM space usage. This could then result in a physical out-of-spool condition if there is no spool space left when processing queries.
An alternative is to create a database under DBC and allocate permanent space to be unused to hold the reserved spool space. Assigning permanent space to DBC to be permanently unused is reserving this physical space for spool usage. The advantage of creating a database to hold spool space means that space will always be set aside and available for spool usage.
A specific example of why it is important to reserve space for DBC is the use of spool space by system tables. Spool limits are allocated for each user or profile and actual space must be available for spool usage when a query is being processed. Sometimes, however, system tables like Transient Journal are allowed to use more space than is available in DBC. When DBC tries to use more space than it has, the system prevents new logons and refuses any data definition language SQL statements. This happens because logons and DDL statements require the system to add additional rows to DBC tables.
To avoid this situation, reserve plenty of space in DBC. This is even more necessary if you are using access logging or database query logging because the tables produced can use up a lot of space. Monitor the space usage for the logging functions often and regularly.
Be sure to not only allocate enough space to DBC but also to regularly clean up old tables by deleting rows from them or archiving them instead if you need the data for later.
40 Database Administration
Chapter 1: Setting Up Your Administrative Environment: All DBAs
Creating a Spool Reserve Database
To create a spool reserve database, submit a CREATE DATABASE statement and specify the amount of space you want to keep in reserve as the PERM parameter.
Do not create objects or store data in this database. As long as the reserve database remains empty, its PERM allocation remains available for use as spool space.
1
2
For example, assume you created an administrative user named DBADMIN. Since the space of this user is under your control, you can use it to create a child database named Spool_Reserve that never contains tables, as follows:
Log on to Teradata Database as user DBC.
Submit the following statement:
3
CREATE DATABASE Spool_Reserve FROM DBADMIN AS PERM =
n ;
where n is the number of bytes that is a specific percentage you have decided is appropriate.
Quit the session and log off.
For more information on determining the allocation of spool space, see “Sizing Spool Space” in Database Design. For more information on determining perm space requirements, see
“Calculating Total PERM Space Requirements” in Database Design.
Guidelines for Reserving Minimum Spool Space
Teradata Database dynamically allocates available permanent space as spool space when necessary. To make sure that reducing permanent space does not impact transaction processing, Teradata recommends that you reserve permanent space for spool requirements.
At minimum, the average uncompressed and non-fallback protected database should reserve
40% of space relative to CURRENTPERM. (For example, if CURRENTPERM is 100 GB, spool space will be 40 GB for a total MAXPERM of 140 GB.)
You may increase the reserve as needed depending on your actual workload. Use the following table to help you estimate your spool space requirements. Note that the percent of spool space suggested is relative to CURRENTPERM.
IF your system has the following fallback rate…
100%
100%
50%
0%
0%
AND the following compression rate…
0%
40%
20%
0%
40%
THEN consider reserving the following spool space percent (that is, this percent is relative to
CURRENTPERM)…
20%
30%
32%
40%
60%
Database Administration 41
Chapter 1: Setting Up Your Administrative Environment: All DBAs
Using Viewpoint Alerts
Note: Because every site is different and can greatly vary, use these numbers as guidelines only.
Using Viewpoint Alerts
Before setting up Viewpoint alerts, make sure you have:
•
Installed a Teradata Viewpoint server and connected it to your system.
•
Enabled the RSS data collection system on your Teradata system.
•
Created the Teradata Viewpoint server logon user (viewpoint) in the database and given it the privileges necessary to logon and execute database monitoring and management functions.
•
Configured at least one administrative user to access and administer Teradata Viewpoint and enabled the Viewpoint data collectors.
See the Teradata Viewpoint Configuration Guide for instructions.
You can configure Teradata Viewpoint to perform alert actions when the database achieves or exceeds certain defined thresholds. You can specify the following alert actions individually or in any combination:
•
Write a message to the alert log
•
Send an email message to a specified address
•
Communicate the alert to a specified third-party application
•
Run a specified BTEQ script or other program
Each alert action set has a unique name and is triggered according to the rules for any alert that specifies the action set name.
Setting Up Alert Actions
The alert setup defines alert notification parameters and alert actions.
See Teradata Viewpoint User Guide for procedure details.
3
4
1
2
From the main Teradata Viewpoint portal, select Admin>Setup.
Use Delivery Settings/Email to configure communication with the host SMTP email server.
Select the Teradata system for which you are configuring the alert.
Use Alerts Presets/Action Sets to set up common alert actions, for example, an email message to all administrative users. Then you can set up monitoring parameters that invoke the associated alert action whenever Teradata Viewpoint detects that a parameter was exceeded.
Note: Specifying one or more roles in the action sends an email to each role member and is the most efficient way of identifying email recipients. You can list email addresses for any recipients that are not Teradata Viewpoint users.
42 Database Administration
Chapter 1: Setting Up Your Administrative Environment: All DBAs
Using Viewpoint Alerts
Creating Alerts
A Teradata Viewpoint alert is based on:
•
A threshold specified for a monitoring parameter, for example, when a database exceeds
95% space usage.
•
The time period during which the parameter must be over threshold to invoke the alert.
•
The name of an Action Set, for example, the alert notification, which defines who should receive the alert, and how the message is delivered.
•
A message that the system delivers to the list of users defined in the Action Set, if the threshold and time criteria are met.
To configure a sample alert:
1
2
From the Teradata Viewpoint main portal, select Admin>Teradata Systems.
From the Setup menu, select Alerts, and then configure an alert, for example, a System
Health alert that sends a message if the system is down, similar to the following example.
Database Administration
Note: The Alert Action name “General Alert” is created using
.
3
Check the Enabled box and click Apply.
Note: See Teradata Viewpoint User Guide for details and options.
43
Chapter 1: Setting Up Your Administrative Environment: All DBAs
Setting Up Teradata Viewpoint Alerts for Space Usage
Setting Up Teradata Viewpoint Alerts for Space
Usage
You can use Teradata Viewpoint to regularly monitor space usage, and catch most space problems. However, it may be useful to setup a few alerts in areas where space problems can seriously affect database function.
The following table contains some examples of common space usage alerts.
Alert
Crashdumps Space
The crashdumps database needs enough space to contain possible large data dumps that occur during crashes, and which are used in system recovery.
DBC Space
User DBC contains all system tables and logs.
Critical system functions depend on DBC having enough space.
Note: You can set the same alert parameters for
DBCMNGR and
SystemFE, which perform other critical system functions.
Setup Parameters
Alert rules:
•
Only include databases = crashdumps
•
Current Perm Max% > 70
Note: The threshold is set low because a crashdump can be very large.
Alert Action:
•
•
Do not run twice in 5 minutes
Severity: Medium
Alert rules:
•
Only include databases = DBC
•
Current Perm Max% > 80
Note: Use 90% for SystemFE.
Alert Action:
•
•
Do not run twice in 5 minutes
Severity: Medium
Response to Alert Occurrence
•
Add perm space to the crashdumps database.
•
Purge the crashdumps database of unneeded data and back up needed data to external media.
Add perm space to the database.
44 Database Administration
Chapter 1: Setting Up Your Administrative Environment: All DBAs
About the Global Default Parameters
Alert
Set up three alerts to identify when a database exceeds important space thresholds.
•
All DB 90%
•
All DB 95%
•
All DB 97%
Setup Parameters
Alert rules:
•
All databases
•
Current Perm Max%
> percent
Alert Action:
•
Email (Pager for critical alerts)
•
Do not run twice in 5 minutes
Severity: (apply one of the following to the related alert)
•
Medium (90%)
•
High (95%)
•
Critical (97%)
Response to Alert Occurrence
You should allocate additional perm space to a database as soon as possible after perm space usage exceeds 90%.
Databases that trigger the High or Critical alert levels before you can respond to a Medium alert are growing very fast and should receive more space immediately.
You can investigate which tables are using database perm space.
About the Global Default Parameters
There are many global defaults that you can change for your system, including international character set settings, time zone, business calendars, and many others. For more information, see
Chapter 18: “Working with System Information and Global Defaults: Operational DBAs.” .
Database Administration 45
广告