2X812 Student Exercise Guide PDF

Download as pdf or txt
Download as pdf or txt
You are on page 1of 126
At a glance
Powered by AI
The document describes exercises for configuring an Informix database server.

The document provides exercises for students learning to configure an Informix database server.

The case study describes steps for configuring a new Informix instance including creating dbspaces, logs, and adding chunks.

V5.4.0.

cover

Front cover

Informix 11.7 System


Administration

(Course code IX812)

Student Exercises
ERC 2.0

ly
on
812
2X
se
ur
co
in
se
ru
Fo

IBM certified course material


Student Exercises

Trademarks
IBM® is a registered trademark of International Business Machines Corporation.
The following are trademarks of International Business Machines Corporation in the United
States, or other countries, or both:
Distributed Relational DRDA Informix
Database Architecture
Adobe is either a registered trademark or a trademark of Adobe Systems Incorporated in
the United States, and/or other countries.
Linux is a registered trademark of Linus Torvalds in the United States, other countries, or
both.
Microsoft and Windows are trademarks of Microsoft Corporation in the United States, other
countries, or both.
UNIX is a registered trademark of The Open Group in the United States and other

ly
countries.

on
Java and all Java-based trademarks and logos are trademarks or registered trademarks of

12
Oracle and/or its affiliates.

8
VMware and the VMware "boxes" logo and design, Virtual SMP and VMotion are registered
2X
trademarks or trademarks (the "Marks") of VMware, Inc. in the United States and/or other
jurisdictions.
se

Other product and service names might be trademarks of IBM or other companies.
ur
co
in
se
ru
Fo

April 2011 edition


The information contained in this document has not been submitted to any formal IBM test and is distributed on an “as is” basis without
any warranty either express or implied. The use of this information or the implementation of any of these techniques is a customer
responsibility and depends on the customer’s ability to evaluate and integrate them into the customer’s operational environment. While
each item may have been reviewed by IBM for accuracy in a specific situation, there is no guarantee that the same or similar results will
result elsewhere. Customers attempting to adapt these techniques to their own environments do so at their own risk.

© Copyright International Business Machines Corporation 2001, 2011.


This document may not be reproduced in whole or in part without the prior written permission of IBM.
Note to U.S. Government Users — Documentation related to restricted rights — Use, duplication or disclosure is subject to restrictions
set forth in GSA ADP Schedule Contract with IBM Corp.
V5.4.0.3
Student Exercises

TOC Contents
Trademarks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . v

Exercise 1. Overview of the Informix Database Server . . . . . . . . . . . . . . . . . . . . . . 1-1


1.1. Matching Exercise . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-2
1.2. Solution to Exercise . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-3

Exercise 2. Preparing for Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-1


2.1. Reviewing Release Notes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-2

Exercise 3. Configuring Client Server Connectivity . . . . . . . . . . . . . . . . . . . . . . . . . 3-1


3.1. Setting Up the sqlhosts File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-2
3.2. Solution to Exercise . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-3

Exercise 4. Configuring a Database Server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-1

ly
4.1. Configuring and Initializing a Database Server . . . . . . . . . . . . . . . . . . . . . . . . . . 4-2

on
4.2. Solution to Exercise . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-4

12
Exercise 5. Monitoring the Informix Database Server . . . . . . . . . . . . . . . . . . . . . . . 5-1

8
5.1. Using Informix Monitoring Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-2
2X
5.2. Solution to Exercise . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-5
se

Exercise 6. Managing Shared Memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-1


ur

6.1. Using Informix Tools to Manage the Server . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-2


6.2. Using Onstat to Monitor Configuration Changes . . . . . . . . . . . . . . . . . . . . . . . . 6-3
co

6.3. Solutions to Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-5


in

Exercise 7. Virtual Processors and Threads . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-1


se

7.1. Monitoring Virtual Processors and Threads . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-2


ru

7.2. Matching Exercise . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-5


7.3. Solutions to Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-6
Fo

Exercise 8. Disk Architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-1


8.1. Using Informix Tools to Study Informix Architecture . . . . . . . . . . . . . . . . . . . . . . 8-2
8.2. Solution to Exercise . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-5

Exercise 9. Managing and Monitoring Disk Space . . . . . . . . . . . . . . . . . . . . . . . . . . 9-1


9.1. Adding Spaces and Chunks to Database Server . . . . . . . . . . . . . . . . . . . . . . . . 9-2
9.2. Solution to Exercise . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-3

Exercise 10. Physical and Logical Logging . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-1


10.1. Adding Logical Logs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-2
10.2. Using onlog (Optional exercise) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-3
10.3. Solutions to Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-4

© Copyright IBM Corp. 2001, 2011 Contents iii


Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises

Exercise 11. The Shared Memory Buffer Pool . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11-1


11.1. Monitoring Checkpoint Activity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-2
11.2. Solution to Exercise . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-5

Exercise 12. Fault Tolerance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .12-1


12.1. Using Disk Mirroring . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-2
12.2. Solution to Exercise . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-3

Exercise 13. Introduction to Backup and Restore . . . . . . . . . . . . . . . . . . . . . . . . . .13-1


13.1. Choosing a Restore Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13-2
13.2. Solution to Exercise . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13-3

Exercise 14. Backup and Restore Using Ontape . . . . . . . . . . . . . . . . . . . . . . . . . . .14-1


14.1. Performing a Backup and Restore . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14-2
14.2. Back up and Restore using STDIO (Optional) . . . . . . . . . . . . . . . . . . . . . . . . 14-3
14.3. Solutions to Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14-4

ly
Exercise 15. Temporary Files and Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .15-1

on
15.1. Using Temporary Dbspaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15-2
15.2. Solution to Exercise . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15-4

8 12
Exercise 16. Performance Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .16-1
2X
16.1. Matching Exercise . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16-2
16.2. Solution to Exercise . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16-3
se

Exercise 17. Monitoring User Activity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .17-1


ur

17.1. Dynamic Lock Management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17-2


co
in

Exercise 18. Event Alarms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .18-1


18.1. Using Alarm Programs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18-2
se

18.2. Solution to Exercise . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18-3


ru

Exercise 19. SQL Administration Functions and Task Scheduler . . . . . . . . . . . . .19-1


Fo

19.1. Executing SQL administration commands . . . . . . . . . . . . . . . . . . . . . . . . . . . 19-2


19.2. Creating a sensor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19-4
19.3. Analyzing sensor results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19-5
19.4. Solutions to exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19-6

Exercise 20. Troubleshooting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .20-1


20.1. Troubleshooting a Disabled Server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20-2
20.2. Solution to Exercise . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20-4

Exercise 21. A Configuration Case Study . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .21-1


21.1. Configuration Case Study 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21-2
21.2. Configuration Case Study 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21-4
21.3. Solutions to Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21-5

iv Informix 11.7 System Admin © Copyright IBM Corp. 2001, 2011


Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V5.4.0.3
Student Exercises

TMK Trademarks
The reader should recognize that the following terms, which appear in the content of this
training document, are official trademarks of IBM or other companies:
IBM® is a registered trademark of International Business Machines Corporation.
The following are trademarks of International Business Machines Corporation in the United
States, or other countries, or both:
Distributed Relational DRDA® Informix®
Database Architecture™
Notes® 400®
Adobe is either a registered trademark or a trademark of Adobe Systems Incorporated in
the United States, and/or other countries.
Linux is a registered trademark of Linus Torvalds in the United States, other countries, or

ly
both.

on
Microsoft and Windows are trademarks of Microsoft Corporation in the United States, other

12
countries, or both.

8
UNIX is a registered trademark of The Open Group in the United States and other
2X
countries.
Java and all Java-based trademarks and logos are trademarks or registered trademarks of
se

Oracle and/or its affiliates.


ur

VMware and the VMware "boxes" logo and design, Virtual SMP and VMotion are registered
co

trademarks or trademarks (the "Marks") of VMware, Inc. in the United States and/or other
in

jurisdictions.
se

Other product and service names might be trademarks of IBM or other companies.
ru
Fo

© Copyright IBM Corp. 2001, 2011 Trademarks v


Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises

ly
on
8 12
2X
se
ur
co
in
se
ru
Fo

vi Informix 11.7 System Admin © Copyright IBM Corp. 2001, 2011


Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V5.4.0.3
Student Exercises

EXempty Exercise 1. Overview of the Informix Database


Server

What this exercise is about


In this exercise, students are tested on some of the concepts they
learned in the corresponding unit of the Student Notebook.

What you should be able to do


At the end of the exercise, you should be able to:
• Define key Informix database server terms

ly
on
8 12
2X
se
ur
co
in
se
ru
Fo

© Copyright IBM Corp. 2001, 2011 Exercise 1. Overview of the Informix Database Server 1-1
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises

1.1. Matching Exercise


Match the term on the left with the correct definition on the right.

__ 1. chunk a. Physical contiguous pages on a disk that are


assigned to a specific tblspace.
__ 2. virtual processors
b. The largest part of shared memory that is dedicated
__ 3. extent to holding data from disk.
__ 4. logical log c. Area on disk that holds before-images of pages.
__ 5. buffer pool d. A unit of disk space that is assigned to a dbspace.
__ 6. checkpoint e. A system event in which modified buffers are copied
__ 7. page to disk.
__ 8. physical log f. A basic unit of storage and I/O in a server system.

ly
__ 9. resident portion g. Space on disk that holds transaction information.

on
__ 10. dbspaces h. Processes that make up the database server.

12
__ 11. virtual portion i. The shared memory component that contains thread
and session data.
8
2X
j. A logical collection of chunks that forms a pool of disk
se

space used by tables and databases.


ur

k. The shared memory component that contains the


co

buffer pool.
in
se
ru
Fo

1-2 Informix 11.7 System Admin © Copyright IBM Corp. 2001, 2011
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V5.4.0.3
Student Exercises

EXempty 1.2. Solution to Exercise

d 1. chunk a. Physical contiguous pages on a disk that are


assigned to a specific tblspace.
h 2. virtual processors
b. The largest part of shared memory that is dedicated
a 3. extent to holding data from disk.
g 4. logical log c. Area on disk that holds before-images of pages.
b 5. buffer pool d. A unit of disk space that is assigned to a dbspace.
e 6. checkpoint e. A system event in which modified buffers are copied
f 7. page to disk.
c 8. physical log f. A basic unit of storage and I/O in a server system.
k 9. resident portion g. Space on disk that holds transaction information.

ly
j 10. dbspaces h. Processes that make up the database server.

on
i 11. virtual portion i. The shared memory component that contains thread

12
and session data.
j.
8
A logical collection of chunks that forms a pool of disk
2X
space used by tables and databases.
se

k. The shared memory component that contains the


buffer pool.
ur
co
in
se
ru
Fo

© Copyright IBM Corp. 2001, 2011 Exercise 1. Overview of the Informix Database Server 1-3
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises

ly
on
8 12
2X
se
ur
co
in
se
ru
Fo

1-4 Informix 11.7 System Admin © Copyright IBM Corp. 2001, 2011
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V5.4.0.3
Student Exercises

EXempty Exercise 2. Preparing for Configuration

What this exercise is about


In this exercise, students will locate and examine Informix release note
information about their lab machines.

What you should be able to do


At the end of the exercise, you should be able to:
• Locate the Machine Specific Notes and identify supported features
for the installed Informix platform.

ly
on
8 12
2X
se
ur
co
in
se
ru
Fo

© Copyright IBM Corp. 2001, 2011 Exercise 2. Preparing for Configuration 2-1
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises

2.1. Reviewing Release Notes


For this and subsequent exercises, use the following information to start the lab
environment and log on to the lab server.
• Classroom students: Your instructor will provide you with information about starting
the virtual eLab image.
• Instructor Led Online students: Use the information provided to you to access your
eLab environment. Your instructor will provide help if needed.
• Self-paced students: Click the link provided on the Exercise page to access the eLab
environment.
Use the following information to log on to the virtual eLab environment:
Login: informix
Password: ibm2blue

ly
on
The release notes for Informix are located in $INFORMIXDIR/release/locale/lang_code.

12
There are several files in this directory that provide additional notes for various products
and features. One of the files you should pay close attention to is
8
ids_machine_notes_version.txt. This file contains the Machine Specific Notes for the
2X
server environment.
se

Take a few moments to familiarize yourself with the Machine Specific Notes on your
ur

classroom machine. See if you can locate the following:


co

• Recommended kernel parameter settings


in

• Patches required
se

• Supported network protocols (NETTYPE)


ru

• Operating system features supported by Informix (list here):


Fo

__________________________________
__________________________________
__________________________________
__________________________________
__________________________________
__________________________________

Note

The information in the release notes is platform specific. The release notes for the
Informix installation at your workplace might be different from what you see in the
classroom.

2-2 Informix 11.7 System Admin © Copyright IBM Corp. 2001, 2011
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V5.4.0.3
Student Exercises

EXempty Exercise 3. Configuring Client Server


Connectivity

What this exercise is about


In this exercise, students will configure connectivity options for their
database server environment.

What you should be able to do


At the end of the exercise, you should be able to:
• Configure entries in the sqlhosts file

ly
on
8 12
2X
se
ur
co
in
se
ru
Fo

© Copyright IBM Corp. 2001, 2011 Exercise 3. Configuring Client Server Connectivity 3-1
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises

3.1. Setting Up the sqlhosts File


In this exercise, you will create an sqlhosts file to use for the database server you will
create and use for this course. Use the following information:
Classroom machine (host) name: localhost
Login: informix
Password: ibm2blue
__ 1. Log on to the classroom machine using the login and password from above.
__ 2. In your home directory, create a file called sqlhosts. In this file, add entries for two
servers:
__ a. Create the first entry to support shared memory connections. Use local_shm as
the server name. Also provide the appropriate nettype and hostname. For the
service name, use the same name as the server name.

ly
__ b. Create the second entry to support network connections. Use local_tcp as the

on
server name, and provide the appropriate nettype and hostname. Use
local_tcp as the service name.

8 12
Note
2X
Refer to the Machine Specific Notes to determine what nettype to use for network
se

connections on your classroom system.


ur
co
in

What entries did you make in this file?


se
ru
Fo

__ 3. Verify that the host name you used for your sqlhosts entries are included in the
/etc/hosts file, and the service name for your TCP entry is in the /etc/services file.
__ 4. Change the permissions of your sqlhosts file to 660:
chmod 660 sqlhosts
In the next module, you will configure your database server using the sqlhosts file you
created.

3-2 Informix 11.7 System Admin © Copyright IBM Corp. 2001, 2011
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V5.4.0.3
Student Exercises

EXempty 3.2. Solution to Exercise


__ 1. Log on to the classroom machine using the login and password from above.
__ 2. In your home directory, create a file called sqlhosts. In this file, add entries for two
servers:
__ a. Create the first entry to support shared memory connections. Use local_shm as
the server name. Also provide the appropriate nettype and hostname. For the
service name, use the same name as the server name.
__ b. Create the second entry to support network connections. Use local_tcp as the
server name, and provide the appropriate nettype and hostname. Use
local_tcp as the service name.
What entries did you make in this file?
The following entries would be used:
local_shm onipcshm localhost local_shm

ly
local_tcp onsoctcp localhost local_tcp

on
The nettype value for the TCP servicename might be different (ontlitcp)

12
depending on your lab environment.
8
__ 3. Verify that the host name you used for your sqlhosts entries are included in the
2X
/etc/hosts file, and the service name for your TCP entry is in the /etc/services file.
se

__ 4. Change the permissions of your sqlhosts file to 660:


ur

chmod 660 sqlhosts


co
in
se
ru
Fo

© Copyright IBM Corp. 2001, 2011 Exercise 3. Configuring Client Server Connectivity 3-3
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises

ly
on
8 12
2X
se
ur
co
in
se
ru
Fo

3-4 Informix 11.7 System Admin © Copyright IBM Corp. 2001, 2011
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V5.4.0.3
Student Exercises

EXempty Exercise 4. Configuring a Database Server

What this exercise is about


In this exercise, students will configure and initialize an Informix
database server.

What you should be able to do


At the end of the exercise, you should be able to:
• Set environment variables required to access your database
server.
• Modify key configuration parameters in the $ONCONFIG file.

ly
• Initialize a database server.

on
• Verify initialization by analyzing the message log file.

8 12
2X
se
ur
co
in
se
ru
Fo

© Copyright IBM Corp. 2001, 2011 Exercise 4. Configuring a Database Server 4-1
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises

4.1. Configuring and Initializing a Database Server


In this exercise, you will configure and initialize a database server from scratch.
Follow these steps to configure and initialize a database server:
__ 1. Log on to the classroom system as user informix.
__ 2. Create a script file in your home directory called set_ids. Make sure that your script
includes settings for the following environment variables:
INFORMIXDIR /opt/informix
PATH $INFORMIXDIR/bin:$PATH
ONCONFIG onconfig.local
INFORMIXSERVER local_shm
INFORMIXSQLHOSTS informix_home/sqlhosts
Set your environment variables by running your script using the command:

ly
. ./set_ids

on
__ 3. In your home directory, create a cooked file called rootchunk to be used as the first
chunk in your root dbspace. Make sure that owner, group, and permissions on this

12
file are properly set.
8
2X
__ 4. Verify that you have two entries in your sqlhosts file. One entry is called local_shm
for shared memory connection and one entry is called local_tcp for network
se

connection.
ur

__ 5. Change directory to $INFORMIXDIR/etc:


co

cd $INFORMIXDIR/etc
in

