Friday, May 27, 2011

A Relational Database Management System (RDBMS)

A Relational Database Management System (RDBMS) is a Database Management System (DBMS) that is based on the relational model. Most database systems today are based on this type of system.

A database is a vital system for any organisation that stores mission critical information. The continual failure of a company's database system can only lead to the demise of the organisation - companies cannot do business without a working database system.

To provide an insight into the quality of software that is available, we have compiled a list of 10 open source RDBMS. Hopefully, there will be something of interest here for anyone who wants to store data in an efficient way.

There are many excellent database systems that are closed source free to download applications. Worthy of particular note are DB2 (a real heavyweight by IBM), Oracle Database 11g (developed by Oracle Corporation), MaxDB (capable of running terabyte-range data in continuous operation) and Berkeley DB (a high-performance embedded database).

Now, let's explore the 10 open source RDBMS at hand. For each title we have compiled its own portal page, a full description with an in-depth analysis of its features, together with links to relevant resources and reviews.
READ MORE - A Relational Database Management System (RDBMS)

The DCL identifies


The DCL identifies two levels of technical priorities for Linux in the data center: Priority One Capabilities are considered the most important for data center readiness for Linux, while Priority Two Capabilities are those intended to stimulate thought and discussion.

Beyond general priorities of importance, the DCL working group examines Linux enterprise capabilities in the traditional functional areas:
Scalability
Performance
Reliability, availability, serviceability (RAS)
Manageability
Clusters
Security
Usability
Standards
The standards category references specifications controlled outside DCL. This category includes only capabilities with standards related to adopting Linux in data centers.

At this stage, the OSDL DCL investigation is focused on enterprise-level usage models. The technical discussions center around data center issues such as security, storage networking, and file system performance. Because the objective of the DCL is to accelerate the maturation of Linux as an enterprise operating system, investigation of the other features on this list concentrates on server functionality and data center administration needs. Clearly, most of the features on this list are equally important to all who develop, use, or administer the system. But these nonserver-related issues are addressed in other OSDL initiatives such as the Desktop Linux working group.

In the latter half of 2004 the DCL Working Group will move on to its second objective: documenting the requirements necessary to advance Linux further in the data center, and recommending technical approaches to meet those requirements.
Call for Participation


The mission of the Data Center Linux (DCL) Working Group is to provide a forum for industry leaders to accelerate adoption and deployment of Linux in data centers.

The working group has completed its first pass at identifying Linux capabilities in the data center, and has developed a prioritized list of capabilities needed. The Data Center Linux Technical Capabilities v1.0 document is available for public review on the OSDL Web site. We encourage any interested person to review it and provide input. Together we can all help Linux become the enterprise operating system of choice.
READ MORE - The DCL identifies

Monday, May 16, 2011

Creating a DNS Server, Web Server and Database Server Using Linux Fedora 8

Creating a DNS Server, Web Server and Database Server Using Linux Fedora 8

DNS server and LAMP using Fedora Linux I have ever actually write in my previous article, about DNS Server Linux, Linux Web Server. With the aim of helping fellow who just happened to switch to Linux and using Linux Fedora 8, it helps me write this article. This guide is for the case as follows:

Creating a DNS server for the domain linuxer.local

Creating a virtual DNS servers for domains fxekobudi.local, sarolangun.local

Creating a Web server for the domain linuxer.local, fxekobudi.local, and sarolangun.local

Creating a server using a MySQL database to be used by open source applications (WordPress, Joomla, and Drupal) locally on the domain site builder that I mentioned above.


Before you start stepping into the configuration of DNS and LAMP (Linux-Apache-MySQL-PHP), the following is the configuration on the laptop that I use:


Loopback IP: 127.0.0.1

NIC IP Address: 192.168.0.44

Netmask: 255,255,255,192 (/ 26)


Package BIND: bind-9.5.0-18.a7, bind-libs-9.5.0-18.a7, bind-utils-9.5.0-18.a7, bind-chroot-9.5.0-18.a7

Package APACHE: httpd-2.2.6-3 httpd-tools-2.2.6-3, system-config-httpd-1.4.4-1, httpd-manual-2.2.6-3

MySQL Package: mysql-libs-5.0.45-4.fc8, mysql-5.0.45-4.fc8, mysql-server-5.0.45-4.fc8

PHP Package: php-common-5.2.4-3 php-5.2.4-3 php-gd-5.2.4-3 php-cli-5.2.4-3 php-mysql-5.2.4-3


All packages are already included in Fedora 8 installer DVD, so if you have not installed, please install using the DVD media or can also use the repository of Fedora 8. To check whether already installed or not, use the command: $ rpm-qa | grep [package name]
READ MORE - Creating a DNS Server, Web Server and Database Server Using Linux Fedora 8

Open Source Databases

