Skip Headers

Oracle9i Lite Developer's Guide for Windows CE/Pocket PC
Release 5.0.2
Part No. B10100-01
Go To Table Of Contents
Contents
Go To Index
Index

Previous Next

B
Oracle Lite Utilities

This document describes how to use the following Oracle Lite database utilities. The utility names are listed in alphabetical order inTable B-1:

Table B-1 Tools and Utilities

Utility Description
CREATEDB   Use this to create Oracle Lite databases.
DECRYPDB   Use this to decrypt your Oracle Lite database.
ENCRYPDB   Use this to encrypt your Oracle Lite database.
Mobile SQL   Mobile SQL is a GUI interface that allows you to connect to Oracle Lite databases.
ODBINFO   Use this utility to find out the version number and volume ID of an Oracle Lite database.
REMOVEDB   Use this to remove Oracle Lite databases.

B.1 Running Command Line Utilities on a CE Device

For PocketPCs, running command line applications requires executing a sequences of button clicks which are slightly different for different models.

B.1.1 Compaq iPaq

Hold down on the Action button (the direction buttons below the screen) and click and hold on the top right corner of the screen. This brings up a menu - select the "run" menu item and a dialog pops up prompting you for the file name of the program to execute.

B.1.2 HP Jornada and Casio

Press and hold down on the dial on the left side of the device and click and hold on the top right corner of the screen. The same menu pops up.

B.2 CREATEDB


Description

Utility for creating a database.


Syntax
CREATEDB DataSourceName DatabaseName [VolID]

Key Words and Parameters
DataSourceName

Data source name, used to look up the ODBC.INI file for the default database directory.


Note:

If you specify an invalid DSN, Oracle Lite ignores the DSN and creates the database in the current directory. To access this database through ODBC, you must create a DSN for the database that points to the directory in which the database resides.

DatabaseName

Name of the database to be created. It can be a full path name or just the database name. If only the database name is given, the database is created under the Data Directory for the data source name specified in the ODBC.INI file. The extension for the database name must always be .ODB. If a name without the .ODB is given, the .ODB is appended.

VolID

When specified, the VolID is used as the database ID, instead of the database ID from the POLITE.INI file. The ID must be unique for each database.


Examples
createdb polite db1

createdb polite c:\testdir\db2.odb 300

B.3 DECRYPDB


Description

This tool allows you to decrypt an encrypted Oracle Lite database. See Section B.4, "ENCRYPDB" for more information.


