<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="https://script.spoken-tutorial.org/skins/common/feed.css?303"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>https://script.spoken-tutorial.org/index.php?action=history&amp;feed=atom&amp;title=LibreOffice-Suite-Base%2FC4%2FDatabase-Maintenance%2FEnglish</id>
		<title>LibreOffice-Suite-Base/C4/Database-Maintenance/English - Revision history</title>
		<link rel="self" type="application/atom+xml" href="https://script.spoken-tutorial.org/index.php?action=history&amp;feed=atom&amp;title=LibreOffice-Suite-Base%2FC4%2FDatabase-Maintenance%2FEnglish"/>
		<link rel="alternate" type="text/html" href="https://script.spoken-tutorial.org/index.php?title=LibreOffice-Suite-Base/C4/Database-Maintenance/English&amp;action=history"/>
		<updated>2026-04-08T21:25:58Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.23.17</generator>

	<entry>
		<id>https://script.spoken-tutorial.org/index.php?title=LibreOffice-Suite-Base/C4/Database-Maintenance/English&amp;diff=328&amp;oldid=prev</id>
		<title>Chandrika: Created page with '{| border=1 !Visual Cues !Narration |- |Show Slide Number 1  Spoken tutorial on LibreOffice Base : Database Maintenance Learning Objectives  * Maintain a Database   * Modify Data…'</title>
		<link rel="alternate" type="text/html" href="https://script.spoken-tutorial.org/index.php?title=LibreOffice-Suite-Base/C4/Database-Maintenance/English&amp;diff=328&amp;oldid=prev"/>
				<updated>2012-11-27T15:21:01Z</updated>
		
		<summary type="html">&lt;p&gt;Created page with &amp;#039;{| border=1 !Visual Cues !Narration |- |Show Slide Number 1  Spoken tutorial on LibreOffice Base : Database Maintenance Learning Objectives  * Maintain a Database   * Modify Data…&amp;#039;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{| border=1&lt;br /&gt;