Open Source Databases
Even as Linux has garnered support by all of the major commercial database vendors, the freely available open source databases have grown in sophistication and features. Below follows a partial list of some of the more popular of these.

Please Note, in addition to the listings below, many of the commercial database vendors have free "personal edition" or "single user" policies that allow their products to be used free of charge at home or in non-commercial applications. The goal of these policies to allow users to evaluate their software free-of-charge, and to allow developers to port their applications without making a large financial investment.


SQLite Embeddable SQL Database Engine (New Listing!)
SQLite Embeddable SQL Database Engine is a C library that implements an entire SQL server. This allows application programmers to embed an SQL server directly into thier application. Note that this is not a client library, and it cannot be used to contact an SQL server.
Implements most of the SQL 92 dialect.
Small footprint; 25K lines of code.
Sources in the public domain; no license.

McKoi SQL Database
The McKoi SQL Database is written entirely in Java. Supports transactions, referential integrity, triggers, indexes, Java-specific enhancements. Supports multi-threaded, multi-client operation; embedable. Released under the GPL license. This is probably the most advanced open-source pure-Java database out there.

SAP DB
The SAP DB is the liberation, under the GPL/LGPL license, of the SAP AG database. This is a major enterprise-class database.

HypersonicSQL
hsql is a small, (100KB) fast, embeddable relational DB written entirely in Java. Supports only a subset of the SQL standard. A 'stable' version now available. Modified BSD license.

PostgreSQL
PostgreSQL is a powerful and complete SQL implementation that rivals commercial databases such as Oracle. This database (along with MySQL) is the leading GPL'ed database system for the GNU/Linux & BSD platforms. Commercial support is available from a company formed by the leading Postgres developers.
Fully Transactional, with full ACID (Atomicity, Consistency, Isolation and Durability) properties. Seven different levels of locking for consistent queries and updates.
Tremendous performance improvements in Version 7.0
Support for Triggers
Support for user defined data types.
Support for stored procedures. These can be defined in a variety of ways, including an internal language, or very generally as a shared library, written in any language, linked into the Postgres server.
On-Line Backups
Multiple index type (b-tree, hash, etc.)
Commercial ODBC drivers from OpenLink
Non-commercial ODBC drivers
The Postgres HOWTO provides an extensive reference for a large number of Postgres facts and tools.

MySQL
MySQL from MySQL AB is, with Postgres, one of the most popular GPL'ed databases for the GNU/Linux and BSD platforms.
Commercial sales, support and training is available from NuSphere. They also do contract programming and infrastructure enhancements and feature additions for MySQL.
Commercial support from AbriaSoft.
Rudimentary support for table locking recently added.
Complex but powerful user access control mechanism.
Multi-threaded for parallel queries
Includes ODBC, Perl, C, Java, Tcl, Python API's

InterBase
The InterBase SQL server from InterBase Corp. is the well-known InterBase database released under an open source (MPL) license. In case you are wondering why you haven't heard of InterBase before, note that they were recently spun off from Inprise, which is, of course, the new name for Borland.

CQL++
Machine Independent Software offers the CQL++ DBMS. Originally developed originally as a full-featured commercial software product, it is currently available under several licenses, including the GNU GPL. (The free version is under GPL, non-free, non-GPL versions are available at reasonable cost.) The feature list mentions the following:

Transaction support, including commit, rollback, nested transactions, logging, failure recovery.
ANSI 1989 Level 2 SQL and ODBC Level 1 API support
ISAM or B-tree access
Unlimited number of cursors
BLOB (Binary Large Object) Support
Optimistic concurrency control with shared read locks.
Preprocessor for embedding SQL in C++

Gadfly
Gadfly is a small, portable database system written entirely in python and specifically intended for python programmers. Database files are portable from Win95 to Linux. Source code freely available, and is commercially supported by Chordate Systems.

GigaBASE and FastDB
GigaBASE (US Mirror) and FastDB (US Mirror) are memory & file-based databases with an SQL-like query language. Because they compile into an application, they avoid most of the DB management problems of client-server. BSD-like license.

GNU SQL
GNU SQL from Russia ... project development seems to have stalled in 1998.
READ MORE - Open Source Databases

Wednesday, May 11, 2011

Common Attributes Apache Tomcat Configuration



Common Attributes Apache Tomcat Configuration


Attribute Description
className Java class name of the implementation to use. This class must implement the org.apache.catalina.Server interface. If no class name is specified, the standard implementation will be used.

port The TCP/IP port number on which this server waits for a shutdown command. This connection must be initiated from the same server computer that is running this instance of Tomcat.

shutdown The command string that must be received via a TCP/IP connection to the specified port number, in order to shut down Tomcat.

Common Sender Attributes

Attribute Description
className Required, only available implementation is org.apache.catalina.tribes.transport.ReplicationTransmitter

Common Transport Attributes