Copy the onconfig.std to your configuration filename, onconfig.local.


se

__ 6. Edit the $ONCONFIG file using vi, gedit, or other text editor. Change configuration
ru

parameters as follows:
Fo

__ a. Set ROOTPATH to the full path and filename of the rootchunk file you created in
Step 3.
__ b. Set ROOTSIZE to 100000.
__ c. Set the PHYSFILE parameter to 14000.
__ d. Set the LOGSIZE parameter to 5000.
__ e. Set the MSGPATH parameter to informix_home/online.log.
__ f. Set SERVERNUM to 1.
__ g. Set DBSERVERNAME to the same value as INFORMIXSERVER. This is also
the name you used in the first column of your sqlhosts file.
__ h. Set DBSERVERALIASES to the second server name you configured in your
sqlhosts file.

4-2 Informix 11.7 System Admin © Copyright IBM Corp. 2001, 2011
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V5.4.0.3
Student Exercises

EXempty __ i. Set the TAPEDEV and LTAPEDEV parameters to /dev/null. These parameters
specify the name of the devices to use for backing up the database server and
logical logs using the ontape command.
__ j. Set the DUMPDIR parameter to /tmp.
__ 7. Initialize your database server by issuing the following command:
oninit -iy

Warning

The -i option of the oninit command is used to initialize the disk space for a database
instance for the first time. Any data that currently resides in your root dbspace is
overwritten during this initialization.

__ 8. View the contents of the message log using the onstat -m command (or by viewing

ly
on
the online.log file). Answer the following questions:
__ a. At what time was the disk initialization completed?

__ b. When does the first checkpoint occur? 8 12


2X
se

__ c. When does your server go to Online mode?


ur
co

__ d. When does the building of sysmaster begin?


in

__ e. How many logical logs are used during the building of sysmaster and sysutils?
se
ru

__ f. When does the building of sysmaster complete?


Fo

__ g. When does the building of sysutils complete?

__ h. What other databases are created?

© Copyright IBM Corp. 2001, 2011 Exercise 4. Configuring a Database Server 4-3
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises

4.2. Solution to Exercise


__ 8. View the contents of the message log using the onstat -m command (or by viewing
the online.log file). Answer the following questions:
__ a. At what time was the disk initialization completed?
Look for the line containing the phrase: Complete Disk Initialized.
__ b. When does the first checkpoint occur?
Locate the first line that contains the words: Checkpoint Completed.
__ c. When does your server go to Online mode?
This is noted in the log by the message: On-Line Mode.
__ d. When does the building of sysmaster begin?
Look for: Building ‘sysmaster’ database.
__ e. How many logical logs are used during the building of sysmaster and sysutils?

ly
on
Look for the messages indicating that sysmaster and sysutils were built
successfully. Search upward from there to find the last logical log

12
completed.
8
2X
__ f. When does the building of sysmaster complete?
Look for: ‘sysmaster’ database built successfully.
se

__ g. When does the building of sysutils complete?


ur
co

Look for: ‘sysutils’ database built successfully.


__ h. What other databases are created?
in
se

The sysuser and sysadmin databases are also created.


ru
Fo

4-4 Informix 11.7 System Admin © Copyright IBM Corp. 2001, 2011
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V5.4.0.3
Student Exercises

EXempty Exercise 5. Monitoring the Informix Database


Server

What this exercise is about


In this exercise, students will use monitoring tools to obtain the status
or perform validation tests on various database server features.

What you should be able to do


At the end of the exercise, you should be able to:
• Query the sysmaster database for information about database
server objects.

ly
• Use onstat to obtain status information.

on
• Use oncheck to validate and display information about database

12
objects on disk.

8
2X
se
ur
co
in
se
ru
Fo

© Copyright IBM Corp. 2001, 2011 Exercise 5. Monitoring the Informix Database Server 5-1
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises

5.1. Using Informix Monitoring Tools


In this exercise, you will use the SMI and the onstat and oncheck commands to answer a
series of questions.

Create the demonstration database


Informix provides a script you can use to create a fully functional database.
__ 1. Create the stores_demo database by executing the command:
dbaccessdemo -log
When asked if you want to copy examples into your current directory, respond by
entering N.

Using onstat

ly
__ 2. Execute dbaccess and connect to the stores_demo database. In a separate

on
window, use onstat to perform the following tasks:

12
__ a. Display a list of all onstat command options.

8
2X
__ b. Display the last few lines of the message file.
se
ur

__ c. Display the configuration parameter settings in the $ONCONFIG file.


co
in

__ d. Display the Informix session ID and the UNIX process ID (PID) of your dbaccess
se

session.
ru
Fo

__ e. Show the status of your dbspaces and chunks.

__ f. Show the status of your logical logs.

__ g. Display a list of all active threads.

Using oncheck
__ 3. Use oncheck to do the following:
__ a. Display the oncheck command options.

5-2 Informix 11.7 System Admin © Copyright IBM Corp. 2001, 2011
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V5.4.0.3
Student Exercises

EXempty
__ b. Display a disk utilization report of the items table in the stores_demo database.

__ c. Check and correct any indexes and rowids in the stores_demo database that
are inconsistent.

__ d. Perform a check of the reserved pages.

__ e. Perform a check of the reserved pages and print reserved page information.

__ f. Check the extents allocated for the database server and print a report of extent
allocations.

ly
on
__ g. Perform a check of the system catalog tables for the stores_demo database.

8 12
__ 4. Return to the window where dbaccess is running. Exit the dbaccess application.
2X
se

Query the sysmaster database


ur

__ 5. Using sysmaster tables and views, execute SQL commands to obtain the following
co

information:
in

__ a. Display a list of the databases in your database server.


se
ru

__ b. Display a list of all chunks that are online.


Fo

__ c. Display a list of the table names in the stores_demo database.

__ d. Show the number of extents allocated in each of the tables in the stores_demo
database.

__ e. Show the percentage of each of the logs that have been filled.

__ f. Show the number of locks held by each session (list the user name and the
process ID of the client).

© Copyright IBM Corp. 2001, 2011 Exercise 5. Monitoring the Informix Database Server 5-3
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises

__ g. You can use the function dbinfo(“sessionid”) from within an SQL statement to
return your session ID. Use this function to retrieve information from the
sysmaster database regarding your session.

ly
on
8 12
2X
se
ur
co
in
se
ru
Fo

5-4 Informix 11.7 System Admin © Copyright IBM Corp. 2001, 2011
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V5.4.0.3
Student Exercises

EXempty 5.2. Solution to Exercise

Create the demonstration database


__ 1. Create the stores_demo database by executing the command:
dbaccessdemo -log
When asked if you want to copy examples into your current directory, enter N.

Using onstat
__ 2. Execute dbaccess and connect to the stores_demo database. In a separate
window, use onstat to perform the following tasks:
__ a. Display a list of all onstat command options.
onstat --

ly
__ b. Display the last few lines of the message file.

on
onstat -m

12
__ c. Display the configuration parameter settings in the $ONCONFIG file.
onstat -c 8
2X
__ d. Display the Informix session ID and the UNIX process ID (PID) of your dbaccess
se

session.
ur

onstat -g ses
co

__ e. Show the status of your dbspaces and chunks.


in

onstat -d
se

__ f. Show the status of your logical logs.


ru

onstat -l
Fo

__ g. Display a list of all active threads.


onstat -g act

Using oncheck
__ 3. Use oncheck to do the following:
__ a. Display the oncheck command options.
oncheck --
__ b. Display a disk utilization report of the items table in the stores_demo database.
oncheck -pT stores_demo:items

© Copyright IBM Corp. 2001, 2011 Exercise 5. Monitoring the Informix Database Server 5-5
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises

__ c. Check and correct any indexes and rowids in the stores_demo database that
are inconsistent.
oncheck -cI stores_demo
__ d. Perform a check of the reserved pages.
oncheck -cr
__ e. Perform a check of the reserved pages and print reserved page information.
oncheck -pr
__ f. Check the extents allocated for the database server and print a report of extent
allocations.
oncheck -pe
__ g. Perform a check of the system catalog tables for the stores_demo database.
oncheck -cc stores_demo

ly
__ 4. Return to the window where dbaccess is running. Exit the dbaccess application.

on
Query the sysmaster database

8 12
__ 5. Using sysmaster tables and views, execute SQL commands to obtain the following
2X
information:
se

__ a. Display a list of the databases in your database server.


ur

SELECT name
co

FROM sysmaster:sysdatabases;
__ b. Display a list of all chunks that are online.
in

SELECT c.chknum chunk_number, d.name dbspace,'On-Line' status


se

FROM sysmaster:syschunks c, sysmaster:sysdbspaces d


ru

WHERE c.dbsnum = d.dbsnum AND c.is_offline = 0;


Fo

__ c. Display a list of the table names in the stores_demo database.


SELECT t.tabname
FROM sysmaster:systabnames t
WHERE t.dbsname = 'stores_demo';
__ d. Show the number of extents allocated in each of the tables in the stores_demo
database.
SELECT tabname, count(*) num_extents
FROM sysmaster:sysextents
WHERE dbsname = 'stores_demo'
GROUP BY tabname
ORDER BY tabname;

5-6 Informix 11.7 System Admin © Copyright IBM Corp. 2001, 2011
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V5.4.0.3
Student Exercises

EXempty __ e. Show the percentage of each of the logs that have been filled.
SELECT uniqid, ROUND ((used/size) * 100, 2) percent_used
FROM sysmaster:syslogs;
__ f. Show the number of locks held by each session (list the user name and the
process ID of the client).
SELECT trim(ss.username) || '-' || ss.sid user_session,
sp.locksheld, ss.pid
FROM sysmaster:syssesprof sp, sysmaster:syssessions ss
WHERE sp.sid = ss.sid;
__ g. You can use the function dbinfo(“sessionid”) from within an SQL statement to
return your session ID. Use this function to retrieve information from the
sysmaster database regarding your session.
SELECT *
FROM sysmaster:syssessions ss, sysmaster:syssesprof sp

ly
WHERE sp.sid = dbinfo ("sessionid") AND sp.sid = ss.sid;

on
8 12
2X
se
ur
co
in
se
ru
Fo

© Copyright IBM Corp. 2001, 2011 Exercise 5. Monitoring the Informix Database Server 5-7
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises

ly
on
8 12
2X
se
ur
co
in
se
ru
Fo

5-8 Informix 11.7 System Admin © Copyright IBM Corp. 2001, 2011
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V5.4.0.3
Student Exercises

EXempty Exercise 6. Managing Shared Memory

What this exercise is about


In this exercise, students will use Informix tools to manage the
database server.

What you should be able to do


At the end of the exercise, you should be able to:
• Use the onmode command to transition the database server from
one mode to another.
• Use the oninit command to initialize the database server.

ly
• Use the onstat command to monitor components of the database

on
server and use the information to modify the server configuration.

8 12
2X
se
ur
co
in
se
ru
Fo

© Copyright IBM Corp. 2001, 2011 Exercise 6. Managing Shared Memory 6-1
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises

6.1. Using Informix Tools to Manage the Server


In this exercise, you will use the onstat, onmode, and oninit commands to view the server
status and to change the operating mode of the server. Perform the following tasks and
answer the questions provided.
__ 1. Bring your server from Online mode to Quiescent mode.

__ 2. Run the onstat - command to verify the current operating mode of your server.
__ 3. Bring your server from Quiescent mode to Offline mode.

__ 4. Bring your server from Offline mode to Quiescent mode.

__ 5. Run dbaccess and try to select a database.

ly
on
__ a. Are you able to select a database in Quiescent mode?

12
__ b. What kinds of tasks can be performed in Quiescent mode?
8
2X
se

__ 6. Bring the server to Single-User mode. Try starting a dbaccess session. Did it work?
ur
co

__ 7. After verifying that the server is online, bring the server directly from Online to Offline
mode.
in
se
ru

__ 8. Now, bring the server directly from Offline to Online mode.


Fo

__ 9. If you want your database server to be brought online each time your computer is
rebooted, what commands must be added to the system startup file?

__ 10. Using one of the Informix utilities, determine the build version and build number for
your instance. What command did you use?

6-2 Informix 11.7 System Admin © Copyright IBM Corp. 2001, 2011
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V5.4.0.3
Student Exercises

EXempty 6.2. Using Onstat to Monitor Configuration Changes


In this exercise, you will modify the configuration of your server and view the effects using
onstat commands.
__ 1. Run the onstat -g seg command. How many segments are allocated in your server
for the resident portion of shared memory? the virtual portion? the message portion?
__ 2. List the type of shared memory segment (resident, virtual, or message) and the size
of each segment listed.
Type Size
__________ __________
__________ __________
__________ __________
__________ __________
__________ __________

ly
__ 3. Choose one configuration parameter that you think is most likely to cause an

on
increase in the size of the resident portion of shared memory. Change the
parameter, then reinitialize shared memory.

12
__ a. What parameter did you change?
8
2X
se

__ b. How much larger is your resident portion as a result of this change?


ur
co

__ 4. Choose one configuration parameter that you think is most likely to cause an
increase in the size of the virtual portion of shared memory. Change the parameter,
in

then reinitialize shared memory.


se

__ a. What parameter did you change?


ru
Fo

__ b. How much larger is your virtual portion as a result of this change?

__ c. Why would you want to increase the size of the SHMVIRTSIZE parameter?

__ 5. Modify the size configured for the SHMADD parameter by doubling it. Reinitialize
shared memory and run onstat -g seg to view the size of the segments.
__ a. What effect did your change have on the size of the shared memory segments?

© Copyright IBM Corp. 2001, 2011 Exercise 6. Managing Shared Memory 6-3
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises

__ 6. Without reinitializing your database server, modify your server to force the resident
portion to always be in memory.
__ a. What command did you use?

__ b. What command can you use to determine that forced residency is imposed on
the resident-portion segments?

__ 7. Bring your server to Offline mode and then back up to Online mode.
__ a. Is forced residency still imposed on your resident-portion segments?

__ b. What must you do to force residency of the resident-portion segments each time
the server is initialized?

ly
on
8 12
2X
se
ur
co
in
se
ru
Fo

6-4 Informix 11.7 System Admin © Copyright IBM Corp. 2001, 2011
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V5.4.0.3
Student Exercises

EXempty 6.3. Solutions to Exercises

6.1. Using Informix Tools to Manage the Server


__ 1. Bring your server from Online mode to Quiescent mode.
Use either onmode -s or onmode -u.
__ 2. Run the onstat - command to verify the current operating mode of your server.
__ 3. Bring your server from Quiescent mode to Offline mode.
onmode -k
__ 4. Bring your server from Offline mode to Quiescent mode.
oninit -s
__ 5. Run dbaccess and try to select a database.
__ a. Are you able to select a database in Quiescent mode?

ly
on
You cannot perform any database operations in Quiescent mode.
__ b. What kinds of tasks can be performed in Quiescent mode?

12
You can run any system administration utility (onstat, onparams, etc.)
8
2X
when in Quiescent mode.
__ 6. Bring the server to Single-User mode. Try starting a dbaccess session. Did it work?
se

onmode -j ; You can now start a dbaccess session and connect to a database.
ur
co

__ 7. After verifying that the server is online, bring the server directly from Online to Offline
mode.
in

onmode -ky
se

__ 8. Now, bring the server directly from Offline to Online mode.


ru

oninit
Fo

__ 9. If you want your database server to be brought online each time your computer is
rebooted, what commands must be added to the system startup file?
Include these commands in your system startup script:
INFORMIXDIR=path
PATH=$INFORMIXDIR/bin:$PATH
INFORMIXSERVER=servername
INFORMIXSQLHOSTS=path/sqlhosts_filename
ONCONFIG=config_filename
export INFORMIXDIR PATH INFORMIXSERVER INFORMIXSQLHOSTS ONCONFIG
oninit
__ 10. Using one of the Informix utilities, determine the build version and build number for
your instance. What command did you use?

© Copyright IBM Corp. 2001, 2011 Exercise 6. Managing Shared Memory 6-5
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises

onstat -version

6.2. Using Onstat to Monitor Configuration Changes


__ 1. Run the onstat -g seg command. How many segments are allocated in your server
for the resident portion of shared memory? the virtual portion? the message portion?
This information is determined by counting the segments for each of the
different types specified in the class column.
__ 2. List the type of shared memory segment (resident, virtual, or message) and the size
of each segment listed.
Obtain this information from the class and size columns.
__ 3. Choose one configuration parameter that you think is most likely to cause an
increase in the size of the resident portion of shared memory. Change the
parameter, then reinitialize shared memory.

ly
__ a. What parameter did you change?

on
The parameter that affects the size of the resident portion the most is

12
BUFFERPOOL, specifically, the buffers setting. Try increasing the buffers
setting for the 2K BUFFERPOOL by 1000.
8
2X
__ b. How much larger is your resident portion as a result of this change?
Determine the difference in the size of the resident portion before and after
se

the change is made.


ur
co

__ 4. Choose one configuration parameter that you think is most likely to cause an
increase in the size of the virtual portion of shared memory. Change the parameter,
in

then reinitialize shared memory.


se

__ a. What parameter did you change?


ru

The best choice is SHMVIRTSIZE.


Fo

__ b. How much larger is your virtual portion as a result of this change?


