Lianja DBA (Database Administrator) cheat sheet
by
, 2021-11-26 at 22:57 (9122 Views)
The Lianja database is a high performance SQL and NoSQL (Navigational data access) database.
It is embedded in Lianja App Builder, Lianja App Center, Lianja Cloud Server and Lianja SQL Server.
Despite its powerful features the Lianja database is simple to set up and easy to use.
It is used in many business critical installations worldwide including banking, defense and logistics.
A Lianja database is a container holding a collection of tables, views, and their associated constraints and business rules. Tables consist of rows and columns, also referred to as records and fields. Each column or field has a name, a data type and a width. It can optionally have decimal places, a description and data validation rules. Data is added to the table by adding rows or records.
Further details about the Lianja database can be found here.
If you are a DBA (Database Administrator) you should make yourself familiar with the Lianja Console and the following Database Admin CLI commands.
CREATE DATABASE
Creates a database with the specified name.
CREATE TABLE
Creates a table.
ALTER TABLE
Used to add, modify or delete table columns and constraints.
CREATE VIRTUALTABLE
The CREATE VIRTUALTABLE command creates a new virtual table in the current database.
ALTER VIRTUALTABLE
The ALTER VIRTUALTABLE command modifies a virtual table in the current database.
DROP TABLE
The DROP TABLE command removes a table and all its data from the database.
COPY TABLE
Copy a table to a new table along with its associated files.
RENAME TABLE
Change the name of a table and its associated files.
CREATE INDEX
The CREATE INDEX command creates an index file for the specified table.
ALTER INDEX
The ALTER INDEX command is used to rebuild an existing index file for the specified table.
DROP INDEX
The DROP INDEX command removes an index from a table.
DROP DATABASE
The DROP DATABASE command removes the specified database and all its tables.
OPEN DATABASE
The OPEN DATABASE command sets the specified database, <database name> as the default database for subsequent operations or SQL queries.
LIST DATABASE
The LIST DATABASE command is used to display information about the currently active database.
CLOSE DATABASE
The CLOSE DATABASES command closes the currently open database and its tables
COPY DATABASE
The COPY DATABASE command is used to copy an existing database to a new database.
BACKUP DATABASE
The BACKUP DATABASE command creates a backup of the active or specified database.
RESTORE DATABASE
The RESTORE DATABASE command restores a previously created database backup for the database specified by <database name>.
LIST BACKUPS
The LIST BACKUPS command lists the currently available database backups.
REINDEX DATABASE
The REINDEX DATABASE command rebuilds the indexes for each table in the active database.
REBUILD DATABASE
The REBUILD DATABASE command rebuilds the catalog for the active or specified database.
PACK DATABASE
The PACK DATABASE command packs all the tables in the active database removing records marked for deletion.
OPTIMIZE DATABASE (to be documented)
The OPTIMIZE DATABASE command packs all the tables in the active database removing records marked for deletion. Unlike the PACK DATABASE command, OPTIMIZE DATABASE will copy records in the order of the primary key to be adjacent to each other on disk. This can have a dramatic performance improvement in networked systems as it significantly reduces disk seek times.
CHECK DATABASE
The CHECK DATABASE command checks the integrity of a database and all its tables, indexes and memo files.
COMPILE DATABASE
Compile stored procedure files in the specified database.
COMPARE DATABASE
The COMPARE DATABASE command compares two databases, <databasename1> and <databasename2>, and optionally generates an upgrade script, <filename.prg>, that can be packaged up and uploaded to a live system.
PUSH DATASESSION
The PUSH DATASESSION command is used to save the current data session. It can then be restored using the POP DATASESSION command. Data sessions can be pushed and popped up to 256 levels deep and operate on a last in, first out basis. All tables are closed by the PUSH DATASESSION command.
POP DATASESSION
The POP DATASESSION command is used to restore the last data session saved with PUSH DATASESSION.
Lianja KVS (Key Value Store)
A key-value database is a type of nonrelational database that uses a simple key-value method to store data. A key-value database stores data as a collection of key-value pairs in which a key serves as a unique identifier. Both keys and values can be anything, ranging from simple objects to complex compound objects.
Lianja Cloud Admin Console
The Lianja Admin Console for Lianja Cloud provides you with everything you need to administer your users, databases, packages, reports and - very importantly - forensics in the cloud. It also contains a real time dashboard that is dynamically updated.
The Data Workspace
The Data workspace is where you perform database administration operations on your data, browse and modify it and view it in a variety of different data views: Grid, Form and Split View. From Lianja v6.3, the QueryBuilder is supported in the Data Editor in the Data Workspace. Just click the icon in the actionbar to open the QueryBuilder.
Generate Database Doc
Click the "Shortcuts" icon in the bottom left corner, then choose "Generate Database Doc...".