Attribute                  Description
className              Required, an implementation of the org.apache.catalina.tribes.transport.MultiPointSender.
Non-blocking implementation is org.apache.catalina.tribes.transport.nio.PooledParallelSender
Blocking implementation is org.apache.catalina.tribes.transport.bio.PooledMultiSender

rxBufSize                The receive buffer size on the socket. Default value is 25188 bytes.

txBufSize                The send buffer size on the socket. Default value is 43800 bytes.

direct                      Possible values are true or false. Set to true if you want the receiver to use direct bytebuffers when reading data from the sockets. Default value is false

keepAliveCount     The number of requests that can go through the socket before the socket is closed, and reopened for the next request. The default value is -1, which is unlimited.

keepAliveTime      The number of milliseconds a connection is kept open after its been opened. The default value is -1, which is unlimited.

timeout                 Sets the SO_TIMEOUT option on the socket. The value is in milliseconds and the default value is 3000 milliseconds.

maxRetryAttempts    How many times do we retry a failed message, that received a IOException at the socket level. The default value is 1, meaning we will retry a message that has failed once. In other words, we will attempt a message send no more than twice. One is the original send, and one is the maxRetryAttempts.

ooBInline                 Boolean value for the socket OOBINLINE option. Possible values are true or false.

soKeepAlive            Boolean value for the socket SO_KEEPALIVE option. Possible values are true or false.

soLingerOn             Boolean value to determine whether to use the SO_LINGER socket option. Possible values are true or false. Default value is true.

soLingerTime         Sets the SO_LINGER socket option time value. The value is in seconds. The default value is 3 seconds.

soReuseAddress    Boolean value for the socket SO_REUSEADDR option. Possible values are true or false.

soTrafficClass        Sets the traffic class level for the socket, the value is between 0 and 255. Default value is int soTrafficClass = 0x04 | 0x08 | 0x010; Different values are defined in java.net.Socket#setTrafficClass(int).

tcpNoDelay           Boolean value for the socket TCP_NODELAY option. Possible values are true or false. The default value is true

throwOnFailedAck    Boolean value, default value is true. If set to true, the sender will throw a org.apache.catalina.tribes.RemoteProcessException when we receive a negative ack from the remote member. Set to false, and Tribes will treat a positive ack the same way as a negative ack, that the message was received.
READ MORE - Common Attributes Apache Tomcat Configuration

DataSourceDefinition Annotation

DataSourceDefinition Annotation

Apache Derby is the Apache DB subproject, it is entirely written using Java, is an open source relational database, its size is very small, basic engine with JDBC driver is only 2.6MB, it supports the SQL standard, it provides an embedded JDBC drive, it can be embedded into any Java-based applications, Derby also supports common client / server model, it is easy to install and use.

For example, the following annotation creates a datasource definition for a Derby database:
@DataSourceDefinition(name = "java:app/env/Servlet_DataSource",
minPoolSize = 0,
initialPoolSize = 0,
className = "org.apache.derby.jdbc.ClientXADataSource",
user = "APP",
password = "APP",
databaseName = "testdb",
properties = {"connectionAttributes=;create=true"}
)


The datasource definition is uniquely identified by the name element. This is the JNDI name by which the datasource will be registered. Notice that the name specified in the name element begins with a namespace scope, in this case, java:app. Java EE 6 introduces application component environment namespaces, which includes the following scopes.
READ MORE - DataSourceDefinition Annotation

Tuesday, May 3, 2011

Creating The Table In PHP


Creating A Table

Before you can do anything with your database, you must create a table. A table is a section of the database for storing related information. In a table you will set up the different fields which will be used in that table. Because of this construction, nearly all of a site's database needs can be satisfied using just one database.

Creating a table in PHPMyAdmin is simple, just type the name, select the number of fields and click the button. You will then be taken to a setup screen where you must create the fields for the database. If you are using a PHP script to create your database, the whole creation and setup will be done in one command.

Fields

There are a wide variety of fields and attributes available in MySQL and I will cover a few of these here:Field Type Description
TINYINT Small Integer Number
SMALLINT Small Integer Number
MEDIUMINT Integer Number
INT Integer Number
VARCHAR Text (maximum 256 characters)
TEXT Text



These are just a few of the fields which are available. A search on the internet will provide lists of all the field types allowed.

Creating A Table With PHP

To create a table in PHP is slightly more difficult than with MySQL. It takes the following format:

CREATE TABLE tablename {

Fields

}

The fields are defined as follows:

fieldname type(length) extra info,

The final field entered should not have a comma after it.

I will give full an example of using these later in the section.

The Contacts Database