Determine the difference in the size of the virtual portion before and after
the change is made.
__ c. Why would you want to increase the size of the SHMVIRTSIZE parameter?
Increase SHMVIRTSIZE when you find that your server always adds virtual
shared memory segments. A larger SHMVIRTSIZE means that the database
server is less likely to require additional memory allocations. Adding
additional segments could result in a negative impact on database server
performance.
__ 5. Modify the size configured for the SHMADD parameter by doubling it. Reinitialize
shared memory and run onstat -g seg to view the size of the segments.
__ a. What effect did your change have on the size of the shared memory segments?

6-6 Informix 11.7 System Admin © Copyright IBM Corp. 2001, 2011
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V5.4.0.3
Student Exercises

EXempty If more than one virtual shared memory segment was allocated, the size of
the additional segment should be greater than the segment allocated
previously.
__ 6. Without reinitializing your database server, modify your server to force the resident
portion to always be in memory.
__ a. What command did you use?
onmode -r
__ b. What command can you use to determine that forced residency is imposed on
the resident-portion segments?
Run onstat -g seg. If the resident-portion segment has been forced to
remain in memory, you should see an asterisk (*) in the class column.
__ 7. Bring your server to Offline mode and then back up to Online mode.
__ a. Is forced residency still imposed on your resident-portion segments?

ly
No. Forcing residency using onmode -r is only in effect for the current

on
server session.

12
__ b. What must you do to force residency of the resident-portion segments each time
the server is initialized?
8
2X
Set the value of the RESIDENT configuration parameter to 1.
se
ur
co
in
se
ru
Fo

© Copyright IBM Corp. 2001, 2011 Exercise 6. Managing Shared Memory 6-7
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises

ly
on
8 12
2X
se
ur
co
in
se
ru
Fo

6-8 Informix 11.7 System Admin © Copyright IBM Corp. 2001, 2011
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V5.4.0.3
Student Exercises

EXempty Exercise 7. Virtual Processors and Threads

What this exercise is about


In this exercise, students will monitor and configure virtual processors
and threads.

What you should be able to do


At the end of the exercise, you should be able to:
• Use the onstat command to monitor VP and thread activity.
• Use the VPCLASS configuration parameter to add virtual
processors and modify VP settings.

ly
• Use the NETTYPE parameter to configure communications

on
threads.

8 12
2X
se
ur
co
in
se
ru
Fo

© Copyright IBM Corp. 2001, 2011 Exercise 7. Virtual Processors and Threads 7-1
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises

7.1. Monitoring Virtual Processors and Threads


In this exercise, you will use the onstat utility to monitor virtual processor and thread
activity on your server. This utility is discussed in detail in the next module. Follow the
instructions and answer the questions provided. You will need the stores_demo database
that you created in a previous module for this exercise. If this database does not exist,
create it with the dbaccessdemo command.
__ 1. Run the command dbaccess stores_demo at the UNIX command line. This
command opens a new session on the server.
__ 2. Open another window and run onstat -g ath at the command line. This onstat
option lists all threads.
__ a. What threads are currently running?

__ b. How many poll threads are started?

ly
on
__ c. On what VPs are the poll threads running?

8 12
2X
__ d. Can you identify your session thread? What is the status of this thread?
se
ur

__ 3. Run onstat -g glo at the command line. This onstat option shows the VPs that have
been started for this server.
co

__ a. How many VPs are running?


in
se

__ b. What are the VP classes that are running?


ru
Fo

__ c. How many CPU VPs are running?

__ d. Is the dbspace that holds the logical and physical logs mirrored?

__ 4. An sqlexec thread is a session thread that runs on a CPU VP. From the output of
onstat -g ath command, count the number of sqlexec threads and the number of
CPU VPs. In a separate window, run dbaccess and connect to a database in the
server. Run onstat -g ath again and count the number of sqlexec threads and the
number of CPU VPs.
__ a. How does the output illustrate multithreading?

7-2 Informix 11.7 System Admin © Copyright IBM Corp. 2001, 2011
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V5.4.0.3
Student Exercises

EXempty __ 5. Run onstat -g ath.


__ a. Count the number of poll threads. How many are associated with shared
memory? How many with TLI or SOC? On what VPs are they running?

__ b. Count the number of listener threads. How many are associated with shared
memory? How many with TLI or SOC? On what VPs are they running?

__ c. Are there any disconnect threads? What communication mechanism are they
associated with? On what VPs are they running?

__ 6. The number of threads in the ready, wait, or sleep queue can be monitored using
onstat. If the ready queue increases over time, it might indicate that additional VPs
must be allocated.

ly
Run onstat -g rea (if there is no activity on your system, there will be no threads in

on
the ready queue), onstat -g wai, and onstat -g sle.

8 12
__ 7. Allocate an additional CPU VP by running onmode -p 1 cpu (make sure that you
2X
run onstat -g glo before the new VP is allocated).
se

__ a. Run onstat -g glo to identify the new CPU VP.


ur
co

__ b. Run onstat -g ath. Are there any threads running on the new CPU VP? See if
in

you can get a thread to start on the new VP.


se
ru

__ 8. Bring your database server to offline mode, configure a single user-defined virtual
processor called myvp. Bring the server back up to Online mode.
Fo

__ a. What entry did you make in the configuration file?

__ b. Verify that the new user-defined virtual processor was started. What command
did you use?

__ c. What threads are currently active under the new virtual processor?

__ d. With the server remaining online, add an additional myvp VP. Verify that the new
VP was started.

© Copyright IBM Corp. 2001, 2011 Exercise 7. Virtual Processors and Threads 7-3
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises

__ 9. Bring your server down again. Modify your configuration file so that both your shared
memory and TCP/IP poll threads are running on network VPs. Configure 2 poll
threads per VP and a limit of 70 users per poll thread. Bring the server online.
__ a. What entries did you make in your configuration file.

__ b. Verify that your network VPs have been started. What command did you use?

__ c. How many poll threads are active on your server? On what VP are they running?

__ 10. How many AIO VPs are currently running on your server?

__ a. Check your configuration file. How many AIO VPs are configured?

ly
on
__ b. Configure your server to run 2 AIO VPs. What entries did you make in the

12
configuration file?

8
2X
__ c. Restart the server and verify that only two AIO VPs are now running.
se
ur

__ d. What is the setting for the AUTO_AIOVPS configuration parameter on your


co

server? How does this setting affect the number of AIO VPs that are running?
in
se
ru
Fo

7-4 Informix 11.7 System Admin © Copyright IBM Corp. 2001, 2011
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V5.4.0.3
Student Exercises

EXempty 7.2. Matching Exercise


Match the term on the left with the correct definition on the right.

__ 1. ready queue __ a. Listen, poll, sqlexec.


__ 2. CPU __ b. The VP class that performs most disk reads and
__ 3. oninit writes to cooked chunks, or when kernel I/O is not on.

__ 4. context __ c. Operating system feature in which priority diminishes


over time.
__ 5. threads
__ d. VPCLASS option that allows a routine to run on a VP
__ 6. LIO without interruption.
__ 7. KIO thread __ e. Sets up session and thread control block for new
__ 8. AIO sessions.

ly
__ 9. affinity __ f. The VP class that performs writes to the logical log.

on
__ 10. process aging __ g. The VP executable name.

12
__ 11. TLI __ h. Program counter, stack pointer, registers.
__ 12. listen thread __ i.
8
A communications VP class.
2X
__ 13. noyield __ j. The VP class that performs most of the work for the
se

server.
ur

__ k. Sends requests to the kernel to perform the I/O.


co

__ l. Holds the context of threads waiting to run on a


in

process.
se

__ m. Allows processes to be assigned to specific CPUs.


ru
Fo

© Copyright IBM Corp. 2001, 2011 Exercise 7. Virtual Processors and Threads 7-5
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises

7.3. Solutions to Exercises

7.1. Monitoring Virtual Processors and Threads


__ 1. Run the command dbaccess stores_demo at the UNIX command line. This
command opens a new session on the server.
__ 2. Open another window and run onstat -g ath at the command line. This onstat
option lists all threads.
__ a. What threads are currently running?
Look for threads with running in the status column. You will see two
running threads: sm_poll and soctcppoll.
__ b. How many poll threads are started?
The poll threads end with ‘poll’: sm_poll and soctcppoll.
__ c. On what VPs are the poll threads running?

ly
on
The VP on which the thread is running is listed in the vp-class column. The
sm_poll thread is running on the CPU VP and the soctcppoll thread is

12
running on the TLI VP.
8
__ d. Can you identify your session thread? What is the status of this thread?
2X
Your session thread appears as an sqlexec thread and probably has a
se

status of cond_wait.
ur

__ 3. Run onstat -g glo at the command line. This onstat option shows the VPs that have
co

been started for this server.


in

__ a. How many VPs are running?


se

At the bottom of the Virtual processor summary section, the total number of
ru

VPs are listed on the total line. You can also count the VPs listed in the
Individual virtual processors section.
Fo

__ b. What are the VP classes that are running?


The VP classes are displayed in the left column of the Virtual processor
summary section. VP classes that are running contain a value greater than
zero in the vps column.
__ c. How many CPU VPs are running?
The number of CPU VPs are listed on the cpu line.
__ d. Is the dbspace that holds the logical and physical logs mirrored?
If only one PIO and LIO VP are started, then the logs are not mirrored.
__ 4. An sqlexec thread is a session thread that runs on a CPU VP. From the output of
onstat -g ath command, count the number of sqlexec threads and the number of
CPU VPs. In a separate window, run dbaccess and connect to a database in the

7-6 Informix 11.7 System Admin © Copyright IBM Corp. 2001, 2011
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V5.4.0.3
Student Exercises

EXempty server. Run onstat -g ath again and count the number of sqlexec threads and the
number of CPU VPs.
__ a. How does the output illustrate multithreading?
By connecting to a database, you have started a session and created an
sqlexec thread. There are no new CPU VPs (processes) initiated. Multiple
sqlexec threads are run by a single CPU VP. This is an example of fan-in.
__ 5. Run onstat -g ath.
__ a. Count the number of poll threads. How many are associated with shared
memory? How many with TLI or SOC? On what VPs are they running?
The number of poll threads, and the VPs on which they run, is entirely
dependent on the system configuration. Poll threads run either on the CPU
VP or on a network VP (TLI or SOC). For every network VP, there is one poll
thread.
__ b. Count the number of listener threads. How many are associated with shared

ly
memory? How many with TLI or SOC? On what VPs are they running?

on
Listener threads (sm_listen or soctcplst) generally run on the CPU VP. The

12
number depends on the system configuration.
8
__ c. Are there any disconnect threads? What communication mechanism are they
2X
associated with? On what VPs are they running?
se

This is also dependent on the system configuration. Shared memory


ur

communication has disconnect threads and TLI/SOC does not. An


co

sm_discon thread is used to clean up a session when the connection is


closed or the client dies.
in

__ 6. The number of threads in the ready, wait, or sleep queue can be monitored using
se

onstat. If the ready queue increases over time, it might indicate that additional VPs
ru

must be allocated.
Fo

__ a. Run onstat -g rea (if there is no activity on your system, there will be no threads
in the ready queue), onstat -g wai, and onstat -g sle.
__ 7. Allocate an additional CPU VP by running onmode -p 1 cpu (make sure that you
run onstat -g glo before the new VP is allocated).
__ a. Run onstat -g glo to identify the new CPU VP.
__ b. Run onstat -g ath. Are there any threads running on the new CPU VP? See if
you can get a thread to start on the new VP.
You might not see any threads running on the new CPU VP. The easiest
way to start a thread on the new VP is to exit and restart one of your
dbaccess sessions. This causes an sqlexec thread to run on the new CPU
VP.

© Copyright IBM Corp. 2001, 2011 Exercise 7. Virtual Processors and Threads 7-7
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises

__ 8. Bring your database server to offline mode, configure a single user-defined virtual
processor called myvp. Bring the server back up to Online mode.
__ a. What entry did you make in the configuration file?
VPCLASS myvp,num=1
__ b. Verify that the new user-defined virtual processor was started. What command
did you use?
Run the onstat -g glo command and look for a virtual processor called myvp.
__ c. What threads are currently active under the new virtual processor?
Run the onstat -g ath command and look for threads that have a value of
#myvp in the vp-class column.
__ d. With the server remaining online, add an additional myvp VP. Verify that the new
VP was started.
Use the command, onmode -p 1 myvp. Verify by running onstat -g glo.

ly
on
__ 9. Bring your server down again. Modify your configuration file so that both your shared
memory and TCP/IP poll threads are running on network VPs. Configure 2 poll

12
threads per VP and a limit of 70 users per poll thread. Bring the server online.
__ a. What entries did you make in your configuration file. 8
2X
NETTYPE ipcshm,2,70,NET
se

NETTYPE soctcp,2,70,NET
ur

__ b. Verify that your network VPs have been started. What command did you use?
co

Use the onstat -g glo command and look for network VP classes in the
in

vp-class column.
se

__ c. How many poll threads are active on your server? On what VP are they running?
ru

Run onstat -g ath. There are four poll threads, two running on each of the
network virtual processors.
Fo

__ 10. How many AIO VPs are currently running on your server?
Run onstat -g glo to determine the number of AIO VPs.
__ a. Check your configuration file. How many AIO VPs are configured?
The number of AIOs is configured by adding an additional VPCLASS entry.
Since a VPCLASS parameter is not configured for AIO VPS, a default value
is used. The default number of AIO VPs allocated is (2 * num_of_chunks) or
6, whichever is greater.
__ b. Configure your server to run 2 AIO VPs. What entries did you make in the
configuration file?
VPCLASS aio,num=2
__ c. Restart the server and verify that only two AIO VPs are now running.

7-8 Informix 11.7 System Admin © Copyright IBM Corp. 2001, 2011
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V5.4.0.3
Student Exercises

EXempty Verify by running onstat -g glo.


__ d. What is the setting for the AUTO_AIOVPS configuration parameter on your
server? How does this setting affect the number of AIO VPs that are running?
The AUTO_AIOVPS parameter is set to 1 (enabled) by default. The purpose
of the automatic AIO VP tuning feature is to allow the server to
automatically allocated additional AIO VPs when it determines they are
needed to improve performance.

7.2. Matching Exercise

l 1. ready queue __ a. Listen, poll, sqlexec.


j 2. CPU __ b. The VP class that performs most disk reads and
writes to cooked chunks, or when kernel I/O is not on.
g 3. oninit

ly
__ c. Operating system feature in which priority diminishes
h 4. context

on
over time.
a 5. threads

12
__ d. VPCLASS option that allows a routine to run on a VP
f 6. LIO without interruption.
8
2X
k 7. KIO thread __ e. Sets up session and thread control block for new
b 8. AIO sessions.
se

m 9. affinity __ f. The VP class that performs writes to the logical log.


ur

__ g. The VP executable name.


co

c 10. process aging


i 11. TLI __ h. Program counter, stack pointer, registers.
in

__ i. A communications VP class.
se

e 12. listen thread


__ j. The VP class that performs most of the work for the
ru

d 13. noyield
server.
Fo

__ k. Sends requests to the kernel to perform the I/O.


__ l. Holds the context of threads waiting to run on a
process.
__ m. Allows processes to be assigned to specific CPUs.

© Copyright IBM Corp. 2001, 2011 Exercise 7. Virtual Processors and Threads 7-9
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises

ly
on
8 12
2X
se
ur
co
in
se
ru
Fo

7-10 Informix 11.7 System Admin © Copyright IBM Corp. 2001, 2011
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V5.4.0.3
Student Exercises

EXempty Exercise 8. Disk Architecture

What this exercise is about


In this exercise, students will examine various disk components of the
Informix architecture.

What you should be able to do


At the end of the exercise, you should be able to:
• Use the oncheck command to check and view various disk
structures within the database server.

ly
on
8 12
2X
se
ur
co
in
se
ru
Fo

© Copyright IBM Corp. 2001, 2011 Exercise 8. Disk Architecture 8-1


Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises

8.1. Using Informix Tools to Study Informix Architecture


Use dbaccess and the command-line utility oncheck to complete the following exercise.
__ 1. Reinitialize your database server (that is, recreate your instance, do not just reboot).
Use onmode -yuck to bring the server down. Clear out the contents of your cooked
file by running the command:
cat /dev/null > /home/informix/rootchunk
Run oninit -ivy to reinitialize the server.

Note

When you initialize your instance, wait for the sysmaster, sysutils, and sysadmin
databases to be created before executing an oncheck command. Monitor your message
log for the messages indicating that these databases were built successfully. You can
monitor your message log using onstat -rm.

ly
on
12
__ 2. Execute oncheck -pe | more. This is called the extent report.

8
__ a. Using the output from oncheck -pe, determine how much space is allocated to
2X
the following structures:
se

reserved pages __________ logical log (each) __________


chunk free-list page __________ database tblspace __________
ur

tblspace tblspace __________ sysmaster.syscolumns __________


co

physical log __________ sysadmin.mon_table_names __________


in
se

Hint
ru

Try using commands that extract the specific information you need. For example:
Fo

oncheck -pe | grep sysmaster

__ b. What unit of measure does oncheck -pe use to display information?

__ 3. Create a database using the Query language option of dbaccess:


CREATE DATABASE new_db;
__ 4. Execute oncheck -pe | more. What structures did you create during Step #3?

__ 5. Create a table in your database using the Query language option of dbaccess:
CREATE TABLE new_table(col1 CHAR(800));

8-2 Informix 11.7 System Admin © Copyright IBM Corp. 2001, 2011
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V5.4.0.3
Student Exercises

