:meta-keywords: coradb query, corasql interpreter, running sql, coradb management tools, coradb manager, query browser, migration toolkit :meta-description: CORASQL Interpreter, Management Tools, CoraDB Manager and Query Browser, Migrating schema/data with CoraDB Migration Toolkit. Query Tools =========== CORASQL Interpreter ---------------- The CORASQL Interpreter is a program used to execute the SQL statements and retrieve results in a way that CoraDB supports. The entered SQL statements and the results can be stored as a file. For more information, see :ref:`corasql-intro` and :ref:`corasql-exec-mode`. CoraDB also provides a GUI-based program called "CoraDB Manager". You can execute all SQL statements and retrieve results in the query editor of CoraDB Manager. For more information, see :ref:`cm-cqb`. This section describes how to use the CORASQL Interpreter on the Linux environment **Starting the CORASQL Interpreter** You can start the CORASQL program in the shell as shown below. At the initial installation, **PUBLIC** and **DBA** users are provided and the passwords of the users not set. If no user is specified while the CORASQL Interpreter is executed, **PUBLIC** is used for log-in. :: % corasql demodb CoraDB SQL Interpreter Type `;help' for help messages. corasql> ;help === === All session commands should be prefixed by `;' and only blanks/tabs can precede the prefix. Capitalized characters represent the minimum abbreviation that you need to enter to execute the specified command. ;REAd [] - read a file into command buffer. ;Write [] - (over)write command buffer into a file. ;APpend [] - append command buffer into a file. ;PRINT - print command buffer. ;SHELL - invoke shell. ;CD - change current working directory. ;EXit - exit program. ;CLear - clear command buffer. ;EDIT - invoke system editor with command buffer. ;LISt - display the content of command buffer. ;RUn - execute sql in command buffer. ;Xrun - execute sql in command buffer, and clear the command buffer. ;COmmit - commit the current transaction. ;ROllback - roll back the current transaction. ;AUtocommit [ON|OFF] - enable/disable auto commit mode. ;REStart - restart database. ;SHELL_Cmd [shell-cmd] - set default shell, editor, print and pager ;EDITOR_Cmd [editor-cmd] command to new one, or display the current ;PRINT_Cmd [print-cmd] one, respectively. ;PAger_cmd [pager-cmd] ;DATE - display the local time, date. ;DATAbase - display the name of database being accessed. ;SChema class-name - display schema information of a class. ;TRigger [`*'|trigger-name] - display trigger definition. ;Get system_parameter - get the value of a system parameter. ;SEt system_parameter=value - set the value of a system parameter. ;PLan [simple/detail/off] - show query execution plan. ;Info - display internal information. ;TIme [ON/OFF] - enable/disable to display the query execution time. ;LINe-output [ON/OFF] - enable/disable to display each value in a line ;HISTORYList - display list of the executed queries. ;HISTORYRead - read entry on the history number into command buffer. ;TRAce [ON/OFF] [text/json] - enable/disable sql auto trace. ;HElp - display this help message. **Running SQL with CORASQL** After the CORASQL has been executed, you can enter the SQL into the CORASQL prompt. Each SQL statement must end with a semicolon (;). Multiple SQL statements can be entered in a single line. You can find the simple usage of the session commands with the ;help command. For more information, see :ref:`corasql-session-commands`. :: % corasql demodb corasql> SELECT SUM(n) FROM (SELECT gold FROM participant WHERE nation_code='KOR' corasql> UNION ALL SELECT silver FROM participant WHERE nation_code='JPN') AS t(n); === === sum(n) ============= 82 1 rows selected. (0.106504 sec) Committed. corasql> ;exit .. _cm-cqb: Management Tools ================ +--------------------------+-----------------------------------------------------------------------------+-----------------------------------------------------------------+ | | Summary of features | Downloads of the recent files | +==========================+=============================================================================+=================================================================+ | CoraDB Manager | Java client tool for SQL execution & DB operation. | `CoraDB Manager Download | | | | `_ | | | 1) Java-based management tool (JRE 1.6 or higher required) | | | | | | | | 2) Auto upgrade after the initial download | | | | | | | | 3) Useful to manage multiple hosts | | | | | | | | 4) DB access via CoraDB Manager server | | +--------------------------+-----------------------------------------------------------------------------+-----------------------------------------------------------------+ | CoraDB Migration Toolkit | Java-based client tool to migrate schema and data from source DB | `CoraDB Migration Toolkit Download | | | (MySQL, Oracle, CoraDB) to CoraDB. | `_ | | | | | | | 1) Java-based management tool (JRE 1.6 or higher required) | | | | | | | | 2) Auto upgrade after the initial download | | | | | | | | 3) Available migration only for multiple queries results, | | | | the reuse of migration scenario; good to batch job | | | | | | | | 4) Direct DB access with JDBC | | +--------------------------+-----------------------------------------------------------------------------+-----------------------------------------------------------------+ .. +--------------------------+-----------------------------------------------------------------------------+-----------------------------------------------------------------+---------------------------------------------------------------------+ .. | | Summary of features | Downloads of the recent files | Links to the latest documents | .. +==========================+=============================================================================+=================================================================+=====================================================================+ .. | CoraDB Manager | Java client tool for SQL execution & DB operation. | `CoraDB Manager Download | `CoraDB Manager Documents | .. | | | `_ | `_ | .. | | 1) Java-based management tool (JRE 1.6 or higher required) | | | .. | | | | | .. | | 2) Auto upgrade after the initial download | | | .. | | | | | .. | | 3) Useful to manage multiple hosts | | | .. | | | | | .. | | 4) DB access via CoraDB Manager server | | | .. +--------------------------+-----------------------------------------------------------------------------+-----------------------------------------------------------------+---------------------------------------------------------------------+ .. | CoraDB Migration Toolkit | Java-based client tool to migrate schema and data from source DB | `CoraDB Migration Toolkit Download | `CoraDB Migration Toolkit Documents | .. | | (MySQL, Oracle, CoraDB) to CoraDB. | `_ | `_ | .. | | | | | .. | | 1) Java-based management tool (JRE 1.6 or higher required) | | | .. | | | | | .. | | 2) Auto upgrade after the initial download | | | .. | | | | | .. | | 3) Available migration only for multiple queries results, | | | .. | | the reuse of migration scenario; good to batch job | | | .. | | | | | .. | | 4) Direct DB access with JDBC | | | .. +--------------------------+-----------------------------------------------------------------------------+-----------------------------------------------------------------+---------------------------------------------------------------------+ Running SQL with CoraDB Manager ------------------------------- CoraDB Manager is the client tool that you should download and run. It is a Java application which requires JRE or JDK 1.6 or higher. #. Download and install the latest CoraDB Manager file. CoraDB Manager is compatible with CoraDB DB engine 2008 R2.2 or higher version. It is recommended to upgrade to the latest version periodically; it supports the auto-update feature. (CoraDB FTP: http://ftp.coradb.ai/CoraDB_Tools/CoraDB_Manager ) #. Start CoraDB service on the server. CoraDB Manager server should be started for CoraDB Manager client to access to DB. For more information, see :ref:`coradb-manager-server`. :: C:\CoraDB>coradb service start ++ coradb service is running. #. After the installation of CoraDB Manager, register host information on the [File > Add Host] menu. To register the host, you should enter host address, connection port (default: 8001), and CoraDB Manager user name/password and install the JDBC driver of the same version with DB engine (supporting auto-driver-search/auto-update). #. Choose the host on the left tress and perform the CoraDB Manager user (=host user) authentication. The default ID/password is admin/admin. #. Create a new database as clicking the right mouse button on the database node, or try to connect as choosing the existing database on the bottom of the host node. At this time, do the DB user's login. The default db user is "dba", and there is no password. #. Run SQL on the access DB and confirm the result. The host, DB and table list are displayed on the left side, and the query editor and the result window is shown on the right side. You can reuse the SQLs which have been succeeded with [SQL History] tab and compare the multiple results of several DBs as adding the DBs for the comparison of the result with [Multiple Query] tab. .. image:: /images/gs_manager_sql.png .. FIXME: For more information, see http://www.coradb.ai/wiki_tools/entry/coradb-manager-manual_kr\ . Migrating schema/data with CoraDB Migration Toolkit --------------------------------------------------- CoraDB Migration Toolkit is a tool to migrate the data and the schema from the source DB (MySQL, Oracle, and CoraDB) to the target DB (CoraDB). It is also Java applications which require JRE or JDK 1.6 or later. You should download separately. (CoraDB FTP: http://ftp.coradb.ai/CoraDB_Tools/CoraDB_Migration_Toolkit ) It is useful in case of switching from other DB into CoraDB, in case of migrating into other hardware, in case of migrating some schema and data from the operating DB, in case of upgrading CoraDB version, and in case of running the batch jobs. The main features are as follows: * Supports the tools/some schema and data migration * Available to migrate only the desired data as running several SQLs * Executable without suspending of operation as supporting online migration through JDBC * Available offline migration with CSV, SQL, CoraDB loaddb format data * Available to run directly on the target server as extracting the run-script of migration * Shorten the batch job time as reusing the migration run-script. .. image:: /images/gs_manager_migration.png .. FIXME: For more information, see http://www.coradb.ai/wiki_tools/entry/coradb-migration-toolkit-manual\ . Drivers ======= The drivers supported by CoraDB are as follows: * :doc:`CoraDB JDBC driver ` (`Downloads JDBC `_) * :doc:`CoraDB CCI driver ` (`Downloads CCI `_) * :doc:`CoraDB PHP driver ` (`Downloads PHP `_) * :doc:`CoraDB PDO driver ` (`Downloads PDO `_) * :doc:`CoraDB ODBC driver ` (`Downloads ODBC `_) * :doc:`CoraDB OLE DB driver ` (`Downloads OLE DB `_) * :doc:`CoraDB ADO.NET driver ` (`Downloads ADO.NET `_) * :doc:`CoraDB Perl driver ` (`Downloads Perl `_) * :doc:`CoraDB Python driver ` (`Downloads Python `_) * :doc:`CoraDB Ruby driver ` (`Downloads Ruby `_) * :doc:`CoraDB Node.js driver ` (`Downloads Node.js `_) Among above drivers, JDBC and CCI drivers are automatically downloaded while CoraDB is being installed. Thus, you do not have to download them manually.