Foundation Db2 and Python: Access Db2 with Module-Based API Examples Using Python 1st Edition W. David Ashley - Download the ebook today and experience the full content
Foundation Db2 and Python: Access Db2 with Module-Based API Examples Using Python 1st Edition W. David Ashley - Download the ebook today and experience the full content
com
https://ebookmeta.com/product/foundation-db2-and-python-
access-db2-with-module-based-api-examples-using-python-1st-
edition-w-david-ashley/
OR CLICK HERE
DOWLOAD EBOOK
https://ebookmeta.com/product/foundation-db2-and-python-access-
db2-with-module-based-api-examples-using-python-1st-edition-w-david-
ashley-2/
ebookmeta.com
https://ebookmeta.com/product/learn-opencv-with-python-by-
examples-2nd-edition-james-chen/
ebookmeta.com
https://ebookmeta.com/product/pocket-handbook-of-gi-
pharmacotherapeutics-3rd-edition-marianna-g-mavilia-george-y-wu/
ebookmeta.com
Training a Wife 1st Edition Trinity Blacio
https://ebookmeta.com/product/training-a-wife-1st-edition-trinity-
blacio/
ebookmeta.com
https://ebookmeta.com/product/physics-text-book-part-1-for-
class-12-12089-ncert-author/
ebookmeta.com
https://ebookmeta.com/product/the-business-of-emotions-in-modern-
history-1st-edition-mandy-l-cooper/
ebookmeta.com
https://ebookmeta.com/product/web-development-and-design-foundations-
with-html5-10-e-10th-edition-terry-felke-morris/
ebookmeta.com
https://ebookmeta.com/product/euphrates-river-valley-settlement-the-
carchemish-sector-in-the-third-millennium-bc-edgar-peltenberg/
ebookmeta.com
Foundation
Db2 and Python
Access Db2 with Module-Based API
Examples Using Python
—
W. David Ashley
Foundation Db2
and Python
Access Db2 with Module-Based API
Examples Using Python
W. David Ashley
Foundation Db2 and Python
W. David Ashley
Austin, TX, USA
v
Table of Contents
vi
Table of Contents
Creating a Table��������������������������������������������������������������������������������������������������������������������� 41
Alter a Table��������������������������������������������������������������������������������������������������������������������������� 43
Other Table SQL Statements�������������������������������������������������������������������������������������������������� 43
Dropping a Table�������������������������������������������������������������������������������������������������������������������� 44
Summary������������������������������������������������������������������������������������������������������������������������������������ 44
vii
Table of Contents
viii
Table of Contents
ix
Table of Contents
ibm_db.execute_many�������������������������������������������������������������������������������������������������������� 163
ibm_db.fetch_tuple������������������������������������������������������������������������������������������������������������� 165
ibm_db.fetch_assoc������������������������������������������������������������������������������������������������������������ 166
ibm_db.fetch_both�������������������������������������������������������������������������������������������������������������� 167
ibm_db.fetch_row��������������������������������������������������������������������������������������������������������������� 168
ibm_db.field_display_size��������������������������������������������������������������������������������������������������� 169
ibm_db.field_name������������������������������������������������������������������������������������������������������������� 169
ibm_db.field_num��������������������������������������������������������������������������������������������������������������� 170
ibm_db.field_precision�������������������������������������������������������������������������������������������������������� 172
ibm_db.field_scale�������������������������������������������������������������������������������������������������������������� 173
ibm_db.field_type���������������������������������������������������������������������������������������������������������������� 174
ibm_db.field_width������������������������������������������������������������������������������������������������������������� 174
ibm_db.foreign_keys����������������������������������������������������������������������������������������������������������� 175
ibm_db.free_result�������������������������������������������������������������������������������������������������������������� 178
ibm_db.free_stmt���������������������������������������������������������������������������������������������������������������� 179
ibm_db.get_option�������������������������������������������������������������������������������������������������������������� 179
ibm_db.next_result������������������������������������������������������������������������������������������������������������� 181
ibm_db.num_fields�������������������������������������������������������������������������������������������������������������� 183
ibm_db.num_rows�������������������������������������������������������������������������������������������������������������� 184
ibm_db.pconnect����������������������������������������������������������������������������������������������������������������� 185
ibm_db.prepare������������������������������������������������������������������������������������������������������������������� 187
ibm_db.primary_keys���������������������������������������������������������������������������������������������������������� 188
ibm_db.procedure_columns������������������������������������������������������������������������������������������������ 190
ibm_db.procedures������������������������������������������������������������������������������������������������������������� 192
ibm_db.recreatedb�������������������������������������������������������������������������������������������������������������� 194
ibm_db.result���������������������������������������������������������������������������������������������������������������������� 194
ibm_db.rollback������������������������������������������������������������������������������������������������������������������� 195
bm_db.server_info�������������������������������������������������������������������������������������������������������������� 196
ibm_db.set_option��������������������������������������������������������������������������������������������������������������� 199
ibm_db.special_columns���������������������������������������������������������������������������������������������������� 201
x
Table of Contents
ibm_db.statistics����������������������������������������������������������������������������������������������������������������� 203
ibm_db.stmt_error�������������������������������������������������������������������������������������������������������������� 206
ibm_db.stmt_errormsg������������������������������������������������������������������������������������������������������� 206
ibm_db.table_privileges������������������������������������������������������������������������������������������������������ 207
ibm_db.tables���������������������������������������������������������������������������������������������������������������������� 209
Summary���������������������������������������������������������������������������������������������������������������������������������� 210
Index��������������������������������������������������������������������������������������������������������������������� 211
xi
About the Author
W. David Ashley is a technical writer for Skillsoft where he
specializes in open source, particularly Linux. As a member
of the Linux Fedora documentation team, he recently led
the Libvirt project documentation and wrote the Python
programs included with it. He has developed in 20 different
programming languages during his 30 years as a software
developer and IT consultant, including more than 18 years at
IBM and 12 years with American Airlines.
xiii
About the Technical Reviewer
Sourav Bhattacharjee is a senior technical member for
Oracle Cloud Infrastructure. As part of IBM Watson Health
Lab, he has developed many scalable systems, published a
few research papers, and applied some patents to USPTO. He
has an ample amount of hands-on experience in Python,
Java, machine learning, and many database systems. He
earned his master’s degree from the Indian Institute of
Technology, Kharagpur, India.
xv
CHAPTER 1
Introduction to Db2
Welcome to this introduction to Db2. Since you are here, you are likely looking for a
place to get started with Db2. Our hope is that this book will be that first step you are
looking for. This book is meant to be an introduction to the Db2 environment and to
the Python interface. The first half of the book will cover Db2 at a level that should be of
interest to both administrators and programmers. It will cover many aspects of Db2 that
you will make use of in either of the two roles. The last half of the book will concentrate
on using the Python programming language to interface to Db2. While mainly oriented
to programmers, administrators will find it useful as well for some of their everyday
tasks.
Db2 has a long history and is the first relational database implementation. It was
first proposed by Edgar Frank “Ted” Codd in a paper titled “A Relational Model of Data
for Large Shared Data Banks” in 1969 while working at the IBM’s San Jose Research
Laboratory in California. In the next four years, IBM researchers worked to create a
system based on the principles described in Codd’s paper (called System R). During
this time, it became obvious that a new language was needed to interact with the new
system. Codd wrote a new paper “A Data Base Sublanguage Founded on Relational
Calculus,” which became the basis for the new language called DSL/Alpha. This quickly
went through some name changes but eventually ended up being called SQL, short for
Structured Query Language.
Eventually there was an effort in the 1970s to port DSL/Alpha to the 370 mainframe
environment. It was renamed to Database 2 in 1982. The next year it was made available
to the public with another name change, DB2. This was a limited release but was highly
regarded by the customers that evaluated it. The customers actually pushed IBM to
deliver DB2 to a wider set of customers. IBM was somewhat reluctant because they were
trying to hold on to their IMS/DB market share. But eventually the customers won out,
and DB2 began to spread to other platforms including OS/2, AIX/RS6000, and Windows.
1
© W. David Ashley 2021
W. D. Ashley, Foundation Db2 and Python, https://doi.org/10.1007/978-1-4842-6942-8_1
Chapter 1 Introduction to Db2
Over the next two decades, the product went through a number of name changes
and several platform code bases. Recently with the release of version 11.1, IBM
rebranded the entire product line and brought the code bases into a small number of
code bases. The following set of products are now the standard offerings:
The code bases for today’s Db2 offerings share a common code base that makes
porting the code to another hardware/software platform a relatively easy process. The
SQL code base has been standardized so that it is the same across all platforms, making
moving to another platform an easy task from a programming perspective.
There is also a current movement in programming applications with embedded
SQL. These types of applications are very hard to port from one platform to another
without major code modifications. Instead, IBM is moving (where possible) to an API
that can be called to process SQL statements and make use of programming language
variables for values to be added to the SQL statement. This is the methodology used for
Python that we will explore later in this book.
In the past, Db2 was considered to be too large for most applications. But as personal
computers have become a lot more powerful and then databases used by even a small
number of people have become extremely large, Db2 has become more attractive in the
management of this data. Also, the pricing model of Db2 on these platforms has become
more competitive. So if you need the performance and the ability to manage large
amounts of data, Db2 can be a very attractive product.
2
Chapter 1 Introduction to Db2
This table is a good example because it shows the kind of relationships that can
be expressed in a relational database. The CUSTNO column holds a unique customer
number for each customer (or row). The column is the primary key for this table. The
FNAME and LNAME identify the first and last names of the customer. The STREET is
the address to be used for billing the customer. The STATE column is the U.S. state the
address is located. The ZIP column identifies the mailing zip code.
3
Chapter 1 Introduction to Db2
D
omains
Domains (or attributes) limit the data in a column to a particular type. For instance, the
data might be an integer of a particular type, a monetary value, a character string of fixed
or variable length, a date or time value, or some other domain that has been defined.
K
eys and Indexes
The STATE column in Table 1-1 is a foreign key – that is, a primary key in another table.
A rule can be set up so that when you add a new row to the customer table, the system
checks that the value in your proposed STATE field is a valid entry in the state table. If it is
not, the record will not be inserted, and an error will be generated. Keys are also known
as indexes. When you create a primary key in a table, a special index table is created to
hold valid keys. This table is like any other table in the system; it can be queried, added
to, and deleted from. Thus, all the valid keys can be inserted into and maintained in the
table, and it can be maintained just like any other table. Only the special rules make the
index table special.
R
elationships
All of this shows just some of the kinds of relationships that can be created (or derived)
to properly maintain a set of tables. There are probably other kinds of customer tables
that could be created like a table to maintain customer credit ratings, a customer
shipping address table, a customer contacts table, etc. All of these are specialized entities
that have relationships with the other customer tables. This is what a relational database
is all about. The idea is to express a relationship with data organized so the data is only
stored where needed and hopefully only one time.
Relationships allow the user to create customized reports that can express custom
views of the data from the database. At first glance these reports may look like they have
no relation to the data contained in the database, but they can give insights to the data
not easily possible by other means.
4
Chapter 1 Introduction to Db2
Transactions
Another aspect of relational databases is support for transactions. This means providing
a locking mechanism that can allow data to be modified while others are reading the
data or modifying other data at the same time. This is known as the ACID test, which is
an acronym for the following tests:
Stored Procedures
A relational database typically implements stored procedures. These are programs
stored in the database to implement special processing under several circumstances.
These procedures usually involve business logic that needs to be implemented the
same across all the database users. In many cases, only the stored procedure has the
proper permissions to modify, insert, delete, or access the data being manipulated. This
prevents users from making modifications to the data if they do not have the correct
permissions.
5
Chapter 1 Introduction to Db2
Constraints
Another property of relational databases are constraints. These make it possible to
further restrict an attribute. For instance, a column might be defined as an integer. But
the range of numbers might actually need to be constrained to a particular range. This is
what a constraint provides.
Constraints can come in many forms and are used for a number of purposes. They
are stored within the database and used when adding or modifying data.
Normalization
Normalization is another attribute of a relational database. This design process reduces
the number of nonatomic values and the duplication of data throughout the database,
thus preventing anomalies and loss of integrity. The process is known as normalization.
The process of normalization is performed by the administrator, usually during the
creation of the database. Users are not usually involved in this activity.
SQL
Within the first few years of creating the first relational database, it became very obvious
that something was needed to actually manipulate the data in a relational database. The
language was invented at IBM by Donald D. Chamberlin and Raymond F. Boyce in the
early 1970s. It was originally known as SEQUEL, but that name was trademarked and it
was changed to Structured Query Language (SQL). SQL was later standardized by ANSI,
but each relational database product extended it as needed to conform to their product
or hardware platform.
SQL is divided into four categories of statements:
Most SQL books spend most of their resources on the DML part of SQL, but the other
parts are just as important, especially to the database administrator.
6
Chapter 1 Introduction to Db2
7
Chapter 1 Introduction to Db2
The INSERT statement adds new rows into a table. This new data may also
automatically alter the content of a view of the table data.
The UPDATE statement alters one or more rows in an existing table (and any view
dependent on the table). The statement does not add new rows to a table, it only alters
existing data.
The DELETE statement removes rows from a table (and any view dependent on the
table).
S
ummary
This chapter has presented some of the basic concepts that make up a relational
database and the SQL that supports it. This information is common to almost all
relational databases.
8
CHAPTER 2
Installing Db2
This chapter covers installing Db2 on Linux and Windows. Both environments use
the same installer to perform installation and creation of userids and permissions.
The installation process is pretty easy and straightforward, but there are a number of
questions you might have before you start the installation that are not answered by the
install program. We will try to cover those questions as we come to them.
9
© W. David Ashley 2021
W. D. Ashley, Foundation Db2 and Python, https://doi.org/10.1007/978-1-4842-6942-8_2
Chapter 2 Installing Db2
The fourth system is a Lenovo ThinkCentre M920 with 256 GB of SSD and a 1 TB
drive with 16 GB of memory. It has an i7 CPU. This is my development workstation
where I test all my Linux development and remote access to servers. The operating
system is Fedora 32.
The fifth system is a Lenovo ThinkPad T580 with 256 GB of SSD, 16 GB of memory,
and an i7 CPU. It runs Fedora 32 and usually serves as my travel machine but also as an
auxiliary test device.
I nstallation Prerequisites
Before you even start the Db2 install program, there are a number of prerequisites that
need to be met before you can successfully install everything. Our install environment
for this book is CentOS 8.2. The prerequisites for this OS should be the same for RHEL
8.2, but may be different for other Linux environments. Windows environments have
their own prerequisites, but they are similar to the Linux prerequisites.
The first thing we need is the Db2 install program and support files. To get the free
version of Db2, just go to
www.ibm.com/account/reg/us-en/signup?formid=urx-33669
This gets you to the account registration page. You can either log in with an existing
userid or create a new one. After you are logged in, the website will present you a
preferences page. Select your preferences and select the Continue button. On the
next web page, select the download you need. Unless you need them, just ignore the
pureScale support downloads. Once the download is complete, move the downloaded
file to a safe location and then unzip or untar it. This will create a new subdirectory in the
current directory with the install files exploded inside.
Caution! Do not move the downloaded file to the directory you intend to place
databases. You will have a mess of files on your hands when you create your first
database.
At the time this book was written, the version of Db2 that was available was version
11.5.4. Older free versions of Db2 are not made available when IBM introduces a new
version.
10
Chapter 2 Installing Db2
Now that you have your evaluation version of Db2, you are probably wondering what
its limitations are. The evaluation version does not ever expire. It has no limitation on
the number of databases. The one and only limitation is the total size of all databases,
currently limited to 100 GB. This is more than enough space to perform your own
evaluation of the software unless you are trying to test a very large system. If that is your
plan, IBM will be more than glad to help with a production version of Db2 and even
some engineers.
At this point, we are now ready to find out what our prerequisites are. To do this,
simply run the install program. This program is located in the untarred subdirectory
we previously created. The expanded directory is named server_dec. To run the install
program, just run the following commands:
$ cd server_dec
$ ./db2setup
If prerequisites are needed by Db2, the install program will list them and then exit.
Be sure to read everything output by the install program. On our CentOS 8.2 system, it
listed two prerequisites:
• libpam.so* (32-bit)
• libstdc++.so.6 (32-bit)
“Wait. Why does Db2 need 32-bit libraries?” you ask. Db2 is a collection of a bunch
of products, some of which have not changed in a decade or more. Rather than possibly
introducing new bugs into the system, IBM has chosen to keep the older version of
some of these products. Thus, these prerequisite libraries are needed to support those
products.
Use your system’s software installer to install the prerequisite packages. For Linux,
this will be either the dnf or yum programs for RPM-based packages. Once you have the
prerequisites installed, you are ready to proceed to really installing Db2. But before we
do that, we need to do a little planning.
11
Chapter 2 Installing Db2
The first result of the install is that you will have two new userids created on the
target machine. The default names of these IDs are db2inst1 and db2fenc1. The
db2inst1 ID will have some files stored in its home directory, and you need to make
sure there is enough space to accommodate them. There are a limited number of files,
but you should make sure you are prepared for them. The db2fenc1 ID only has a very
limited number of files stored in its home directory.
The second result is not really a result of the install. It is more a default that is set
as a result of the install. This item is the location where databases will be installed. The
default location for databases is in the db2inst1 home directory! THIS IS NOT WHERE
YOU WANT TO STORE DATABASES! You are probably going to store them on a different
drive/location. We will discuss this point again after we cover the install process and
before we create the sample database.
There are also a few minor points that are a result of the install, but we will cover
those as we get to them.
I nstalling Db2
We are now ready to install Db2. This process must be done by the root (on Linux)
or admin (on Windows) user, so start by becoming the root/admin user. On Windows
you will need to log out and log back in as the admin user. On Linux just perform the
following command:
$ su - root
After this you need to change to the directory where you placed the expanded files of
the Db2 download package. Then run the db2setup install package:
$ cd server_dec
$ ./db2setup
If you have installed all the prerequisites, this should show you the Welcome page
(Figure 2-1).
12
Chapter 2 Installing Db2
This page has a number of products that you can select. The first product is Db2
Server, and this is the product we will install. The second product is Db2 with pureScale,
which we did not download. The third product is Db2 Connect Server, which is used
for distributed databases. The fourth product is Db2 Connect Client, which is used for
building compiled code that includes SQL statements. The last product is Db2 Runtime
Client, which is used for running compiled code from the Db2 Connect Client version.
At this point you should select the top item in the list, Db2 Server Editions. The
version number may be different if you downloaded a newer version of Db2. The other
selections are not important at this point in time. After clicking the Next button, the next
page will appear.
14
Chapter 2 Installing Db2
The Configuration page allows you to select either a Typical or a Custom install. At
this point, select a Typical install. You must also check the box to agree to the IBM terms
before you proceed. When finished, click the Next button and the next page shown in
Figure 2-4 will appear.
You can check out the Custom install option for some items you may want to change.
Most users just perform a Typical install.
The Instance Owner page allows you to create the account that will own the first
instance of Db2 and the group name of the new user. Just leave the db2inst1 information
as it appears and then enter the password and confirmation for the new account. This
is the account that will have new files installed in its home directory. When you have
entered in the new password and confirmed it for the account, click Next and the page
shown in Figure 2-5 will be displayed.
15
Chapter 2 Installing Db2
The db2fenc1 user will run user-defined functions and stored procedures outside the
address space of the Db2 database. Enter the db2fenc1 password and confirm it. When
finished, click Next which will dosplay the page in Figure 2-6.
16
Chapter 2 Installing Db2
The next page is the Response File and Summary page. The response file is a part of
the installation set of files, so it does not have to be created. Click the Finish button to
start the install of Db2 as shown in Figure 2-7.
17
Chapter 2 Installing Db2
When the installation is complete, this is the page that will be shown. You can choose
to review the post-install steps, review the log file, or just click the Finish button to exit
the install.
At this point, the Db2 installation steps are complete, and we are ready to look at the
post-install tasks that will need to be considered.
Note With Ubuntu Linux, the Db2 instance owner and fenced user that are
created by the Db2 install are assigned the Dash shell by default. This can cause
scripts that begin with the line #!/bin/bash to stop working. If you want to use Bash
as the default shell when you log into either of these users, execute the command
csh -s /bin/bash username (where username is the name of the Db2 instance
owner or fenced user) before doing anything else.
1. Try to log into the db2fenc1 userid using the password you set
from the db2setup command. Correct any problems you may find.
2. Try to log into the db2inst1 userid using the password you set
from the db2setup command. Correct any problems you may
find. You should note the location of the sqllib directory and its
contents as you may need to become familiar with them. This may
or may not be a link to another location.
This will update the path in the Db2 configuration so that all databases belonging to
db2inst1 will be stored in the new location.
At this point, we are now finished with our post-install tasks, and we are ready to
proceed to installing the sample database.
19
Chapter 2 Installing Db2
$ su - db2inst1
The Db2 database instance needs to be started, so that is our next step:
$ db2start
Now we can actually install the sample database. This command will take a few
minutes, so be patient:
The -force option ensures that if the database is already installed, it will be overlaid
with the default content. The -sql option tells Db2 not to install the XML data into the
database.
Now we can connect to the database and test it:
If successful, you should see some output that looks something like this:
20
Chapter 2 Installing Db2
Important Be sure to include quotes around the text that follows db2. If the
quotes are omitted, the operating system will try to process the command
incorrectly, and an error will result.
Summary
This chapter has presented the steps to installing and verifying the installation of Db2.
Be sure to read the Caution, Note, and Important sections presented in the chapter as
they have valuable information for some operating systems.
21
CHAPTER 3
Db2 Management
The management of Db2 is not an easy affair. It is not like any open source relational
database. It is a little like Oracle, but there are differences. This is because Db2 for Linux,
Unix, and Windows is a lot like maintaining a mainframe database, just on a smaller and
easier scale. While there are many tools to help manage the Db2 environment contained
in the product itself, the key to proper management is understanding the architecture
of the product and how it manages hardware resources. Without this knowledge, it
is easy to get into trouble and overextend the hardware of the machine. With proper
management, a single piece of hardware can manage either a few large databases or
many smaller ones without stretching the resources on the machine too far.
This chapter will give you enough knowledge so that you can set up the Db2
environment properly without overburdening you with facts that have few, if any,
consequences.
D
b2 Instances
Instances are the top-level architectural structure in Db2. When you installed Db2, you
created the first Db2 Instance, which had the default name of db2inst1. This is also the
Instance that holds the sample database we installed in the previous chapter.
Any number of databases can be installed in an Instance. But it is possible to
overload an Instance and cause performance problems. This is because Db2 sets aside
a fixed number of processes and threads for each Instance, and it does not dynamically
add or remove resources during the active lifetime of an Instance. You must stop the
instance, adjust the number of resources, and then restart the Instance. Of course, the
databases owned by the Instance will have to be stopped and restarted as well. That
is the key: stopping and starting an Instance can have impacts on availability and the
contained databases. If you are continually stopping and restarting Instances, your
users will not be very happy with your management skills.
23
© W. David Ashley 2021
W. D. Ashley, Foundation Db2 and Python, https://doi.org/10.1007/978-1-4842-6942-8_3
Chapter 3 Db2 Management
Instances are easy to describe, but harder to justify. You have to know some history
to be able to properly understand where they came from as well as why they even exist.
Instances were first introduced just after the year 2000. Their justification came as the
databases on multi-drive machines started to become very large. They were so large
and had so many users that the network interface became a bottleneck in processing
database requests. It seems that the machines now far outpaced the network in being
able to handle database requests. Db2 had plenty of idle time while it waited on the
network interface to process the next request. This was in the days when the fastest
common networks were only 10 MB capacity. What was needed was a way to divide the
databases among multiple network ports. Thus, instances were born.
Instances were not only given their own network port, they were also given their
own processes, threads, and semaphores. Thus, if a database crashed for any reason, it
would only disrupt the databases within the containing Instance. The other Instances
and databases would continue to run normally while the database administrator dealt
with the downed Instance.
Instances can be used in many ways by the database administrator, but the most
common use is to prevent network port congestion. The second most common use is to
separate sets of databases from each other for security purposes. Since each Instance
has its own set of administrators and users, this helps to enforce security between
Instances.
One other attribute of an instance is that it has no physical presence on your disk
system, or at least not much of one. It is very hard to point to a place in the disk system
and say, “This is where an instance resides.” There are a few files created with the
instance, but these do not describe where the instance is. You should just think of it as
a logical entity and not a physical one.
There is a set of commands that administrators can use to manage instances. The
following are some example Db2 commands that manage Instances.
Note All the commands used in this chapter can be run in one of two ways. They
can be run by logging into the db2inst1 user, or they can be run by using the
sudo db2inst1 prefix to the command.
24
Chapter 3 Db2 Management
db2ilist
This command lists all the Instances that are available on a system:
db2ilist
Output:
db2inst1
db2inst2
db2inst3
Output:
To start or stop the database manager of an instance on Db2 UDB, the following
command is executed for the current instance:
set db2instance=db2inst1
Using this command, you can start an Instance. Before this, you need to run “set
instance”:
db2start
Output:
db2stop
Output:
25
Chapter 3 Db2 Management
Creating an Instance
Let us see how to create a new Instance.
If you want to create a new Instance, you need to log in with root. An Instance ID is
not a root ID or a root name.
Here are the steps to create a new Instance:
Step 1: Create an operating system user for an Instance.
Example:
Step 2: Go to the Db2 Instance directory as a root user to create a new Instance.
Location:
cd /opt/ibm/db2/v10.1/instance
Example:
Output:
26
Chapter 3 Db2 Management
Example:
Syntax 1: Update configuration with the service name. In the following syntax,
“svcename” indicates the Instance service name, and “inst_name” indicates the
Instance name.
Example 1: Updating DBM configuration with variable svcename with value “db2c_
db2inst2” for Instance “db2inst2”
Output,:
Syntax 2: Set the “tcpip” communication protocol for the current Instance.
db2set DB2COMM=tcpip
Syntax 3: Stop and start the current Instance to get updated values from database
manager configuration.
db2stop
db2start
Updating an Instance
You can update an instance using the following command,:
db2iupdt
This command is used to update the Instance within the same version release.
Before executing this command, you need to stop the Instance database manager using
the “db2stop” command. The following syntax “inst_name” indicates the previously
released or installed Db2 server Instance name, which you want to update to a newly
released or installed Db2 server version.
27
Chapter 3 Db2 Management
db2iupdt <inst_name>
Example:
./db2iupdt db2inst2
db2iupdt -D <inst_name>
Example:
db2iupdt -D db2inst2
Upgrading an Instance
You can upgrade an instance from a previous version of a Db2 copy to a newly installed
version of a Db2 copy:
db2iupgrade
Example:
Command parameters:
If you are using the super user (su) on Linux for the db2iupgrade command, you
must issue the “su” command with the “-” option.
28
Random documents with unrelated
content Scribd suggests to you:
The Project Gutenberg eBook of L'Île du
Levant
This ebook is for the use of anyone anywhere in the United
States and most other parts of the world at no cost and with
almost no restrictions whatsoever. You may copy it, give it away
or re-use it under the terms of the Project Gutenberg License
included with this ebook or online at www.gutenberg.org. If you
are not located in the United States, you will have to check the
laws of the country where you are located before using this
eBook.
Language: French
L'ILE DU LEVANT
PAR
Paul OTLET
BRUXELLES
TYPOGRAPHIE ET LITHOGRAPHIE E. GUYOT
1882
L'ILE DU LEVANT
INTRODUCTION
Il y a un an et demi environ mon père m'annonçait qu'il venait
d'acheter de M. Philippart l'Ile du Levant, la dernière de l'Archipel
des îles d'Hyères, situé dans la Méditerranée. On peut juger de mon
enthousiasme et de celui de mon frère en apprenant cette nouvelle.
Une île en pleine mer! aller en bateau! Etre Robinson! Mener une
véritable vie d'insulaire. Que de projets on formait déjà, quel rêve
que d'habiter une île! Avec quelle impatience nous attendions les
vacances! comme nous comptions les jours qui nous en séparaient
encore!
Enfin ce jour heureux arriva. Comme la pendule marchait
lentement ce jour-là! Bref, le train exprès de 7 heures 20 du soir
nous emporte avec la rapidité de l'éclair vers ces régions bénies du
ciel, vers ce paradis terrestre. A 10 heures du matin nous étions à
Marseille, et à midi un quart nous débarquions à Toulon. Après avoir
mangé un morceau au Café du Commerce sur le port, nous nous
embarquons dans le yacht la Nora Creina. C'est un splendide vapeur
à hélice, comportant 7 hommes d'équipage, filant ses 9 nœuds à
l'heure et tenant la mer comme pas un. La Nora Creina a 27 mètres
de longueur sur 5 de large. Elle est divisée comme suit:
Cabine du capitaine et du second.
Grand salon, office, et une cabine.
Ensuite viennent la machine et la chaufferie.
3 cabines, la cuisine et enfin le poste de l'équipage.
La Nora jauge 38 tonnes et a une machine de la force de 70
chevaux. Elle cale 1 mètre 80 à l'avant et 2 mètres 30 à l'arrière.
Aussitôt montés à bord, quatre hommes s'empressèrent de déraper
l'ancre. Cinq minutes après nous étions en route pour l'île du Levant.
En passant devant le vaisseau amiral, le capitaine fît saluer trois fois
selon l'usage, et notre salut nous fut aussitôt rendu.
1880 1881
Janvier 7 Janvier 9
Février 3 Février 3
Mars 2 Mars 2
Avril 4 Avril 1
Mai 5 Mai pas
Juin 2 Juin ”
Juillet pas Juillet ”
Août ” Août 1
Septembre 1 Septembre 4
Octobre 3 Octobe 4
Novembre 8 Novembre 6
Décembre 1 Décembre 12
—— ——
Total 36 Total 42
II.
Sur l'île du Levant
Tout pousse à l'avenant.
Mais, chos' des plus étranges
Nous n'avons pas d'oranges.
• • • • • • • •
C'pendant pour en goûter
Nous pouvons en ach'ter.
III.
Sur l'île du Levant
Comme sur le continent,
Aidé par la nature,
On fait de l'agriculture.
• • • • • • • •
C'pendant il pleut trop peu
Sous notre beau ciel bleu.
IV.
Dans l'île du Levant,
Il n'y a pas longtemps
L'influence maligne
N'atteignait pas la vigne;
• • • • • • • •
Maint'nant l' Phylloxéra
Se conduit comme un rat.
V.
Dans l’île du Levant,
Ile d'or du vieux temps,
On trouve des richesses
Des mines de tout' espèces.
• • • • • • • •
C'pendant y a plus d' cailloux
Que de pierres à bijoux.
VI.
La belle île du Levant
A l'arche ressemblant
Contient, chose bizarre,
Des animaux peu rares;
• • • • • • • •
C'pendant Noé malin
Y mit trop de lapins.
VII.
Sur l'île du Levant
Vécur' probablement
Adam le premier homme,
Madame Eve et sa pomme.
• • • • • • • •
Maint'nant y a plus d' serpents
Que d'épouses d'Adam.
VIII.
A l'île du Levant
Le climat est charmant,
On n' connait pas la neige
Comme dans la froid' Norwège.
• • • • • • • •
C'pendant Monsieur le Vent
Est parfois trop violent.
IX.
Sur l'île du Levant
On vit bien sans argent,
On n'entend plus sans cesse:
Apporte-moi des espèces.
• • • • • • • •
C'pendant vers le premier
A Toulon faut payer.
X.
Près de l'île du Levant
On pêche facilement
Langoust', poissons par mille
Qu'on nomme rougets de l'île;
• • • • • • • •
Mais ils n' sont pas parents
Du poète puissant.
XI.
Dans l'île du Levant
On mang' comme chez Brébant.
L'on a s'maine et dimanche
Du lapin sur la planche.
• • • • • • • •
C'pendant not' cordon bleu,
Devrait varier un peu.
FINALE.
La belle île du Levant
Vous est connue maint'nant.
Voyez l' propriétaire,
Demandez-lui des terres.
• • • • • • • •
Si vous n'êt' pas grincheux,
Vous y s'rez très heureux.
VARIANTE.
«La rangée des îles d'Hyères[1], dit Adolphe Joanne dans son
guide d'Hyères, est composée de trois îles principales et de quelques
îlots[2]. Ce sont les anciennes Stœcades des Grecs. A l'époque de la
Renaissance, on désignait l'archipel par le nom poétique d'Îles d'or,
très probablement parce que sous l'influence des études classiques
et par une allusion instinctive au groupe des terres Fortunées, on
plaçait dans les îles d'Hyères les orangers qui entouraient la ville.
C'est d'ailleurs là une idée qui n'a pas encore été dissipée
complètement souvent on attribue par erreur le climat et les
productions de la campagne d'Hyères à cet archipel exposé à toutes
les fureurs du mistral. Elles sont très faiblement peuplées, bien
qu'elles possèdent d'excellents ports, des vallons fertiles, des
emplacements favorables à l'établissement d'usines diverses; elles
sont rarement visitées, en dépit de leurs sites charmants.
»L'île de Porquerolles« la plus connue et la plus peuplée des trois
grandes îles, tire son nom des sangliers qui peuplaient autrefois ses
forêts. C'est l'ancienne Porté (première). Elle a 8 kil. de longueur sur
2 kil. de largeur et compte environ 300 habitants. Porquerolles est
presque entièrement couvert de bois de pins et de chênes, et n'offre
guère de clairières que sur le versant septentrional de l'île. Les
maisons du hameau principal (hôtel restaurant du Progrès) sont
groupées au pied de la citadelle, sur les pentes d'un monticule qui
domine une petite crique semi-circulaire exposée au vent du nord.
Le phare, dont le feu fixe à éclat brille jusqu'à 36 kil., est situé sur
une autre colline (83 mètres) presque directement au sud. Les
constructions de la fabrique de soude, où travaillent plus d'une
centaine d'ouvriers, occupent un charmant vallon près de la pointe
occidentale de l'île[3].
»L'île de Port-Cros (Port creux), l'antique Mezé (île du milieu) est
située exactement en face du cap Bénat; sa longueur est de 4 kil., sa
longueur de 2 kil. 1/2. C'est la plus sauvage des trois îles de
l'archipel. La colline du vieux sémaphore qui porte une vigie fortifiée,
s'élève à 197 mètres. La population ne dépasse pas 20 à 25
habitants. Il s'y trouve aussi à l'est une fabrique de soude.[4] Le
gibier abonde à Port-Cros ainsi que dans l'îlot de Bagaud, à l'Ouest,
que l'on a récemment fortifié.
»L'île du Levant ou du Titan, appelée aussi Cabaros dans les
anciens titres, est l'antique Hypœa (inférieure) des Grecs. Ses
dimensions sont à peu près les mêmes que celles de Porquerolles.
Les collines dont la plus haute, les Pierres Blanches, s'élève à 129
mètres, sont presque entièrement couvertes de bois. Une colonie de
plus de 100 jeunes détenus y a été fondée. A l'extrémité orientale de
l'île se trouvent un phare à feu fixe de troisième ordre, d'une portée
de 27 kil., et les restes de l'ancienne tour du Titan. L'île du Levant
est la plus remarquable de l'Archipel par ses curiosités
minéralogiques: grenats, tourmaline, asbeste, etc.»
Nous citerons maintenant quelques passages tirés du remarquable
ouvrage d'Amédée Aufauvre, intitulé Hyères et sa Vallée, édité chez
Hachette, et dans lequel il parle de l'île du Levant en ces termes:
«Son nom indique sa situation. Autrefois cette île portait le nom
de la tour antique dont les vestiges gardent encore le nom primitif
de Tour du Titan. Sa longueur est de 8 kilomètres sur une largeur
moyenne de 1 kilomètre et demi.
»L'île du Levant dispute à Porquerolles l'honneur d'avoir servi de
retraite à Théodore, évêque de Fréjus, après avoir été moine dans le
couvent de Saint-Honorat de Lérins. C'est aussi dans l'île du Levant
que se réfugia le Monge des îles d'Or.
Quoique la plus grande, quoique son sol soit moins accidenté que
celui de ses voisines, l'île du Levant possède encore moins
d'habitants que Port-Cros bordée d'écueils, moins fertile que
Porquerolles. Cette île est celle qui présente le plus d'intérêt au point
de vue zoologique et végétal.
»Elle fut celle sur laquelle les chevaliers de Saint-Jean de
Jérusalem paraissent avoir eu des projets d'établissement.
»Entre l'île du Levant et Port-Cros il n'y a pas plus de 3
kilomètres[5], mais de la plage d'Hyerès la distance est évaluée à 25
kilomètres.[6]
»A l'île du Levant on trouve à peu près tous les sols et toutes les
végétations particulières à l'Archipel, les oiseaux et les quadrupèdes
n'offrent pas beaucoup de variantes. Mais, ce qui donne un intérêt
particulier à ce territoire, c'est la présence des roches granatifères,
de l'andalousite, de toutes les variétés de la tourmaline, gisements
d'amiante, de titaniate de fer etc., et surtout la collection complète
de la flore particulière au climat de la contrée.»
Nous trouvons encore à l'île du Levant les ruines d'un ancien
château maure, construit pendant l'occupation des montagnes de
Provence de 889 à 975 par les Maures. Donc le Castellas remonte au
moins au Xe siècle. Ce château est bâti sur la crête d'un rocher
escarpé, situé à peu près au milieu de l'île du côté nord. On y trouve
encore des oubliettes.