EXempty __ 6. Execute oncheck -pT new_db:new_table | more. This is the tblspace disk
utilization report. Notice that when a table is newly created, there are no extents or
pages allocated for the table.
__ 7. Insert a row into your new table using the Query language option of dbaccess:
INSERT INTO new_table VALUES ("1st row");
__ 8. Execute oncheck -pT new_db:new_table | more. Notice that the number of pages
used is 2 and that there is one row. Also notice that the unused data bytes per page
still totals 412. What do the 2 used pages contain?

__ 9. Insert 2 more rows into new_table. Use the same or different values. 
Execute: oncheck -pT new_db:new_table | more.
__ a. Why are there three used pages?

ly
__ b. Why is the total number of unused data bytes 824?

on
12
__ 10. The following is a calculation of the byte usage per data page:
8
2X
Utilized by Space used (bytes)
data = 2 (rows) * 800 (bytes) 1600
se

header 24
ur

time stamp 4
co

slot table = 2(rows) *


8
4(bytes)
in
se

total 1636
ru

unused bytes = 2048 - 1636 412


Fo

__ 11. Alter the table and add an additional column using the Query language option of
dbaccess:
ALTER TABLE new_table ADD (col2 CHAR(1600));
UPDATE new_table SET col2 = "Hello";
__ 12. Execute oncheck -pT new_db:new_table | more. What is the new type of page
that is allocated and why?
__ 13. Create a table using the Query language option of dbaccess:
CREATE TABLE tab2 (col1 CHAR(255));
__ 14. Create an index on tab2 using the Query language option of dbaccess:
CREATE INDEX idx_tab2 ON tab2(col1);

© Copyright IBM Corp. 2001, 2011 Exercise 8. Disk Architecture 8-3


Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises

__ 15. Insert a row into tab2 using the Query language option of dbaccess:
INSERT INTO tab2 values ("1");
__ 16. Execute oncheck -pe. How has the distribution of extents changed?

__ 17. Execute oncheck -pT new_db:tab2 | more.


__ a. How many pages have been used for the table? What do they contain?

__ b. How many pages have been used for the index? What do they contain?

__ c. How many unused data bytes are there in the index?

__ d. How has the output changed since adding the index?

ly
on
12
__ 18. The following is a calculation of the byte usage per index page:
Utilized by
8
Space used (bytes)
2X
key 255
header 24
se

timestamp 4
ur

slot table 4
co

rowid 4
delete flag 1
in

total 292
se

unused bytes = 2048 - 292 1756


ru

__ 19. Insert 7 more rows into tab2 using different values for each row (for example, 2, 3, 4,
Fo

5, 6, 7, 8).
__ 20. Execute oncheck -pT new_db:tab2 | more. What is different about the space that
has been allocated to the index?

8-4 Informix 11.7 System Admin © Copyright IBM Corp. 2001, 2011
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V5.4.0.3
Student Exercises

EXempty 8.2. Solution to Exercise


Use dbaccess and the command-line utility oncheck to complete the following exercise.
The solutions provided assume a 2-kilobyte page size.
__ 1. Reinitialize your database server (that is, recreate your instance, do not just reboot).
Use onmode -yuck to bring the server down. Clear out the contents of your cooked
file by running the command:
cat /dev/null > /home/informix/rootchunk
Run oninit -ivy to reinitialize the server.
__ 2. Execute oncheck -pe | more. This is called the extent report.
__ a. Using the output from oncheck -pe, determine how much space is allocated to
the following structures:
reserved pages 12 pages logical log (each) LOGSIZE

ly
chunk free-list page 1 page database tblspace 4 pages

on
tblspace tblspace 250 pages sysmaster.syscolumns 128 pages
physical log PHYSFILE sysadmin.mon_table_names 16 pages

12
Note that the database tblspace extent is listed as
8
2X
sysmaster:’informix’.sysdatabases.
__ b. What unit of measure does oncheck -pe use to display information?
se

The report displays information in number of pages. To determine the page


ur

size, enter onstat -b at the command line and locate the buffer size in the
co

summary line at the end of the report.


in

__ 3. Create a database using the Query language option of dbaccess:


se

CREATE DATABASE new_db;


ru

__ 4. Execute oncheck -pe | more. What structures did you create during Step #3?
Fo

Extents were allocated for the system catalog tables for the new_db database.
__ 5. Create a table in your database using the Query language option of dbaccess:
CREATE TABLE new_table(col1 CHAR(800));
__ 6. Execute oncheck -pT new_db:new_table | more. This is the tblspace disk
utilization report. Notice that when a table is newly created, there are no extents or
pages allocated for the table.
__ 7. Insert a row into your new table using the Query language option of dbaccess:
INSERT INTO new_table VALUES ("1st row");
__ 8. Execute oncheck -pT new_db:new_table | more. Notice that the number of pages
used is 2 and that there is one row. Also notice that the unused data bytes per page
still totals 412. What do the 2 used pages contain?

© Copyright IBM Corp. 2001, 2011 Exercise 8. Disk Architecture 8-5


Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises

One page is a bitmap page; the other page is a data page.


__ 9. Insert 2 more rows into new_table. Use the same or different values.
Execute: oncheck -pT new_db:new_table | more.
__ a. Why are there 3 used pages?
The last row inserted could not fit on the first data page. An additional data
page was allocated to store the row. A data row is not split across multiple
pages unless:
- The row is larger than the data page
- A variable character column is expanded and, as a result, the row does
not fit on the page
__ b. Why is the total number of unused data bytes 824?
There are 412 bytes on each data page that are never used, based on the
page overhead and the length of the row.

ly
__ 10. The following is a calculation of the byte usage per data page:

on
Utilized by Space used (bytes)

12
data = 2 (rows) * 800 (bytes) 1600
header 24
8
2X
time stamp 4
slot table = 2(rows) *
se

8
4(bytes)
ur
co

total 1636
unused bytes = 2048 - 1636 412
in
se

__ 11. Alter the table and add a column using the Query language option of dbaccess:
ru

ALTER TABLE new_table ADD (col2 CHAR(1600));


UPDATE new_table SET col2 = "Hello";
Fo

__ 12. Execute oncheck -pT new_db:new_table | more. What is the new type of page
that is allocated and why?
The new type of page is a remainder page. It is created because the row size is
now larger than the page size. Each row consumes a single page and a
portion of a remainder page. Multiple rows can share the same remainder
page.
__ 13. Create a table using the Query language option of dbaccess:
CREATE TABLE tab2 (col1 CHAR(255));
__ 14. Create an index on tab2 using the Query language option of dbaccess:
CREATE INDEX idx_tab2 ON tab2(col1);

8-6 Informix 11.7 System Admin © Copyright IBM Corp. 2001, 2011
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V5.4.0.3
Student Exercises

EXempty __ 15. Insert a row into tab2 using the Query language option of dbaccess:
INSERT INTO tab2 values ("1");
__ 16. Execute oncheck -pe. How has the distribution of extents changed?
A new extent has been allocated consisting of 6 pages for the index extent.
__ 17. Execute oncheck -pT new_db:tab2 | more.
__ a. How many pages have been used for the table? What do they contain?
Two pages have been used: one bitmap page and one data page.
__ b. How many pages have been used for the index? What do they contain?
Two pages have been used: one bitmap page and one index page.
__ c. How many unused data bytes are there in the index?
There are 1,756 unused data bytes in the index.
__ d. How has the output changed since adding the index?

ly
on
Information about the index extent is now included in the oncheck output.

12
__ 18. The following is a calculation of the byte usage per index page:
Utilized by
8
Space used (bytes)
2X
key 255
header 24
se

timestamp 4
ur

slot table 4
co

rowid 4
delete flag 1
in

total 292
se

unused bytes = 2048 - 292 1756


ru

__ 19. Insert 7 more rows into tab2 using different values for each row (for example, 2, 3, 4,
Fo

5, 6, 7, 8).
__ 20. Execute oncheck -pT new_db:tab2 | more. What is different about the space that
has been allocated to the index?
By adding an additional 7 rows, the first index page is filled and a b+-tree node
split occurs. The output from oncheck indicates that there are now 2 levels to
the index.

© Copyright IBM Corp. 2001, 2011 Exercise 8. Disk Architecture 8-7


Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises

ly
on
8 12
2X
se
ur
co
in
se
ru
Fo

8-8 Informix 11.7 System Admin © Copyright IBM Corp. 2001, 2011
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V5.4.0.3
Student Exercises

EXempty Exercise 9. Managing and Monitoring Disk Space

What this exercise is about


In this exercise, students will use Informix tools to create and modify
disk space components.

What you should be able to do


At the end of the exercise, you should be able to:
• Use the onspaces command to create and modify dbspaces,
sbspaces, chunks, and mirror chunks.

ly
on
8 12
2X
se
ur
co
in
se
ru
Fo

© Copyright IBM Corp. 2001, 2011 Exercise 9. Managing and Monitoring Disk Space 9-1
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises

9.1. Adding Spaces and Chunks to Database Server


In this exercise, you will create various spaces and add chunks to these spaces using the
onspaces command.
__ 1. Create the following cooked files in your home directory: temp_space, log_space,
data_space1, data_space2, mdata_space1, mdata_space2, sb_space1, and
msb_space1. Make sure that the cooked files have correct permissions.
__ 2. Edit your configuration file to enable mirroring on your server by setting MIRROR to
a value of 1 and removing the default value of MIRRORPATH. Set the value of
DBSPACETEMP to tempdbs. Reinitialize server shared memory by bringing your
server offline and back online.
__ 3. Add a tempdbs dbspace using one of the new cooked files you created. Do not
mirror the dbspace. Make the initial chunk 5000 kilobytes.

ly
__ 4. Create a dbspace named logspace. Make the initial chunk 50,000 kilobytes. (This

on
dbspace will be used in a future exercise.) Do not mirror the dbspace.

8 12
__ 5. Create a dbspace named dbspace1. Make the initial chunk 8000 kilobytes with a
2X
page size of 8 KB. Mirror the dbspace.
se
ur

__ 6. Add an 8000-kilobyte chunk to dbspace1. Note that this chunk must be mirrored
co

because the dbspace is mirrored.


in
se

__ 7. Add a 10,000-kilobyte mirrored sbspace called sbspace1, with a 1500-kilobyte


metadata area and a 600-kilobyte metadata offset. Assume an expected average
ru

smart-large-object size of 16 kilobytes.


Fo

__ 8. Using onstat, determine the number of pages used in dbspace1.

__ 9. Create the demonstration database again in your dbspace1 dbspace by entering:


dbaccessdemo -log -dbspace dbspace1
Answer N to abort when you are prompted by the script.
__ 10. Run onstat -b.
__ a. How many buffer pools exist now?
__ b. What is the page size for each?
__ c. Was a change made in the onconfig file?

9-2 Informix 11.7 System Admin © Copyright IBM Corp. 2001, 2011
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V5.4.0.3
Student Exercises

EXempty 9.2. Solution to Exercise


__ 1. Create the following cooked files in your home directory: temp_space, log_space,
data_space1, data_space2, mdata_space1, mdata_space2, sb_space1, and
msb_space1. Make sure that the cooked files have correct permissions.
cd
touch temp_space; chmod 660 temp_space
touch log_space; chmod 660 log_space
touch data_space1; chmod 660 data_space1
touch data_space2; chmod 660 data_space2
touch mdata_space1; chmod 660 mdata_space1
touch mdata_space2; chmod 660 mdata_space2
touch sb_space1; chmod 660 sb_space1
touch msb_space1; chmod 660 msb_space1
__ 2. Edit your configuration file to enable mirroring on your server by setting MIRROR to

ly
a value of 1 and removing the default value of MIRRORPATH. Set the value of

on
DBSPACETEMP to tempdbs. Reinitialize server shared memory by bringing your
server offline and back online.

12
__ 3. Add a tempdbs dbspace using one of the new cooked files you created. Do not
8
mirror the dbspace. Make the initial chunk 5000 kilobytes.
2X
onspaces -c -d tempdbs -t -p /home/informix/temp_space -o 0 -s 5000
se

__ 4. Create a dbspace named logspace. Make the initial chunk 50,000 kilobytes. (This
ur

dbspace will be used in a future lab exercise.) Do not mirror the dbspace.
co

onspaces -c -d logspace -p /home/informix/log_space -o 0 -s 50000


in

__ 5. Create a dbspace named dbspace1. Make the initial chunk 8000 kilobytes with a
se

page size of 8 KB. Mirror the dbspace.


ru

onspaces -c -d dbspace1 -p /home/informix/data_space1 -o 0 -s 8000


-k 8 -m /home/informix/mdata_space1 0
Fo

__ 6. Add an 8000-kilobyte chunk to dbspace1. Note that this chunk must be mirrored
because the dbspace is mirrored.
onspaces -a dbspace1 -p /home/informix/data_space2 -o 0 -s 8000
-m /home/informix/mdata_space2 0
__ 7. Add a 10,000-kilobyte mirrored sbspace called sbspace1, with a 1500-kilobyte
metadata area and a 600-kilobyte metadata offset. Assume an expected average
smart-large-object size of 16 kilobytes.
onspaces -c -S sbspace1 -p /home/informix/sb_space1 -o 0 -s 10000
-m /home/informix/msb_space1 0 -Ms 1500 -Mo 600
-Df "AVG_LO_SIZE=16"

© Copyright IBM Corp. 2001, 2011 Exercise 9. Managing and Monitoring Disk Space 9-3
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises

__ 8. Using onstat, determine the number of pages used in dbspace1.


onstat -d
Your onstat output should look something like this:

IBM Informix Dynamic Server Version 11.70.UC1DE -- On-Line -- Up 00:06:14 --


243700 Kbytes
Dbspaces
address number flags fchunk nchunks pgsize flags owner name
4b044818 1 0x60001 1 1 2048 N BA informix rootdbs
4ca5ed00 2 0x42001 2 1 2048 N TBA informix tempdbs
4cb28630 3 0x60001 3 1 2048 N BA informix logspace
4cc66058 4 0x60002 4 2 8192 M BA informix dbspace1
4cc35400 5 0x68002 6 1 2048 M SBA informix sbspace1
5 active, 2047 maximum
Chunks
address chunk/dbs offset size free bpages flags pathname
4b044988 1 1 0 50000 16357 PO-B-- /home/informix/rootchunk
4c9f9018 2 2 0 2500 2447 PO-B-- /home/informix/temp_space
4cc41030 3 3 0 25000 24947 PO-B-- /home/informix/log_space
4cc661c8 4 4 0 1000 947 PO-B-- /home/informix/data_space1
4cc06450 4 4 0 1000 0 MO-B-- /home/informix/mdata_space1

ly
4cc35030 5 4 0 1000 997 PO-B-- /home/informix/data_space2

on
4cc35218 5 4 0 1000 0 MO-B-- /home/informix/mdata_space2
4cc35570 6 5 0 5000 4197 4197 POSB-- /home/informix/sb_space1
Metadata 750 697 750

12
4cc41a00 6 5 0 5000 0 0 MOSB-- /home/informix/msb_space1
6 active, 32766 maximum
8
2X
__ 9. Create the demonstration database again in your dbspace1 dbspace by entering:
se

dbaccessdemo -log -dbspace dbspace1


ur
co

Answer N to abort when you are prompted by the script.


__ 10. Run onstat -b.
in

__ a. How many buffer pools exist now?


se
ru

Run onstat -g buf. Two buffer pools now exist.


__ b. What is the page size for each?
Fo

The first buffer pool has the default page size for the critical dbspace
pagesize, and the second buffer pool has a pagesize equal to the one you
used to create new dbspaces (8K).
__ c. Was a change made in the onconfig file?
Yes. Another BUFFERPOOL configuration parameter was added to the end
of the file with a new pagesize and the default values for the rest of the
fields.

9-4 Informix 11.7 System Admin © Copyright IBM Corp. 2001, 2011
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V5.4.0.3
Student Exercises

EXempty Exercise 10. Physical and Logical Logging

What this exercise is about


In this exercise, students will create, modify, and configure the
physical log and logical log files.

What you should be able to do


At the end of the exercise, you should be able to:
• Add logical logs
• Move and resize the physical log file

ly
on
8 12
2X
se
ur
co
in
se
ru
Fo

© Copyright IBM Corp. 2001, 2011 Exercise 10. Physical and Logical Logging 10-1
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises

10.1. Adding Logical Logs


In this exercise, you will add logical logs to the logspace dbspace that you created in the
last exercise and drop the logical logs located in the rootdbs dbspace. To do this, you will
perform an archive using the ontape utility. The ontape utility is covered in detail in a later
exercise.
Using onparams, perform the following:
__ 1. Add six new logical logs to the logspace dbspace.
__ 2. Look at the status of the logical logs. What does the A flag indicate?

__ 3. Drop the logical logs located in the rootdbs dbspace. The current log in use in the
rootdbs dbspace must be switched to the next logical log located in your logspace
dbspace using the onmode command described earlier in this module. There must
be at least three usable logs in a system at any given time.

ly
on
12
Moving the physical log
8
2X
__ 4. Move the physical log to the dbspace logspace using the onparams utility. Be
prepared to discuss any difficulties encountered with the class.
se

How can you verify that the physical log was moved to the new dbspace?
ur
co
in
se
ru
Fo

10-2 Informix 11.7 System Admin © Copyright IBM Corp. 2001, 2011
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V5.4.0.3
Student Exercises

EXempty 10.2. Using onlog (Optional exercise)