The contacts database will contain all the conact information for the people you enter and the information will be able to be edited and viewed on the internet. The following fields will be used in the database:
Name Type Length Description
id INT 6 A unique identifier for each record
first VARCHAR 15 The person's first name
last VARCHAR 15 The person's last name
phone VARCHAR 20 The person's phone number
mobile VARCHAR 20 The person's mobile number
fax VARCHAR 20 The person's fax number
email VARCHAR 30 The person's e-mail address
web VARCHAR 30 The person's web address



You may be wondering why I have used VARCHAR fields for the phone/fax numbers even though they are made up of digits. You could use INT fields but I prefer to use VARCHAR as it will allow dashes and spaces in the number, as well as textual numbers (like 1800-COMPANY) and as we will not be initiating phone calls from the web it is not a problem.

There is one other thing you should be aware of in this database. The id field will also be set as PRIMARY, INDEX, UNIQUE and will be set to auto_increment (found under Extra in PH
PMyAdmin). The reason for this is that this will be the field identifier (primary and index) and so must be unique. The auto increment setting means that whenever you add a record, as long as you don't specify an id, it will be given the next number.

If you are using PHPMyAdmin or a management program you can now create this in a table called contacts.

Creating The Table In PHP

The following code should be used to create this table in PHP. Some of the code has not been covered yet but I will explain it fully in the next part.


Enter your database, MySQL username and MySQL password in the appropriate positions on the first three lines above.
READ MORE - Creating The Table In PHP

Selecting A Database

Selecting A Database

Here's something that's not too complicated: to select a MySQL database in PHP use the mysql_select_db ( ) function, like this:

mysql_select_db ("mydatabase");

Couldn't be simpler, as long as everything went well -- more on that in a minute.


Creating a Database

OK, we're going to create a database, and to honor the one responsible for this need, our database will be called "Murphy". A database is created by using a query, and therefore the mysql_query ( ) function. (Remember that I talked about the way that everything is thought of as a query, even though it might not actually be making any sort of "enquiry".) The query will be given the CREATE DATABASE parameter, like this:

mysql_query ('CREATE DATABASE murphy');

Again not too complicated, as long as everything went well. Now it's time to think about what to do if everything didn't quite go as planned. I've said this before, and I'll add the caveat that I use the word "hacker" in it's old sense: the difference between a hacker and a programmer is that a hacker works and works until they find a way to make their code work, but a programmer works and works until they also find every way it won't work. Being so, as programmers, we must find a way to handle every error that might come our way.


Handling Errors

In the last part of this tutorial series, I discussed the use of the Error Control Operator and the die ( ) function. Now we'll add one more function to our arsenal. The MySQL support in PHP includes a function called mysql_error ( ) whose very useful purpose is to provide a text version of an error returned by the MySQL server. We can certainly take advantage of that in our error handling!

I also want to introduce another element here. This is purely a matter of coding technique. There are many ways to write this piece of code, but I feel this form to be quite elegant. You will remember that an "if" statement has this basic format:

if (condition)
{do this if condition is true}
else
{do this if condition is false}

We can take advantage of that. When a function performs properly it returns with a condition of "true", and when something goes wrong it returns with a "false" condition. Of course, it can also return values, error codes and the like, but for the moment lets ponder just the condition. Since it returns a condition, we can use the function call as the "condition" in an "if" statement. This will allow us to put code in the "true" side of the statement to do what we want when everything is ok, and to put code in the "false" side to handle our errors.

Let's build an example. First, we're going to connect to the server, and if everything is good, we'll create a database. I there were errors, we'll terminate the program, displaying an error message. In the process of creating the database, if everything goes well, we'll select the database so that we can use it, and if there are errors we'll terminate the program, displaying an appropriate message. Similarly, when selecting the database, we'll use messages to let us know how things went.

Programmatically, this means putting an "if" statement inside the "do this if condition is true" code. When an "if" statement is put into either side of another "if" statement in this fashion, it is know as "nesting" the "if" statements. When you write nested "if"s it is highly recommended that you use indentation and spacing to help you keep track of where you are. It is altogether too easy to have and extra or a missing parenthesis and completely change the logic flow of your program -- often without causing any PHP syntax error. Be warned! Be careful!

Now, here's our code (you might want to spend a little time following through this to make sure you fully understand it):

if ( $connid = mysql_connect ( 'localhost' 'username' 'password' ) )
{ print '
Connected to MySQL Server.
';
if ( @mysql_query ( 'CREATE DATABASE murphy' ) )
{ print '
Database murphy created.
';
if ( @mysql_select_db ( 'murphy' ) )
{ print '
Databse murphy selected
';
}
else
{ die ( '
Database selection failed because ' , mysql_error ( ) , '
' )
}
}
else
{ die ( '
Database creation failed because ' , mysql_error ( ) , '
' )
}
}
else
{ die ( '
Database Server connection failed because ' , mysql_error ( ) , '
' )
}


Oh yes, we're getting into it now!
READ MORE - Selecting A Database
 
THANK YOU FOR VISITING