Syntax
DECRYPDB DSN | NONE DBName [Password

Key Words and Parameters
DSN

Data source name of the Oracle Lite database that you want to decrypt. If you specify NONE, DBName has to be entered with the full path name (without the .ODB extension).

DBName

Name of the database to be decrypted. If DSN was specified as NONE, DBName must be entered with the full path name.

Password

Optional. The password used previously to encrypt the Oracle Lite database. If you do not enter the password, DECRYPDB prompts you to enter it.


Comments

An Oracle Lite database cannot be decrypted if there is any open connection to the database.

If you call this utility from another program, the values which can be returned are listed in Table B-2:

Table B-2 ECRYPDB Return Codes

Return Code Description
EXIT_SUCCESS Success.
EXIT_USAGE Command line arguments are not properly used or are in error.
EXIT_PATH_TOO_LONG Path is too long.
EXIT_SYSCALL I/O error while making new decrypted copy on disk.
EXIT_BAD_PASSWD Incorrect password supplied.

See the comments in Section B.4, "ENCRYPDB" for more information.

B.4 ENCRYPDB


Description

This tool allows you to encrypt an Oracle Lite database with a password and to change a database password. The password prevents unauthorized access to the database and encrypts the database, so that the data stored in the database files cannot be interpreted. See Section B.3, "DECRYPDB" for more information.

ENCRYPDB uses CAST5 encryption, which is a 128-bit, DES compliant encryption scheme.


Syntax
ENCRYPDB DSN | NONE DBName [New_Passwdor [Old_Passwdor]]

Key Words and Parameters
DSN

Data source name of the Oracle Lite database that you want to encrypt. If you specify NONE, DBName must be a fully qualified database name with the full path name (without the .ODB extension). If dsn is a value other than NONE, then the name must appear as a data source name in the ODBC.INI file.

DBName

Name of the database to be encrypted. If DSN was specified as NONE, DBName must be entered with the full path name.

New_Passwd and Old_Passwd

Optional, the password (or previously used password) for encrypting the database. This password can be 128 characters in length. If you do not enter a password, ENCRYPDB prompts you to enter one. Since both passwords are optional in the command line to invoke the utility, the command line could have three different forms:


Comments

If you call this utility from another program, the values which can be returned are listed in Table B-3:

Table B-3 ENCRYPDB Return Codes

Return Code Description
EXIT_SUCCESS Success.
EXIT_USAGE Command line arguments are not properly used or are in error.
EXIT_PATH_TOO_LONG Path is too long.
EXIT_SYSCALL I/O error while making new encrypted copy on disk.
EXIT_BAD_PASSWD Incorrect password supplied.

The default Oracle Lite database (POLITE.ODB) is not encrypted. After encrypting an Oracle Lite database every user that attempts to establish a connection to the encrypted Oracle Lite database must provide the valid password. If the password is not provided, Oracle Lite returns an error. An Oracle Lite database cannot be encrypted if there are any open connections to the database.

You should consider the following when encrypting and decrypting Oracle Lite databases:

B.4.1 Synchronizing with an Encrypted Oracle Lite Database

These steps are required to synchronize with an encrypted Oracle Lite database:

  1. Retrieve the user password from the Mobile Server Repository.

  2. Convert the password into uppercase. For example, change "manager" into "MANAGER".

  3. Launch Mobile Sync (msync.exe) and execute a sync. Provide username, password and Mobile Server URL. Select Apply and then select Sync. This creates an non-encrypted Oracle Lite database.

  4. Encrypt the Oracle Lite database using ENCRYPDB utility using the converted uppercase password, for example MANAGER.

  5. Continue to synchronize.

B.5 Mobile SQL

Mobile SQL is an application that allows the user to execute SQL statements against the local database. It is both a developers tool and a code example. It allows you to access functionality provided by the ODBC and Oracle Lite OKAPI interfaces of the underlying Oracle Lite database engine.

B.5.1 Database Access

Mobile SQL accesses the database through both the ODBC and OKAPI interface. Most functions are performed through ODBC, but functions that ODBC cannot handle are implemented using OKAPI function calls.

B.5.2 Starting Mobile SQL

Mobile SQL is started by opening the <ORACLE_HOME>\Mobile\SDK\wince, select the folder representing the version Windows CE, then the processor on your device. Double-click on the mSQL.exe file. This starts the GUI which accepts standard SQL commands. For more information see the Oracle9i Lite SQL Reference.

B.6 ODBINFO


Description

You can use ODBINFO to find out the version number and volume ID of an Oracle Lite database. ODBINFO can also display and set several parameters.


Syntax

To display current information without making any changes use the syntax:

odbinfo [-p passwd] DSN DBName 

You can also use:

odbinfo [-p passwd] NONE dbpath\dbname.odb

For example:

odbinfo -p tiger polite polite

odbinfo NONE c:\orant\oldb40\polite.odb

If your database is encrypted you need to include the password.

To set or clear options, use one or more "+" or "-" option arguments before the DSN or NONE. For example:

odbinfo +reuseoid -pagelog -fsync polite polite

Parameters

You can use the parameters listed in Table B-4 with the ODBINFO utility:

Table B-4 ODBInfo Parameters

Parameter Description
pagelog By default, a commit backs up modified database pages to <filename>.plg before actually writing the changes to <filename>.ODB. If an application or the operating system experiences a failure during a commit, the transaction is cleanly rolled back during the next connect. If -pagelog is specified, no backup is created and the database can become corrupted if a failure occurs.
fsync Oracle Lite generally forces the operating system to write all the modified buffers associated with the database back to disk during a commit. If this option is disabled (-fsync), the operating system can keep the changes in memory until a later time. If the system (but not the application) crashes before the buffers are flushed, the database can become corrupted.

Using odbinfo -fsync -pagelog improves the performance of applications that use many small transactions (with autocommit on) or ones with massive updates. However, if the database is corrupted, there is no straightforward way to repair it or recover the data. Therefore these two options should only be cleared during initial loading of the database, if (1) the .ODB file is backed up on regular basis, or (2) the data in the database can be recovered from some other source.

Using this option has no effect on applications that seldom update the database. Setting the transaction isolation level to SINGLE USER has more impact in this case.

reuseoid By default, Oracle Lite does not reuse the ROWID of any row that exists in a table until the table is dropped. The "Slot Deleted" error is returned when accessing a deleted object. This uses two bytes of storage for each deleted object, causing performance and disk space usage to degrade over time if rows are constantly inserted and deleted.

If you use odbinfo +reuseoid, new rows can reuse ROWIDs of previously deleted rows. However, this may not free all the space in a table that already has many deleted objects. For best results, you should set this option immediately after you create your database.

This option is safe for pure relational applications. However, SQL applications that use ROWID and JAC/OKAPI applications that use direct pointers between objects need to verify that all references to an object are set to NULL before the object is deleted. Otherwise, dangling references may eventually point to some other, unrelated object.

compress This option (which is "on" by default) enables run-length compression of objects. Run-length compression takes very little CPU time, so you should only deselect (-compress) this option if:
  • Operating system-level file compression is used, such as DriveSpace or a NTFS compressed attribute. In this case not compressing the same data twice provides a better compression ratio.

  • Most objects in the database are frequently updated to a highly compressible state (for example, all columns set to NULL), and the data cannot be compressed well (such as binary columns with random data). In these cases, using this option (+compress) can result in highly fragmented tables.

Changing this option does not compress or decompress any existing objects in the database.

B.7 REMOVEDB


Description

Utility for deleting a database.


Syntax
REMOVEDB DataSourceName DatabaseName

Key Words and Parameters
DataSourceName

Data source name of the database you want to remove.

DatabaseName

The name of the database to delete. It can be a full path name or just the database name. If only the database name is given, the database is deleted from the Data Directory for the data source name specified in the ODBC.INI file.


Examples
removedb polite db1

removedb polite c:\testdir\db2.odb


Previous Next
Oracle Logo
Copyright © 2002 Oracle Corporation

All rights reserved
Go To Table Of Contents
Contents
Go To Index
Index