In this exercise, you will use the onlog utility to view logical log records. Refer to the
Interpreting Logical Log Records chapter of the IBM Informix Administrator’s Reference
for information about the structure of individual logical log record types.
__ 1. To generate some transactions in the logical logs, run the following command:
dbaccessdemo -log -dbspace dbspace1
Answer N to abort when you are prompted by the script.
__ 2. Execute the onlog utility on the current log and redirect the contents to a file:
onlog > onlog.out
__ 3. View the onlog output file. Find the last row that was inserted into a database
(HINSERT).
__ a. What subentries are provided for this log record?

ly
on
__ b. On what table was the INSERT statement operating?

8 12
Hint
2X
Perform a query on the systabnames table in the sysmaster database.
se
ur
co
in

__ 4. Find the approximate time of the last checkpoint. Were there any open transactions
at the time of the last checkpoint?
se
ru

__ 5. Locate a CHALLOC record in the output file.


Fo

__ a. What is the purpose of a CHALLOC transaction?

__ b. With what SQL command is a CHALLOC most likely to be associated?

__ c. What subentry information is provided with the CHALLOC record?

© Copyright IBM Corp. 2001, 2011 Exercise 10. Physical and Logical Logging 10-3
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises

10.3. Solutions to Exercises

10.1. Adding Logical Logs


__ 1. Add six new logical logs to the logspace dbspace.
Execute the following command six times:
onparams -a -d logspace
__ 2. Look at the status of the logical logs. What does the A flag indicate?
The A flag indicates the logs that are newly added.
__ 3. Drop the logical logs located in the rootdbs dbspace. The current log in use in the
rootdbs dbspace must be switched to the next logical log located in your logspace
dbspace using the onmode command described earlier in this module. There must
be at least three usable logs in a system at any given time.
Run onstat -l to see which log is current. Run onmode -l to advance to the first

ly
log in logspace. Make sure that the current checkpoint is in the current log by

on
running onmode -c. Drop the logical logs in the rootdbs by running the

12
command onparams -d -l lognum where lognum is the logical log file number.

8
2X
Moving the physical log
se

__ 4. Move the physical log to the dbspace logspace using the onparams utility. Be
prepared to discuss any difficulties encountered with the class.
ur
co

onparams -p -s 14000 -d logspace


How can you verify that the physical log was moved to the new dbspace?
in

oncheck -pe logspace


se
ru
Fo

10.2. Using onlog (Optional exercise)


__ 1. To generate some transactions in the logical logs, run the following command:
dbaccessdemo -log -dbspace dbspace1
Answer N to abort when you are prompted by the script.
__ 2. Execute the onlog utility on the current log and redirect the contents to a file:
onlog > onlog.out
__ 3. View the onlog output file. Find the last row that was inserted into a database
(HINSERT).
__ a. What subentries are provided for this log record?

10-4 Informix 11.7 System Admin © Copyright IBM Corp. 2001, 2011
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V5.4.0.3
Student Exercises

EXempty The subentries for the HINSERT record are the tblspace ID number, the
rowid number, and the slot length (the length of the row that is being
inserted).
__ b. On what table was the INSERT statement operating?

Hint

Perform a query on the systabnames table in the sysmaster database.)

Use the following query as an example:


SELECT * FROM systabnames
WHERE hex(partnum) = "0x0040000F";
The tblspace ID number (partnum) must be in the format shown.

ly
__ 4. Find the approximate time of the last checkpoint. Were there any open transactions

on
at the time of the last checkpoint?

12
To find the last checkpoint, search for a CKPOINT entry from the bottom of the
file. Date and time information is not provided for a CKPOINT entry, but is for
8
2X
BEGIN and COMMIT entries. The subentry field for the number of open
transactions is in the last column of the CKPOINT entry. If there are one or
se

more open transactions, then information about each open transaction is also
provided.
ur
co

__ 5. Locate a CHALLOC record in the output file.


in

__ a. What is the purpose of a CHALLOC transaction?


se

The CHALLOC record indicates an extent was allocated within a chunk.


ru

__ b. With what SQL command is a CHALLOC most likely to be associated?


Fo

Depending on the CHALLOC record you located, the associated SQL


statement might not be clear. Most of the time, a CHALLOC occurs as the
result of an INSERT statement.
__ c. What subentry information is provided with the CHALLOC record?
The CHALLOC record includes subentry information for the page number
and the size of the extent that is allocated.

© Copyright IBM Corp. 2001, 2011 Exercise 10. Physical and Logical Logging 10-5
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises

ly
on
8 12
2X
se
ur
co
in
se
ru
Fo

10-6 Informix 11.7 System Admin © Copyright IBM Corp. 2001, 2011
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V5.4.0.3
Student Exercises

EXempty Exercise 11. The Shared Memory Buffer Pool

What this exercise is about


In this exercise, students will use Informix utilities to monitor the
shared memory buffer pool, and to monitor checkpoint activity.

What you should be able to do


At the end of the exercise, you should be able to:
• Analyze onstat reports to learn about buffer pool activity
• Use the onstat and oncheck utilities to analyze checkpoints

ly
on
8 12
2X
se
ur
co
in
se
ru
Fo

© Copyright IBM Corp. 2001, 2011 Exercise 11. The Shared Memory Buffer Pool 11-1
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises

11.1. Monitoring Checkpoint Activity


In this exercise, you will monitor your server as you perform various tasks related to
reading pages into the shared memory buffer pool, checkpoints, and flushing buffer pool
pages to disk. Additional information is also provided for you to read as you perform the
required tasks.
__ 1. Bring your server to Offline mode and back up to Online mode. This allows you to
start with a clean shared memory buffer pool.
__ 2. Run the command onstat -B | more. This command lists all of the pages that are
currently in the shared memory buffer pool.
__ 3. Refer to The onstat Utility chapter of the Informix Administrator’s Reference. Look
for the section that describes the column values of onstat -b command (these are
the same as the onstat -B command).

Note

ly
on
Flag values in Informix are displayed as hexadecimal representations of a series of binary
switches that are either turned on or off. This allows a single flag to simultaneously

12
contain multiple flag settings. At the hexadecimal level, that is, what you see in a report
8
output, the flag value is determined by adding up all of the setting states. For example, a
2X
pgflgs value of 70 represents the sum of three different page type values: 40 + 20 + 10. A
se

buffer with a pgflgs value of 70 is a B+ tree (index) node page, root-node page, and a
branch-node page. As you will learn in a later exercise, this is possible because there is
ur

only one level in the B+ tree.


co
in
se

What are some of the page types you see listed in the pgflgs column of your report?
Why do you suppose these pages were read into shared memory when you started
ru

your server?
Fo

__ 4. Run the command dbaccessdemo bufftest. If necessary, use the -dbspace option
to specify a target dbspace for the database. Answer N to the prompt to copy
example files.
__ 5. Run the onstat -B | more command again. See if you can identify the new pages
that are written to the shared memory buffer.
__ 6. Run the onstat -m command to view the last few lines of your message log. When
did the last checkpoint occur on your server?

11-2 Informix 11.7 System Admin © Copyright IBM Corp. 2001, 2011
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V5.4.0.3
Student Exercises

EXempty
Note

The message log provides you with a lot of information about checkpoints. In addition to
telling you the time each checkpoint occurred, it also shows how long it took to complete
the checkpoint.
In a separate message log entry, information about where the checkpoint log record is
written. The loguniq value is the unique ID number of the logical log where the checkpoint
record was written and the logpos value is an encoded address indicating the page
number and byte offset within that page indicating the exact location of the checkpoint
record.

__ 7. Run the onstat -l command to view the log status report.


__ a. What is the unique ID number of the current logical log?

ly
on
__ b. What logical log contains the last checkpoint record?

8 12
2X
__ 8. Run the onmode -l command to advance to the next logical log. Run onstat -l to
verify that the current logical log has changed.
se

__ 9. Run the command: oncheck -pr | more. This command displays information from
ur

the system reserved pages. Scroll down until you see the heading, Validating
co

PAGE_1CKPT & PAGE_2CKPT. This portion of the report provides information


about the last checkpoint that occurred on your server and provides information
in

about each logical log.


se

__ a. What is shown as the Logical log unique identifier?


ru
Fo

__ b. What is the Logical log position at Ckpt?

__ c. What is the significance of the Physical-log position at Ckpt?

Note

The oncheck -pr command prints a report directly from information on disk. Unlike the
onstat commands demonstrated above, the oncheck -pr command can be run when the
server is in Offline mode.

© Copyright IBM Corp. 2001, 2011 Exercise 11. The Shared Memory Buffer Pool 11-3
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises

__ d. Why is it important to know which logical log contains the last checkpoint record?

__ e. What can you do to write a checkpoint to the current logical log? Go ahead and
execute the command. Run onstat -l and onstat -m to verify the checkpoint.

__ 10. Run the onstat -g ckp command to display a checkpoint history report. (You might
need to cut/paste the report into a text editor and set to a small font size in order to
view the report clearly.) How many checkpoints are shown? How many are
nonblocking checkpoints? How many are blocking?

ly
on
8 12
2X
se
ur
co
in
se
ru
Fo

11-4 Informix 11.7 System Admin © Copyright IBM Corp. 2001, 2011
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V5.4.0.3
Student Exercises

EXempty 11.2. Solution to Exercise


__ 1. Bring your server to Offline mode and back up to Online mode. This allows you to
start with a clean shared memory buffer pool.
__ 2. Run the command onstat -B | more. This command lists all of the pages that are
currently in the shared memory buffer pool.
__ 3. Refer to The onstat Utility chapter of the Informix Administrator’s Reference. Look
for the section that describes the column values of onstat -b command (these are
the same as the onstat -B command).
What are some of the page types you see listed in the pgflgs column of your report?
Why do you suppose these pages were read into shared memory when you started
up your server?
You are likely to see reserved pages (0x1000), chunk free-list pages (0x8),
tblspace pages (0x2—these are pages from the tblspace tblspace), free-list
pages (0x4—these are also known as bit-map pages), and physical log

ly
on
pages (0x800). The server reads the reserved pages so that it can find the
information it needs to initialize the server. All other pages are read into

12
shared memory automatically because they contain information that is
frequently used.
8
2X
__ 4. Run the command dbaccessdemo bufftest. If necessary, use the -dbspace option
to specify a target dbspace for the database. Answer N to the prompt to copy
se

example files.
ur

__ 5. Run the onstat -B | more command again. See if you can identify the new pages
co

that are written to the shared memory buffer.


in

__ 6. Run the onstat -m command to view the last few lines of your message log. When
se

did the last checkpoint occur on your server?


ru

Look for a line in the message log that begins with Checkpoint Completed.
Fo

__ 7. Run the onstat -l command to view the log status report.


__ a. What is the unique ID number of the current logical log?
The current logical log is the one that has a C in the flags column.
__ b. What logical log contains the last checkpoint record?
The logical log that contains the last checkpoint has an L in the flags
column.
__ 8. Run the onmode -l command to advance to the next logical log. Run onstat -l to
verify that the current logical log has changed.
__ 9. Run the command: oncheck -pr | more. This command displays information from
the system reserved pages. Scroll down until you see the heading, Validating
PAGE_1CKPT & PAGE_2CKPT. This portion of the report provides information

© Copyright IBM Corp. 2001, 2011 Exercise 11. The Shared Memory Buffer Pool 11-5
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises

about the last checkpoint that occurred on your server and provides information
about each logical log.
__ a. What is shown as the Logical log unique identifier?
The logical log unique ID should be the same as the loguniq value from the
message log.
__ b. What is the Logical log position at Ckpt?
The logical log position at checkpoint should be the same as the logpos
value from the message log.
__ c. What is the significance of the Physical-log position at Ckpt?
The Physical-log position at Ckpt is the pointer to the first physical log page
at the completion of the last checkpoint. If another checkpoint is
completed, the current position in the physical log is written to the
checkpoint reserve page. All physical log pages located before that
position are no longer needed.

ly
on
__ d. Why is it important to know which logical log contains the last checkpoint record?

12
One reason why you need to know the location of the last checkpoint is if
you are moving logical logs to a new dbspace and want to delete the old
logical logs. 8
2X
__ e. What can you do to write a checkpoint to the current logical log? Go ahead and
se

execute the command. Run onstat -l and onstat -m to verify the checkpoint.
ur

Force a checkpoint with the onmode -c command.


co

__ 10. Run the onstat -g ckp command to display a checkpoint history report. (You might
in

need to cut/paste the report into a text editor and set to a small font size in order to
se

view the report clearly.) How many checkpoints are shown? How many are
nonblocking checkpoints? How many are blocking?
ru

Blocking checkpoints are indicated with an asterisk next to the entry in the
Fo

Trigger column.

11-6 Informix 11.7 System Admin © Copyright IBM Corp. 2001, 2011
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V5.4.0.3
Student Exercises

EXempty Exercise 12. Fault Tolerance

What this exercise is about


In this exercise, students will monitor the status of mirrored spaces on
their database server.

What you should be able to do


At the end of the exercise, you should be able to:
• Use the onspaces command to bring down and recover the primary
chunk in a mirrored pair

ly
on
8 12
2X
se
ur
co
in
se
ru
Fo

© Copyright IBM Corp. 2001, 2011 Exercise 12. Fault Tolerance 12-1
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises

12.1. Using Disk Mirroring


This exercise demonstrates mirroring functionality. In this exercise, you will start with the
stores database in a mirrored dbspace (dbspace1). You will bring one chunk of the
mirrored pair offline. Because of mirroring, you will still be able to view and insert data! You
will bring the chunk online. Recovery will occur automatically.
__ 1. Use onstat to determine the status of the chunks in your server. Verify that
dbspace1 is mirrored.

__ 2. Use dbaccess to verify that you can select from the stores_demo database that
you created in dbspace1 in an earlier exercise.
__ 3. Use onspaces to bring down the primary chunk in dbspace1.

__ 4. Use onstat to verify that the chunk is marked as down.

ly
on
12
__ 5. Use dbaccess to select all customers from the customer table in the stores_demo
database. (Even though the primary chunk is down, the mirrored chunk is online and
you can still view all customers.) 8
2X
se

__ 6. Use dbaccess to insert a new customer into the customer table.


ur
co

__ 7. Use onspaces to recover the down chunk.


in
se

__ 8. Use onstat to verify that the chunk is back online.


ru
Fo

__ 9. Use onstat -m to view the message log.


__ a. What does it tell you about the recovery of the primary chunk?

__ b. What did you, as the system administrator, have to do to assist in the recovery of
the down chunk and the synchronization of data?

12-2 Informix 11.7 System Admin © Copyright IBM Corp. 2001, 2011
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V5.4.0.3
Student Exercises

EXempty 12.2. Solution to Exercise


__ 1. Use onstat to determine the status of the chunks in your server. Verify that
dbspace1 is mirrored.
onstat -d
An M in the flags column of the dbspaces table indicates if the dbspace is
mirrored.
__ 2. Use dbaccess to verify that you can select from the stores_demo database that
you created in dbspace1 in an earlier exercise.
__ 3. Use onspaces to bring down the primary chunk in dbspace1.
onspaces -s dbspace1 -p pathname -o 0 -D
__ 4. Use onstat to verify that the chunk is marked as down.
onstat -d

ly
__ 5. Use dbaccess to select all customers from the customer table in the stores_demo

on
database. (Even though the primary chunk is down, the mirrored chunk is online and

12
you can still view all customers.)
DATABASE stores_demo;
8
2X
SELECT * FROM customer;
__ 6. Use dbaccess to insert a new customer into the customer table.
se
ur

Here is an example:
co

INSERT INTO CUSTOMER (customer_num, fname, lname)


VALUES (0, "John", "Smith");
in

__ 7. Use onspaces to recover the down chunk.


se

onspaces -s dbspace1 -p pathname -o 0 -O


ru

__ 8. Use onstat to verify that the chunk is back online.


Fo

onstat -d
__ 9. Use onstat -m to view the message log.
__ a. What does it tell you about the recovery of the primary chunk?
Messages in the log indicate when recovery of the chunk starts and when it
completes.
__ b. What did you, as the system administrator, have to do to assist in the recovery of
the down chunk and the synchronization of data?
The administrator must perform a recovery of the down chunk so that it
can be synchronized with the mirror chunk.

© Copyright IBM Corp. 2001, 2011 Exercise 12. Fault Tolerance 12-3
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises

ly
on
8 12
2X
se
ur
co
in
se
ru
Fo

12-4 Informix 11.7 System Admin © Copyright IBM Corp. 2001, 2011
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V5.4.0.3
Student Exercises

EXempty Exercise 13. Introduction to Backup and Restore

What this exercise is about


In this exercise, students will determine what kind of a restore would
be required based on given scenarios.

What you should be able to do


At the end of the exercise, you should be able to:
• Determine what type of restore option is appropriate for various
situations

ly
on
8 12
2X
se
ur
co
in
se
ru
Fo

© Copyright IBM Corp. 2001, 2011 Exercise 13. Introduction to Backup and Restore 13-1
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises

13.1. Choosing a Restore Method


Listed below are some scenarios that describe a failure of some kind in the server. Indicate
whether a cold restore, a warm restore, or a mixed restore is the most appropriate based
on the information provided and place an X in the appropriate column.

Cold Warm Mixed


Restore Restore Restore
1. The device that contains the dbspace where
the orders table is located has failed. Without
the orders table, new orders cannot be
entered.
2. The device containing the root dbspace has
failed. There are two other dbspaces on the
server that contain few, small databases.

ly
3. Logical logs are stored on logdbs1, logdbs2,

on
and logdbs3. The disk that contains logdbs3