!Visual Cues&lt;br /&gt;
!Narration&lt;br /&gt;
|-&lt;br /&gt;
|Show Slide Number 1 &lt;br /&gt;
Spoken tutorial on LibreOffice Base : Database Maintenance&lt;br /&gt;
Learning Objectives&lt;br /&gt;
&lt;br /&gt;
* Maintain a Database &lt;br /&gt;
&lt;br /&gt;
* Modify Database Structure&lt;br /&gt;
&lt;br /&gt;
* Defragment a database&lt;br /&gt;
&lt;br /&gt;
* Take Backups&lt;br /&gt;
|Welcome to the Spoken tutorial on LibreOffice Base.&lt;br /&gt;
&lt;br /&gt;
In this tutorial on Database Maintenance, we will learn how to&lt;br /&gt;
&lt;br /&gt;
Maintain a Database &lt;br /&gt;
&lt;br /&gt;
Modify Database Structure&lt;br /&gt;
&lt;br /&gt;
Defragment a database&lt;br /&gt;
&lt;br /&gt;
And take Backups&lt;br /&gt;
|-&lt;br /&gt;
|Show Slide Number 2&lt;br /&gt;
&lt;br /&gt;
Database Maintenance&lt;br /&gt;
&lt;br /&gt;
* Keep the database up-to-date, reliable and safe&lt;br /&gt;
&lt;br /&gt;
* Modify data structures, update forms&lt;br /&gt;
&lt;br /&gt;
* Example: Library database had books as the only media available initially&lt;br /&gt;
&lt;br /&gt;
* Later, we expanded the Library to include more media like DVDs and CDs&lt;br /&gt;
&lt;br /&gt;
* We added a new table Media to store DVD and CD info&lt;br /&gt;
&lt;br /&gt;
* Such changes keep the database up-to-date and hence more usable&lt;br /&gt;
|Database Maintenance&lt;br /&gt;
&lt;br /&gt;
Throughout the life of a Base database, we will need to take steps to keep the data up-to-date, reliable and safe.&lt;br /&gt;
&lt;br /&gt;
This includes modifying the data structure, and updating forms as is necessary to keep the data current.&lt;br /&gt;
&lt;br /&gt;
Let us consider the Library example database that we built in our previous tutorials.&lt;br /&gt;
&lt;br /&gt;
This database initially had tables on books, members and books issued.&lt;br /&gt;
&lt;br /&gt;
And we built our example forms, queries and reports based on this database structure.&lt;br /&gt;
&lt;br /&gt;
Later, the library expanded to have other media such as DVDs and CDs.&lt;br /&gt;
&lt;br /&gt;
So, we modified the Library database to make the structure up-to-date.&lt;br /&gt;
&lt;br /&gt;
For this, we added another table called Media&lt;br /&gt;
&lt;br /&gt;
and we stored the DVD and CD information in the new Media table.&lt;br /&gt;
&lt;br /&gt;
This way, our database became more usable and up-to-date, as we made changes  whenever necessary.&lt;br /&gt;
|-&lt;br /&gt;
|Show Slide Number 3&lt;br /&gt;
&lt;br /&gt;
* Modify Existing Forms&lt;br /&gt;
&lt;br /&gt;
* Add new forms to accommodate new table structures&lt;br /&gt;
&lt;br /&gt;
* Example: Modify Books Data Entry Form to allow entry for DVDs and CDs also.&lt;br /&gt;
&lt;br /&gt;
* Or add a new form to allow data entry for just the DVD and CD media.&lt;br /&gt;
&lt;br /&gt;
* Modify/Add new queries, reports appropriately&lt;br /&gt;
&lt;br /&gt;
* Modify existing table structures&lt;br /&gt;
&lt;br /&gt;
* Example: Members table has Name and Phone info only&lt;br /&gt;
&lt;br /&gt;
* Example: New changes to the Members table: Add Address and City fields &lt;br /&gt;
&lt;br /&gt;
* SQL Syntax:&lt;br /&gt;
&lt;br /&gt;
ALTER TABLE Members ADD Address TEXT, ADD City TEXT&lt;br /&gt;
&lt;br /&gt;
* Visit http://hsqldb.org/doc/2.0/guide/databaseobjects-chapt.html#N10E48 for more information&lt;br /&gt;
|Along with table changes, we will also need to modify the forms to make them easier to use.&lt;br /&gt;
&lt;br /&gt;
Or we can build new forms to accommodate new table structures.&lt;br /&gt;
&lt;br /&gt;
For example, if we had a form to enter books data, we can modify it to allow data entry for DVDs and CDs also.&lt;br /&gt;
&lt;br /&gt;
Here we could add option buttons to choose the type of media, that is: books, or DVDs or CDs.&lt;br /&gt;
&lt;br /&gt;
Or, we can add a brand new form to allow data entry for just the DVD and CD media.&lt;br /&gt;
&lt;br /&gt;
Similarly, we will need to modify or add new queries and reports which are based on the data structure that was changed.&lt;br /&gt;
&lt;br /&gt;
And sometimes we will need to modify existing table structures.&lt;br /&gt;
&lt;br /&gt;
For example, let us consider the Members table that lists all the members in the Library.&lt;br /&gt;
&lt;br /&gt;
It currently stores their names and phone numbers only.&lt;br /&gt;
&lt;br /&gt;
Now if we have to store their address and city information also, we will need to modify the Members table structure.&lt;br /&gt;
&lt;br /&gt;
For this we can use SQL syntax such as:&lt;br /&gt;
&lt;br /&gt;
ALTER TABLE Members &lt;br /&gt;
ADD Address TEXT, &lt;br /&gt;
ADD City TEXT&lt;br /&gt;
&lt;br /&gt;
So the ALTER TABLE statement changes the table structure and adds two new columns:&lt;br /&gt;
&lt;br /&gt;
Address and City which will hold TEXT data.&lt;br /&gt;
&lt;br /&gt;
Visit hsqldb.org/ website for more information on creating and altering table structures. &lt;br /&gt;
&lt;br /&gt;
Use the url address shown on the screen.&lt;br /&gt;
|-&lt;br /&gt;
|Show Slide Number 4&lt;br /&gt;
Defragmenting a database&lt;br /&gt;
&lt;br /&gt;
* Base requires huge memory for a database&lt;br /&gt;
&lt;br /&gt;
* Base allocates a certain memory for the database&lt;br /&gt;
&lt;br /&gt;
* Data not stored in orderly fashion as in the data tables&lt;br /&gt;
&lt;br /&gt;
* Because data gets added or deleted at different times&lt;br /&gt;
&lt;br /&gt;
* And Indexes also take up lot of memory.&lt;br /&gt;
&lt;br /&gt;
* An Index is similar to a catalogue.&lt;br /&gt;
&lt;br /&gt;
* Indexes store the physical location of data for efficient data retrieval&lt;br /&gt;
&lt;br /&gt;
* Deleting data only disconnects the data from the indexes.&lt;br /&gt;
&lt;br /&gt;
* Base’s solution to reorganize data: Defragmenting database&lt;br /&gt;
&lt;br /&gt;
* Open the Base database&lt;br /&gt;
&lt;br /&gt;
* Open the Tools menu and SQL sub menu&lt;br /&gt;
&lt;br /&gt;
* Use following Command in SQL Window:&lt;br /&gt;
CHECKPOINT DEFRAG&lt;br /&gt;
&lt;br /&gt;
* Above command removes unneeded information from the database&lt;br /&gt;
&lt;br /&gt;
* Above command closes, reorganizes data and re-opens database&lt;br /&gt;
&lt;br /&gt;
* Alternate command:&lt;br /&gt;
SHUTDOWN COMPACT.&lt;br /&gt;
&lt;br /&gt;
This command is similar, but does not reopen database.&lt;br /&gt;
&lt;br /&gt;
Visit http://hsqldb.org/doc/2.0/guide/deployment-chapt.html Chapter 11 for more information.&lt;br /&gt;
|Next, let us see how we can keep the Base database reliable for use.&lt;br /&gt;
&lt;br /&gt;
Sometimes, Base requires a huge memory to hold comparatively small number of records.&lt;br /&gt;
&lt;br /&gt;
This is because, Base anticipates a certain amount of memory that the database may need.&lt;br /&gt;
&lt;br /&gt;
And, the data that we see in tables are not stored exactly in the same orderly manner.&lt;br /&gt;
&lt;br /&gt;
Because, as we add data to the tables at different times, their actual storage is not in a particular order.&lt;br /&gt;
&lt;br /&gt;
We can use indexes for table data, like we use a catalogue for a Library of books.&lt;br /&gt;
&lt;br /&gt;
A catalogue not only lists the books, but also stores their physical location. &lt;br /&gt;
&lt;br /&gt;
Similarly, we can build table indexes to locate the data efficiently.&lt;br /&gt;
&lt;br /&gt;
But indexes also can take up a lot of memory.&lt;br /&gt;
&lt;br /&gt;
And, sometimes, deleting table data does not purge the data permanently.&lt;br /&gt;
&lt;br /&gt;
They are just disconnected from table indexes but still occupy the space, until new data is added which takes up the space.&lt;br /&gt;
&lt;br /&gt;
So this is why the database grows bigger in size, although the actual data stored maybe not that big.&lt;br /&gt;
&lt;br /&gt;
Base offers a nice way of reorganizing called Defragmenting.&lt;br /&gt;
&lt;br /&gt;
For this, we will open the database that needs to be defragmented.&lt;br /&gt;
&lt;br /&gt;
Once inside the LibreOffice Base window, we will  click on the Tools menu and then click on SQL sub menu&lt;br /&gt;
&lt;br /&gt;
And type the following command in the SQL window&lt;br /&gt;
&lt;br /&gt;
CHECKPOINT DEFRAG&lt;br /&gt;
&lt;br /&gt;
This SQL command removes the unneeded information in the Base database file.&lt;br /&gt;
&lt;br /&gt;
This will first close the database, reorganize the data and then re-open the database.&lt;br /&gt;
&lt;br /&gt;
Now, we can also use another command in the SQL window&lt;br /&gt;
SHUTDOWN COMPACT.&lt;br /&gt;
&lt;br /&gt;
The only difference here is that this command won’t re-open the database.&lt;br /&gt;
&lt;br /&gt;
For more information on defragmenting, visit hsqldb.org Chapter 11 &lt;br /&gt;
|-&lt;br /&gt;
|Show Slide Number 4&lt;br /&gt;
Backups&lt;br /&gt;
&lt;br /&gt;
* Helps to keep database secure&lt;br /&gt;
&lt;br /&gt;
* Potential loss of database due to &lt;br /&gt;
Computer crashes&lt;br /&gt;
Hard disk drive breakdowns &lt;br /&gt;
Viral infections&lt;br /&gt;
&lt;br /&gt;
* LibreOffice has a good Recovery Wizard that minimizes data loss&lt;br /&gt;
&lt;br /&gt;
* Keeping Backups is very useful&lt;br /&gt;
&lt;br /&gt;
* To take a backup, simply make copies of the Base database file&lt;br /&gt;
&lt;br /&gt;
* Save it in secondary media of storage, such as secondary hard disks, or CDs or DVDs, or flash drives&lt;br /&gt;
|Finally let us talk about Backups which help to keep a database secure.&lt;br /&gt;
&lt;br /&gt;
We could lose our database due to&lt;br /&gt;
&lt;br /&gt;
Computer crashes, &lt;br /&gt;
Hard disk drive breakdowns or &lt;br /&gt;
Viral infections&lt;br /&gt;
&lt;br /&gt;
LibreOffice has a good recovery wizard that minimizes the data loss.&lt;br /&gt;
&lt;br /&gt;
But a wise thing to do is to keep periodic backups of the database.&lt;br /&gt;
&lt;br /&gt;
And taking a backup is very simple.&lt;br /&gt;
&lt;br /&gt;
We will just need to make a copy of the Base database file&lt;br /&gt;
&lt;br /&gt;
And store it in secondary media of storage, such as external hard disks, or CDs or DVDs, or flash drives&lt;br /&gt;
|-&lt;br /&gt;
|Show Slide Number 5&lt;br /&gt;
&lt;br /&gt;
Example: Backups&lt;br /&gt;
&lt;br /&gt;
* Locate Library Database in Windows Explorer&lt;br /&gt;
&lt;br /&gt;
* Copy and paste into a different hard disk drive or into a flash drive.&lt;br /&gt;
&lt;br /&gt;
* A single copy and paste action takes care of backing up all the data structures, data, forms, queries and reports&lt;br /&gt;
&lt;br /&gt;
* Frequency of Backups depends on frequency of data changes or structure changes to the database&lt;br /&gt;
&lt;br /&gt;
* Accordingly schedule daily or weekly backups&lt;br /&gt;
|So to take a backup of the Library database, locate where Library.odb file is saved&lt;br /&gt;
&lt;br /&gt;
And then, copy and paste the file in a different hard disk drive or into a flash drive.&lt;br /&gt;
&lt;br /&gt;
Now this single copy and paste action takes care of backing up the entire database:&lt;br /&gt;
&lt;br /&gt;
With all the data structures, data, forms, queries and reports in it.&lt;br /&gt;
&lt;br /&gt;
How often do we need to take backups?&lt;br /&gt;
&lt;br /&gt;
This depends on how often the database gets changed in terms of data or its structure.&lt;br /&gt;
&lt;br /&gt;
Meaning how often we add, update or delete data.&lt;br /&gt;
&lt;br /&gt;
And how often we modify the table structures, forms, queries or reports.&lt;br /&gt;
&lt;br /&gt;
So we can schedule daily or weekly backups, depending on the frequency of the database usage.&lt;br /&gt;
|-&lt;br /&gt;
|Show Slide Number 6&lt;br /&gt;
Assignment:&lt;br /&gt;
&lt;br /&gt;
1. Alter the Members table to add two new columns Address and City. Let both columns be of data type TEXT.&lt;br /&gt;
Open the Members table in Data entry mode and insert some sample address and city data &lt;br /&gt;
&lt;br /&gt;
2. Defragment the Library database&lt;br /&gt;
&lt;br /&gt;
3. Take a backup of the Library database and save it in a flash drive, or another hard disk drive, if available.&lt;br /&gt;
|Here is an assignment&lt;br /&gt;
&lt;br /&gt;
1. Alter the Members table to add two new columns -  Address and City. Let both columns be of data type TEXT.&lt;br /&gt;
&lt;br /&gt;
Also open the Members table in Data Entry mode and insert some sample address and city data. &lt;br /&gt;
&lt;br /&gt;
2. Next Defragment the Library database.&lt;br /&gt;
&lt;br /&gt;
3. Finally, take a backup of the Library database, save it in a flash drive or another hard disk drive, if available.&lt;br /&gt;
|-&lt;br /&gt;
|Show Slide Number 7&lt;br /&gt;
&lt;br /&gt;
Summary:&lt;br /&gt;
&lt;br /&gt;
* Maintain a Database &lt;br /&gt;
&lt;br /&gt;
* Modify Database Structure&lt;br /&gt;
&lt;br /&gt;
* Defragment a  database&lt;br /&gt;
&lt;br /&gt;
* Take Backups&lt;br /&gt;
|This brings us to the end of this tutorial on Database Maintenance in LibreOffice Base &lt;br /&gt;
&lt;br /&gt;
To summarize, we learned how to: &lt;br /&gt;
&lt;br /&gt;
Maintain a Database &lt;br /&gt;
&lt;br /&gt;
Modify Database Structure&lt;br /&gt;
&lt;br /&gt;
Defragment a database&lt;br /&gt;
&lt;br /&gt;
And take Backups.&lt;br /&gt;
|-&lt;br /&gt;
|Acknowledgement Slide&lt;br /&gt;
|Spoken Tutorial Project is a part of the Talk to a Teacher project, supported by the National Mission on Education through ICT, MHRD, Government of India. This project is co-ordinated by http://spoken-tutorial.org. More information on the same is available at the following link http://spoken-tutorial.org/NMEICT-Intro. This script has been contributed by Priya Suresh, DesiCrew Solutions Pvt Ltd, signing off. Thanks for joining.&lt;br /&gt;
|-&lt;/div&gt;</summary>
		<author><name>Chandrika</name></author>	</entry>

	</feed>