Difference between revisions of "DBA"

From BaseX Documentation
Jump to navigation Jump to search
 
(33 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
This page is part of the [[Getting Started]] Section.
 
This page is part of the [[Getting Started]] Section.
  
The full distributions of BaseX are equipped with a simple browser-based database administration interface, the '''DBA'''. It allows you to create and administrate databases, evaluate queries in realtime, view log files and manage users. The server-side code is completely written in [[XQuery]] and [[RESTXQ]].
+
The full distributions of BaseX are equipped with a browser-based database administration interface, the '''DBA'''. It allows you to create and administrate databases, evaluate queries in real time, view log files, monitor logged-in users, manage users, etc. The server-side code is completely written in [[XQuery]] and [[RESTXQ]].
  
 
These were our design goals:
 
These were our design goals:
  
* The code base is supposed to help and motivate you developing your own RESTXQ web applications.
+
* The code base is supposed to inspire and motivate you developing your own RESTXQ web applications.
* The whole DBA code consumes only 100 KB. It uses very simple Javascript code that should run with nearly every browser. The interface is functional, but limited in terms of flashiness and interactivity.
+
* The XQuery DBA code is very lean; it consumes less than 150 KB. It uses plain and simple JavaScript and no framework.
 
* We tried to make the DBA features as self-explanatory as possible. All functionalities are also available via [[Commands]], [[Module Library|XQuery Modules]] or the Java [[GUI]].
 
* We tried to make the DBA features as self-explanatory as possible. All functionalities are also available via [[Commands]], [[Module Library|XQuery Modules]] or the Java [[GUI]].
* The {{Code|dba}} sub-directory can simply be copied and moved to any other place. All URL paths point to the same directory; it should be straightforward to adjust the RESTXQ path.
+
* The {{Code|dba}} subdirectory can simply be copied and moved to any other place. All URL paths point to the same directory; it should be straightforward to adjust the RESTXQ path.
  
Please be aware that it is an obvious '''security risk''' if you simply put DBA online along with your web page. At the very least, you should change the DBA path and the password of the {{Code|admin}} user!
+
If you put DBA online along with your web page, please ensure at the very least…
 +
* that you have chosen a strong password for your {{Code|admin}} user, and
 +
* that the BaseX process has not been started with admin privileges.
  
The DBA has just been released, and it is in beta stage.
+
=Startup=
We are looking forward to your reports and feature requests! Patches and extensions are even more welcome.
 
  
==Startup==
+
* Download the '''ZIP Archive''' or the '''Windows Installer''' from the [https://basex.org/download download page]
 +
* Start the [[Startup#BaseX_HTTP_Server|BaseX HTTP Server]]
 +
* Open a browser and visit the URL {{Code|http://localhost:8080/dba}}
 +
 
 +
On the welcome page, you need to authenticate yourself by entering the name and password of a user with [[User Management|admin permissions]].
 +
 
 +
=Logs=
  
* Download the '''ZIP Archive''' or the '''Windows Installer''' from the [http://basex.org/download download page]
+
All [[Logging|database logs]] are listed, ordered by creation time in descending order. The interactive filter allows you to search in the users and text columns via regular expressions. The found substrings are highlighted in the output.
* Start the [[Startup#BaseX_HTTP_Server|BaseX HTTP Server]]
+
 
* Open a browser and visit the URL {{Code|http://localhost:8984/dba}}
+
For each day, a new log files is created. Old log files can be selected and deleted.
 +
 
 +
=Databases=
 +
 
 +
The database panel contains a list of all databases. Databases can be created, optimized and dropped. If a database is selected, the database resources, backups and properties are listed. Queries can be run on single database resources.
 +
 
 +
[[Image:DBA-Databases.png|778px|DBA Databases Panel]]
 +
 
 +
=Queries=
 +
 
 +
XQuery expressions can be run in the Queries panel. If evaluation takes too long, or if it consumes too much memory, the execution will be interrupted. You can choose if your query is updating or not.
 +
 
 +
Inside the editor area, you can press Ctrl-Enter to execute the query. You can press Shift-Ctrl-Enter to run your XQuery expression as updating query (or non-updating, if "Updating" is chosen in the dropdown menu).
 +
 
 +
Existing queries can be opened, and saved for future operations. All files will be stored in the current DBA working directory.
 +
 
 +
=Files=
 +
 
 +
Remote files can be downloaded, opened in the query editor or run as BaseX jobs, and new files can be uploaded. The chosen directory affects the Queries panel.
 +
 
 +
You can edit your RESTXQ code in real time by switching to the RESTXQ or repository directory and opening the corresponding modules.
 +
 
 +
[[Image:DBA-Files.png|775px|DBA File Panel]]
 +
 
 +
=Jobs=
 +
 
 +
In the Jobs panel, all queries are listed that are currently being run or queued. You can view details on particular jobs, spot potential bottlenecks, or spot and terminate malicious requests. The panel will always list at least one job, which is the one that is currently preparing your HTTP response.
 +
 
 +
=Users=
 +
 
 +
Existing users can be updated and new users can be created. Extra information can be viewed and modified both globally and locally (see [[User Management]] for more information).
 +
 
 +
=Sessions=
  
==First Steps==
+
The Web Sessions table lists all users that are currently registered in an application or the DBA. See the DBA RESTXQ code for information on how clients can be registered and logged out.
  
On the welcome page, you will need to authenticate yourself by entering a username and password. The default user is {{Code|admin}}/{{Code|admin}}. By specifying a host and port, you can communicate with a remote BaseX server instance. If you keep the field empty, you will be connected to the local BaseX instance.
+
The Database Sessions table shows clients that are connected via the client/server architecture.
  
<table cellpadding="0" cellspacing="0">
+
=Settings=
<tr><td valign="top">
 
The main page of the DBA interface contains a list of all databases on the left.
 
On the right, the global and local options are listed, along with some system
 
information.
 
  
With the "Create…" button, a new database can be created.
+
In the settings, you can tweak some DBA options, enforce a garbage collection and view all current global and local databases options.
Existing database can be viewed, optimized, and dropped.
 
</td><td valign="top">
 
[[Image:bla.png|thumb|DBA Main Page]]
 
</td>
 
</table>
 
  
 
=Changelog=
 
=Changelog=
 +
 +
;Version 9.4
 +
* Updated: Logging was improved for millions of log entries
 +
 +
;Version 8.6
 +
* Updated: Always accessible, even if job queue is full
 +
* Removed: Remote connections (to allow for better optimizations and less locking)
 +
 +
;Version 8.4
 +
* Added: Editor: Key combination 'Shift-Ctrl-Enter', real time mode removed.
  
 
Introduced with Version 8.0.
 
Introduced with Version 8.0.
 
[[Category:Beginner]]
 
[[Category:GUI]]
 

Latest revision as of 09:27, 3 August 2022

This page is part of the Getting Started Section.

The full distributions of BaseX are equipped with a browser-based database administration interface, the DBA. It allows you to create and administrate databases, evaluate queries in real time, view log files, monitor logged-in users, manage users, etc. The server-side code is completely written in XQuery and RESTXQ.

These were our design goals:

  • The code base is supposed to inspire and motivate you developing your own RESTXQ web applications.
  • The XQuery DBA code is very lean; it consumes less than 150 KB. It uses plain and simple JavaScript and no framework.
  • We tried to make the DBA features as self-explanatory as possible. All functionalities are also available via Commands, XQuery Modules or the Java GUI.
  • The dba subdirectory can simply be copied and moved to any other place. All URL paths point to the same directory; it should be straightforward to adjust the RESTXQ path.

If you put DBA online along with your web page, please ensure at the very least…

  • that you have chosen a strong password for your admin user, and
  • that the BaseX process has not been started with admin privileges.

Startup[edit]

On the welcome page, you need to authenticate yourself by entering the name and password of a user with admin permissions.

Logs[edit]

All database logs are listed, ordered by creation time in descending order. The interactive filter allows you to search in the users and text columns via regular expressions. The found substrings are highlighted in the output.

For each day, a new log files is created. Old log files can be selected and deleted.

Databases[edit]

The database panel contains a list of all databases. Databases can be created, optimized and dropped. If a database is selected, the database resources, backups and properties are listed. Queries can be run on single database resources.

DBA Databases Panel

Queries[edit]

XQuery expressions can be run in the Queries panel. If evaluation takes too long, or if it consumes too much memory, the execution will be interrupted. You can choose if your query is updating or not.

Inside the editor area, you can press Ctrl-Enter to execute the query. You can press Shift-Ctrl-Enter to run your XQuery expression as updating query (or non-updating, if "Updating" is chosen in the dropdown menu).

Existing queries can be opened, and saved for future operations. All files will be stored in the current DBA working directory.

Files[edit]

Remote files can be downloaded, opened in the query editor or run as BaseX jobs, and new files can be uploaded. The chosen directory affects the Queries panel.

You can edit your RESTXQ code in real time by switching to the RESTXQ or repository directory and opening the corresponding modules.

DBA File Panel

Jobs[edit]

In the Jobs panel, all queries are listed that are currently being run or queued. You can view details on particular jobs, spot potential bottlenecks, or spot and terminate malicious requests. The panel will always list at least one job, which is the one that is currently preparing your HTTP response.

Users[edit]

Existing users can be updated and new users can be created. Extra information can be viewed and modified both globally and locally (see User Management for more information).

Sessions[edit]

The Web Sessions table lists all users that are currently registered in an application or the DBA. See the DBA RESTXQ code for information on how clients can be registered and logged out.

The Database Sessions table shows clients that are connected via the client/server architecture.

Settings[edit]

In the settings, you can tweak some DBA options, enforce a garbage collection and view all current global and local databases options.

Changelog[edit]

Version 9.4
  • Updated: Logging was improved for millions of log entries
Version 8.6
  • Updated: Always accessible, even if job queue is full
  • Removed: Remote connections (to allow for better optimizations and less locking)
Version 8.4
  • Added: Editor: Key combination 'Shift-Ctrl-Enter', real time mode removed.

Introduced with Version 8.0.