12
has failed. It is important to get the server up
as soon as possible so that order entry can
8
2X
resume. The current logical log is not located
on logdbs3.
se

4. The inventory table is fragmented across five


ur

dbspaces. The dbspace that contains one of


co

these fragments has crashed and must be


replaced.
in

5. The disk that contains a temporary dbspace


se

has failed and must be replaced.


ru
Fo

13-2 Informix 11.7 System Admin © Copyright IBM Corp. 2001, 2011
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V5.4.0.3
Student Exercises

EXempty 13.2. Solution to Exercise

Cold Warm Mixed


Restore Restore Restore
1. The device that contains the dbspace where
the orders table is located has failed. Without
X
the orders table, new orders cannot be
entered.
2. The device containing the root dbspace has
failed. There are two other dbspaces on the X
server that contain few, small databases.
3. Logical logs are stored on logdbs1, logdbs2,
and logdbs3. The disk that contains logdbs3
has failed. It is important to get the server up
X

ly
as soon as possible so that order entry can

on
resume. The current logical log is not located
on logdbs3.

12
4. The inventory table is fragmented across five
dbspaces. The dbspace that contains one of 8
2X
X
these fragments has crashed and must be
replaced.
se

5. The disk that contains a temporary dbspace


ur

X
has failed and must be replaced.
co
in
se
ru
Fo

© Copyright IBM Corp. 2001, 2011 Exercise 13. Introduction to Backup and Restore 13-3
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises

ly
on
8 12
2X
se
ur
co
in
se
ru
Fo

13-4 Informix 11.7 System Admin © Copyright IBM Corp. 2001, 2011
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V5.4.0.3
Student Exercises

EXempty Exercise 14. Backup and Restore Using Ontape

What this exercise is about


In this exercise, students will use the ontape utility to perform various
backup and restore activities.

What you should be able to do


At the end of the exercise, you should be able to:
• Use ontape to back up logical logs
• Use ontape to perform a system backup
• Use ontape to physically and logically restore a database system

ly
on
8 12
2X
se
ur
co
in
se
ru
Fo

© Copyright IBM Corp. 2001, 2011 Exercise 14. Backup and Restore Using Ontape 14-1
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises

14.1. Performing a Backup and Restore


In this exercise, you will perform a system backup, a logical log backup, and restore of your
database server. You will perform a cold restore of your critical dbspaces (rootdbs,
logspace) and, once the system is online, a warm restore of your noncritical dbspaces
(dbspace1, sbspace1).
__ 1. A backup directory (/home/informix/backup) has been created for you to use for
system and logical log backups. Make sure that permissions on this directory are set
to 770.
__ 2. Using vi or other text editor, modify your configuration file to set your server backup
and log backup devices to your backup directory. Do not modify the other ontape
configuration parameters.
__ 3. Bring the server down and back up again.
__ 4. Set the IFX_ONTAPE_FILE_PREFIX environment variable to the name of your
database server.

ly
on
__ 5. Perform a level-0 backup of your database server. What files were created in your
backup directory?

8 12
2X
__ 6. Back up the logical logs. What files were created in your logical log backup
directory?
se
ur
co

__ 7. Bring down your server.


__ 8. Perform a cold restore of your critical dbspaces. Answer n when asked if you want
in

to back up the logs.


se

__ 9. Check that the root dbspace and the dbspace that contains the logical logs are
ru

online.
Fo

__ a. Other dbspaces in your server have a flag of D to indicate they are down.
Chunks for these dbspaces have a flag of I for inconsistent. Which dbspaces are
down?

__ b. Are there dbspaces that you did not ask to restore and are not labeled as
inconsistent? Why?

__ 10. Perform a warm restore of all inconsistent dbspaces in your instance.


__ 11. Make sure that all dbspaces are online.

14-2 Informix 11.7 System Admin © Copyright IBM Corp. 2001, 2011
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V5.4.0.3
Student Exercises

EXempty 14.2. Back up and Restore using STDIO (Optional)


In this exercise, you will perform a system backup and restore using the STDIO facility.
__ 1. Using vi, modify your configuration file to set the TAPEDEV parameter to STDIO.
__ 2. Perform a level-0 backup of your database server using options to compress it, and
send it out to a file with the appropriate compressed file extension (.Z or .gz).
__ 3. Bring your server offline.
__ 4. Restore your server using the zcat utility, so the file does not have to be
uncompressed first. Make sure to pipe the zcat output into the restore command.
__ 5. Verify that the server is Online and that all dbspaces are available for use by the
users.
__ 6. Try a cold restore of the critical dbspaces, followed by a warm restore of the rest
using the same methods as above. Remember that a warm restore can only happen
while the system is either in Quiescent or Online mode, and that logical logs are

ly
needed whenever a full system restore is not being done as a single step.

on
__ 7. Try a multi-level restore. First perform a level-1 backup while the system is online.

8 12
2X
se
ur
co
in
se
ru
Fo

© Copyright IBM Corp. 2001, 2011 Exercise 14. Backup and Restore Using Ontape 14-3
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises

14.3. Solutions to Exercises

14.1. Performing a Backup and Restore


__ 1. A backup directory (/home/informix/backup) has been created for you to use for
system and logical log backups. Make sure that permissions on this directory are set
to 770.
chmod 770 /home/informix/backup
__ 2. Using vi or other text editor, modify your configuration file to set your server backup
and log backup devices to your backup directory. Do not modify the other ontape
configuration parameters.
TAPEDEV /home/informix/backup
LTAPEDEV /home/informix/backup
__ 3. Bring the server down and back up again.

ly
onmode -ky

on
oninit

12
__ 4. Set the IFX_ONTAPE_FILE_PREFIX environment variable to the name of your
database server.
8
2X
IFX_ONTAPE_FILE_PREFIX=$INFORMIXSERVER
export IFX_ONTAPE_FILE_PREFIX
se

__ 5. Perform a level-0 backup of your database server. What files were created in your
ur

backup directory?
co

ontape -s
in

A file called local_shm_L0 was created in the backup directory.


se

__ 6. Back up the logical logs. What files were created in your logical log backup
ru

directory?
Fo

ontape -a
A file called local_shm_Log00000000## was created in the backup directory,
where ## is the number of the log that was backed up.
__ 7. Bring down your server.
onmode -k
__ 8. Perform a cold restore of your critical dbspaces. Answer n when asked if you want
to back up the logs.
ontape -r -D rootdbs logspace
Answer n when asked if you want to restore a level-1 backup. Answer y when
asked if you want to restore log tapes.

14-4 Informix 11.7 System Admin © Copyright IBM Corp. 2001, 2011
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V5.4.0.3
Student Exercises

EXempty __ 9. Check that the root dbspace and the dbspace that contains the logical logs are
online.
onstat -d
__ a. Other dbspaces in your server have a flag of D to indicate they are down.
Chunks for these dbspaces have a flag of I for inconsistent. Which dbspaces are
down?
Only dbspace1 and sbspace1 are flagged as down.
__ b. Are there dbspaces that you did not ask to restore and are not labeled as
inconsistent? Why?
The temporary dbspace, tempdbs, was created with a temporary flag and is,
therefore, never backed up or restored.
__ 10. Perform a warm restore of all inconsistent dbspaces in your instance.
ontape -r -D dbspace1 sbspace1

ly
Answer n when asked if you want to restore a level-1 backup. Answer y when

on
asked if you want to restore log tapes.

12
__ 11. Make sure that all dbspaces are online.
onstat -d 8
2X
se

14.2. Back up and Restore using STDIO (Optional)


ur

__ 1. Using vi, modify your configuration file to set the TAPEDEV parameter to STDIO.
co

__ 2. Perform a level-0 backup of your database server using options to compress it, and
in

send it out to a file with the appropriate compressed file extension (.Z or .gz).
se

ontape -s -L 0 | compress > level_0_archive.Z


ru

or
Fo

ontape -s -L 0 | gzip > level_0_archive.gz


__ 3. Bring your server offline.
onmode -ky
__ 4. Restore your server using the zcat utility, so the file does not have to be
uncompressed first. Make sure to pipe the zcat output into the restore command.
zcat level_0_archive.Z | ontape -r
__ 5. Verify that the server is Online and that all dbspaces are available for use by the
users.
Run onmode -m to bring online, followed by onstat -d or dbaccess.
__ 6. Try a cold restore of the critical dbspaces, followed by a warm restore of the rest
using the same methods as above. Remember that a warm restore can only happen

© Copyright IBM Corp. 2001, 2011 Exercise 14. Backup and Restore Using Ontape 14-5
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises

while the system is either in Quiescent or Online mode, and that logical logs are
needed whenever a full system restore is not being done as a single step.
First back up your current logs to a file; you cannot use STDIO for log
backups. Then run the following commands:
zcat level_0_archive.Z | ontape -r -D rootdbs logspace
onmode -m (to bring the system to On-Line mode)
zcat level_0_archive.Z | ontape -r -D dbspace1 sbspace1
ontape -l (to roll forward the logs for the warm restore)
__ 7. Try a multi-level restore. First perform a level-1 backup while the system is online.
ontape -s -L 1 | gzip -z > level_1_archive.Z
onmode -ky
zcat level_0_archive.Z level_1_archive.Z | ontape -r

ly
on
8 12
2X
se
ur
co
in
se
ru
Fo

14-6 Informix 11.7 System Admin © Copyright IBM Corp. 2001, 2011
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V5.4.0.3
Student Exercises

EXempty Exercise 15. Temporary Files and Tables

What this exercise is about


In this exercise, students will perform tasks to create temporary tables
and will monitor where they are created on disk.

What you should be able to do


At the end of the exercise, you should be able to:
• Configure the location of temporary objects by setting
DBSPACETEMP
• Create temporary objects by running queries, then monitoring disk
usage using onstat

ly
on
8 12
2X
se
ur
co
in
se
ru
Fo

© Copyright IBM Corp. 2001, 2011 Exercise 15. Temporary Files and Tables 15-1
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises

15.1. Using Temporary Dbspaces


When you were creating dbspaces, you created tempdbs as a temporary dbspace. In this
exercise, you will learn about when a temporary dbspace is used.
Before you begin, verify the following:
__ 1. Does the configuration parameter DBSPACETEMP point to your temporary
dbspace?
Run onstat -c | grep DBSPACETEMP to verify that your instance is properly
configured.
__ 2. Is tempdbs specified as a temporary dbspace?
Run onstat -d and verify that tempdbs is flagged as a temporary dbspace (for
example, there is a T in the flags column).
When you have verified your instance configuration, continue with the exercise.

ly
__ 3. Run onstat -d. Observe the amount of space available in the free column for your

on
chunks and calculate total free space for each dbspace.
rootdbs _________

12
logspace _________
tempdbs _________ 8
2X
dbspace1 _________
se

__ 4. In another window, start dbaccess. Run the following query against the
stores_demo database:
ur
co

SELECT *
FROM orders
in

INTO TEMP tmp1


se

WITH NO LOG;
ru

__ 5. In the first window, run onstat -d again. Observe the amount of space available in
Fo

the free column for your dbspaces. In which dbspace was the temporary table
created?.
rootdbs _________
logspace _________
tempdbs _________
dbspace1 _________
__ 6. Return to the window running dbaccess. Run the following query against your
database (Notice that WITH NO LOG is removed):
SELECT *
FROM orders
INTO TEMP tmp2;

15-2 Informix 11.7 System Admin © Copyright IBM Corp. 2001, 2011
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V5.4.0.3
Student Exercises

EXempty __ 7. In the first window, run onstat -d again. Observe the amount of space available in
the free column for your dbspaces. In which dbspace was this new temporary table
created?
rootdbs _________
logspace _________
tempdbs _________
dbspace1 _________
__ 8. In the second window, exit dbaccess.
__ 9. In the first window, run onstat -d again. Observe the amount of space available in
the free column for your dbspaces. What occurred when you exited dbaccess?
rootdbs _________
logspace _________
tempdbs _________
dbspace1 _________

ly
on
__ 10. Edit your configuration file and unset the DBSPACETEMP configuration parameter.
Bring your server offline and then back online so that the change takes effect.

12
Execute the following query:
SELECT *
8
2X
FROM orders
INTO TEMP tmp1
se

WITH NO LOG;
ur

__ 11. In the first window, run onstat -d again. Observe the amount of space available in
co

the free column for your dbspaces. In which dbspace was this new temporary table
in

created?
se

rootdbs _________
ru

logspace _________
tempdbs _________
Fo

dbspace1 _________
__ 12. Return to your query window. Using dbaccess, execute the following query:
CREATE TEMP TABLE tmp2(col1 INT);
__ 13. In the first window, run onstat -d again. Observe the space available in the free
column for your dbspaces. In which dbspace was this new temporary table created?
rootdbs _________
logspace _________
tempdbs _________
dbspace1 _________
__ 14. Modify your configuration file by changing the DBSPACETEMP parameter back to
tempdbs. Shut down and restart your database server.

© Copyright IBM Corp. 2001, 2011 Exercise 15. Temporary Files and Tables 15-3
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises

15.2. Solution to Exercise


__ 1. Does the configuration parameter DBSPACETEMP point to your temporary
dbspace?
Run onstat -c | grep DBSPACETEMP to verify that your instance is properly
configured.
__ 2. Is tempdbs specified as a temporary dbspace?
Run onstat -d and verify that tempdbs is flagged as a temporary dbspace (for
example, there is a T in the flags column).
When you have verified your instance configuration, continue with the exercise.
__ 3. Run onstat -d. Observe the amount of space available in the free column for your
chunks and calculate total free space for each dbspace.
These amounts could be different for each student.

ly
__ 4. In another window, start dbaccess. Run the following query against the

on
stores_demo database:
SELECT *

12
FROM orders
INTO TEMP tmp1 8
2X
WITH NO LOG;
se

__ 5. In the first window, run onstat -d again. Observe the amount of space available in
ur

the free column for your dbspaces. In which dbspace was the temporary table
co

created?
The temporary table is created in tempdbs. The free column for tempdbs is 8
in

pages less.
se

__ 6. Return to the window running dbaccess. Run the following query against your
ru

database (Notice that WITH NO LOG is removed):


Fo

SELECT *
FROM orders
INTO TEMP tmp2;
__ 7. In the first window, run onstat -d again. Observe the amount of space available in
the free column for your dbspaces. In which dbspace was this new temporary table
created?
The temporary table is created in dbspace1. When you omit the WITH NO LOG
clause and build a temporary table in a logged database, the root dbspace or
the dbspace where the current database was created is used.
__ 8. In the second window, exit dbaccess.
__ 9. In the first window, run onstat -d again. Observe the amount of space available in
the free column for your dbspaces. What occurred when you exited dbaccess?

15-4 Informix 11.7 System Admin © Copyright IBM Corp. 2001, 2011
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V5.4.0.3
Student Exercises

EXempty When you exit dbaccess, your session ends and all temporary tables are
removed.
__ 10. Edit your configuration file and unset the DBSPACETEMP configuration parameter.
Bring your server offline and then back online so that the change takes effect.
Execute the following query:
SELECT *
FROM orders
INTO TEMP tmp1
WITH NO LOG;
__ 11. In the first window, run onstat -d again. Observe the amount of space available in
the free column for your dbspaces. In which dbspace was this new temporary table
created?
Without DBSPACETEMP, there is no temporary dbspace to use. An implicit
temporary table (SELECT...INTO TEMP) is created in the root dbspace or in the
dbspace where the current database was created.

ly
on
__ 12. Return to your query window. Using dbaccess, execute the following query:

12
CREATE TEMP TABLE tmp2(col1 INT);

8
__ 13. In the first window, run onstat -d again. Observe the amount of space available in
2X
the free column for your dbspaces. In which dbspace was this new temporary table
created?
se

Because it is an explicit temporary table (CREATE TEMP TABLE statement)


ur

and because there is no DBSPACETEMP specified, it is built in the dbspace


co

where the current database was created.


in

__ 14. Modify your configuration file by changing the DBSPACETEMP parameter back to
se

tempdbs. Shut down and restart your database server.


ru
Fo

© Copyright IBM Corp. 2001, 2011 Exercise 15. Temporary Files and Tables 15-5
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises

ly
on
8 12
2X
se
ur
co
in
se
ru
Fo

15-6 Informix 11.7 System Admin © Copyright IBM Corp. 2001, 2011
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V5.4.0.3
Student Exercises

EXempty Exercise 16. Performance Features

What this exercise is about


In this exercise, students will demonstrate what they have learned
about tuning for performance through a classroom exercise.

What you should be able to do


At the end of the exercise, you should be able to:
• Describe configuration parameters that can be tuned to improve
server performance

ly
on
8 12
2X
se
ur
co
in
se
ru
Fo

© Copyright IBM Corp. 2001, 2011 Exercise 16. Performance Features 16-1
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises

16.1. Matching Exercise


Match the definition on the left with the correct parameter on the right.

__ 1. Specifies a limit to the number of concurrent a. DATASKIP


PDQ queries. b. DS_MAX_QUERIES
__ 2. Set to enable or disable the SQL statement c. DS_MAX_SCANS
cache.
d. DS_TOTAL_MEMORY
__ 3. Set to identify a query as a PDQ query.
e. MAX_PDQ_PRIORITY
__ 4. When set to 0, the current time is obtained
from a shared memory structure. f. OFF_RECVRY_THREADS

__ 5. Used to determine how many threads to g. ON_RECVRY_THREADS


allocate for fast recovery. h. PDQPRIORITY

