2X812 Student Exercise Guide PDF
2X812 Student Exercise Guide PDF
2X812 Student Exercise Guide PDF
cover
Front cover
Student Exercises
ERC 2.0
ly
on
812
2X
se
ur
co
in
se
ru
Fo
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
TOC Contents
Trademarks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . v
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
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
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
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
ly
on
8 12
2X
se
ur
co
in
se
ru
Fo
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
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
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
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
© 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
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
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
• Patches required
se
__________________________________
__________________________________
__________________________________
__________________________________
__________________________________
__________________________________
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
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
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
__ 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
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
© 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
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
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
cd $INFORMIXDIR/etc
in
__ 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?
__ e. How many logical logs are used during the building of sysmaster and sysutils?
se
ru
© 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
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
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
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
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
__ d. Display the Informix session ID and the UNIX process ID (PID) of your dbaccess
se
session.
ru
Fo
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.
__ 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
__ 5. Using sysmaster tables and views, execute SQL commands to obtain the following
co
information:
in
__ 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
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
onstat -d
se
onstat -l
Fo
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
SELECT name
co
FROM sysmaster:sysdatabases;
__ b. Display a list of all chunks that are online.
in
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
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
__ 2. Run the onstat - command to verify the current operating mode of your server.
__ 3. Bring your server from Quiescent mode to Offline mode.
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
__ 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
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
__ 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
__ 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
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
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
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
__ 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
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
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
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
__ 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
__ 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
__ b. Run onstat -g ath. Are there any threads running on the new CPU VP? See if
in
__ 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
__ 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
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
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
process.
se
© 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
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
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
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
__ 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
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
__ i. A communications VP class.
se
d 13. noyield
server.
Fo
© 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
ly
on
8 12
2X
se
ur
co
in
se
ru
Fo
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
Hint
ru
Try using commands that extract the specific information you need. For example:
Fo
__ 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
total 1636
ru
__ 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);
__ 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?
__ b. How many pages have been used for the index? What do they contain?
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
__ 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
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
size, enter onstat -b at the command line and locate the buffer size in the
co
__ 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?
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
__ 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
__ 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.
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
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
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
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
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
__ 5. Create a dbspace named dbspace1. Make the initial chunk 8000 kilobytes with a
se
__ 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
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
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
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
__ 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
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
© 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
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
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
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
© 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
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
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
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.
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
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
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
__ 6. Run the onstat -m command to view the last few lines of your message log. When
se
Look for a line in the message log that begins with Checkpoint Completed.
Fo
© 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
__ 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
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
__ 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.
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
__ 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
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
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
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
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
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
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
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
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
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
__ 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?
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
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
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
__ 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
__ 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
or
Fo
© 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
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
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
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
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
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
__ 14. Modify your configuration file by changing the DBSPACETEMP parameter back to
se
© 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
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
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
cache.
co
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
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
© 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
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
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
BEGIN WORK;
ru
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
__ 9. Change the LTAPEDEV parameter in the configuration file back to the directory you
had before.
in
__ 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
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
__ 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?
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
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
__ 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
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
__ 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
Your message log should contain messages that look something like this:
Fo
© 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
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
__ 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
__ e. Force a checkpoint.
__ 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
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
__ 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
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
© 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
ly
Hint
on
The parameters required for the CREATE CHUNK command are dbspacename,
12
pathname, size, offset.
8
2X
se
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
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
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
© 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
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
__ 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
ly
on
8 12
2X
se
ur
co
in
se
ru
Fo
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
__ 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?
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
__ b. What does the error number that is referenced in the message mean? Does it
explain the problem?
se
ru
__ 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:
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
The message that best explains the problem is the one that begins,
co
You can reproduce the error messages by using the UNIX kill command to
Fo
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
<exhibit removed>
co
User herbt initiated a transaction that was long enough to reach the
se
rolled back.
Fo
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
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
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
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?
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?
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
__ 13. The checkpoint interval is now closer to what you want, but the checkpoint duration
in
__ 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?
© 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
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
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
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
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