ly
__ 6. Maximum of memory that can be allocated for i. RA_PAGES

on
all PDQ requests on the server.
j. RA_THRESHOLD
__ 7. Sets a limit to the priority that can be used by

12
k. STMT_CACHE
applications using PDQ.
8 l. STMT_CACHE_SIZE
2X
__ 8. Set to the number of pages read into shared
memory per read request. m. USEOSTIME
se

__ 9. Determines the size of the SQL statement


ur

cache.
co

__ 10. A list of dbspaces that can be skipped if


in

chunks in the dbspace are offline.


se

__ 11. Determines how many threads to allocate for


ru

recovery during a warm restore.


__ 12. The maximum number of threads that can be
Fo

allocated for parallel scans with PDQ.


__ 13. Determines the point at which additional
pages are read into shared memory during a
query.

16-2 Informix 11.7 System Admin © Copyright IBM Corp. 2001, 2011
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V5.4.0.3
Student Exercises

EXempty 16.2. Solution to Exercise

b  1. Specifies a limit to the number of concurrent a. DATASKIP


PDQ queries.
b. DS_MAX_QUERIES
k  2. Set to enable or disable the SQL statement
cache. c. DS_MAX_SCANS

h 3. Set to identify a query as a PDQ query. d. DS_TOTAL_MEMORY

m  4. When set to 0, the current time is obtained e. MAX_PDQ_PRIORITY


from a shared memory structure. f. OFF_RECVRY_THREADS
f  5. Used to determine how many threads to g. ON_RECVRY_THREADS
allocate for fast recovery.
h. PDQPRIORITY
d  6. Maximum of memory that can be allocated for
all PDQ requests on the server. i. RA_PAGES

ly
j. RA_THRESHOLD

on
e  7. Sets a limit to the priority that can be used by
applications using PDQ. k. STMT_CACHE

12
i 8. Set to the number of pages read into shared l. STMT_CACHE_SIZE
memory per read request. 8
2X
m. USEOSTIME
l 9. Determines the size of the SQL statement
se

cache.
ur

a  10. A list of dbspaces that can be skipped if


co

chunks in the dbspace are offline.


in

g  11. Determines how many threads to allocate for


recovery during a warm restore.
se

c  12. The maximum number of threads that can be


ru

allocated for parallel scans with PDQ.


Fo

j 13. Determines the point at which additional


 pages are read into shared memory during a
query.

© Copyright IBM Corp. 2001, 2011 Exercise 16. Performance Features 16-3
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises

ly
on
8 12
2X
se
ur
co
in
se
ru
Fo

16-4 Informix 11.7 System Admin © Copyright IBM Corp. 2001, 2011
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V5.4.0.3
Student Exercises

EXempty Exercise 17. Monitoring User Activity

What this exercise is about


In this exercise, students will configure and monitor lock usage in their
database server.

What you should be able to do


At the end of the exercise, you should be able to:
• Monitor how the database server manages the dynamic allocation
of locks

ly
on
8 12
2X
se
ur
co
in
se
ru
Fo

© Copyright IBM Corp. 2001, 2011 Exercise 17. Monitoring User Activity 17-1
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises

17.1. Dynamic Lock Management


This exercise demonstrates the use of the Informix dynamic lock management facility.
To complete this exercise, make sure that the LOCKS parameter in your configuration file is
set to 2000. If it is not set to this value, modify the parameter and shutdown and restart the
database server.
__ 1. Make a note of the current setting of the LTAPEDEV parameter in your configuration
file, then set LTAPEDEV to /dev/null. Reinitialize your server shared memory.
__ 2. Using dbaccess, run the following SQL statements:
CREATE DATABASE locktest WITH LOG;
CREATE TABLE locktest (col1 integer) LOCK MODE ROW;
CREATE procedure locktest()
DEFINE i integer;
FOR i = 1 TO 6000
INSERT INTO locktest VALUES (i);

ly
on
END FOR;
END PROCEDURE;

12
EXECUTE PROCEDURE locktest();

8
__ 3. Using a second window, run the onstat -k command and note the number of locks.
2X
The following example highlights the location of this number:
se

Locks
address wtlist owner lklist type tblsnum rowid key#/bsiz
ur

0 active, 2000 total, 2048 hash buckets, 0 lock table overflows


co

You should have 2000 total locks.


in

__ 4. Using the first window, run the following SQL statements:


se

BEGIN WORK;
ru

UPDATE locktest SET col1 = col1 + 1 WHERE 1 = 1;


Fo

__ 5. Using the second window, run the onstat -k command.


You should see a list of active locks on the last line of the onstat output, as shown
here:
6002 active, 8000 total, 2048 hash buckets, 2 lock table overflows

17-2 Informix 11.7 System Admin © Copyright IBM Corp. 2001, 2011
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V5.4.0.3
Student Exercises

EXempty Notice that now there are around 6002 active locks, 8000 locks in total, and 2 lock
table overflows. Now, run the onstat -m command.
Message Log File: /u1/informix92/online.log
01:57:42 Logical Log 100 Complete.
01:57:57 Logical Log 101 Complete.
01:58:09 Logical Log 102 Complete.
01:58:09 Checkpoint Completed: duration was 0 seconds.
02:02:58 dynamically allocated 2000 locks
02:02:59 dynamically allocated 4000 locks
02:03:34 Checkpoint Completed: duration was 0 seconds.
Looking at the output from the onstat -m command, notice that 2000 locks were
added by the dynamic lock manager on the first lock table overflow and 4000 locks
were added as result of the second lock table overflow.
__ 6. Using your first window, run the following SQL command:
COMMIT WORK;

ly
on
__ 7. Using the second window run the onstat -k command. You should see a summary
line at the bottom similar to this:

12
1 active, 8000 total, 2048 hash buckets, 2 lock table overflows
8
2X
Notice now that the lock table has few active locks, but still shows a total of 8000
locks.
se

__ 8. Close the dbaccess session.


ur
co

__ 9. Change the LTAPEDEV parameter in the configuration file back to the directory you
had before.
in

__ 10. Stop and restart the database server.


se

__ 11. Run onstat -k again and you should notice that the total locks is set back to 2000.
ru
Fo

© Copyright IBM Corp. 2001, 2011 Exercise 17. Monitoring User Activity 17-3
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises

ly
on
8 12
2X
se
ur
co
in
se
ru
Fo

17-4 Informix 11.7 System Admin © Copyright IBM Corp. 2001, 2011
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V5.4.0.3
Student Exercises

EXempty Exercise 18. Event Alarms

What this exercise is about


In this exercise, students will examine existing event alarms and
enable them on their servers.

What you should be able to do


At the end of the exercise, you should be able to:
• Modify the event alarm script to raise an alarm when logical logs
become full

ly
on
8 12
2X
se
ur
co
in
se
ru
Fo

© Copyright IBM Corp. 2001, 2011 Exercise 18. Event Alarms 18-1
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises

18.1. Using Alarm Programs


In this exercise, you will use a sample alarm program script provided by Informix and
modify it to be used by your server. The script is called log_full.sh and is located in
$INFORMIXDIR/etc.
__ 1. Copy the log_full.sh script to your student directory.
__ 2. Examine the script. What does the script do? What utility does it run?

__ 3. This script is written for servers that use the onbar utility to back up logical logs.
Modify the script to perform a logical log backup using the ontape utility. What
change did you make?

__ 4. To use the script with your server, do the following:

ly
__ a. Modify your configuration file. Set ALARMPROGRAM to the path of your alarm

on
program file. Make sure that the LTAPEDEV configuration parameter is set to the
lbackup directory in the informix home directory.

12
__ b. Bring your server offline and back up again so that your configuration changes
can take effect. 8
2X
__ c. Run onstat -l to determine which logical log is current.
se

__ d. Run the following command to create a demonstration database and populate


ur

the current logical log file with transactions:


co

dbaccessdemo -log
in

__ e. Run onstat -l again to view the state of your logical logs. If the current logical log
se

has not changed, run the onmode -l command to advance to the next logical log.
ru

__ f. Check your message log. Do the messages in the log indicate that the logical log
Fo

files were backed up after completion of a logical log?

__ 5. What change would you make to the script to force the backup of logical logs only
when all of the logical logs are full?

18-2 Informix 11.7 System Admin © Copyright IBM Corp. 2001, 2011
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V5.4.0.3
Student Exercises

EXempty 18.2. Solution to Exercise


__ 1. Copy the log_full.sh script to your student directory.
__ 2. Examine the script. What does the script do? What utility does it run?
The script performs a backup of the logs using the onbar command. It
monitors the server for class ID number 23.
__ 3. This script is written for servers that use the onbar utility to back up logical logs.
Modify the script to perform a logical log backup using the ontape utility. What
change did you make?
Change the value of the BACKUP_CMD variable to ontape -a.
__ 4. To use the script with your server, do the following:
__ a. Modify your configuration file. Set ALARMPROGRAM to the path of your alarm
program file. Make sure that the LTAPEDEV configuration parameter is set to the
lbackup directory in the informix home directory.

ly
on
__ b. Bring your server offline and back up again so that your configuration changes
can take effect.

12
__ c. Run onstat -l to determine which logical log is current.
8
2X
__ d. Run the following command to create a demonstration database and populate
the current logical log file with transactions:
se

dbaccessdemo -log -dbspace dbspace1


ur

__ e. Run onstat -l again to view the state of your logical logs. If the current logical log
co

has not changed, run the onmode -l command to advance to the next logical log.
in

__ f. Check your message log. Do the messages in the log indicate that the logical log
se

files were backed up after completion of a logical log?


ru

Your message log should contain messages that look something like this:
Fo

10:16:07 Logical Log 5 Complete.


10:18:27 Logical Log 5 - Backup Started
10:18:27 Logical Log 5 - Backup Completed
__ 5. What change would you make to the script to force the backup of logical logs only
when all of the logical logs are full?
Change the event class used in the case statement from 23 to 20. This is the
event class the server sends when logical logs are full.

© Copyright IBM Corp. 2001, 2011 Exercise 18. Event Alarms 18-3
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises

ly
on
8 12
2X
se
ur
co
in
se
ru
Fo

18-4 Informix 11.7 System Admin © Copyright IBM Corp. 2001, 2011
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V5.4.0.3
Student Exercises

EXempty Exercise 19. SQL Administration Functions and


Task Scheduler

What this exercise is about


In this exercise, you will use SQL administration functions to perform
administrative tasks, schedule tasks, and collect and analyze server
information over time.

What you should be able to do


At the end of the exercise, you should be able to:
• Execute system administration commands by calling the admin
and task routines

ly
on
• Create a sensor to monitor system activity

12
• Use SQL queries to analyze information collected by sensors

8
2X
se
ur
co
in
se
ru
Fo

© Copyright IBM Corp. 2001, 2011 Exercise 19. SQL Administration Functions and Task Scheduler 19-1
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises

19.1. Executing SQL administration commands


In this exercise, you will execute a few simple commands using calls to the admin and task
routines.
__ 1. Make sure that you are currently logged in as informix.
__ 2. Create a cooked file in the informix home directory called log_space2. Change
permissions as needed.

__ 3. Start dbaccess, choose Query Language, and select the sysadmin database.
__ 4. Use either the admin or task function to perform the following tasks. Use onstat
commands to verify that the task was successful.
__ a. Add a 10 MB chunk to the logspace dbspace using the cooked file log_space2.

Hint

ly
on
The parameters required for the CREATE CHUNK command are dbspacename,

12
pathname, size, offset.)

8
2X
se

__ b. Add 3 logical log files, 3000 KB each, to the logspace dbspace.


ur
co

__ c. Shut down the database server.


in
se
ru

__ d. Bring the database server back to online mode.


Fo

__ e. Force a checkpoint.

__ f. Switch to the next logical log.

__ g. Perform a check of the extents on the database server (oncheck -ce). (Hint: The
output for the report is written to the command_history table.)

19-2 Informix 11.7 System Admin © Copyright IBM Corp. 2001, 2011
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V5.4.0.3
Student Exercises

EXempty __ h. Drop the chunk that you created in Step a. (Hint: the parameters required are
dbspacename, pathname, offset.)

ly
on
8 12
2X
se
ur
co
in
se
ru
Fo

© Copyright IBM Corp. 2001, 2011 Exercise 19. SQL Administration Functions and Task Scheduler 19-3
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises

19.2. Creating a sensor


In this section, you will create a sensor to collect information about chunk space usage and
store the information in a table.
You are interested in analyzing how space usage for a specific chunk varies during a
particular time interval. You can do this by creating a sensor that monitors the values in the
sysmaster:syschunks table and stores the information in a table that you create so that
you can analyze it after data is collected.
__ 1. Create a sensor called mon_chunks that does the following:
__ a. Creates a table called mon_chunks that includes the following columns:
- id (INTEGER) – To hold the sequence ID for each check ($DATA_SEQ_ID).
- date_time (DATETIME YEAR TO MINUTE) – To hold the date and time of
the check (CURRENT YEAR TO MINUTE).
- chunk_num (INTEGER) – To hold the chunk number (chknum—this is

ly
always 4 for this sensor, but you might want to create similar sensors for

on
other chunks).

12
- used (INTEGER) – This holds the number of bytes that are used by the
chunk (chksize – nfree).
8
2X
__ b. Performs a check of the sysmaster:syschunks table every minute.
se

__ c. Deletes each result table entry after one hour.


ur
co
in
se
ru
Fo

__ 2. Try creating and deleting tables, inserting values into tables, and so on to try to
change the amount of space used in chunk 4.
__ 3. Query the mon_chunks table to view results over time.

19-4 Informix 11.7 System Admin © Copyright IBM Corp. 2001, 2011
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V5.4.0.3
Student Exercises

EXempty 19.3. Analyzing sensor results


In this exercise, you will use simple SQL queries to analyze data collected by a built-in
sensor.
The mon_checkpoint sensor is a built-in sensor that collects information about checkpoint
activity and inserts the information into a table called mon_checkpoint. Use simple SQL
commands to perform the following tasks:
__ 1. Get a count of the number of checkpoints currently recorded in the
mon_checkpoint table.

__ 2. Determine the average number of minutes between checkpoints.

ly
on
__ 3. Determine the number of each type of checkpoint (Blocking and Non-Blocking) that

12
has been recorded.

8
2X
se

__ 4. How often does the mon_checkpoint table get updated? What can you do to
ur

increase the frequency of the updates?


co
in
se
ru
Fo

© Copyright IBM Corp. 2001, 2011 Exercise 19. SQL Administration Functions and Task Scheduler 19-5
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises

19.4. Solutions to exercises

19.1. Executing SQL administration commands


__ 1. Make sure that you are currently logged in as informix.
__ 2. Create a cooked file in the informix home directory called log_space2. Change
permissions as needed.
touch /home/informix/log_space2
chmod 660 /home/informix/log_space2
__ 3. Start dbaccess, choose Query Language, and select the sysadmin database.
__ 4. Use either the admin or task function to perform the following tasks. Use onstat
commands to verify that the task was successful.
__ a. Add a 10 MB chunk to the logspace dbspace using the cooked file log_space2.

ly
Hint

on
The parameters required for the CREATE CHUNK command are dbspacename,

12
pathname, size, offset.
8
2X
se

EXECUTE FUNCTION task("CREATE CHUNK","logspace",


"/home/informix/log_space2","10MB","0");
ur
co

Use onstat -d to verify.


in

__ b. Add 3 logical log files, 3000 KB each, to the logspace dbspace.


se

Run the following command three times:


ru

EXECUTE FUNCTION task("ADD LOG","logspace", "3000KB");


Fo

Use onstat -l to verify.


__ c. Shut down the database server.
EXECUTE FUNCTION task("SHUTDOWN");
Use onstat - to verify.
__ d. Bring the database server back to online mode.
You cannot use SQL commands to restart the database server since a
server must be running to receive the command. You must exit dbaccess
and run the oninit command to restart the server.
__ e. Force a checkpoint.
EXECUTE FUNCTION task("CHECKPOINT");
Check the message log to verify (onstat -m).

19-6 Informix 11.7 System Admin © Copyright IBM Corp. 2001, 2011
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V5.4.0.3
Student Exercises

EXempty __ f. Switch to the next logical log.


EXECUTE FUNCTION task("ONMODE","l");
Use onstat -l to verify.
__ g. Perform a check of the extents on the database server (oncheck -ce).
EXECUTE FUNCTION task("CHECK EXTENTS");
__ h. Drop the chunk that you created in Step a. Were you able to drop the chunk? If
not, then why not?
EXECUTE FUNCTION task("DROP CHUNK","logspace"
"/home/informix/log_space2","0");
If any of the logical logs you created in Step b were assigned to the new
chunk that you created in Step a, then you will not be able to drop the
chunk.

ly
19.2. Creating a sensor

on
__ 1. Create a sensor called mon_chunks that does the following:

12
__ a. Creates a table called mon_chunks that includes the following columns:
8
2X
- id (INTEGER) – To hold the sequence ID for each check ($DATA_SEQ_ID).
- date_time (DATETIME YEAR TO MINUTE) – To hold the date and time of
se

the check (CURRENT YEAR TO MINUTE).


ur

- chunk_num (INTEGER) – To hold the chunk number (chknum—this is


co

always 4 for this sensor, but you might want to create similar sensors for
in

other chunks).
se

- used (INTEGER) – This holds the number of bytes that are used by the
chunk (chksize – nfree).
ru

__ b. Performs a check of the sysmaster:syschunks table every minute.


Fo

© Copyright IBM Corp. 2001, 2011 Exercise 19. SQL Administration Functions and Task Scheduler 19-7
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises

__ c. Deletes each result table entry after one hour.


INSERT INTO ph_task
(tk_name, tk_type, tk_group, tk_description,
tk_result_table, tk_create, tk_execute, tk_stop_time,
tk_start_time, tk_frequency, tk_delete)
VALUES
("mon_chunks","SENSOR","DISK",
"Chunk 4 space usage","mon_chunks",
"CREATE TABLE mon_chunks (id INTEGER,
date_time DATETIME YEAR TO MINUTE, chunk_num INTEGER,
used INTEGER)",
"INSERT INTO mon_chunks SELECT $DATA_SEQ_ID,
CURRENT YEAR TO MINUTE, chknum, chksize-nfree
FROM sysmaster:syschunks WHERE chknum = 4",
NULL, NULL, INTERVAL(1) MINUTE TO MINUTE,
INTERVAL(1) HOUR TO HOUR);

ly
on
__ 2. Try creating and deleting tables, inserting values into tables, and so on to try to
change the amount of space used in chunk 4.

12
__ 3. Query the mon_chunks table to view results over time.
8
2X
se

19.3. Analyzing sensor results


ur
co

__ 1. Get a count of the number of checkpoints currently recorded in the


mon_checkpoint table.
in

SELECT COUNT(*) count FROM mon_checkpoint


se

__ 2. Determine the average number of minutes between checkpoints.


ru

SELECT AVG(intvl) average FROM mon_checkpoint


Fo

__ 3. Determine the number of each type of checkpoint (Blocking and Non-Blocking) that
has been recorded.
SELECT type, COUNT(*) count FROM mon_checkpoint
GROUP BY type
__ 4. How often does the mon_checkpoint table get updated? What can you do to
increase the frequency of the updates?
To find out how often the mon_checkpoint table is updated, run the following
query:
SELECT tk_frequency
FROM ph_task
WHERE tk_name = "mon_checkpoint"

19-8 Informix 11.7 System Admin © Copyright IBM Corp. 2001, 2011
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V5.4.0.3
Student Exercises

EXempty The table is updated once every hour. To increase the frequency of the
updates to once every five minutes, for example, you can run a simple
UPDATE command:
UPDATE ph_task
SET tk_frequency = INTERVAL(5) MINUTE TO MINUTE
WHERE tk_name = "mon_checkpoint"

ly
on
8 12
2X
se
ur
co
in
se
ru
Fo

© Copyright IBM Corp. 2001, 2011 Exercise 19. SQL Administration Functions and Task Scheduler 19-9
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises

ly
on
8 12
2X
se
ur
co
in
se
ru
Fo

19-10 Informix 11.7 System Admin © Copyright IBM Corp. 2001, 2011
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V5.4.0.3
Student Exercises

EXempty Exercise 20. Troubleshooting

What this exercise is about


In this exercise, students will examine a problem scenario and
determine how to resolve the problem.

What you should be able to do


At the end of the exercise, you should be able to:
• Use onstat to locate system problems and respond when
problems occur

ly
on
8 12
2X
se
ur
co
in
se
ru
Fo

© Copyright IBM Corp. 2001, 2011 Exercise 20. Troubleshooting 20-1


Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises

20.1. Troubleshooting a Disabled Server


In this exercise, you will examine several scenarios in which the database server has been
disabled.

Note

Use the finderr utility to interpret error numbers you see when troubleshooting. Simply
run the command finderr error#, where error# is the number of the error that you want to
interpret. The finderr utility displays the error message and a brief explanation of the
message.

Read through the scenario information and answer the questions provided.
__ 1. The database server has crashed, that is, it has been taken offline without warning.

ly
As an alert system administrator, your first instinct is to view the message log file.

on
You view the contents of the message file to find the following messages:

12
10:22:00 Logical Log 10 Complete.
10:22:05 Checkpoint Completed: duration was 4 seconds.
8
2X
10:22:05 Checkpoint loguniq 11, logpos 0x18
se

10:22:05 Logical Log 10 - Backup Completed


ur

10:57:21 Fatal error in ADM VP at mt.c:11375


co

10:57:21 Unexpected virtual processor termination, pid =


4142, exit = 0x9
in
se

10:57:21 PANIC: Attempting to bring system down


10:57:21 semctl: errno = 22
ru
Fo

10:57:21 semctl: errno = 22

__ a. What is the first message that indicates there was a problem?

__ b. Do you think the problem is related to the logical log backup that just completed?
Why or why not?

__ c. What is error number 22? Do you think this error is relevant to the cause of the
problem?

20-2 Informix 11.7 System Admin © Copyright IBM Corp. 2001, 2011
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V5.4.0.3
Student Exercises

EXempty __ d. What do you think might have caused the server to terminate? Do you think you
could duplicate the problem?

__ 2. Here is an example of a message received after the completion of the first


initialization of a server:

09:21:28 On-Line Mode


09:21:28 Building 'sysmaster' database ...
09:21:28 execve() of "/bin/sh sh -c exec
/prods/921/etc/buildsmi /tmp/buildsmi.
1936" failed errno=12
09:21:28 Assert Failed: build_smi failed
09:21:28 Informix Dynamic Server Version 11.70.UC1DE
09:21:28 Who: Session(10, informix@snoopy, 0, 172214960)
Thread(20, build_smi, a40e3b8, 1)

ly
File: rspseudo.c Line: 7562

on
09:21:28 Results: Cannot build/check 'sysmaster' database
09:21:28 stack trace for pid 1936 written to /tmp/af.3fc4477

12
09:21:28 See Also: /tmp/af.3fc4477, shmem.3fc4477.0
8
2X
The server did not crash as a result of this problem, however, the sysmaster
se

database was not created.


ur

__ a. What is the first message that indicates there is a problem?


co
in

__ b. What does the error number that is referenced in the message mean? Does it
explain the problem?
se
ru

__ c. How can this problem be resolved?


Fo

__ 3. The database server appeared to be hung for a few minutes, but all but one session
was able to continue. Here is the output of the message log:

13:07:05 Checkpoint loguniq 12, logpos 0x281b0

13:07:05 Aborting Long Transaction: tx 0xa43c8ec username:


herbt uid: 200

__ a. What does this message mean?


__ b. How can this problem be avoided in the future?

© Copyright IBM Corp. 2001, 2011 Exercise 20. Troubleshooting 20-3


Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises

20.2. Solution to Exercise


__ 1. The database server has crashed, that is, it has been taken offline without warning.
As an alert system administrator, your first instinct is to view the message log file.
You view the contents of the message file to find the following messages:
<exhibit removed>
__ a. What is the first message that indicates there was a problem?
Fatal error in ADM VP at mt.c:11375
(mt.c:11375 is the name of the source-code file and line number where the
error was encountered.)
__ b. Do you think the problem is related to the logical log backup that just completed?
Why or why not?
It is not likely that the problem is related to the logical log backup because
the backup completed at 10:22 and the panic occurred at 10:57.

ly
on
__ c. What is error number 22? Do you think this error is relevant to the cause of the
problem?

12
According to finderr, error -22 is Invalid argument. Since it occurred after the
8
panic, it is likely an effect of the problem, not a cause.
2X
__ d. What do you think might have caused the server to terminate? Do you think you
se

could duplicate the problem?


ur

The message that best explains the problem is the one that begins,
co

Unexpected virtual processor termination. Remember that a virtual processor


is a UNIX process called oninit; there is even a process ID number provided
in

in the message. However, Informix is not able to explain why the VP


se

terminated because the cause is external to the server.


ru

You can reproduce the error messages by using the UNIX kill command to
Fo

kill an oninit process.


__ 2. Here is an example of a message received after the completion of the first
initialization of a server:
<exhibit removed>
The server did not crash as a result of this problem, however, the sysmaster
database was not created.
__ a. What is the first message that indicates there is a problem?
The message that begins with execve( ) of "/bin/sh.
__ b. What does the error number that is referenced in the message mean? Does it
explain the problem?

20-4 Informix 11.7 System Admin © Copyright IBM Corp. 2001, 2011
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V5.4.0.3
Student Exercises

EXempty The finderr utility indicates that error number 12 means Not enough core.
This indicates that there is not enough memory resources available to
execute the buildsmi script, which is the script used by Informix to create
the sysmaster database.
__ c. How can this problem be resolved?
This problem is a result of insufficient memory resources on the host
computer system. There are a couple of possible ways to resolve the
problem:
- Increase swap space on the computer (this expands the virtual memory
of the computer, but will have a negative effect on performance).
- Reduce the amount of memory required by your server by reducing
shared memory configuration parameter values, such as BUFFERS and
SHMVIRTSIZE (this reduces the shared memory that is initially required,
but does not address the resource limits of the computer).

ly
If this type of error is occurring after the first initialization of the server, it

on
could mean that the memory resources of the computer are insufficient to
handle the needs of the server. Perhaps the database server should be

12
installed on a computer with more memory, or other applications that run
8
on the host computer should be run from a remote computer.
2X
__ 3. The database server appeared to be hung for a few minutes, but all but one session
se

was able to continue. Here is the output of the message log:


ur

<exhibit removed>
co

__ a. What does this message mean?


in

User herbt initiated a transaction that was long enough to reach the
se

LTXEHWM (long-transaction exclusive high-water mark). This caused the


server to suspend all user activity so that the long transaction could be
ru

rolled back.
Fo

__ b. How can this problem be avoided in the future?


Add additional logical logs, increase the high-water mark configuration
parameters (but not so high that the long-transaction rollback could fill the
logs), or modify the application to avoid a long-transaction situation.

© Copyright IBM Corp. 2001, 2011 Exercise 20. Troubleshooting 20-5


Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises

ly
on
8 12
2X
se
ur
co
in
se
ru
Fo

20-6 Informix 11.7 System Admin © Copyright IBM Corp. 2001, 2011
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V5.4.0.3
Student Exercises

EXempty Exercise 21. A Configuration Case Study

What this exercise is about


In this exercise, students will create a database server from scratch
using a defined scenario.

What you should be able to do


At the end of the exercise, you should be able to:
• Plan for the initial creation of a new database instance by
determining the resources required
• Use the utilities learned in this course to configure and initialize a
database server, and add additional spaces and logs as needed

ly
on
8 12
2X
se
ur
co
in
se
ru
Fo

© Copyright IBM Corp. 2001, 2011 Exercise 21. A Configuration Case Study 21-1
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises

21.1. Configuration Case Study 1

Pre-exercise discussion
__ 1. Review the resources that are available.
__ a. Draw a diagram of the disk resources.
__ b. What does the shared memory availability suggest as far as a starting size for
resident shared memory? Is there a limit to the total amount of shared memory?

__ c. What is a reasonable starting value for CPU VPs and AIO VPs?

__ 2. Does the case study scenario suggest anything about the distribution of data across
disk drives? How would this be implemented?

ly
on
__ 3. Are temporary dbspaces needed? What is a reasonable starting size and

12
distribution?

8
2X
__ 4. What does the case study scenario suggest about the size of the logical log? What
do you suggest as far as the location of the physical log, logical log, and rootdbs?
se
ur
co

__ 5. How many users are connected to the system at any one time?
in
se

__ 6. Is there one correct solution to this case study?


ru
Fo

Begin configuring
__ 7. Draw a diagram of the disk drives showing dbspaces and the contents of the
dbspaces. Assume that the rootdbs, physical log, and logical logs reside on different
disks.
__ a. What additional dbspaces should you create?

__ b. What size should they be?

21-2 Informix 11.7 System Admin © Copyright IBM Corp. 2001, 2011
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V5.4.0.3
Student Exercises

EXempty Implementation
__ 8. Create an sqlhosts file in your student directory and use INFORMIXSQLHOSTS to
reference it. Allow two methods of connecting to your database server. If you are
using UNIX files, create them before initialization.
__ a. Initialize your system using onmonitor.
__ b. Use command-line utilities to create any additional dbspaces, chunks, or logs.

Post-exercise discussion
__ 9. What were the various disk configurations chosen?

__ 10. What configuration parameter settings were used?

ly
__ 11. Does the total amount of physical and logical log space add up to the total size of

on
the dbspaces created to contain them? Why or why not?

8 12
__ 12. If, after monitoring the system for a while, you discover that the checkpoints are
2X
happening every minute, what configuration parameters would you check to confirm
whether this is reasonable? Which parameters might you change to lengthen the
se

time between checkpoints?


ur
co

__ 13. The checkpoint interval is now closer to what you want, but the checkpoint duration
in

is three minutes. What might you change to shorten the duration?


se
ru

__ 14. The checkpoint duration has improved but when you run onstat -R, you notice that
Fo

the MLRU queues have a greater percentage than lru_max_dirty. Also, onstat -F
indicates that there are some foreground writes. What is a possible remedy for this
situation?

__ 15. How else would you monitor your new system?

© Copyright IBM Corp. 2001, 2011 Exercise 21. A Configuration Case Study 21-3
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises

21.2. Configuration Case Study 2


This case study can be done individually or in a team. Your instructor will provide you with
the location of your disk devices (and the total amount of disk you are allowed to use).
__ 1. Your current Informix instance must be offline. If it is not, then make it so!
__ 2. Create an entirely new instance configuration, with the following initial system setup:
• Rootdbs of 10 MB.
• Mirror the rootdbs.
• You should have 3 temporary dbspaces called tempdbsl, tempdbs2, and
tempdbs3.
• Use the same server number as you have been using in class.
• You need two different types of connections:
- A shared memory connection to handle 50 users.

ly
on
- A TCP connection to handle 20 users.
• We are using this as an OLTP system.

12
__ 3. Wait for the sysmaster and sysutils databases to finish building.
8
2X
__ 4. After your server completes initialization for the first time, make the following
changes:
se

__ a. Add 3 temporary dbspaces of 5 MB each (see the third bullet of Step 2 above).
ur
co

__ b. Add 2 data dbspaces named dbspacel and dbspace2. Make each 10 MB.
__ c. Add 1 dbspace named logdbs. It should be 10 MB. It will contain the logs.
in
se

__ 5. You need 6 logical logs, 1 MB each, located in the logdbs.


ru

__ 6. You need 1 physical log, 2 MB, in the logdbs.


Fo

__ 7. Add 1 chunk of 10 MB to dbspace2.


__ 8. Add 1 chunk of 10 MB to dbspacel.
__ 9. Add mirroring to logdbs.
__ 10. Show your work to your instructor!

21-4 Informix 11.7 System Admin © Copyright IBM Corp. 2001, 2011
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V5.4.0.3
Student Exercises

EXempty 21.3. Solutions to Exercises

21.1. Configuration Case Study 1: One possible solution


The small amount of data does not warrant fragmenting tables, however, placing the
heavily accessed tables on separate drives could improve performance. Since this is a
small system (and you want to minimize CPU utilization), use one CPU VP and two AIO
VPs to start. Allocate one page cleaner for each disk and four LRU queues. During the first
pilot project, you can monitor the system and adjust the configuration parameters
accordingly. Based on ASU’s information about their report writer, allocate twice as much
temporary space as there is allocated for data. Make the logical log big enough to
accommodate transactions that update an entire table.
One possible configuration:
Rootdbs
Temporary dbspace

ly
Disk 1

on
Rootdbs => 5Mb Disk 2

12
Tempdbs1 => 5 Mb
8 Physdbs => 2Mb
2X
Tempdbs2 => 5 Mb
Dbs1 => 3Mb
se
ur

Physical logs
co

Disk 3 Temporary dbspace


Data dbspace
in

Logspace => 5Mb


se

Dbs2 => 5 Mb
ru

Logical logs
Data dbspace
Fo

Notice that two temporary dbspaces were created on different disk drives to accommodate
parallel access to temporary data. The rootdbs is large enough for an initial configuration
(different from the final configuration) and for future logged temporary tables. The two large
tables are located on different disks. The rootdbs, physical log, and logical log are located
on different disk drives.
After setting the configuration parameters using onmonitor and then initializing and
bringing the system into quiescent mode, the following script builds the system shown

© Copyright IBM Corp. 2001, 2011 Exercise 21. A Configuration Case Study 21-5
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises

above. To initialize the system from within the script, add oninit -iy as the first line followed
with onmode -uy for single user mode.
onspaces -c -d dbs1 -p filename -o 0 -s 3000
onspaces -c -d dbs2 -p filename -o 0 -s 5000
onspaces -c -d tempdbs1 -t -p filename -o 0 -s 5000
onspaces -c -d tempdbs2 -t -p filename -o 0 -s 5000
onspaces -c -d physdbs -p filename -o 0 -s 2000
onspaces -c -d logspace -p filename -o 0 -s 5000
onparams -a -d logspace -s 1000
onparams -a -d logspace -s 1000
onparams -a -d logspace -s 1000
onparams -a -d logspace -s 1000
onparams -a -d logspace -s 840
onparams -p -s 1890 -d physdbs -y
ontape -s
onmode -l

ly
onmode -l

on
onmode -l

12
onmode -c
onparams -d -l 1 -y
8
2X
onparams -d -l 2 -y
onparams -d -l 3 -y
se
ur
co
in
se
ru
Fo

21-6 Informix 11.7 System Admin © Copyright IBM Corp. 2001, 2011
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V5.4.0.3

backpg
Back page

ly
on
812
2X
se
ur
co
in
se
ru
Fo
Fo
ru
se
in
co
ur
se
2X
8 12
on
ly

You might also like