Release 1.1. User's Guide and Reference
|
|
|
- Hillary Thornton
- 9 years ago
- Views:
Transcription
1 Release 1.1 User's Guide and Reference
2 1. NuoDB API DataSource Reference Page NuoDB Online Documentation v Overview About the NuoDB Architecture Client Connections System Requirements and Support Installing NuoDB Linux Installation Mac OS X Installation Windows Installation Installing a New License Uninstalling NuoDB Getting Started QuickStart Run the QuickStart Console > Explorer QS Execute SQL Commands Web Console with the QuickStart Copy of Execute SQL Commands Using Command Line to Get Started Linux Command Line Usage Windows Command Line Usage Developing with NuoDB C++ with NuoDB Getting Started Java Hibernate with NuoDB Getting Started Java with NuoDB Getting Started JRuby with NuoDB Getting Started Sample Client Programs Migrating Databases to NuoDB APIs and Drivers NuoDB Drivers Available NuoDB Drivers NuoDB Drivers on GitHub JDBC Connections JDBC Connection Properties ODBC Connections Example: Using ODBC and Microsoft Excel to Read a NuoDB Database Example: Using ODBC and Open Office Calc to Read a NuoDB Database NuoDB ADO.NET Driver NuoDB PHP PDO Driver NuoDB Zend Framework Adapter APIs C++ API Reference JDBC API Reference JDBC API Requirements JDBC API Sample Understanding Client Connections Programming C++ with NuoDB Java With NuoDB Tools and Utilities Tools NuoDB Loader NuoDB Manager NuoDB Migrator NuoDB Migration Usage Examples for NuoDB MSSQL Migration MySQL Migration Oracle Migration
3 PostgreSQL Migration Commands NuoDB SQL CLI nuosql Command Batch Processing from the Command Line Selecting from the DUAL Table Metadata Troubleshooting the NuoDB SQL Client NuoDB Web Console Start the NuoDB Web Console Start a Database Using the Web Console Specify Alert Settings webapp.properties Storefront Demo rd Party Utilities DbVisualizer for NuoDB JDBC Driver OLD_DbVisualizer for NuoDB JDBC Driver SQL Workbench/J SQuirreL Universal SQL SQL Reference Summary of SQL Supported by NuoDB SQL Reference Pages ALTER DOMAIN ALTER SEQUENCE ALTER TABLE ALTER TRIGGER ALTER USER AUTOCOMMIT COMMIT CREATE DATABASE CREATE DOMAIN CREATE INDEX CREATE PROCEDURE CREATE ROLE CREATE SCHEMA CREATE SEQUENCE CREATE TABLE CREATE TRIGGER CREATE USER CREATE VIEW DELETE DROP DATABASE DROP DOMAIN DROP INDEX DROP PROCEDURE DROP ROLE DROP SCHEMA DROP SEQUENCE DROP TABLE DROP TRIGGER DROP USER DROP VIEW EXPLAIN GRANT INSERT RELEASE REPLACE REVOKE ROLLBACK SAVEPOINT
4 SELECT SET SHOW START TRANSACTION TRUNCATE TABLE UPDATE UPGRADE USE SQL Language Elements and Transactions Datatypes Supported by NuoDB NuoDB Extensions Standard SQL Datatype Keywords Supported String Types Date, Time, and TimeStamp Conversions Numeric Types Datatypes [old] <HIDDEN> Domains Operators and Operations Logical Operators Comparison Operators Numeric Operations Functions CHAR_LENGTH Function SUBSTR Function String Concatenation Date and Time Functions Expressions Value Expressions Conditional Expressions Object Privileges Transactions and Isolation Levels Relationship to java.sql Levels Internationalization and Localization Migration Notes Distinction between a schema and a database Compliance with SQL Standard Summary of SQL in NuoDB Working With Triggers SQL Administration and Deployment Administration Tools nuoagent Commands to Start and Stop NuoDB Brokers and Agents Starting and Stopping NuoDB Agents/Brokers, Web Console and Tray Monitor nuodb default.properties Provisioning NuoDB Domain Administrators Data Durability in NuoDB Configuration Scenarios Single Host Configuration Multiple Host Configuration Amazon AWS Multiple Data Centers and Cloud Regions Automate Configuration Scenarios Using Amazon Web Services (AWS) Components Microsoft Azure Deployment Guidelines Memory Management High Availability (HA)
5 Redundancy and Failover Hadoop Distributed File System (HDFS) Troubleshooting NuoDB How To Scale Out a NuoDB Database Setup a Pilot Project on Multiple Hosts Glossary Release Notes Bug Fixes and Improvements Known Bugs and Limitations Acknowledgements Documentation Download
6 NuoDB API DataSource Reference Page JDBC API NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved SPACER
7 NuoDB Online Documentation v1.1 Welcome to the NuoDB Documentation! Installation and Getting Started Installing NuoDB Getting Started Overview SQL Materials SQL Reference SQL Language Elements and Transactions Programming and Administration APIs and Drivers Tools and Utilities Administration Tools
8 Overview A NuoDB system is designed for the configuration, deployment, and management of one or more databases on a cloud. From a conceptual point of view, a NuoDB system has three layers: a Management Layer, an SQL Layer, and a Data Layer. Each NuoDB database is associated with multiple processes running in each of these layers. Management Layer NuoDB Broker is a process that manages access to transaction engines and storage managers, independent of any particular database in the NuoDB system. By default, when you start a broker, the broker defines a NuoDB domain. NuoDB Agent is a process that manages NuoDB processes running on a particular computer. It starts and stops the NuoDB servers and communicates with a broker about the state of the system. NuoDB Manager is a text-based tool that you can use interactively or non-interactively to administer all aspects of NuoDB. NuoDB Web Console is a web based GUI administration tool running by default on; /localhost:8080 NuoDB System Tray is a GUI tool running on MAC OSX and Windows used to more easily launch the NuoDB Console, QuickStart Wizard and SQL Prompt. NuoDB Loader is a tool for importing and exporting data. SQL Layer NuoDB Transaction Engine provides access to a single database. It handles requests from clients, caches data, and coordinates transactions. There may be any number of transaction engines running on a single machine or across a cluster. Data Layer NuoDB Storage Manager is a process that provides durability of the data that it handles (for example by writing to disk). There may be any number of storage managers running on a single machine or across a cluster. Each storage manager is associated with exactly one database. Transaction engines and storage managers send asynchronous messages to each other while the system is running, in order to maintain copies of the current database. NuoDB Domain Lastly, a NuoDB Domain is a collection of NuoDB hosts that have been provisioned to work together to support one or more NuoDB databases. By default, when you start a broker, the broker defines a NuoDB domain. On most platforms the NuoDB installer will automatically start a broker when the OS starts. The following drawing is a conceptual illustration of the components that comprise a NuoDB system.
9 NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved SPACER
10 About the NuoDB Architecture Atomic Architecture, Latency and Storage Management NuoDB uses a unique architecture to achieve high performance, elasticity, scalability, and ACID compliance. Overview How does NuoDB handle the case of two transactions, running on parts of a database that are separated by a long-latency network, where each transaction can run and commit before either transaction can determine the existence of the other? How do storage managers that ensure durability also maintain consistency with each other and with the current state of the database? The NuoDB architecture makes it possible for transaction engines to maintain a copy of a database in memory, and for storage managers to stay synchronized with each other and with the transaction engines. All elements of a NuoDB database (data, indexes, metadata, and transaction state) are maintained in objects called atoms, which are of various types. The transaction manager atom (TMA) tracks the start events and commit events of all transactions in the system. Instances of the TMA receive and send messages to and from other TMAs, and to and from TEs and SMs. Each TE and each SM has a TMA instance. Transactions A NuoDB client application starts a transaction by recording a start event on a TE, which is referred to as the local TE. Similarly, when the transaction completes, the TE records a transaction end event. All TEs record all start and end events, making it possible for all transactions to be visible across the database. All TEs for a particular database communicate with each other by means of batched, asynchronous messages; messages about transaction state changes require no acknowledgement. When two transactions are operating independently (for example, inserting values into different tables) they do not communicate at all. How Conflicts Are Resolved Conflicts can occur on specific pieces of data, such as trying to update to the same record, or inserting the same values into unique indexes. If multiple copies of an atom are in circulation, and there is a conflict, a single instance of the atom is designated as the atom chairman. The atom chairman acts as referee and resolves the conflict of operations on data. The steps in this kind of conflict resolution are as follows: The local records or index atom instance sends a change request to the records or index atom chairman. The chairman receives change requests and determines if there is a conflict. During this communication process, each change is stalled. Consequently the transaction thread stalls until the atom chairman responds. If the change does not conflict with concurrent changes the transaction proceeds. Commit Protocol NuoDB database administrators can set a minimum level of durability for a database, and application developers can require a higher level of durability for specific applications. The commit protocol is specified as a command line option. The remote commit with journaling protocol guarantees that at least one SM has copies of all of a transaction's changes before the transaction commits. The following list describes the steps in a commit process: The transaction issues a commit request to the TE it is connected to (which is the local TE). The local TE sends a pre-commit message to the TMAs on SMs. The SMs receive the pre-commit message and each one: Flushes its replication message journal, using direct I/O Sends a "CommitACK" message to the TMA on the local TE. The TMA on the local TE: Receives at least one "CommitACK" message Sends a "committed" message to all other TMAs Tells its TE that it can respond to the transaction saying its commit succeeded. Because the commit sequence is critical to performance, the messages are not batched, but sent immediately. This sequence guarantees that all changes made by the committed transaction are on durable storage in at least one place. If all the SMs serving the database fail simultaneously, applying the journaled replication message to the archived atoms restores all changes made by transactions that had committed before the catastrophe. Applications or databases with higher durability requirements can require a commit
11 protocol, which requires receiving "commit received" messages from two SMs. NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved SPACER
12 Client Connections The following illustration shows a simple NuoDB database system and a client that wants to connect to it. The steps in the process shown in this conceptual illustration are as follows: 1. An application that seeks to connect to the database calls to the broker on Host A Because the Broker communicates with all Agents in the Domain it knows which Transaction Engines are available and determines the best transaction engine for the application. The broker communicates back to the client that it should connect to the Transaction Engine on Host B. Once the Application knows which Host and Transaction Engine to communicate with, it will no longer communicate with the Broker. The client connects to the Transaction Engine on Host B. About Client Connections and Transaction Engines NuoDB distributes new requests for transactions from a client application to existing transaction engines that are connected to the client application. There is no mechanism for redistributing existing connections when a new transaction engine starts. You must explicitly establish a new connection from the client application and send it to the newly started transaction engine. If you add a transaction engine process while client applications are connected to transaction engines that are already running, and you want to have the same number of connections, and you want to balance the connections among all transaction engines, you must explicitly disconnect the existing client connections and reconnect clients to all transaction engines after you start the new transaction engine. NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved SPACER
13 System Requirements and Support NuoDB runs on Linux, Mac OS X, and Windows, and requires the Java SDK. Supported Operating Systems Ubuntu and 12.x RHEL 5.9 and 6.x Linux (x64) SuSe Linux Enterprise Server 11 sp2 opensuse 12.x Amazon Basic EC2 MAC OS X 10.7.x or later (x64) Windows (x64) 7 or later note: Client support only for x32 Additional Software Requirements NuoDB requires Java 1.6 or later, and has been tested using the following software: Oracle Java 1.6 MAC JDK 1.6 Open JDK 1.6 On Windows (x64), Java must also be (x64). 3rd Party Software NuoDB will install Jetty as the embedded web server for NuoConsole:\ Jetty 8.1 Minimum Recommended Hardware CPU Memory Dual Core x86_64, 1.6GHz 4 GB Unsupported Software NuoDB does not support g++ on Windows NuoDB Ruby drivers have not been tested on Windows NuoDB Go driver is not supported NuoDB Perl driver is not supported
14 NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved SPACER
15 Installing NuoDB NuoDB is supported on and provides installation packages multiple operating systems. Please select your platform of choice below for further details. System Requirements and Support Linux Installation Mac OS X Installation Windows Installation Installing a New License Bug Fixes and Improvements Known Bugs and Limitations NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved SPACER
16 Linux Installation To install and add new users you must have write access to the /opt directory. RPM Installation Run the RedHat Package Manager (RPM) using the NuoDB package $ rpm --install nuodb-1.1.linux.x64.rpm Installation Details Installation Directory Path Variable /opt/nuodb /opt/nuodb/bin NuoDB Broker Running Using options from the default.properties file Web Console Running License 2 Hosts DEB Installation Run the Debian package utility, dpkg: dpkg --i nuodb-1.1.linux.x64.deb Installation Details Installation Directory Path Variable /opt/nuodb /opt/nuodb/bin NuoDB Broker Running Using options from the default.properties file Web Console Running License 2 Hosts TAR.GZ Installation Copy the compressed file and expand it to the install directory you wish to use: $ sudo cp nuodb-1.1.linux.x64.tar.gz /opt/ $ sudo tar -zxvf /opt/nuodb-1.1.linux.x64.tar.gz Configure your environment variable. Add $NUODB_ROOT /nuodb/bin to the PATH, where $NUODB_ROOT is where you installed the product.
17 $ export PATH=$PATH:/opt/nuodb/bin Optionally, use init.d scripts to start NuoDB processes. NuoDB provides a sample init.d script. To experiment with the NuoDB SQL client and a sample NuoDB database see the QuickStart. You can also get started just by using the command line: see Linux Command Line Usage. Installation Details Installation Directory Path Variable No Default Set during Installation No Default must be set manually NuoDB Broker Not Running Must be started manually Web Console Not Running Must be started manually License 2 Hosts NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved SPACER
18 Mac OS X Installation To install NuoDB you must have write access to the /opt directory. Wizard Installation NuoDB can be installed by double-clicking the.pkg file and walking through the installation prompts. Once the installation is complete, the QuickStart Wizard will appear. The OS X Gatekeeper feature may cause an "Unidentified Developer" error to be thrown when downloading or installing apps that were not purchased via the Mac App Store. If you experience this behavior use the following to resolve the error: 1. Goto: System Preferences > Security and Privacy > General 2. Select the "Anywhere" radio button for "Allow applications downloaded from:" Command Line Installation The Command Line installation of NuoDB allows you bypass the installation Wizard and install using all of the default options. Please note that the QuickStart Wizard will appear once the Command Line installation is complete. $ sudo installer -pkg ~/Downloads/nuodb-1.1.macosx.x64.pkg -target / Installation Details The following are the default installation details, regardless of the installation method (Wizard or Command Line). Installation Directory Path Variable /opt/nuodb /opt/nuodb/bin NuoDB Broker Running Using options from the default.properties file Web Console Running Default License 2 Hosts Post Installation Once the installation is complete you will be prompted to run the QuickStart Wizard which will introduce you to the elements of the NuoDB Architecture and automatically start a test database. You can choose to cancel the QuickStart Wizard, and in that case we would suggest that you review the Linux Command Line Usage for examples of how to start a database manually. NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved SPACER
19 Windows Installation Prerequisites Write permissions. To install NuoDB you must have write access to the C:\Program Files directory..net Framework v4 or later must be installed, or the NuoDB ADO.NET driver, which is part of the NuoDB install package, will not install. To verify you have it, look for it in the list of installed programs in Control Panel (Start > Control Panel > Programs > Programs and Features). If it's not installed, download and install.net Framework v4 before installing NuoDB. Important Previous versions of NuoDB 64-bit installations are automatically upgraded as part of the NuoDB v1.1 installation process. 32-bit installations however are not, and require the user to first uninstall the previous version before installing NuoDB v1.1. Wizard Installation NuoDB can be installed by double-clicking the.exe file and walking through the installation prompts. Once the installation is complete, the QuickStart Wizard launches. When you install NuoDB on Windows you may see a User Account Settings dialog indicating that the installer is about to make changes to the computer. Our installer is a signed as NuoDB, Inc. Silent Installer The silent installer suppresses all interactive dialog prompts and installs NuoDB to the default locations noted below. Command > nuodb-1.1.windows.x64.exe /S The installer does several things beyond unpacking the software, including: Sets up the proper registry entries for the NuoDB ODBC driver Checks that a valid version of Java is installed Installs and starts a broker as a Windows Service. Installation Details The following are the default installation details, regardless of the installation method (Wizard or Silent Install). Installation Directory Path Variable c:\program Files\nuodb c:\program Files\nuodb\bin NuoDB Broker Running Using options from the default.properties file Web Console Running Default License 2 Hosts
20 Post Installation Once the installation is complete you will be prompted to run the QuickStart Wizard which will introduce you to the elements of the NuoDB Architecture and automatically start a test database. You can choose to cancel the QuickStart Wizard, and in that case we would suggest that you review the Windows Command Line Usage for examples of how to start a database manually. NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved SPACER
21 Installing a New License The Free License is limited to a domain of two hosts only. The following instruction will walk you through obtaining and installing a new license. Obtain a new license License Type Cost Notes Developer Free Requires online registration at the NuoDB WebSite Allows for unlimited hosts Not supported for production environments. Professional Priced Requires a purchase by contacting the Nuo DB Sales Organization Supported for production environments Regardless of how you obtain your new license, you will receive an with your new license file as an attachment. Installation Steps Before you Begin You must have a Broker running to successfully install your new license. The following instruction assumes you are using default domain and password as defined in the etc/default.properties file. Save your License The license needs to be saved to and installed on the host running the Broker, only. There is no need to install the license to any other host in your NuoDB Domain. Start the Broker # By default, the NuoDB installation will automatically start a broker and domain for you unless you installed using the TAR.GZ files. UNIX $ java -jar /opt/nuodb/jar/nuoagent.jar & Windows > start java -jar "c:\program Files\nuodb\jar\nuoagent.jar" Start nuodbmanager
22 # Always use the nuodbmanager utility when administering your domain and database from the command line. UNIX $ java -jar /opt/nuodb/jar/nuodbmanager.jar --broker localhost --password bird Windows > java -jar "c:\program Files\nuodb\jar\nuodbmanager" --broker localhost --password bird Install your new license # The following command is for all platforms nuodb [domain] > apply domain license licensefile /path/to/your/license_file.txt Verify your new license # The following command is for all platforms nuodb [domain] > show domain license NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved SPACER
23 Uninstalling NuoDB To unistall NuoDB: Windows 7 Control Panel Navigate to Start > Control Panel > Programs > Uninstall a program Select NuoDB from the list of installed programs and click Unistall/Change. The NuodDB Uninstall dialog opens. 3. Click Uninstall to uninstall NuoDB. Windows Command Line Interface 1. Open a CMD window (Start > Run > cmd). Run the following commands: > cd C:\Program Files\NuoDB\ > uninstall nuodb-sh Linux/Mac OSX 1. Open a Terminal and run the following commands: $ cd /opt/nuodb $ sudo sh uninstall-nuodb.sh $ Password: $ This will uninstall NuoDB and remove ALL associated files and preferences. $ Do you wish to proceed with the uninstall? (Y/n): y $ Uninstalling NuoDB... $ NuoDB successfully uninstalled. NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved SPACER
24 Getting Started Get started with NuoDB by running a NuoDB startup script that creates a sample database for you to explore, or by creating your own database. Run a sample client that shows how to connect an application to a NuoDB database. QuickStart Using Command Line To Get Started Developing with NuoDB NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved SPACER
25 QuickStart Get started with NuoDB by running a NuoDB startup script that creates a domain, a database, and a sample schema. The script starts NuoDB Console and the NuoDB SQL client, so you can use NuoDB with a small sample project. Run the QuickStart Execute SQL Commands Use NuoDB Web Console to Explore the Domain NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved SPACER
26 Run the QuickStart Procedure to get the product up and running with a sample NuoDB database. The Quickstart runs as a part of the installation however, these instructions will guide you after the product is installed. This task is part of the NuoDB QuickStart, which offers an introduction to the basic features of NuoDB. Run the QuickStart Wizard Windows and Mac OS X Wizard 1. From the NuoDB System Tray select NuoDB Console. The NuoDB Console opens in a browser tab. Note Currently, there is no system tray available for Linux installations. To run the QuickStart manually on a Linux install, see Command-Line instructions in the next section 2. On the Console > Home tab, click Start QuickStart. 3. Leave the Domain Settings and Database Settings unchanged, and click Create Database to start a storage manager (SM), start a transaction engine (TM), create a schema, and import sample data into the database. The QuickStart database is created.
27 4. Once the database is created, click the Admin or Explorer link to login to the domain containing the database. 5. The Domain Login dialog appears. Accept the default Domain name and password credentials (domain, bird) and click Log in.
28 The Explorer link opens to the Console Explorer tab, showing the test database in the Data Hierarchy tree. Click here to expand... The Admin link opens to the Console Admin tab showing Domain Overview of the domain you are logged into. Click here to expand...
29 Run the QuickStart Command-Line The quickstart can also be executed form the command line. Running from the command line accomplishes the same steps as the visual quickstart and provides you with a SQL prompt for further exploring. LINUX/MAC $ /opt/nuodb/run-quickstart WINDOWS > c:\program Files\NuoDB\run-quickstart.cmd QuickStart Tasks On all platforms, running the Quickstart accomplishes the following: Configures your system path. Creates a domain (which is named domain) using the settings in the default.properties file. The initial administrator (with a user name of domain) has an initial password (bird), and a second domain administrator user is quickstart with a password of quickstart. Starts a NuoDB database, named test, with its storage repository in WINDOWS: \tmp\test_archive LINUX/MAC: /tmp/test_archive Creates sample schema (hockey). Creates a sample database (test). Imports data to the sample database from: WINDOWS: %\nuodb\samples\quickstart\bruins.csv LINUX/MAC: $/nuodb/samples/quickstart/bruins.csv Starts the NuoDB SQL client (nuosql), with user name and password of dba and goalie, respectively. Starts NuoDB Console as a process. By default it starts on After the script finishes: Take a look at the remaining tasks in the Quick Start documentation to discover how you can experiment with the NuoDB SQL client, NuoDB Manager and NuoDB Console.
30 To understand the role of various NuoDB system components, look at the Overview topic. Other topics explain how to start a pilot project of your own, how to set up and administer a system on the cloud, and connect a client to NuoDB. NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved SPACER
31 Console > Explorer QS 1. Double-click the database. The Database Login dialog launches with the default username and password (dba, goalie). 2. If not already present, enter the username and password, and click Login. You are now logged into database as DBA. 3. To run a query against the database, click New. A tabbed New Query window opens. 4. Write a SQL query and click Execute Query. Note Unless the schema is selected in the Database Hierarchy, fully qualified table names must be used in SQL Explorer
32 4. queries, e.g., hockey.teams or system.connections. This is because the SQL Explorer uses the USE statement internally in the Database Hierarchy, and therefore its use in the Query window can produce SQL processing conflicts. Selecting a schema in the Database Hierarchy implements USE for your query. The query executes. NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved SPACER
33 Execute SQL Commands Start NuoSQL from the Command-Line To launch nuosql from the command line, open a terminal or command line window and cd to: Linux/Mac opt/nuodb/bin Windows C:\Program Files\nuodb\bin Then issue the following command. nuosql <DatabaseName>@<HostName> --user <UserName> --password <Password> Linux/Mac Example... Linux/Mac Command $ nuosql test@localhost --user dba --password goalie Linux/Mac Result Execute your SQL Commands Windows Example... Windows Command > cd "c:\program Files\nuodb\bin" > nuosql.exe test@localhost --user dba --password goalie Windows Result
34 Execute your SQL Commands Executing SQL Commands Once NuoSQL is started you can execute SQL commands as you normally would. More information regarding the NuoDB SQL Syntax can be found here and here. In the window where the SQL session is running issue the following command: SQL> SHOW TABLES; Tables in schema HOCKEY MASTER SCORING TEAMS MASTER, SCORING and TEAMS are the sample tables created when you execute the QuickStart. To see what is in the table, run the following: SQL> SELECT * FROM teams ORDER BY name; YEAR TMID CONFID DIVID RANK PLAYOFF G W L T OTL NAME TOB th Battalion 1972 ALB 0 WW Alberta Oilers 2010 AND WC PC 2 CQF Anaheim Ducks <ETC> Type help to show a list of the NuoDB SQL client commands.
35 SQL> help ALTER DOMAIN ALTER SEQUENCE ALTER TABLE ALTER TRIGGER ALTER USER <ETC> Change definition of a domain (not yet implemented) Change definition of a sequence Change definition of a table Change definition of a trigger Change definition of a user Exit the NuoDB SQL client by typing quit at the SQL prompt: SQL> quit NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved SPACER
36 Web Console with the QuickStart Use NuoDB Web Console to view, analyze, and manage a domain. This example uses the domain created by running the Quick Start. Connect to the Web Console By default the NuoDB Web Console runs on port 8080 and the install packages will configure the Web Console to automatically run in the background. The examples shown here are based on the database that is created as a part of the QuickStart. If you have not run the QuickStart please see Run the QuickStart for information Open a browser and go to: Login using the following: a. b. Username: quickstart Password: quickstart Domain Overview The default view of the domain, will provide you with access to manage the domain and database resources. Select your Domain to install a new license. Select Database to Add/Remove databases from your Domain. Select Host to manage individual NuoDB processes.
37 View the Database View the current Test database by selecting database link. The Databases page will view information such as; Status of the database Transactions per second Number of Client Connections CPU and Memory usage Click the name of the database to view more details about the database processes and status. View Database Acitivity Regardless of the database view you are in there will always be a graphical Activity view in the Web Console window.
38 View Host Information To view information about the individual hosts in your domain, you must select host from the Domain Overview. Next Select the individual host you want to work with to view detailed information. NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved SPACER
39 Copy of Execute SQL Commands NuoDB is bundled with both a browser based and text based analysis and management tools for your NuoDB database. Launch SQL Explorer 1. Launch the following from your browser: 2. Login to your Domain. Note: this example uses the domain credentials for the QuickStart domain (quickstart / quickstart) 3. Select your database from the Database Hierarchy and supply your database level credentials. Note: this example uses the domain credentials for the QuickStart domain (dba / goalie) 4. Select "New" from the Database Hierarchy pane, to open a Query Tab and enter your SQL commands. 5. Go To Sample SQL Commands... Launch NuoSQL from the System Tray NuoSQL is the command line interface to the NuoDB SQL interface. Use the instruction below that matches your OS. OSX Tutorial... Select NuoDB SQL Prompt from the System Tray menu.
40 A Terminal window will open with the SQL> prompt. Sample SQL Commands... By default using the System Tray to launch the NuoDB SQL Prompt will attempt to connect to the test database that is created when the QuickStart is executed. If this database is not running you will receive an error similar to: Connection Failed: no NuoDB nodes are available for database If you receive this error, simply run the QuickStart to start the database. Windows Tutorial... Select NuoDB SQL Prompt from the System Tray menu.
41 A CMD window will open with the SQL> prompt Sample SQL Commands... By default using the System Tray to launch the NuoDB SQL Prompt will attempt to connect to the test database that is created when the QuickStart is executed. If this database is not running you will receive an error similar to: Connection Failed: no NuoDB nodes are available for database If you receive this error, simply run the QuickStart to start the database. Currently, the Linux installation of NuoDB does not have a System Tray integration. On Linux, you must launch NuoSQL from the command line (below). Start NuoSQL from the Command-Line You can also start NuoSQL directly from the command-line. NuoSQL Syntax
42 nuosql --user <UserName> --password <Password> Unix Example... Unix Command $ nuosql test@localhost --user dba --password goalie Unix Result Execute your SQL Commands Windows Example... Windows Command > cd "c:\program Files\nuodb\bin" > nuosql.exe test@localhost --user dba --password goalie Windows Result
43 Execute your SQL Commands Executing SQL Commands Once NuoSQL is started you can execute SQL commands as you normally would. More information regarding the NuoDB SQL Syntax can be found here and here. In the window where the SQL session is running issue the following command: SQL> SHOW TABLES; Tables in schema HOCKEY MASTER SCORING TEAMS MASTER, SCORING and TEAMS are the sample tables created when you execute the QuickStart. To see what is in the table, run the following: SQL> SELECT * FROM teams ORDER BY name; YEAR TMID CONFID DIVID RANK PLAYOFF G W L T OTL NAME TOB th Battalion 1972 ALB 0 WW Alberta Oilers 2010 AND WC PC 2 CQF Anaheim Ducks <ETC> Type help to show a list of the NuoDB SQL client commands. SQL> help ALTER DOMAIN ALTER SEQUENCE ALTER TABLE ALTER TRIGGER ALTER USER <ETC> Change definition of a domain (not yet implemented) Change definition of a sequence Change definition of a table Change definition of a trigger Change definition of a user Exit the NuoDB SQL client by typing quit at the SQL prompt: SQL> quit
44 NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved SPACER
45 Using Command Line to Get Started Instead of using NuoDB Console to manage a domain you can use command line tools and programs. You must always start by running a broker to create a domain. Using Command Line on Linux/Mac Using Command Line on Windows NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved SPACER
46 Linux Command Line Usage Guidelines for setting up a NuoDB database from the command line (Linux only) Create a Data Directory Because NuoDB does not have a default storage directory you are free to create your directory in almost any location. For this sample procedure, create the directory in the temp directory, as shown: $ sudo mkdir /opt/nuodb/samples/testdata Start a NuoDB Broker All NuoDB installer packages will configure a broker to start automatically. The.tar.gz package will not configure the broker to start automatically. Starting a broker defines a NuoDB domain and the domain is required for you to run your NuoDB databases. # Start a broker with the default host and password by running the following command: $ java -jar /opt/nuodb/jar/nuoagent.jar --broker & Start NuoDB Manager Use NuoDB Manager to set up and manage processes in the domain from the command line. NuoDB Manager is a text-based tool to help domain administrators control, monitor, and analyze all aspects of NuoDB domains. Starting the tool requires a broker to be running. $ java -jar /opt/nuodb/jar/nuodbmanager.jar --broker localhost --password bird nuodb [domain] > Start a Storage Manager The Storage Manager is the process that controls reads and writes of your data on disk. In this sample procedure, the Storage Manager uses the directory that you created earlier for storage. nuodb [domain] > start process sm host localhost database testdb Process command-line options: Archive directory: /opt/nuodb/samples/testdata Initialize archive: true Started process:... [ pid = 9950 ] Start a Transaction Engine The Transaction Engine is the process that executes SQL requests from the client. When you create a transaction engine for the first time you must specify a user name and password for the database administrator. nuodb [domain] > start process te host localhost database testdb Process command-line options: --dba-user dba --dba-password dba Started process:... [ pid = 9961 ]
47 Launch NuoDB SQL Launch the NuoDB SQL client: nuosql. This is the default utility for editing and executing SQL. $ /opt/nuodb/bin/nuosql gsdatabase@localhost --user dba --password dba SQL> CREATE TABLE t1 (DATA varchar (100), CUR_TIME timestamp default('now')); SQL> INSERT INTO t1 (DATA) VALUES ('Time of update is:'); SQL> SELECT * FROM t1; DATA CUR_TIME Time of update is: :52: Linux Startup Script The sample script named nuoagent is located in /opt/nuodb/etc/ that can be used on any UNIX platform, including instances of NuoDB on a cloud, such as Amazon EC2 or others. During installation NuoDB creates both a user and a group named nuodb. You can set up the system to run the init script on startup, and also specify (independent of the script) that NuoDB should run as the user nuodb. LSB Distributions (RHEL, Centos) Copy and Confirgure the script to your /etc/init.d folder. $ sudo cp ${$NUODB_ROOT}/etc/nuoagent /etc/init.d/nuoagent $ chmod 755 /etc/init.d/nuoagent $ chmod +x /etc/init.d/nuoagent $ chkconfig --add nuoagent $ chkconfig --level 2345 nuoagent on Use the following commands to start and stop the service: $ sudo service nuoagent start $ sudo service nuoagent stop $ sudo service nuoagent restart $ sudo service nuoagent status To delete the service $ chkconfig --del nuoagent LSB distributions (Debian, Ubuntu) Install the service
48 $ sudo cp ${$NUODB_ROOT}/etc/nuoagent /etc/init.d/nuoagent $ chmod 755 /etc/init.d/nuoagent $ sudo update-rc.d nuoagent defaults To delete the service $ sudo update-rc.d -f nuoagent remove Note: Using nuodbmanager to create a domain administrator causes the broker for the domain to write database account information in /etc. NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved SPACER
49 Windows Command Line Usage Guidelines for setting up a NuoDB database from the command line (Windows only) Create an Archive Directory NuoDB does not have a default Archive Directory so, you are free to create one in almost any location. For this sample procedure, create the directory in the \temp directory, as shown: > mkdir c:\temp\gsdata Start a NuoDB Broker The NuoDB Windows installer will configure a broker to start automatically so the following if for informational purposes only. Starting a broker defines a NuoDB domain and the domain is required for you to run your NuoDB databases. # Start a broker with the default host and password by running the following command: > start java -jar "c:\program Files\nuodb\jar\nuoagent.jar" --broker Start NuoDB Manager Use NuoDB Manager to set up and manage processes in the domain from the command line. NuoDB Manager is a text-based tool to help domain administrators control, monitor, and analyze all aspects of NuoDB domains. Starting the tool requires a broker to be running. > java -jar "C:\Program Files\nuodb\jar\nuodbmanager.jar" --broker localhost --password bird nuodb [domain] > Start a Storage Manager The Storage Manager is the process that controls reads and writes of your data on disk. In this sample procedure, the Storage Manager uses the directory that you created earlier for storage. nuodb [domain] > start process sm host localhost database testdb Process command-line options: Archive directory: c:\temp\gsdata Initialize archive: true Started process:... [ pid = 9950 ] Start a Transaction Engine The Transaction Engine is the process that executes SQL requests from the client. When you create a transaction engine for the first time you must specify a user name and password for the database administrator.
50 nuodb [domain] > start process te host localhost database testdb Process command-line options: --dba-user dba --dba-password dba Started process:... [ pid = 9961 ] Launch NuoDB SQL Launch the NuoDB SQL client: nuosql. This is the default utility for editing and executing SQL. > "c:\program Files\nuodb\bin\nuosql.exe" gsdatabase@localhost --user dba --password dba SQL> CREATE TABLE t1 (DATA varchar (100), CUR_TIME timestamp default('now')); SQL> INSERT INTO t1 (DATA) VALUES ('Time of update is:'); SQL> SELECT * FROM t1; DATA CUR_TIME Time of update is: :52: NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved SPACER
51 Developing with NuoDB List of samples in Java, C++, Hibernate, and JRuby You can find most of the programming samples in the \nuodb\samples folder (Windows), /nuodb/samples folder (Linux/Mac). The following table lists the samples. Directory Description Language java Simple Hello program. Java cpp Simple Hello program. C++ hibernate Sample application that makes use of Hibernate and the NuoDB Hibernate dialect. Java dialect jruby Includes a sample application and Gems JRuby C++ with NuoDB Getting Started Simple Hello program in C++ JRuby with NuoDB Getting Started A JRuby application that connects to NuoDB and uses NuoDB gems. Java with NuoDB Getting Started A simple "Hello" Javs program Java Hibernate with NuoDB Getting Started How to run the Hibernate sample client using processes created by the Quick Start script. NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved SPACER
52 C++ with NuoDB Getting Started A simple Hello program in C++ The sample program is located in: %NUODB_ROOT%\samples\cpp (Windows) $NUODB_ROOT/samples/cpp (Linux/Mac) Linux Ensure that LD_LIBRARY_PATH includes /opt/nuodb/lib64 cd /opt/nuodb/samples/cpp gcc -I../../include HelloDB.cpp \../../lib64/libnuoremote.so -o HelloDB Windows cd C:\Program Files\NuoDB\samples\cpp copy "C:\program files\nuodb\bin\nuoremote.dll" cl/ehsc HelloDB.cpp \ "c:\program files\nuodb\lib\nuoremote.lib" Mac OSX g++ -Xlinker -rpath -Xlinker../../lib64 -I../../include HelloDB.cpp \../../lib64/libnuoremote.dylib -o HelloDB Then run the built executable: > HelloDB test@localhost You should see the following to stdout: Name with id of 12: Fred # 12 NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved SPACER
53 Java Hibernate with NuoDB Getting Started How to run the Hibernate sample client using processes created by the Quick Start script. For Java users NuoDB supports a Hibernate dialect and provides a sample application that makes use of Hibernate and the NuoDB Hibernate dialect. NuoDB supports versions and 4.1.x of Hibernate. The files for the Hibernate sample application are in the installation area as follows: \samples\hibernate (Windows) /samples/hibernate (UNIX) The hibernate dialect jar file is in: \jar\nuodb-hibernate-1.0.jar (Windows) /jar/nuodb-hibernate-1.0.jar (UNIX) Prerequisite: The example requires Maven, which is a software project management tool available from the Apache Maven Project ( he.org/ ). Steps: Make sure you have Maven installed. Install the hibernate dialect for NuoDB. On UNIX mvn install:install-file -DgroupId=com.nuodb -DartifactId=nuodb-jdbc -Dversion=1.0 \ -Dpackaging=jar -Dfile=/opt/nuodb/jar/nuodbjdbc.jar mvn install:install-file -DgroupId=com.nuodb -DartifactId=nuodb-hibernate -Dversion=1.0 \ -Dpackaging=jar -Dfile=/opt/nuodb/jar/nuodb-hibernate-1.0.jar On Windows mvn install:install-file -DgroupId=com.nuodb -DartifactId=nuodb-jdbc -Dversion=1.0 ^ -Dpackaging=jar -Dfile="c:\Program Files\NuoDB\jar\nuodbjdbc.jar" mvn install:install-file -DgroupId=com.nuodb -DartifactId=nuodb-hibernate -Dversion=1.0 ^ -Dpackaging=jar -Dfile="c:\Program Files\NuoDB\jar\nuodb-hibernate-1.0.jar" 3. Set up a sample database by launching the script for the QuickStart sample. Change to the directory where you installed NuoDB and run the following command. run-quickstart 4. Exit from the NuoDB SQL client: SQL> quit 5. Change to the directory that has the sample application: \samples\hibernate (Windows) /samples/hibernate (UNIX) 6. Compile and run the hibernate sample application, which runs against the NuoDB processes created by the script.
54 6. mvn compile mvn exec:java Results The application adds two users, updates the name and address for each user to uppercase, and runs the query again. The results appear as shown: Found 2 user records: User (1/0), Username: fred, Name: Fred Flintstone, admin home: Street: '301 Cobblestone Way', Zipcode: '00001', City: 'Bedrock' bill: Street: '301 Cobblestone Way', Zipcode: '00001', City: 'Bedrock' ship: Street: '1 Slate Drive', Zipcode: '00002', City: 'Granitetown' User (2/0), Username: barney, Name: Barney Rubble, member home: Street: '303 Cobblestone Way', Zipcode: '00001', City: 'Bedrock' bill: Street: '303 Cobblestone Way', Zipcode: '00001', City: 'Bedrock' ship: Street: '1 Slate Drive', Zipcode: '00002', City: 'Granitetown' Found 2 user records: Found 2 user records: User (1/1), Username: fred, Name: FRED FLINTSTONE, member home: Street: '301 Cobblestone Way', Zipcode: '00001', City: 'Bedrock' bill: Street: '301 COBBLESTONE WAY', Zipcode: '00001', City: 'BEDROCK' ship: Street: '1 Slate Drive', Zipcode: '00002', City: 'Granitetown' User (2/1), Username: barney, Name: BARNEY RUBBLE, member home: Street: '303 Cobblestone Way', Zipcode: '00001', City: 'Bedrock' bill: Street: '303 COBBLESTONE WAY', Zipcode: '00001', City: 'BEDROCK' ship: Street: '1 Slate Drive', Zipcode: '00002', City: 'Granitetown' If you have trouble compiling and running the sample, remove all NuoDB processes and run the Quick Start script again. You can remove processes using either operating system tools or NuoDB Manager. NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved SPACER
55 Java with NuoDB Getting Started Sample Program The sample Java program is installed by default in the following directory. Linux/Mac /opt/nuodb/samples/java/hellodb.java Windows c:\program Files\NuoDB\samples\java\HelloDB.java Run the Sample Linux/Mac $ sudo cd /opt/nuodb/samples/java $ javac HelloDB.java $ java -classpath.:../../jar/nuodbjdbc.jar HelloDB Windows > cd "c:\program Files\NuoDB\samples\java" > javac HelloDB.java > java -classpath.;..\..\jar\nuodbjdbc.jar HelloDB Expected Output The table 'NAMES' was created. New id=1 for column ID New id=2 for column ID New id=3 for column ID New id=4 for column ID New id=5 for column ID New id=6 for column ID New id=7 for column ID New id=8 for column ID New id=9 for column ID New id=10 for column ID New id=11 for column ID New id=12 for column ID New id=13 for column ID New id=14 for column ID New id=15 for column ID The NAME with id of 12 is 'Fred # 12' The following code fragment shows the several lines of the sample, showing how to establish a connection to NuoDB:
56 public class HelloDB { /** The driver class provided by NuoDB. */ public static final String DRIVER_CLASS = "com.nuodb.jdbc.driver"; /** The base URL for connecting to a local database server. */ public static final String DATABASE_URL = "jdbc:com.nuodb://localhost/"; // the established connection to a local server private final Connection dbconnection; /** * Creates an instance of HelloDB and connects to a local server, * as the given user, to work with the given named database * user the user name for the connection password the password for the given user dbname the name of the database at the server to use */ public HelloDB(String user, String password, String dbname) throws SQLException { Properties properties = new Properties(); properties.put("user", user); properties.put("password", password); properties.put("schema", "hello"); dbconnection = DriverManager.getConnection(DATABASE_URL + dbname, properties); } } /** Closes the connection to the server. */ public void close() throws SQLException { dbconnection.close(); } NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved SPACER
57 JRuby with NuoDB Getting Started A JRuby application that connects to NuoDB and uses NuoDB gems. The sample is in the following file: %NUODB_ROOT%\samples\jruby\sample.rb (Windows), $NUODB_ROOT/samples/jruby/sample.rb (UNIX) The following code fragment shows the first several lines of sample.rb, which indicate how to make the connection to NuoDB: require 'rubygems' require 'active_record' puts "Connecting to database..." ActiveRecord::Base.establish_connection( :adapter => 'nuodb', :database => 'test', :username => 'cloud', :password => 'user' ) The application creates a schema, creates several records using the schema definition, and reads them back. It requires the following files: NuoDB's Active Record gem - activerecord-jdbcnuodb-adapter-1.0.gem NuoDB's JDBC gem - jdbc-nuodb-1.0.gem If you haven't already, download and install the JRuby ( ). Instructions for building and installing the Gem may be found here. The Gems used by the sample cannot be installed in /sample/jruby. In a different directory install them as follows: > gem install hoe > gem update --system > gem install activerecord > gem install jdbc-nuodb-1.0.gem > gem install activerecord-jdbcnuodb-adapter-1.0.gem 4. Verify that the gems are installed:
58 > gem list *** LOCAL GEMS *** activemodel (3.2.6) activerecord (3.2.6) activerecord-jdbc-adapter (1.2.2) activerecord-jdbcnuodb-adapter (1.0) activesupport (3.2.6) arel (3.0.2) bouncy-castle-java ( ) builder (3.0.0) bundler (1.1.3) i18n (0.6.0) jdbc-nuodb (1.0) jruby-launcher ( java java) jruby-openssl ( ) multi_json (1.3.6) rake ( , 0.8.7) rubygems-bundler (0.9.0) rvm ( ) sources (0.0.1) tzinfo (0.3.33) 5. Change your working directory to the samples/jruby subdirectory and run the sample: > jruby sample.rb The results should be as follows:
59 Connecting to database... Create tables drop_table("users") -> s -> 0 rows -- drop_table("addrs") -> s -> 0 rows -- create_table("users") -> s -> 0 rows -- create_table("addrs") -> s -> 0 rows Create user records... Created User(3), Username: fred, Name: Fred Flintstone, admin Address: Addr(3:3) Street: 301 Cobblestone Way City: Bedrock Zip: Created User(4), Username: barney, Name: Barney Rubble, member Address: Addr(4:4) Street: 303 Cobblestone Way City: Bedrock Zip: Print user records... Found 2 records: User(3), Username: fred, Name: Fred Flintstone, admin Address: Addr(3:3) Street: 301 Cobblestone Way City: Bedrock Zip: User(4), Username: barney, Name: Barney Rubble, member Address: Addr(4:4) Street: 303 Cobblestone Way City: Bedrock Zip: Modify user records... Print user records... Found 2 records: User(3), Username: fred, Name: FRED FLINTSTONE, member Address: Addr(3:3) Street: 301 COBBLESTONE WAY City: Bedrock Zip: User(4), Username: barney, Name: BARNEY RUBBLE, admin Address: Addr(4:4) Street: 303 COBBLESTONE WAY City: Bedrock Zip: NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved SPACER
60 Sample Client Programs Several sample open source applications and demos are available on Github: Storefront Demo Cayenne ColdFusion JBoss Node.js Apache Tomcat Apache Tomcat Servlet NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved SPACER
61 Migrating Databases to NuoDB The NuoDB Migrator tool provides a means to move data out of other databases and into NuoDB. To get started, see NuoDB Migrator as well as specific use cases for: MSSQL Migration MySQL Migration, Oracle Migration PostgreSQL Migration. Full details are documented in Load command, Dump command and Schema command. NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved SPACER
62 APIs and Drivers Programming with NuoDB is like programming with any other database: you write your client program and connect the client executable to NuoDB using a database connection such as JDBC. In this section you should find everything you need to get going: list of supported drivers with download links, APIs, sample client programs, and a client-host schematic that illustrates the NuoDB architecture. NuoDB Drivers NuoDB APIs Sample Client Programs Understanding Client Connections NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved SPACER
63 NuoDB Drivers NuoDB drivers are available as part of the product and on GitHub. NuoDB also supports tools such as SQuirreL and DbVisualiser for working with databases. Available NuoDB Drivers NuoDB Drivers on GitHub JDBC Connections ODBC Connections NuoDB ADO.NET Driver NuoDB PHP PDO Driver NuoDB Zend Framework Adapter NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved SPACER
64 Available NuoDB Drivers NuoDB automatically installs drivers and supports database connections as shown in the following table. Additional drivers are available on GitHub. Installed Drivers NuoDB supports the following drivers as part of the product: Driver JDBC ODBC.NET PHP PDO Usage The JDBC driver is installed automatically in the jar directory in the installation area. The NuoDB installer automatically installs the 32-bit driver for ODBC connections on Windows platforms. NOTE: 64-bit Windows applications will not work properly with the 32-bit NuoDB ODBC driver. The NuoDB installer automatically installs the 32-bit driver for ODBC connections on Windows platforms. NOTE: 64-bit Windows applications will not work properly with the 32-bit NuoDB ODBC driver. NuoDB PHP PDO Driver is available on GitHub and as part of the NuoDB product. The NuoDB Zend Framework adapter is also supported and depends on this driver. The NuoDB PHP PDO Driver on Linux supports PHP 5.4.x. NuoDB Drivers on GitHub See for information about language-specific drivers supported by means of GitHub. The drivers include the following: Name of Driver Description URL Node.js Node.js node-db compatible native driver for NuoDB NuoDB database bindings for Node.js PHP PHP compatible native driver for NuoDB Use Basic PHP Drivers on Microsoft Windows and Linux. This driver supports PHP 5.4.x. PHO PDO PHP PDO driver for NuoDB Use PHP PDO Driver on Linux SilverStripe NuoDB for SilverStripe (BETA) SilverStripe Adapter for the PHP PDO NuoDB Module PHP Zend PHP PDO extension for Zend. (BETA) This adapter is developed and tested with the Zend Framework Version The interface is written as a PHP PDO extension. Zend Framework Data Adapter for NuoDB
65 Ruby and JRuby Ruby native driver, JRuby active record Write Ruby Extensions in C/C++, Use ActiveRecord Driver, Use Native Driver, Use Ruby Rails The NuoDB Ruby Driver requires Ruby NuoDB Ruby Native Database Driver JRuby ActiveRecord NuoDB Adapter Project NuoDB Forum: Use NuoDB Ruby driver Drupal NuoDB Drupal Database Driver (BETA) NuoDB Driver for Drupal Go NuoDB Go Driver (BETA) NuoDB Go Driver (Beta) Perl NuoDB DBD Module for Perl DBI. (BETA) NuoDB for Perl (Beta) Tools and Programming Samples on GitHub In addition to drivers on Github, NuoDB supports the following command line interfaces and programming examples on Github. Command line interface for migration to NuoDB database JNDI resource to use with the HockeyServlet class definition Files on Github for the sample NuoDB Community Forum NuoDB provides a community forum, where you can read and submit comments, questions, and answers related to all things NuoDB. For example, technical information about developing applications is at the following URL: See NuoDB Drivers on GitHub for a list of drivers available on GitHub. NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved SPACER
66 NuoDB Drivers on GitHub Sources of information to assist with writing NuoDB client applications and drivers. NuoDB Drivers on GitHub See for information about language-specific drivers supported by means of GitHub. The drivers include the following: Name of Driver Description URL Node.js PHO PDO Node.js node-db compatible native driver for NuoDB PHP PDO driver for NuoDB Includes support for Linux, Mac OS X and Windows NuoDB database bindings for Node.js NuoDB PHP PDO Driver SilverStripe NuoDB for SilverStripe (BETA) SilverStripe Adapter for the PHP PDO NuoDB Module PHP Zend Ruby and JRuby PHP PDO extension for Zend. (BETA) This adapter is developed and tested with the Zend Framework Version The interface is written as a PHP PDO extension. Ruby native driver, JRuby active record Write Ruby Extensions in C/C++, Use ActiveRecord Driver, Use Native Driver, Use Ruby Rails The NuoDB Ruby Driver requires Ruby Zend Framework Data Adapter for NuoDB NuoDB Ruby Native Database Driver JRuby ActiveRecord NuoDB Adapter Project NuoDB Forum: Use NuoDB Ruby driver Drupal NuoDB Drupal Database Driver (BETA) NuoDB Driver for Drupal Go NuoDB Go Driver (BETA) NuoDB Go Driver (Beta) Perl NuoDB DBD Module for Perl DBI. (BETA) NuoDB for Perl (Beta) Tools and Programming Samples on GitHub In addition to drivers on Github, NuoDB supports the following command line interfaces and programming examples on Github. Command line interface for migration to NuoDB database JNDI resource to use with the HockeyServlet class definition Files on Github for the sample NuoDB Community Forum NuoDB provides a community forum, where you can read and submit comments, questions, and answers related to all things NuoDB. For example, technical information about developing applications is at the following URL:
67 NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved SPACER
68 JDBC Connections NuoDB automatically installs drivers and supports database connections by means of JDBC. It also supports several tools that work with JDBC connections. The JDBC driver is installed automatically in: Windows %NUODB_ROOT% \jar directory Linux/Mac $NUODB_ROOT /jar directory, where NUODB_ROOT is the folder where you installed NuoDB. RDBMS Access JDBC provides RDBMS access by allowing you to embed SQL inside Java code. The correct URL syntax for a NuoDB JDBC client is as follows: jdbc:com.nuodb://{broker}:{port}/{database} where BROKER is the address for the NuoDB Broker agent, as IP address or DNS name string. PORT is the configured port for that broker; if not defined it is assumed to be DATABASE is the name of the NuoDB database you are connecting to and is required. The following fragment is from the Java sample; it shows how to connect to the local database server.
69 /** An example program for connecting to a NuoDB database server. */ public class HelloDB { /** The driver class provided by NuoDB. */ public static final String DRIVER_CLASS = "com.nuodb.jdbc.driver"; /** The base URL for connecting to a local database server. */ public static final String DATABASE_URL = "jdbc:com.nuodb://localhost/"; // the established connection to a local server private final Connection dbconnection; /** * Creates an instance of HelloDB and connects to a local server, * as the given user, to work with the given named database * user the user name for the connection password the password for the given user dbname the name of the database at the server to use */ public HelloDB(String user, String password, String dbname) throws SQLException { Properties properties = new Properties(); properties.put("user", user); properties.put("password", password); properties.put("schema", "hello"); dbconnection = DriverManager.getConnection(DATABASE_URL + dbname, properties); } /** Closes the connection to the server. */ public void close() throws SQLException { dbconnection.close(); }... Java with NuoDB Getting Started How to run a simple Java application against NuoDB JDBC API Requirements JDBC applications use the JDBC API to set the transaction isolation level. NuoDB JDBC API Sample Using NuoDB JDBC API for connection pooling and support for high availability. NuoDB API DataSource Reference Page NuoDB C++ API Reference Step-by-step explanation of the HelloDB C++ sample application, a C++ program that you can run as a client against a NuoDB database. The NuoDB C++ API is modeled after the JDBC API. JDBC Connection Properties Program fragment showing JDBC properties and sample connection URL Use DbVisualizer for NuoDB JDBC Driver How to configure DbVisualizer for NuoDB JDBC driver SQuirreL Universal SQL
70 How to use SQuirreL tool SQL Workbench/J How to use SQL Workbench/J with NuoDB NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved SPACER
71 JDBC Connection Properties Program fragment showing JDBC properties and sample connection URL How to Specify Properties You can specify connection properties on the JDBC URL directly, as shown: jdbc:com.nuodb://{broker}:{port}/{database}?[schema=schema] This is an important feature for situations where you control only the JDBC URL and none of the underlying Java code, and you are unable to call setproperty("schema"...) directly. You can also set properties programmatically, as shown: String connecturl = "jdbc:com.nuodb://broker_host:48004/my_database"; Properties connectproperties = new Properties(); connectproperties.put("user", DB_USER); connectproperties.put("password", DB_PASSWORD); connectproperties.put("schema", "test"); connectproperties.put("isolation", "write_committed"); try { connection = DriverManager.getConnection(connectURL, connectproperties); connection.setautocommit(false); } catch (SQLException e) { throw new RuntimeException("TestConnection: cannot open database "+database+" at "+connecturl + "; check user credentials and broker status.", e); } NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved SPACER
72 ODBC Connections NuoDB supports connections by means of ODBC, which is an open specification that provides a predictable API for accessing SQL servers and any data source with an ODBC connection. The NuoDB installer automatically installs the 32-bit driver for ODBC connections on Windows platforms. NOTE: 64bit Windows applications will not work properly with the 32-bit NuoDB ODBC driver. The transaction levels defined by ODBC and supported by NuoDB are shown in the following table. ODBC Constant SQL_TXN_READ_UNCOMMITTED SQL_TXN_READ_COMMITTED SQL_TXN_REPEATABLE_READ SQL_TXN_SERIALIZABLE Notes Dirty reads, non-repeatable reads and phantom reads can occur. Dirty reads are prevented; non-repeatable reads and phantom reads can occur. Dirty reads are prevented; non-repeatable reads happen after writes; phantom reads can occur. Dirty reads, non-repeatable reads and phantom reads are prevented. NOTE: NuoDB supports WRITE_COMMITED as an extension, which you an emulate as an isolation level in ODBC applications using SQLSe tconnectattr and passing an attribute value of 5. Example: Using ODBC and Microsoft Excel to Read a NuoDB Database Step-by-step example using Flights application NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved SPACER
73 Example: Using ODBC and Microsoft Excel to Read a NuoDB Database Step-by-step example using Storefront Demo application Set up and run the Storefront Demo as described in Storefront Demo. From the Windows Start menu search for ODBC in the Search programs and files textbox, and choose Data Sources (ODBC). The ODBC Data Source Administrator dialog opens. a. Click Add, (the Create New Data Source dialog opens), select the NuoDB ODBC Driver from the list, and then click Finish.
74 The NuoDB ODBC Setup dialog opens. i. Configure the NuoDB ODBC Setup according to the following table: Note The database name, user name and password are all case sensitive. Parameter Data Source Name (DSN) Description Database User Password Schema Description StorefrontDemo Storefront Demo StorefrontUser StorefrontUser <leave empty> b. Click Test Connection to verify your connection to the NuoDB database. 3. Open a blank Excel spreadsheet and select the Data tab > From Other Sources > Microsoft Query.
75 3. The Choose Data Source dialog opens. 4. In the Databases tab, select StorefrontDemo* and click OK.
76 The Query Wizard - Choose Columns dialog opens. 5. Select a table in Available tables and columns, and add to the Columns in your query, then click Next. The Query Wizard - Filter Data dialog appears Walk thru the Query Wizard to construct your query. When you come to the end of the Wizard, click Return Data to Microsoft Excel, then Finish, and OK out of the Import Data dialog. Click Refresh to display the Storefront data in the spreadsheet. NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved SPACER
77 Example: Using ODBC and Open Office Calc to Read a NuoDB Database Step-by-step example using Storefront Demo application using ODBC on a Windows 7 NuoDB and Open Office installation Set up and run the Storefront Demo as described in Storefront Demo. From the Windows Start menu search for ODBC in the Search programs and files textbox, and choose Data Sources (ODBC). The ODBC Data Source Administrator dialog opens. a. Click Add, (the Create New Data Source dialog opens), select the NuoDB ODBC Driver from the list, and then click Finish.
78 The NuoDB ODBC Setup dialog opens. b. Configure the NuoDB ODBC Setup according to the following table: Note The database name, user name and password are all case sensitive. Parameter Data Source Name (DSN) Description Database User Password Schema Description StorefrontDemo Storefront Demo StorefrontUser StorefrontUser <leave empty> c. Click Test Connection to verify your connection to the NuoDB database. 3. Launch Open Office and open a blank Calc spreadsheet. 4. Choose File > New Database. The Database Wizard opens. 5. In Step 1. Select database, choose Connect to an existing database > ODBC, and then click Next.
79 5. 6. In Step 2. Set up ODBC connection, click Browse, select the StorefrontDemo and click OK. 7. IN Step 3. Set up user authentication, type StorefrontUser in User name and select Password required, and then click Test
80 7. Connection. If you are prompted for a password, type StorefrontUser. Note StorefrontUser is both the user name and password for the Storefront Demo Click Next if the connection was successfully established, and choose Yes, register the database..., and Open the database..., and then click Finish. Save and name the database file. The database opens in Open Office Calc.
81 NuoDB ADO.NET Driver The ADO.NET Driver for NuoDB enables you to develop.net applications that connect to the NuoDB CDMS. It is a fully managed ADO.NET driver, written in C# for.net 3.5, implements all the required ADO.NET interfaces and integrates with ADO.NET aware tools. Included in the driver is a plugin for Visual Studio 2010 and 2012 that acts as a DDEX (Data Designer Extensibility) provider. By means of this plugin, you can browse the content of a NuoDB database and manipulate the data contained therein. Prerequisites NuoDB 1.1 (minimum version required) Visual Studio Professional 2010/2012.NET Framework v4 or later. Visual Studio Visual Studio will install the.net Framework as a prerequisite Visual Studio Express A limitation of Visual Studio Express Editions is that they do not allow the use of 3rd party drivers. If you are using Visual Studio Express you must upgrade to a Professional edition of Visual Studio. Installation The ADO.NET driver for NuoDB is bundled with the main NuoDB Installer and automatically registers the.net assembly, declares the database provider, and installs the Visual Studio plugin in the available IDEs. Integration with Visual Studio IDE The DDEX plugin for Visual Studio Professional 2010/2012 is automatically installed with the ADO.NET Driver for NuoDB, The plugin enables you to work with the driver from within the familiar IDE interface. To connect to a NuoDB database: From the Server Explorer panel in Visual Studio, right-click the Data Connections node and select Add Connection. The Change Data Source dialog appears. If the Server Explorer panel is not visible, you can open it from the View > Server Explorer menu. From Data Source, choose NuoDB Database; and in Data Provider, choose.net Data Provider for NuoDB; then click OK. The Add Connection dialog appears. Configure the connections settings: Broker Address: DNS or IP address of the machine were the broker is running Database: Name of your NuoDB database Username: Username for the connections Password: Password for the username Default Schema: Name fo the schema to connect to Click Test Connection to test your configuration; then click OK to finish. Binding a Data Source to a Windows Form DataSet From within a Windows Form project, open the Data Sources view (Data > Show Data Sources) Click the Add New Data Source toolbar button. The Data Source Configuration Wizard opens. Walk through the Data Source Configuration Wizard dialog: Choose Database > Next; Choose Dataset > Next; Accept the default data connection option ([ localhost (test) ] > Next; Accept the Save the Connection String to the Application Configuration File default > Next; Select which tables you want to import into the DataSet and click FInish. (As a test, choose HOCKEY.) The solution updates to include the new DataSet and Data Sources view.
82 Create a Form or other Database Object: In the Data Sources view,select the HOCKEY node under the testdataset and drag it on the form preview. A new Data Grid View object is created, along with the objects implementing the binding between the visual form and the NuoDB database. Other objects could also be created by selecting from the drop-down list invoked from the arrow button to the right of HOCKEY. Compile and run the application. The HOCKEY table form appears. Binding a Windows Form using Entity Framework The first step to be done is hence creating native.net objects replicating the data structures found in the NuoDB database. Right click the application node in the Solution Explorer, and select Add > New Item. From the Data category of the installed templates, select ADO.NET Entity Data Model, Name the new file as HockeyModel.edmx The Entity Data Model Wizard appears. Walk through the Entity Data Model Wizard: Select Generate From Database > Next; Select an existing connection (coming from the project settings or from the Server Explorer connections) or make a new one, > Next; Select the table you want mapped into native objects > Finish. After the wizard is dismissed, the *edmx tab displays a diagram of the new entities, and the Data Sources view will have a new data source.
83 To add form components to the Entity Frameworks model: In the Data Sources view, click the Add New Data Source toolbar button. The Data Source Configuration Wizard appears. Select Object from the list of choices, then click Next. Expand the structure of the application and select the HOCKEY type that the Entity Framework wizard has created to model the HOCKEY table in the database, then click FInish.
84 Once the wizard is finished, the Data Sources view will contain a new HOCKEY top-level entry; selecting this node and dragging it on the Windows Forms will create a new Data Grid View. This new grid control must be populated by writing some custom code; double-click on the form to open the code window, and change it to include a reference to the newly defined testentities, binding its HOCKEY property to the DataSource property of the new data grid object. Running the modified code will show two Data Grid controls bound to the same database, using the two different binding technologies. Using LINQ to Query the Database without using SQL Statements Instead of binding an entire table to the grid control, the user can filter the data by writing a LINQ statement, for instance: this.hockeydatagridview1.datasource = from player in context.hockey where player.position == "Goalie" select player; Running the modified program will display in the lower grid control only the two players that play as goalkeeper, by running a SQL statement dynamically-generated from the LINQ syntax.
85 Advanced Usage The ADO.NET driver for NuoDB can be used directly from any VB.NET, C# or Managed C++ application. After adding the NuoDb.Data.Client.dll to the list of referenced assemblies, the user can write standard ADO.NET client code like this: string cs="server=localhost;database=test;user=dba;password=goalie;schema=test"; using (NuoDbConnection connection = new NuoDbConnection(cs)) { DbCommand command = new NuoDbCommand("select * from hockey", connection); connection.open(); DbDataReader reader = command.executereader(); while (reader.read()) { Console.WriteLine("\t{0}\t{1}\t{2}", reader[0], reader[1], reader[2]); } } reader.close();
86 An application can also avoid the need to bind explicitly to a single ADO.NET provider, and selecting it at runtime via the DbProviderFactory functionality. In this case the manipulation of the data will occur only via the standard interfaces defined by ADO.NET. DbProviderFactory factory = DbProviderFactories.GetFactory("NuoDb.Data.Client"); using (DbConnection cn = factory.createconnection()) { DbConnectionStringBuilder builder = factory.createconnectionstringbuilder(); builder["server"] = host; builder["user"] = user; builder["password"] = password; builder["schema"] = schema; builder["database"] = database; Console.WriteLine("Connection string = {0}", builder.connectionstring); reader[2]); } cn.connectionstring = builder.connectionstring; cn.open(); DbCommand cmd = factory.createcommand(); cmd.connection = cn; cmd.commandtext = "select * from hockey"; DbDataReader reader = cmd.executereader(); while (reader.read()) { Console.WriteLine("\t{0}\t{1}\t{2}", reader[0], reader[1], } reader.close(); Connection String Definition When using the ADO.NET driver for NuoDB directly, the configuration is specified in a single connection string. Note This version of the ADO.NET driver for NuoDB doesn t implement Connection Pooling. Options in the configuration string are separated by a semi-colon character ;. Inside each option, the name of the option is separated by its value by a = character. White spaces around the name and the value are ignored. If the value of an option contains a semi-colon, or must include spaces at the beginning or at the end, it should be enclosed in single or double quotes. The list of recognized options are: Server Database User Password Schema The address of the NuoDB broker, in the form hostname[:port] The name of the database (i.e. chorus) to open The name of the DBA user The password of the DBA user The schema to be used by default (optional). If the schema is not specified, all the tables in the SQL queries must be fully specified, e.g. HOCKEY.HOCKEY Uninstalling the ADO.NET Driver To uninstall the driver:
87 Open the Control Panel and select the Uninstall Software option. From the list of installed program select the ADO.NET Driver for NuoDB and click Uninstall. NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved SPACER
88 NuoDB PHP PDO Driver NuoDB PHP PDO Driver is available on GitHub and as part of the NuoDB product. The NuoDB PHP PDO Driver is a PHP extension shared library file. (On Linux it is pdo_nuodb.so. On Windows it is php_pdo_nuodb.dll. ) NuoDB supports drivers for both 5.2 and 5.3. For detailed instructions about installing the driver, see the INSTALL.TXT in the PHP PDO Driver directory in the install area Copy the shared library file into PHP's extension library directory. Enable the shared library in your PHP configuration file, which is typically named php.ini. Linux users: add the following to the PHP configuration file: extension=pdo_nuodb.so 3. Windows users: add the following to the PHP configuration file: extension=php_pdo_nuodb.dll Verify that the NuoDB PHP PDO Driver is enabled Search for "PDO drivers", for example by issuing the following command: php -i grep PDF The list of drivers should show nuodb. 4. Use the sample PHP application to try out the driver. NuoDB provides a sample application ( example.php) that you can run with the driver. It is based on the database (Hockey) set up by the run-quickstart script. The follow code listing is from the sample: try { $db = new PDO("nuodb:database=test@localhost;schema=Hockey", "dba", "goalie") or die; $sql = "select * from hockey where NUMBER<12"; foreach ($db->query($sql) as $row) { print_r ($row); } $db = NULL; } catch(pdoexception $e) { echo $e->getmessage(); } $db = NULL; echo "done\n"; Note the connection string on the following line: $db = new PDO("nuodb:database=test@localhost;schema=Hockey", "dba", "goalie") or die; 5. Optionally set up logging to a file in the file system. Enable logging by adding the following in your PHP configuration file: [pdo_nuodb] pdo_nuodb.enable_log=1 pdo_nuodb.logfile_path=/tmp/nuodb_pdo.log NOTES There are two kinds of PHP runtimes that are in common usage a thread-safe (TS) runtime and a non-thread-safe (NTS) runtime.
89 PHP is typically paired with the Apache HTTP web server on Linux systems. There are both thread-safe and non-thread-safe versions of Apache HTTP, which is the reason for different PHP runtimes. Apache HTTP can also be used on Windows. PHP can also be paired with the Microsoft IIS web server. Microsoft IIS is thread safe and should always be paired with the thread safe version of PHP. NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved SPACER
90 NuoDB Zend Framework Adapter The NuoDB Zend Framework Adapter depends on the NuoDB PHP PDO Driver. There is information on the Web about the purpose of the Zend Framework. The NuoDB Zend Framework adapter uses the NuoDB PHP PDO Driver, so that needs to be installed and enabled first. The NuoDB Zend Framework adapter is contained in the file Nuodb.php Install the NuoDB Zend Framework Data Adapter Copy Nuodb.php to the Zend Framework library Zend/Db/Adapter/Pdo directory. Run a sample application. A sample Zend Framework application that uses the NuoDB Zend Framework Data Adapter to perform CRUD operations on the NuoDB example Hockey database (set up by running the run-quickstart script). The example is in the the zf_ hockey directory. NOTE Following is a example of a Zend Framework resource.db configuration (this is from the application.ini file for the zf_hockey application): resources.db.adapter = PDO_NUODB resources.db.params.host = localhost resources.db.params.username = dba resources.db.params.password = goalie resources.db.params.dbname = test@localhost resources.db.params.schema = hockey resources.db.params.options.autoquoteidentifiers = false NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved SPACER
91 APIs C++ API JDBC API NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved SPACER
92 C++ API Reference Step-by-step explanation of the HelloDB C++ sample application, a C++ program that you can run as a client against a NuoDB database. The NuoDB C++ API is modeled after the JDBC API. This topic includes code snippets from the NuoDB C++ sample and introduces the basics of programming with NuoDB C++ API. The following table shows the location of the required files in relation to the installation directory. Program file Windows UNIX nuodb\samples\cpp\hellodb.cpp nuodb/samples/cpp/hellodb.cpp Shared Library Windows UNIX nuodb\bin\nuoremote.dll nuodb/lib64/libnuoremote.so Header Files Windows UNIX nuodb\include nuodb/include A simple C++ application must include NuoDB.h, which includes the Connection.h, SqlDate.h, SqlTime.h, and SqlTimeStamp.h. You must include other header files separately if they are required. Compiling the HelloDB sample application Windows Visual Studio 10.0 cl /I<path-to-NuoDB>/include /EHsc HelloDB.cpp <path-to-nuodb>\lib\nuoremote.dll UNIX Make sure that the required libraries are in the path. Linux # # Build script for the Linux HelloWorldCPP sample # Requires gcc to build # # To run the built sample, ensure that LD_LIBRARY_PATH include /opt/nuodb/lib64 # g++ -I../../include HelloDB.cpp../../lib64/libNuoRemote.so -o HelloDB Mac
93 # # Build script for the HelloWorldCPP sample on Mac OS X # Requires g++ to build # g++ -Xlinker -rpath -Xlinker../../lib64 -I../../include HelloDB.cpp../../lib64/libNuoRemote.dylib -o HelloDB NuoDB C++ Namespace The NuoDB C++ API classes are contained in the "NuoDB" C++ namespace. Your application can use that namespace with the following statement: using namespace NuoDB; NuoDB C++ Database Connection In order to perform persistent work, you need to establish a connection to the NuoDB database. In the HelloDB example, this is done by creating a Connection object as follows: Connection *connection = Connection::create( dbname, // database "cloud", // username "user", // password 1, // number of properties to follow "schema", "hello"); // schema=hello property The first argument, dbname is a string in format: DataBaseName@Hostname. Where DataBaseName is the name of the database and Hostn ame is the hostname of the machine that contains the processes for that database. The HelloDB example uses "test@localhost" for dbname. The second argument is a string for the database username. The third argument is a string for the database password. The fourth argument is an integer that is a count for the number of properties that occur in the remaining arguments. The remaining arguments are pairs of string arguments. Each string pair is used as name/value properties, where the first string in the pair is the property name and the second string in the pair is the property value. Closing a database connection When you are finished with the database connection, you should close it as follows: connection->close(); NuoDB Remote objects also support reference counting. There are two methods, addref() and release() : addref() // increments an internal use counter release() // decrements that counter and deletes the object when the reference count goes to zero. Creating a Statement object For SQL queries that do not need to return results, you can use the Statement class. You can create a Statement object from the Connection
94 object. The following code creates a new Statement object and uses it to create a "names" database table: Statement *stmt = connection->createstatement(); try { stmt->execute("create table names (id int generated always as identity primary key, name string)"); connection->commit(); stmt->close(); printf("the table 'NAMES' was created.\n"); } catch (SQLException& xcp) { connection->rollback(); printf("the table 'NAMES' already exists, re-using it.\n"); } Transaction Control To commit persistent work, you should call the commit method on the Connection object: connection->commit(); To rollback persistent work, you should call the rollback method on the Connection object: connection->rollback(); Prepared Statements To execute parameterized SQL queries, you need to create a PreparedStatement object from the Connection object. The following example code selects the 'name' from the 'names' table that matches a particular id parameter: PreparedStatement *stmt = connection->preparestatement("select name from names where id=?"); stmt->setint(1, id); // bind integer parameter. ResultSet *rs = stmt->executequery(); Retrieving Results In the code above, the stmt->executequery() returned a ResultSet object. The following code shows how retrieve a single row from that result set: char *name; if (rs->next()) { name = new char [ strlen(rs->getstring(1)) + 1]; strcpy(name, rs->getstring(1)); } Closing results sets and statements
95 When you are finished with the ResultSet, Statement, and PreparedStatement objects, you should close them as follows: rs->close(); stmt->close(); Generated Keys If you insert rows into a database table, and want to retrieve any generated keys, then pass NuoDB::RETURN_GENERATED_KEYS as the second argument to the Connection::prepareStatement call. The following code inserts rows into the names table and the uses a ResultSet to retrieve any generated keys: PreparedStatement *stmt = connection->preparestatement("insert into names (name) values (?),(?),(?),(?),(?),(?),(?),(?),(?),(?),(?),(?),(?),(?),(?)", NuoDB::RETURN_GENERATED_KEYS); /* batch insert a set of names */ for (int i=1; i <= 15; i++) { char name[100]; sprintf(name, "Fred # %d", i); stmt->setstring(i, name); } try { int updatecount = stmt->executeupdate(); // This is how to retrieve the generated key. Only the generated column value is returned ResultSet * resultset = stmt->getgeneratedkeys(); ResultSetMetaData * resultsetmetadata = resultset->getmetadata(); const char * columnname = resultsetmetadata->getcolumnname(1); while (resultset->next()) printf("new id=%d for column %s\n", resultset->getint(1), columnname); connection->commit(); resultset->close(); stmt->close(); } catch (SQLException &xcp) { connection->rollback(); throw; } NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved SPACER
96 JDBC API Reference <p> </p> NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved SPACER
97 JDBC API Requirements JDBC applications use the JDBC API to set the transaction isolation level. The numeric values for setting the NuoDB transaction levels are as follows: CONSISTENT_READ = 7 WRITE_COMMITTED = 5 READ_COMMITTED = 2 The JDBC interface provides five isolation levels, as shown in the following table, along with information about NuoDB support for each level. NuoDB also supports WRITE_COMMITED, as previously described. NuoDB returns an error to the client if it specifies an unsupported transaction isolation level. ID JDBC Constant NuoDB support Notes 0 Connection.TRANSACTION_N ONE 1 Connection.TRANSACTION_R EAD_UNCOMMITTED 2 Connection.TRANSACTION_R EAD_COMMITTED 4 Connection.TRANSACTION_R EPEATABLE_READ 8 Connection.TRANSACTION_S ERIALIZABLE no no yes no yes No Transactions Dirty reads, non-repeatable reads and phantom reads can occur. Dirty reads are prevented; non-repeatable reads and phantom reads can occur. In NuoDB this behavior is specified as READ_COMMITTED. Dirty reads are prevented; non-repeatable reads happen after writes; phantom reads can occur. Dirty reads, non-repeatable reads and phantom reads are prevented. In NuoDB this behavior is specified as CONSISTENT_READ. NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved SPACER
98 JDBC API Sample Using NuoDB JDBC API for connection pooling and support for high availability. This procedure describes a sample that uses connection pooling for High Availability (HA). On Github you can find a sample context file as well as a sample client. The code snippets in this topic show how to use the NuoDB JDBC API. See the items in the following table for resources that are related to the sample application server. Resources Files on Github for the sample NuoDB API DataSource Reference Page Purpose JNDI resource to use with sample application. The sample uses hoc key schema, which is loaded when you run the run-quickstart script. The src folder has the HockeyServlet class definition Implementation of this class enables high availability, in the sense that you can list more than one broker. The reference page for DataSource describes the properties in the sample in more detail. The essential attribute in this case is factory, which selects the NuoDB JDBC factory class for creating an instance of DataSource. The DataSource class incorporates the DriverManager.getConnection method, which is illustrated in another Java sample provided with NuoDB, namely /samples/java/hellodb.java. The advantage of using the DataSource class is that it takes care of many complexities associated with managing NuoDB connections, such as dealing with redundancy of brokers, and reconnecting to the database if a transaction process terminates. See the following code snippets from each sample, which are designed to get a connection, prepare and execute statements off the connection. Using DriverManager Class in HelloDB.java dbconnection = DriverManager.getConnection (DATABASE_URL + dbname, properties);... PreparedStatement stmt = dbconnection.preparestatement ("insert into names (id, name) values (?,?)"); Using DataSource Class in HockeyServlet.java DataSource ds = (DataSource)initContext.lookup("jdbc/nuoDB"); con = ds.getconnection(); Statement stmt = con.createstatement(); The following code shows how to use the DataSource class outside of an application server that is running the NuoDB JDBC driver: Properties p = new Properties(); p.setproperty(datasource.prop_url, "jdbc:com.nuodb://localhost/database"); p.setproperty(datasource.prop_username, "user"); p.setproperty(datasource.prop_password, "password"); DataSource ds = new DataSource(p); con = ds.getconnection();... When you are running the NuoDB JDBC driver in an application you can use DataSource to benefit from its implementation of high availability. For example, the set of properties for the Hockey Servlet enables connections to two brokers on localhost and backuphost. If one broker goes down, the DataSource automatically connects to the database by means of the other available broker. The following code is an example of how to define the class for use with the hockey schema.
99 < Resource name="jdbc/nuodb" auth="container" type="javax.sql.datasource" factory="com.nuodb.jdbc.datasourceconnectionfactory" initialsize="2" maxactive="100" maxidle="30" maxwait="10000" maxage="60000" username="dba" password="goalie" defaultschema="hockey" defaultreadonly="false" defaultautocommit="true" testonreturn="false" testonborrow="false" testwhileidle="false" validationquery="select 1 FROM DUAL" validationinterval="30000" timebetweenevictionrunsmillis="5000" url-delimiter=" " url="jdbc:com.nuodb://localhost/test jdbc:com.nuodb://backuphost/test" /> The following table describes the attributes in the example. Name of attribute factory= Description Selects the NuoDB factory class for creating DataSources "com.nuodb.jdbc.datasourceconnectionfactory" initialsize="2" maxactive="100" maxidle="30" maxwait="10000" maxage="60000" These attributes control the pool. Starting with idle connections of initialsize, each idle connection is made active when requested by the user. When exactly maxactive connections are active (either by activating idle ones or by creating new ones if there are no idle ones), the user is stalled for maxwait msec until the running ones are closed and returned to the pool. When connections are returned to the pool, if there are any maxidle connections waiting, they are discarded instead of being recycled. In any case, after a connection has existed for more than maxage msec, it is discarded. This feature means makes it possible to benefit from new transaction engines that have been added to the database. username="dba" Required to access a NuoDB database. password="goalie" defaultschema="hockey" defaultreadonly="false" defaultautocommit="true" The default attributes each cause the corresponding JDBC API properties to be invoked on new connections. If an attribute is not defined, the API is not invoked; if the attribute is defined, it is invoked with whatever value they specify.
100 testonreturn="false" testonborrow="false" testwhileidle="false" If testonreturn is set to true and a user closes the connection to return it to the pool of connections, an extra query is executed to verify if the connection is still valid. The extra query is specified by v alidationquery. If the query fails, the connection is not recycled and it is discarded. Similarly, if testonborrow is set to true, the test is done when the connection is taken from the pool of idle ones, before returning to the user. validationquery="select 1 from dual;" validationinterval="30000" If the specified query fails, the connection is discarded and a new one is taken from the pool. NOTE: This test is performed only every validationinterval msec. If testwhileidle is set to true, idle connections are also tested. timebetweenevictionrunsmillis="5000" url-delimiter=" " url="jdbc:com.nuodb://localhost/test jdbc:com.nuodb://backuphost/t est" Specifies the clock of the timer that scans the idle connections to determine if connections have become too old ( maxage), if there are too many ( maxidle), or if they are broken ( testwhileidle) and must be discarded. Optional. Specifies one or more character(s) that separate multiple brokers as specified in the url attribute. The NuoDB JDBC driver tries each broker in the order they are specified, until one broker accepts the connection. The driver continues to use this broker unless an error occurs. If there is an error the driver continues to try the brokers until if finds a new one to use. See url-delimiter. The following listing shows the sample servlet code: package com.nuodb.servletsample; import java.io.ioexception; import java.io.printwriter; import java.sql.connection; import java.sql.resultset; import java.sql.sqlexception; import java.sql.statement; import javax.naming.context; import javax.naming.initialcontext; import javax.naming.namingexception; import javax.servlet.servletexception; import javax.servlet.annotation.webservlet; import javax.servlet.http.httpservlet; import javax.servlet.http.httpservletrequest; import javax.servlet.http.httpservletresponse; import javax.sql.datasource; /** * Servlet implementation class HockeyServlet public class HockeyServlet extends HttpServlet { private static final long serialversionuid = 1L;
101 /** HttpServlet#HttpServlet() */ public HockeyServlet() { super(); // TODO Auto-generated constructor stub } /** HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response) */ protected void doget(httpservletrequest request, HttpServletResponse response) throws ServletException, IOException { Context envcontext; Connection con = null; try { envcontext = new InitialContext(); Context initcontext = (Context)envContext.lookup("java:/comp/env"); DataSource ds = (DataSource)initContext.lookup("jdbc/nuoDB"); con = ds.getconnection(); Statement stmt = con.createstatement(); String query = "select * from hockey"; ResultSet rs = stmt.executequery(query); PrintWriter out = response.getwriter(); response.setcontenttype("text/html"); out.print("<center><h1>hockey Players Details</h1></center>"); out.print("<html><body><table border=\"1\" cellspacing=10 cellpadding=5>"); out.print("<th>number</th>"); out.print("<th>name</th>"); out.print("<th>team</th>"); out.print("<th>position</th>"); while(rs.next()) { out.print("<tr>"); out.print("<td>" + rs.getint("number") + "</td>"); out.print("<td>" + rs.getstring("name") + "</td>"); out.print("<td>" + rs.getstring("team") + "</td>"); out.print("<td>" + rs.getstring("position") + "</td>"); out.print("</tr>"); } out.print("</table></body></html>"); } catch(sqlexception sqle) { sqle.printstacktrace(); } catch (NamingException ne) { ne.printstacktrace(); } finally { if(con!= null) try { con.close(); } catch (SQLException sqle) { sqle.printstacktrace(); } }
102 } /** HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response) */ protected void dopost(httpservletrequest request, HttpServletResponse response) throws ServletException, IOException { // TODO Auto-generated method stub
103 } } See the JDBC API Reference for a complete list of properties for the DataSource class. NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved SPACER
104 Understanding Client Connections The following illustration shows a simple NuoDB database system and a client that wants to connect to it. The steps in the process shown in this conceptual illustration are as follows: 1. An application that seeks to connect to the database calls to the broker on Host A Because the Broker communicates with all Agents in the Domain it knows which Transaction Engines are available and determines the best transaction engine for the application. The broker communicates back to the client that it should connect to the Transaction Engine on Host B. Once the Application knows which Host and Transaction Engine to communicate with, it will no longer communicate with the Broker. The client connects to the Transaction Engine on Host B. About Client Connections and Transaction Engines NuoDB distributes new requests for transactions from a client application to existing transaction engines that are connected to the client application. There is no mechanism for redistributing existing connections when a new transaction engine starts. You must explicitly establish a new connection from the client application and send it to the newly started transaction engine. If you add a transaction engine process while client applications are connected to transaction engines that are already running, and you want to have the same number of connections, and you want to balance the connections among all transaction engines, you must explicitly disconnect the existing client connections and reconnect clients to all transaction engines after you start the new transaction engine. NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved SPACER
105 Programming <paste text here> NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved SPACER
106 C++ with NuoDB Environment Setup Advanced Features.NET Integration API Reference The NuoDB C++ API may be found here: Additional Resources Links to: Driver sources and other samples pointers to tech blog posts or DZone articles pointers to other C++ sections NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved SPACER
107 Java With NuoDB Environment Setup Advanced Features J2EE Integration API Reference The NuoDB Java API may be found here: Additional Resources Links to: Driver sources and other samples pointers to tech blog posts or DZone articles pointers to other sections such as Java Hibernate with NuoDB
108 Tools and Utilities Explore the range of tools and 3rd party utilities to administer your NuoDB Domain and database. Tools 3rd Party Utilities Administration Tools NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved SPACER
109 Tools NuoDB Manager NuoDB Migrator NuoDB SQL CLI NuoDB Web Console NuoDB Loader NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved SPACER
110 NuoDB Loader Import and export data to and from NuoDB nuoloader database_name --user user_name --password database_password [options]... Description NuoDB Loader is a command-line utility to import and export data to and from a NuoDB database. It supports comma-separated value (CSV) file formats. It runs as a client of NuoDB and requires a database user name and password. Empty elements in a CSV file are treated as NULL. To specify an empty string use double quotation marks ( " ). For example, when importing: 1,2,3,,5 - NULL is assigned to column #4 (because it is specified as an empty element) 1,2,3,"",5 - Empty string is assigned to column #4 (because it is specified with double quotation marks) Similarly, export operations specify empty strings with double quotation marks, and a value of NULL is exported as an empty element. Note: When you use options with the --import option, be sure to separate them with commas only and no spaces. Options Option Connection Options Definition Must be specified if required by the database. --schema database schema --connection-property x=y [--connection-property x=y]...] Specifies properties for the nuoloader client connection to the server. Multiple connection properties may be specified on one command line Import Options --import filename[, import file options] --to [SQL insert update] Specifies a CSV file to be imported along with import options. The import file options follow the filename and must be separated by commas. If filename is not provided, data is expected on stdin. If the file does not exist, the process may hang. Use the --to option to specify the destination. --import file options Optionally specified list of attributes that indicate formatting conventions used in the input file. For an import operation, a valid prepared SQL INSERT/UPDATE statement is expected as the argument. Question mark '?' is used to specify a position of a parameter. For example: "insert into FOO values (?,?,?)"
111 separator= character_spec where character_spec is a printable character (just one character) or word "tab" for horizontal tabulation Example:,separator=@ skip number of lines to skip in the beginning of the file trim Values: leading, trailing, both or none. Controls stripping leading and trailing white spaces. escape backslash '\' is used to escape double quotes, new lines, and tabulation. See the following example, which is based on the schema created and used when you run /opt/nuodb/run-quickstart. (Note that in this example data is added to a new table, TEAM, not to existing HOCKEY table. Note: There is no space surrounding the commas.
112 SQL> CREATE TABLE hockey.team (number INT, name string, position string); SQL> SHOW TABLES; Tables in schema HOCKEY HOCKEY TEAM SQL> quit; $ nuoloader --user dba --password goalie --import "/opt/nuodb/samples/quickstart/bruins.csv",skip --to 'INSERT INTO hockey.team (number, name,position) VALUES (?,?,?);' test Imported 25 rows, failed 0 rows, size 686 bytes from /opt/nuodb/samples/quickstart/bruins.csv $ nuosql test@localhost --user dba --password goalie --schema Hockey SQL> SHOW TABLES; Tables in schema HOCKEY HOCKEY TEAM SQL> SELECT * FROM team; NUMBER NAME POSITION PATRICE BERGERON Forward 11 GREGORY CAMPBELL Forward 38 JORDAN CARON Forward 18 NATHAN HORTON Forward 23 CHRIS KELLY Forward 46 DAVID KREJCI Forward 17 MILAN LUCIC Forward 63 BRAD MARCHAND Forward 20 DANIEL PAILLE Forward 49 RICH PEVERLEY Forward 67 BENOIT POULIOT Forward 91 MARC SAVARD Forward 19 TYLER SEGUIN Forward 22 SHAWN THORNTON Forward 43 MATT BARTKOWSKI Defense 55 JOHNNY BOYCHUK Defense 33 ZDENO CHARA Defense 14 JOE CORVO Defense 21 ANDREW FERENCE Defense 47 STEVEN KAMPFER Defense 54 ADAM MCQUAID Defense 44 DENNIS SEIDENBERG Defense 40 TUUKKA RASK Goalie 30 TIM THOMAS Goalie 1 MAX SUMMIT Fan
113 Batching options --batch-size Size of a batch in bytes, default is 64KB --batch-count Size of a batch in the number of rows, default is no-batch-commit Override default automatic batch commit. For better performance data can be imported using batches. Options control the size of single batch and whether or not each batch should be processed as a separate transaction. Batching can be turned off by setting either --batch-size or --batch-count to zero. Note: The default is to commit after batch execution to make sure the data is committed. Use caution when changing the default. Export options --export SQL_SELECT_statement --to destination [ ex port file options] For example: Specify an SQL SELECT statement to be exported into a file in CSV format, and specify an output file name for the export operation. If no filename is specified output is sent to stdout. nuoloader -\-user dba -\-password goalie -\-export "select * from hockey.hockey;" test export file options separator separator= character_spec where character_spec is a printable character (just one character) or word "tab" for horizontal tabulation Example:,separator=@ An optional comma separated list of modifiers to the output file format. titles If specified, columns names are written in the first line escape Use backslash '\' to escape double quotation marks, new lines and tabulation enclose All fields must be specified within double quotation marks Reporting options --verbose Reports progress for each executed batch. --log Redirects error and verbose output into a file. Miscellaneous options --strict Halts execution on any error. --help Prints the list of options. --version Prints the version. --schema Default schema By default, an erroneous line is reported and execution continues.
114 NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved SPACER
115 NuoDB Manager Syntax java -jar nuodbmanager.jar --broker host --password administrator_password [ --user user_name ] [ --database database-name ] [ --properties propertiesfile ] [ -- --file batchfile --command "cmd" [ ;... ] ] [ --help] Command Line Options Note: This command is in the /jar folder of the NuoDB installation directory. Name --broker host --password administrator_password Usage The initial account requires the administrator password as well as the broker. The initial administrator password is specified in the def ault.properties file. --broker host --password user_password [--user user_name] --database database-name --properties propertiesfile In general specify your username and password for your administrator account, as well as the broker for the domain. Alternatively, you can omit the username, and specify the initial administrator password. Name of a particular database in the domain. If the database does not exist, the tool generates an error. If you do not specify the database to be managed when you start NuoDB Manager, you can begin your session by issuing the manag e command to work with a specific database. In NuoDB Manager you can issue the show domain databases com mand to discover existing databases. Specifies a Java properties file to use with nuodbmanager.jar. -- Specifies that commands will be piped into the host. --file batchfile Runs the commands in batchfile. --command cmd [,... ] ] Specifies NuoDB commands to run directly on the command line. The command must be specified in double quotes (" "), and arguments to the options argument of a command must be specified in single quotes ( ' ' ). See the nuodb reference page for a list of nuodb command line options. Description Use NuoDB Manager just as you use NuoDB Console to monitor, analyze, and control all aspects of a NuoDB domain. You manage the databases in a domain by managing transaction engines and storage managers. As a domain administrator you can create and remove users who can also manage the database processes. NuoDB Manager is a text-based tool you can specify commands interactively or non-interactively. To use the tool interactively, run the jar file
116 to start the tool, and then type commands at the prompt. Type quit to exit the session. To execute SQL operations against a database use the nuosql command rather than the nuodbmanager command. Using NuoDB Manager To manage the domain and database created by the run-quickstart script: # SM = storage manager # TE = transaction manager java -jar nuodbmanager.jar --broker localhost --password quickstart --user quickstart nuodb [domain] > manage database test nuodb [domain/test] > show domain summary Hosts: [broker] localhost/ :48004 Database: test [SM] localhost/ :51737 [ pid = 930 ] RUNNING [TE] localhost/ :51746 [ pid = 936 ] RUNNING nuodb [domain/test] > The following table shows the commands that are available. You can specify them interactively, in a script, or when you run nuodbmanager.jar with the --commandoption. Note Note that --dba-user and --dba-password must be specified for the initial transaction engine for a database. If you are managing a specific database (or you specified the database when you started NuoDB Manager) you do not have to specify it when using the commands. Command Syntax and Example Description apply apply domain license licensefilelicense_file name Apply a new license to the domain
117 nuodb [domain] > apply domain license License file:./mylicense $java -jar nuodbmanager.jar --broker localhost --password bird \ --command "apply domain license licensefile./mylicense" $ java -jar nuodbmanager.jar --broker localhost \ --password quickstart --user quickstart \ --command "show domain license" Professional Edition License (free version) Uid = 83e895a7-a111-49fb-ad7e-20d9b860 6a43 Holder = ProfessionalBase Invalid before = January 10, :40:12 AM EST Invalid after = August 17, :12:55 AM EST Allowed hosts = 2 Maximum database size = 4 create create domain administrator user user_nam e password user_password $ java -jar nuodbmanager.jar --password bird --broker localhost \ > --command "create domain administrator user admin password admin" $ java -jar nuodbmanager.jar --broker localhost \ --user admin --password admin nuodb [domain] > Create a new domain administrator account. echo echo property property_name Display the value of property_name nuodb [domain] >echo property host localhost
118 help nuodb [domain] >help [command_na me] Display help for the specified command. If no command is specified, show a list of commands. Note The help syntax uses $ to specify a required argument along with its value. For example: shutdown process $host $pid indicates correct syntax for the following command: shutdown process host localhost pid 2343 nuodb [domain] > help help apply capture create echo log manage monitor quiesce remove restart set show shutdown start trace unquiesce unset nuodb [domain] > help create create domain administrator $user $password log log domain domain_name categories log database database_name categories log process host_name pid categories Generates a log for a domain, a database, or a process. You must specify the categories of logging information that you require.
119 Interactive logging is not supported in this version. You can use the command line as follows: $java -jar nuodbmanager.jar \ --broker localhost --password bird \ --command "log database test categories error,info,net,warn" Thu Sep 20 17:27:10 EDT 2012: local/ :50036 [ pid = 496 ] [net] monitor: log listener, mask 0x8e Thu Sep 20 17:27:10 EDT 2012: local/ :50205 [ pid = 584 ] [net] monitor: log listener, mask 0x8e Thu Sep 20 17:27:10 EDT 2012: local/ :50027 [ pid = 490 ] [net] monitor: log listener, mask 0x8e manage manage database database_name Specifies name of database you want to manage using this tool nuodb [domain] >manage database test nuodb [domain/test] > monitor monitor domain monitor database database_name monitor hosts monitor process host_name pid Use domain, database, process arguments to capture internal statistics from NuoDB processes. Use hosts to monitor statistics generated from the hosts, not from any specific process.
120 Interactive monitoring is not supported in this version. You can use the command line as shown in the following two examples: $ java -jar nuodbmanager.jar \ --broker localhost --password bird \ --command "monitor database test" local/ :50027 [ pid = 490 ] ActualVersion = 10 AdminReceived = 0 AdminSent = 1 ArchiveDirectory = /tmp/test_archive ArchiveQueue = 0 BytesReceived = 242 BytesSent = 5985 ClientCncts = 0 ClientReceived = 0 ClientSent = 0 Commits = 0 CurrentActiveTransactions = Stalls = 0 Updates = 0 UserMilliseconds = 0 WaitForDatabaseStallCount = 0 $ java -jar nuodbmanager.jar \ --broker localhost --password bird \ --command "monitor hosts" Sep 21, :31:02 PM [ localhost/ :48004 ]: load = Sep 21, :31:02 PM [ localhost/ :48004 ]: cores = 4.0 Sep 21, :31:03 PM [ localhost/ :48004 ]: load = Sep 21, :31:03 PM [ localhost/ :48004 ]: cores = 4.0 Sep 21, :31:04 PM [ localhost/ :48004 ]: load = Sep 21, :31:04 PM [ localhost/ :48004 ]: cores = quiesce quiesce database database-name Causes transaction engines in the specified database to cease operations. This command does not shut down the database.
121 nuodb [domain/test] > show domain processes Database: test [SM] local/ :51370 [ pid = 697 ] RUNNING [TE] local/ :51381 [ pid = 703 ] RUNNING nuodb [domain/test] > quiesce database test host localhost nuodb [domain/test] > show domain processes Database: test [SM] local/ :51370 [ pid = 697 ] QUIESCED [TE] local/ :51381 [ pid = 703 ] QUIESCED remove remove domain administrator remove domain license $ java -jar nuodbmanager.jar --broker localhost --user admin --password admin nuodb [domain] > remove domain administrator admin nuodb [domain] > quit $ java -jar nuodbmanager.jar --broker localhost --user admin --password admin Domain entry failed: Login credentials were rejected Removes a domain administrator account that was created with the create command. Removes current license for the domain. restart restart process host existing_nuodb_hostna me pid pid_number restart process host existing_nuodb_hostna me pid pid_number newhost nuodb_hostna me restart process host localhost pid 5678 Shut down a running process on existing_n uodb_hostname with pid of pid_number and then re-start it with the same configuration and on the same host where it was running. Shut down a running process on existing_n uodb_hostname with pid of pid_number and then re-start a process with the same configuration on a new host specified asnuo db_hostname. In this case, the running process must be a transaction engine; this command does not work with a storage manager process. set set property property-name value property_ value Specifies a new property by name and assigns a value to it.
122 nuodb [domain] >set property host value localhost nuodb [domain] > echo property host localhost show show domain ( summary license hosts databases processes ) show domain database ( hosts processes ) database_name Displays specified information about a domain, a database, or a process. Display of databases includes of count of its current processes. show process ( config memory status ) host host_name pid pid_number nuodb [domain/test] > show domain summary Hosts: [broker] localhost/ :48004 Database: test [SM] local/ :51370 [ pid = 697 ] RUNNING [TE] local/ :51381 [ pid = 703 ] RUNNING nuodb [domain/test] > show process status host localhost pid 697 NodeID: 1 NodeState: RUNNING Clients: 0 shutdown shutdown domain shutdown database database_name shutdown process pid pid_number [ graceful { true false } ] [ allownondurable { true false } ] nuodb [domain/test] > shutdown process host localhost pid 6465 graceful true Stop processes as specified: all on a domain, all for a specified database, a specific process. If there are no connections or all connections are idle, the process proceeds to shutdown. If there are idle connections, the shutdown occurs after they have completed, or when the timeout has expired. Shutting down gracefully means that existing requests and connections are allowed to gracefully complete while no new requests and/or connections are accepted. By default the graceful property is true and allownondurable is false; that is, by default, the process shuts down gracefully and you are not allowed to stop a process if doing so would result in a domain without a storage manager.
123 start start process te host host_name database database_name [ options] [;...] start process sm host host_name database database_name archive archive_dir [ initialize {true false} ] [ options ] Start transaction engine (te) or storage manager (sm) on the specified host and database. Optionally specify nuodb command line options. See nuodb reference page for a list of options. If you are starting the first transaction engine for a database, you must specify a user name and password for the database administrator using nuodb command line options. (--dba-user and --dba--password). Note that for storage manager you must also specify a directory as the location for the files to be stored. Whenever you start a new storage manager specify initialize. Use single quotation marks ( ' ') to specify multiple arguments on the command line with the options property nuodb [domain/test] > start process te host localhost Process command-line options: --dba-user dba --dba-password goalie Started process: localhost/ :51018 [ pid = 1840 ] nuodb [domain/test] > start process sm host localhost database test archive /tmp/archive initialize true options '--verbose error,info,warn' Started process: local/ :63480 [ pid = 7949 ] unquiesce unquiesce database database-name Causes transaction engines in the specified database to resume operations after being quiesced.
124 nuodb [domain/test] > show domain processes Database: test [SM] local/ :51370 [ pid = 697 ] QUIESCED [TE] local/ :51381 [ pid = 703 ] QUIESCED nuodb [domain/test] > database test nuodb [domain/test] > domain processes unquiesce show Database: test [SM] local/ :51370 [ pid = 697 ] RUNNING [TE] local/ :51381 [ pid = 703 ] RUNNING Examples The examples show the a command line, interactive usage, and a script. The examples assume you have executed the run-quickstart script in the install directory. Command Line Usage # Start a transaction engine from the command line. # Note: te = transaction manager $ java -jar nuodbmanager.jar --broker localhost --password bird \ --command "start process te host localhost database test options \ '--dba-user dba --dba-password goalie'" Started process: local/ :50488 [ pid = 853 ] Interactive Usage # Start the tool and create a new domain administrator (adminuser) and password (adminpw) # $ java -jar nuodbmanager.jar --broker localhost --password bird nuodb [domain] > create domain administrator user adminuser password adminpw nuodb [domain] > quit # Start the tool as the new user. # $ $ java -jar nuodbmanager.jar --broker localhost --user adminuser --password adminpw # Type help [ command ] to display available commands and parameters. # nuodb [domain] > help show
125 show domain ( summary license hosts databases processes ) show database ( hosts processes ) $database show host processes $host show process ( config memory status ) $host $pid # Type show domain summary to show a summary of all processes. # Note: # SM = Storage Manager # TE = Transaction Manager nuodb [domain] > show domain summary Hosts: [broker] localhost/ :48004 Database: test [SM] local/ :51427 [ pid = 536 ] RUNNING [TE] local/ :51438 [ pid = 542 ] RUNNING # Specify "test" as the database to manage. nuodb [domain] > manage database test # Set local host as the default value of the host property. nuodb [domain/test] > set property host value localhost # Display the value of the host property. nuodb [domain/test] > echo property host localhost # Use default value for host when specifying commands, such as start and shutdown. # # By default the tool uses the value for the database that it is currently managing # and the values for any required properties (such ashost) that are currently specified. # The DBA username and password are not required because this is not the first TE to be started. # Notice that the tool prompts for required parameters and options to pass to the nuodbcommand. # nuodb [domain/test] >start process te Process command-line options: Started: [TE] local/ :51579 [ pid = 553 ] RUNNING # Show status of a process nuodb [domain/test] > show process status host localhost pid 536 NodeID: 1 NodeState: RUNNING Clients: 0 # Cause specified database to cease operations without stopping the processes. # nuodb [domain/test] > quiesce database test host localhost nuodb [domain/test] > show host processes [SM] local/ :51427 [ pid = 536 ] QUIESCED [TE] local/ :51438 [ pid = 542 ] QUIESCED [TE] local/ :51579 [ pid = 553 ] QUIESCED # Pass options to nuodb process when you start a second storage manager. # Also notice that it the storage manager is quiesced because the database is quiesced. #
126 nuodb [domain/test] > nuodb [domain/test] > start process sm host localhost database test archive /tmp/archive initialize true options '--verbose error,info,warn' Started: [SM] local/ :51719 [ pid = 555 ] QUIESCED Running a Script # Sample script # $ java -jar nuodbmanager.jar --broker localhost --password bird \ > --file _NdbMan.script Hosts: [broker] localhost/ :48004 Database: test [SM] local/ :50027 [ pid = 548 ] [TE] local/ :50036 [ pid = 554 ] [TE] local/ :50839 [ pid = 731 ] [SM] local/ :50867 [ pid = 734 ] Started process: local/ :50877 [ pid = 740 ] NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved SPACER
127 NuoDB Migrator NuoDB Migrator is a command-line Java program, which helps domain administrators to migrate schema and existing data to a NuoDB database. It interfaces with a source database over a JDBC compliant driver and designed to support all major RDBMS that are available. Installation Directory NuoDB Migrator comes bundled with the core product, its installation directory will be referenced as NUODB_MIGRATOR_ROOT along the users guide document and the contents of it is shown on the following image. Linux/Mac $ /opt/nuodb/tools/migrator WINDOWS > c:\program Files\nuodb\tools\migrator JDBC driver installation NuoDB Migrator doesn't directly interact with a database, instead the tool relies on JDBC API and uses a JDBC driver to enable database connectivity. Prior to performing any migration command an appropriate JDBC driver should be installed. Read the Installing a JDBC driver page for information on where to download a JDBC driver and how to configure NuoDB Migrator to use it. Migration Commands With the NuoDB Migrator command-line interface, domain administrators are able to perform the following database backup and migration tasks: Migrate a schema to a target NuoDB database Dump data from an existing database Load data to a target NuoDB database Copy data from an existing database to a target NuoDB database COMMAND DESCRIPTION schema dump load Generates a schema for a target NuoDB database Dump data from an existing database Load data to a target NuoDB database To get available command line options for a particular migration command run the following script in your command line: Linux/Mac $ bin/nuodb-migrator -h schema dump load Windows > bin\nuodb-migrator -h schema dump load Usage examples Usage examples for NuoDB Usage examples for MSSQL Usage examples for MySQL
128 Usage examples for Oracle Usage examples for PostgreSQL NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved SPACER
129 NuoDB Migration Configure NuoDB JDBC Driver The NuoDB Migrator relies on the value of NUODB_ROOT environmental variable to discover NuoDB JDBC Driver, the driver will be loaded automatically. Supported Drivers Install Directory CLASSPATH variable NuoDB JDBC Driver $NUODB_ROOT/jar Linux/Mac: CLASSPATH=/opt/nuodb/jar/nuodbjdbc.jar;$CLASSPATH Windows: set CLASSPATH=C:\Program Files\NuoDB\jar\nuodbjdbc.jar;%$CLASSPATH% For a NuoDB JDBC connection configuration instructions read JDBC connection page. Migration commands NuoDB stores data in user schemas and to configure connection to a NuoDB database you should provide connection URL, schema name, username and password to authenticate with. Schema Schema command captures test1 schema and saves it to a file specified by -output.path parameter: bin/nuodb-migrator schema --source.url=jdbc:com.nuodb://localhost/db1 --source.schema=test1 --source.username=user --source.password=pass --output.path=/tmp/schema.sql Dump The following command creates a dump of all tables from NuoDB database named db1, found in schema schema1 in CSV format. Dump data files will be saved in /tmp directory along with dump.cat which is a catalog file. bin/nuodb-migrator dump --source.driver=com.nuodb.jdbc.driver --source.url=jdbc:com.nuodb://localhost/db1 --source.schema=schema1 --source.username=user --source.password=pass --output.type=csv --output.path=/tmp/dump.cat Load Loading a previously generated dump from --input.path to a NuoDB database into --target.schema is performed using load comman d: bin/nuodb-migrator load --target.url=jdbc:com.nuodb://localhost/db2 --target.schema=test2 --source.username=user --source.password=pass --input.path=/tmp/dump.cat
130 NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved SPACER
131 Usage Examples for NuoDB Configuring Class Path To access metadata information and tabular data stored in NuoDB the tool uses NuoDB JDBC Driver. It relies on the value of NUODB_ROOT en vironmental variable to discover NuoDB JDBC Driver, the driver will be loaded automatically. For advanced cases you can override NUODB_ROOT variable with a valid NuoDB installation directory from a command line shell. On Windows it s one of two: set NUODB_ROOT="C:\Program Files\NuoDB" # NuoDB v1.1 or later set NUODB_ROOT="C:\Program Files (x86)\nuodb" # NuoDB v1.0.2 or earlier On Linux/Mac: NUODB_ROOT="/opt/nuodb" Alternatively, NuoDB Migrator can pick up a JDBC Driver from the system CLASSPATH variable. On Windows: set CLASSPATH=C:\Program Files\NuoDB\jar\nuodbjdbc.jar;%$CLASSPATH% On Linux/Mac: CLASSPATH=/opt/nuodb/jar/nuodbjdbc.jar;$CLASSPATH For a NuoDB JDBC connection configuration instructions read JDBC connection page. Migration commands NuoDB stores data in user schemas and to configure connection to a NuoDB database you should provide connection URL, schema name, username & password to authenticate with. Schema Schema command captures hockey schema (form the QuickStart database) and saves it to a file specified by --output.path parameter: $ bin/nuodb-migrator schema --source.driver=com.nuodb.jdbc.driver --source.url=jdbc:com.nuodb://localhost/test --source.schema=hockey --source.username=dba --source.password=goalie --output.path=/tmp/schema.sql Dump The following command creates a dump of all tables from NuoDB database named test, found in schema hockey in CSV format. Dump data files will be saved in /tmp directory along with dump.cat which is a catalog file.
132 $ bin/nuodb-migrator load --target.url=jdbc:com.nuodb://localhost/test --target.schema=hockey --source.username=dba --source.password=goalie --input.path=/tmp/dump.cat Load Loading a previously generated dump from --input.path to a NuoDB database into --target.schema is performed using load comman d: $ bin/nuodb-migrator load --target.url=jdbc:com.nuodb://localhost/test --target.schema=myschema --target.username=dba --target.password=goalie --input.path=/tmp/dump.cat NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved SPACER
133 MSSQL Migration Download and Configuring MSSQL JDBC Driver To access MSSQL, you should download and install one of the supported drivers below. Supported Drivers Microsoft JDBC Driver jtds JDBC Driver Install Directory Alternately use the system CLASSPATH $NUODB_MIGRATOR_ROOT/jar set CLASSPATH={path\to\jdbc.jar};%$CLASSPATH% Migration Commands Schema This sample command generates a NuoDB schema using MSSQL dbo schema from cat1 catalog: bin/nuodb-migrator schema --source.driver=net.sourceforge.jtds.jdbc.driver --source.url=jdbc:jtds:sqlserver://localhost:1433/db1 --source.username=user --source.password=pass --source.catalog=cat1 --source.schema=dbo Dump The following command creates a dump of all tables from MSSQL dbo schema, which is in cat1 catalog, in CSV format. Dump will be created in /tmp directory: bin/nuodb-migrator dump --source.driver=net.sourceforge.jtds.jdbc.driver --source.url=jdbc:jtds:sqlserver://localhost:1433/db1 --source.username=user --source.password=pass --source.catalog=cat1 --source.schema=dbo --output.type=csv --output.path=/tmp/dump.cat Load Loading MSSQL dump from --input.path to a NuoDB database into --target.schema is performed using load command: bin/nuodb-migrator load --target.url=jdbc:com.nuodb://localhost/db2 --target.schema=test2 --target.username=user --target.password=pass --input.path=/tmp/dump.cat NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved SPACER
134 MySQL Migration Download and Configure MySQL JDBC Driver To access MySQL download and install the following driver: Supported Driver* Install Directory Alternately use system CLASSPATH MySQL Connector/J JDBC Driver $NUODB_MIGRATOR_ROOT/jar Linux/Mac: CLASSPATH={path/to/jdbc.jar};$CLASSPATH Windows: set CLASSPATH={path\to\jdbc.jar};%$CLASSPATH% MySQL Connector/J is an official JDBC Type 4 driver and is a pure Java implementation of the MySQL protocol which does not rely on the MySQL client libraries. For additional information, see MySQL JDBC Driver. Migration Commands Schema The following sample command generates a NuoDB schema from MySQL db1 catalog: bin/nuodb-migrator schema --source.driver=com.mysql.jdbc.driver --source.url=jdbc:mysql://localhost:3306/db1 --source.username=root --source.password=12345 Dump To dump tables from MySQL db1 catalog in CSV format to /tmp directory execute: bin/nuodb-migrator dump --source.driver=com.mysql.jdbc.driver --source.url=jdbc:mysql://localhost:3306/db1 --source.username=root --source.password= output.type=csv --output.path=/tmp/dump.cat Load Restoring a dump to a NuoDB database into --target.schema is performed using load command: bin/nuodb-migrator load --target.url=jdbc:com.nuodb://localhost/db2 --target.schema=test2 --target.username=user --target.password=pass --input.path=/tmp/dump.cat NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved
135 SPACER
136 Oracle Migration Download and Configure Oracle JDBC Driver To connect to an Oracle database download Oracle Thin Driver to $NUODB_MIGRATOR_ROOT/jar directory: Supported Drivers Install Directory CLASSPATH Oracle Thin Driver (ojdbc6.jar) $NUODB_MIGRATOR_ROOT/jar Linux: CLASSPATH={path/to/jdbc.jar};$CLASSPATH Windows: set CLASSPATH={path\to\jdbc.jar};%$CLASSPATH% The Oracle Thin Driver is a platform-independent driver also known as the direct to database driver. This driver does not require any additional Oracle software on the client-side. Additional Information Oracle JDBC Migration commands Schema This sample command generates a NuoDB schema using Oracle test1 schema from cat1 catalog: bin/nuodb-migrator schema --source.driver=oracle.jdbc.driver.oracledriver --source.url=jdbc:oracle:thin:@//localhost:1521/db1 --source.username=user --source.password=pass --source.catalog=cat1 --source.schema=test1 Dump Creating a dump of Oracle catalog specified by --source.catalog parameter in CSV format to --output.path directory execute the following command: bin/nuodb-migrator dump --source.driver=oracle.jdbc.driver.oracledriver --source.url=jdbc:oracle:thin:@//localhost:1521/db1 --source.username=user --source.password=pass --source.catalog=cat1 --source.schema=test1 --output.type=csv --output.path=/tmp/dump.cat Load Loading Oracle dump from --input.path to a NuoDB database into --target.schema is performed using load command: bin/nuodb-migrator load --target.url=jdbc:com.nuodb://localhost/db2 --target.schema=test2 --target.username=user --target.password=pass --input.path=/tmp/dump.cat
137 NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved SPACER
138 PostgreSQL Migration Download and Install Postgres JDBC Driver Download a required version of PostgreSQL Native Driver to a $NUODB_MIGRATOR_ROOT/jar directory: Supported Driver Install Directory CLASSPATH JDBC4 PostgreSQL Driver $NUODB_MIGRATOR_ROOT/jar Linux: CLASSPATH={path/to/jdbc.jar};$CLASSPATH Windows: set CLASSPATH={path\to\jdbc.jar};%$CLASSPATH% PostgreSQL provides a type 4 JDBC driver. Type 4 indicates that the driver is written in Pure Java, and communicates in the database system's own network protocol. Because of this, the driver is platform independent; once compiled, the driver can be used on any system. Additional Information PostgreSQL Driver Migration commands Schema The following sample generates a NuoDB schema from PostgreSQL db1 database public schema: bin/nuodb-migrator schema --source.driver=org.postgresql.driver --source.url=jdbc:postgresql:db1 --source.username=postgres --source.password=postgres --source.schema=public Dump To create a dump from PostgreSQL db1 database tables from public schema in CSV format to --output.pathdirectory execute: bin/nuodb-migrator dump --source.driver=org.postgresql.driver --source.url=jdbc:postgresql:db1 --source.username=postgres --source.password=postgres --source.schema=public --output.type=csv --output.path=/tmp/dump.cat Load To restore previously created dump to a NuoDB database into --target.schema run load command: bin/nuodb-migrator load --target.url=jdbc:com.nuodb://localhost/db2 --target.schema=test2 --target.username=user --target.password=pass --input.path=/tmp/dump.cat
139 NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved SPACER
140 Commands Dump Load Schema NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved SPACER
141 Dump command Description The command dumps data from an existing database. A dump will be created from of all tables from found in specified catalog and/or schema in a desired format format. Dump data files will be saved in specified output directory along with a dump catalog file. Syntax bin/nuodb-migrator dump [source database connection, required] --source.driver=driver # JDBC driver class name --source.url=url connection URL in the standard syntax jdbc:<subprotocol>:<subname> [--source.username=[username]] [--source.password=[password]] [--source.properties=[properties]] # Source database # Source database username # Source database password # Additional connection properties encoded as # URL query string "property1=value1&property2=value2" [--source.catalog=[catalog]] # Default database catalog name to use [--source.schema=[schema]] # Default database schema name to use [output specification, required] --output.type=output type # Output type (csv, xml, bson) [--output.path=[output path]] specified the current # directory will be used # Path on the file system, if not [--output.*=[attribute value]] # Output format attributes (csv.encoding, csv.delimiter, # csv.quoting, csv.quote, csv.escape, csv.line.separator, # xml.encoding, xml.version) [table names, types & query filters, optional] [--table=table [table...]] # Table name [--table.type=[table type [table type...]]] # Comma separated types of tables (TABLE, VIEW, SYSTEM TABLE, # GLOBAL TEMPORARY, ALIAS, SYNONYM, etc) to process, by default # only TABLE is included into dump [--table.*.filter=[query filter]] # Filters table records using specified filter by appending it # to the SELECT statement after WHERE clause [select statements, optional] [--query=query] # Select statement [--time.zone (-t)=time zone] be dumped and reloaded between # servers in different time zones # Time zone enables date columns to Usage examples The command below creates a dump from MySQL database test in CSV format and saves it to /tmp directory:
142 bin/nuodb-migrator dump --source.driver=com.mysql.jdbc.driver --source.url=jdbc:mysql://localhost/test --source.username=root --source.password= output.type=csv --output.path=/tmp/dump.cat Time zone option --time.zone enables to dump DATE, DATETIME, TIMESTAMP columns in a different time zone. Time zone is instantiated by its identifier, an abbreviation such as PST or a full name such as America/Los_Angeles: bin/nuodb-migrator dump... --time.zone=utc+2 To create a dump for specific tables their names should be provided on the command line via --table parameter. You can use either of 2 options: bin/nuodb-migrator dump... --table=t1,t2,t3 bin/nuodb-migrator dump... --table=t1 --table=t2 --table=t3 NuoDB Migrator allows to dump a subset of rows which match condition specified with filter option. The filter's value will be appended to generated SELECT statement: bin/nuodb-migrator dump... --table.t1.filter=id>1000 NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved SPACER
143 Load command Description Load dump data to a target NuoDB database. Syntax bin/nuodb-migrator load [target database connection, required] --target.url=url # Target database connection URL in the format # jdbc:com.nuodb://{broker}:{port}/{database} [--target.username=[username]] # Target database username [--target.password=[password]] # Target database password [--target.properties=[properties]] # Additional connection properties encoded as # URL query string "property1=value1&property2=value2" [--target.schema=[schema]] # Default database schema name to use [input specification, required] --input.path=[input path] # Path on the file system [--input.*=[attribute value]] # Input format attributes [--time.zone (-t)=time zone] # Time zone enables date columns to be dumped and # reloaded between servers in different time zones Usage examples The load command restores dump to NuoDB db1 database using dump catalog file provided by --output.path parameter: bin/nuodb-migrator load --target.url=jdbc:com.nuodb://localhost/db1 --target.username=dba --target.password=goalie --input.path=/tmp/dump.cat NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved SPACER
144 Schema command Description Generates a schema for a target NuoDB database. Syntax bin/nuodb-migrator schema [source database connection, required] --source.driver=driver --source.url=url # JDBC driver class name # Source database connection URL in the standard syntax jdbc:<subprotocol>:<subname> [--source.username=[username]] # Source database username [--source.password=[password]] # Source database password [--source.properties=[properties]] # Additional connection properties encoded as # URL query string "property1=value1&property2=value2" [--source.catalog=[catalog]] # Default database catalog name to use [--source.schema=[schema]] # Default database schema name to use [target database connection, optional] [--target.url=url] # Target database connection URL in the format jdbc:com.nuodb://{broker}:{port}/{database} [--target.username=[username]] # Target database username [--target.password=[password]] # Target database password [--target.properties=[properties]] # Additional connection properties encoded as # URL query string "property1=value1&property2=value2" [--target.schema=[schema]] # Default database schema name to use [script output, optional] --output.path=output path # Saves script to a file specified by path [custom type declarations, optional] [--type.name=type name] # SQL type name template, i.e. decimal({p},{s}) or # varchar({n}), where {p} is a placeholder for a # precision, {s} is a scale and {n} is a maximum size [--type.code=type code] # Integer code of declared SQL type [--type.size=[type size]] # Maximum size of custom data type [--type.precision=[type precision]] # The maximum total number of decimal digits that # can be stored, both to the left and to the right # of the decimal point. Typically, type precision # is in the range of 1 through the maximum precision of 38 [--type.scale=[type scale]] # The number of fractional digits for numeric data types [--meta.data.*=[true false]] # Includes of excludes specific meta data type (catalog, # schema, table, column, primary.key, index, foreign.key, # check.constraint, auto.increment) from the generated output, # by default all objects are generated [--script.type=drop [create]] statements to be generated, default # is drop & create # Comma separated types of
145 [--group.scripts.by=[table meta.data]] # Group generated DDL scripts, table by default [--identifier.quoting=[identifier quoting]] # Identifier quoting policy name, minimal, always or fully # qualified class name implementing # com.nuodb.migrator.jdbc.dialect.identifierquoting, # default is always [--identifier.normalizer=[identifier normalizer]] # Identifier transformer to use, available normalizers are # noop, standard, lower.case, upper.case or fully qualified # class name implementing
146 # com.nuodb.migrator.jdbc.dialect.identifiernormalizer, # default is noop Usage examples Generated schema can be exported to a NuoDB database through --target.* options, to a file via --output.path parameter. If neither a target database nor a file were provided, scripts are written to the standard output stream, which can be handled as a regular stream in any OS. The following command generates NuoDB schema from MySQL catalog and prints it to the standard output. bin/nuodb-migrator schema --source.driver=com.mysql.jdbc.driver --source.url=jdbc:mysql://localhost/test --source.username=root --source.password=12345 The tool generates DROP & CREATE statements for target objects. Using --script.type option you can alter the default behavior. The following causes only DROP scripts to be outputted: bin/nuodb-migrator schema... --script.type=drop You can exclude certain types of objects from output by listing them in --meta.data.* option. The command below below instructs the migrator to not include foreign keys and auto incremented columns into generated DDL scripts: bin/nuodb-migrator schema... --meta.data.foreign.key=false --meta.data.auto.increment=false NuoDB migrator uses identifier quoting & identifier normalizer policies to produce names for tables & columns. Those policies may be overridden on the command line using --identifier.quoting & --identifier.normalizer parameters: bin/nuodb-migrator schema... --identifier.quoting=minimal --identifier.normalizer=lower.case The above line will quote only identifiers which are stop words & reserved words, all generated names will appear in lower case format. Troubleshooting NuoDB Migrator contains data type registrations for all standard JDBC types & vendor specific types for MSSQL, PostgreSQL, MySQL & Oracle. A meta data error during schema generation "Unsupported type VARCHAR, type code 12, length 20 on table datatypes1 column c1" indicates that a type needs to be introduced to NuoDB Migrator additionally: bin/nuodb-migrator schema... --type.code=12 --type.name=varchar({n}) SQL type name template --type.name can contain placeholders, which will be substituted with type specifiers during type name creation, where {p} is a placeholder for a precision, {s} is a scale and {n} is a maximum size. NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved SPACER
147 NuoDB SQL CLI Step-by-step instructions to execute SQL statements using the NuoDB SQL client. You can execute SQL statements by running the nuosql command, starting the NuoDB SQL client. You can use the NuoDB SQL client to test your SQL statements. 1. If you have not already done so, start a database. 2. Invoke nuosql specifying the name of the database and using your password. See nuosql Command. 3. Issue SQL statements at the SQL> prompt. The following example creates a table, inserts some data, then selects it. SQL> CREATE SCHEMA xyzzy; SQL> USE xyzzy; SQL> CREATE TABLE foo (f1 integer, f2 string); SQL> INSERT INTO foo (f1, f2) VALUES (123, 'abc'); SQL> SELECT * FROM foo; F1 F abc AUTOCOMMIT is on by default, so you do not have to explicitly commit each statement. If AUTOCOMMIT is off, nuosql does not commit changes to the database automatically. If AUTOCOMMIT is off, and you are running concurrent applications and/or concurrent nuosql sessions, you get confusing and inconsistent results. To commit changes explicitly, use the COMMIT statement. SQL> COMMIT To undo a change that has not been committed, use the ROLLBACK statement. SQL> ROLLBACK The following examples show the use of ROLLBACK and COMMIT in relation to AUTOCOMMIT: AUTOCOMMIT is on The first set of transactions are committed because AUTOCOMMIT is on.
148 SQL> SHOW AUTOCOMMIT; Autocommit is on SQL> CREATE TABLE t (N INT); SQL> INSERT INTO t VALUES (1); SQL> SELECT * FROM t; N -- 1 AUTOCOMMIT is off Setting AUTOCOMMIT OFF after the first set of transactions means that the next transaction is not committed. SQL> AUTOCOMMIT OFF; SQL> INSERT INTO t VALUES (2); SQL> SELECT * FROM t; N ROLLBACK ROLLBACK discards the second transaction (there is only one row in the table after ROLLBACK). SQL> ROLLBACK; SQL> SELECT * FROM t; N -- 1 COMMIT with AUTOCOMMIT off You can explicitly COMMIT the current transaction while AUTOCOMMIT is OFF.
149 SQL> INSERT INTO t VALUES (2); SQL> COMMIT; SQL> SELECT * FROM t; N SQL> ROLLBACK; SQL> SELECT * FROM t; N nuosql Command Syntax for the nuosql command, used to start nuosql as a client against a specified database. Requires a username and password. Batch Processing from the Command Line Using commands and writing scripts for batch processing Selecting from the DUAL Table DUAL is a table created by NuoDB that is not persisted in the database. Metadata Schema for describing NuoDB database objects (such as tables, columns, indexes, and others) Troubleshooting the NuoDB SQL Client How to deal with SQL errors in NuoDB databases Working With Triggers Examples of creating, altering, and dropping triggers in NuoDB NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved SPACER
150 nuosql Command Syntax for the nuosql command, used to start nuosql as a client against a specified database. Requires a username and password. Syntax nuosql database_name --user user --password password [options] Description Starts nuosql client as an interactive tool. To start nuosql you must be a database administrator, or be assigned a username and password by the database administrator. The nuosql tool supports basic command line editing capability when used interactively. Note Command line editing (keystroke sequences to edit the input line) is not available on Windows. You can use nuosql non-interactively by specifying a command file with the --file option. Options Name Of Option --schema --user --password --config --connection-property x=y [--connection-property x=y]...] --file filename --nosemicolon --help --version --history filename --show-prompt --verbose [debug info warn i18n ] --log filename Description Default schema User name for the database User password Configuration file Specifies properties for the nuosql client connection to the server. Multiple connection properties may be specified on one command line. Command file. See Batch processing of SQL from the command line Do not require semicolon command terminator Display this information Display the agent version Specify a history file In non-interactive level show a prompt at line start Report details in each level of logging or, for internalization, the category of logging. For example --verbose i18n means log all debug, info, or war n level logging for the i18n category. Specify a log file
151 Example If you have run the Quick Start script on the local machine, the specifications for the test database are --user dba --password goalie. The database administrator starts nuosql against the test database. $ nuosql test --user dba --password goalie Using nuosql, the database administrator creates and commits a new user and password for the testdatabase. SQL> create user NewHire password 'Green'; SQL> commit; SQL> quit The new user successfully starts nuosql and creates a table. $ nuosql test --user NewHire --password Green SQL> create table newtable(number integer, name string); SQL> show tables; Tables in schema USER NEWTABLE SQL> quit; Specify the time zone as a connection property for a client application. $ nuosql test --user dba --password goalie --connection-property TimeZone=America/New_York NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved SPACER
152 Batch Processing from the Command Line Using commands and writing scripts for batch processing The nuosql client accepts commands from redirected standard input (stdin) or by means of a file using the --file <filename> argument. By default, when redirecting input, nuosql suppresses the SQL > prompt on output and automatically exits on EOF. The following syntax executes the commands in command_filename for the test database: nuosql test --file command_filename --password password Note When you specify the --file command_filename option, nuosql executes all the commands in the specified file, and then runs interactively. You can change this behavior by specifying an explicit exit at the end of the specified file. You can add a prompt to the output by specifying the --show-prompt option. Example The following text (_NdbSql.script) is an example of a command file: drop table t if exists; create table t (x integer); insert into t values (10); insert into t values (20); select * from t; quit; Run the script as follows: $ nuosql test --user dba --password goalie --file _NdbSql.script drop table t if exists; create table t (x integer); insert into t values (10); insert into t values (20); select * from t; X quit; Use the --show-prompt option as follows:
153 $ nuosql test --user dba --password goalie --file _NdbSql.script --show-prompt SQL> create table t (x integer); SQL> insert into t values (10); SQL> insert into t values (20); SQL> select * from t; X SQL> quit; NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved SPACER
154 Selecting from the DUAL Table DUAL is a table created by NuoDB that is not persisted in the database. The DUAL table is accessible by the name DUAL to all users. It resolves to a table with a single row. It appears to be in whatever schema you are using, as well as in the system schema. Selecting from the DUAL table is useful for computing a constant expression with the SELECT statement. Because DUAL has only one row, the constant is returned only once. Alternatively, you can select a constant, column, or expression from any table, but the value will be returned as many times as there are rows in the table. You cannot qualify DUAL with any schema other than the system schema. See the following examples Convert hex values to decimal SQL> select 0xeff1c23 from dual; Select substring SQL> select substr('nuodb', 1, 3) from dual; --- Nuo Return character length SQL> select character_length('nuodb') from dual; - 5 NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved SPACER
155 Metadata Schema for describing NuoDB database objects (such as tables, columns, indexes, and others) The schema that has metadata information is the SYSTEM schema. The table that has metadata information is system.tables. To list all the non-system tables in the database, use the following: SQL> SELECT * FROM system.tables WHERE type <> SYSTEM TABLE The system schema also contains tables that describe columns (system.fields), indexes, views, and others. NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved SPACER
156 Troubleshooting the NuoDB SQL Client How to deal with SQL errors in NuoDB databases Query Connection Closed If you get an SQL error indicating that the query failed because a remote connection closed, restart the database and try again. NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved SPACER
157 NuoDB Web Console The NuoDB Web Console is the GUI utility used to administer your NuoDB Domain, explore your database and connect to the NuoDB Developer Community. With NuoDB v1.1, the Web Console is integrated with the Dev Center. Accessing the Console To access the Console: 1. Launch a web browser, and enter IP_Address:8080/console.html, where IP_Address is the the IP address or domain name of the server where you installed NuoDB. If you are accessing the Console from one of the machines where you installed NuoDB, you can access it through the localhost, by entering in your browser. To launch the Console from the System Tray: 1. From the System Tray (Mac OS X or Windows only), click the NuoDB icon and choose NuoDB Console. The Console on the localhost launches in a browser tab. 2. In the address bar, enter IP_Address:8080/console.html, where IP_Address is the the IP address or domain name of the server where you installed NuoDB. Console GUI Home Admin Explorer Demos Home The Home screen provides an entry point for launching the: Quickstart create a sample database Admin create, deploy, manage and monitor your databases Explorer an SQL browsing tool run queries and view result sets Storefront a demo capable of simulating thousands of concurrent transactions Samples NuoDB sample applications and demos on GitHub
158 Admin The Admin screen displays a tutorial on the left and a Domain Overview panel on the right. You can add additional view gadgets with which to administer your databases: Click Add View and then select they type of view from the Gadget drop-down list.
159 Explorer The Explorer screen provides a navigation tree of your database and database objects. 1. Select one of the databases in the treed view, and login at the prompt That database's object appear in the treed view. Click New Query to open an SQL query code textbox. Type your query and click Execute Query. The results set is returned.
160 Demos The Demos tab provides links to the QuickStart, Storefront, and GitHub samples.
161 Start the NuoDB Web Console All NuoDB install packages (with the exception of the TAR.GZ files) will automatically start the Web Console as part of the installation. This section will outline the steps to manually start and stop the console for those occasions where manual intervention may be needed. Start a Database Using NuoDB Console To start a database using the console you must have set up a domain by starting a broker from the command line. Specify Alert Settings Procedure for changing the default settings for the alert messages that are displayed in the home page of NuoDB Console. webapp.properties Defines properties for NuoDB Console. The properties in webapp.properties and default.properties must be consistent. Editing webapp.properties in Windows Windows users must have write permissions to the NuoDB directory in order to save changes to the webapp.properties file. See Write Permissions in Windows for instructions on granting directory-level write permissions in Windows.
162 NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved SPACER
163 Start the NuoDB Web Console Before you Begin A Broker must be running Start the embedded Jetty Web Server on the host running your Broker. Open a browser window to: If you prompted for a Domain login, use domain and bird for the Domain Username and Domain Password Note All of these conditions can be met by running the QuickStart. By default, the Web Console will use port If this port is already in use, or designated for some other purpose, change the default setting for the port by editing webapp.properties. Start a NuoDB Broker A NuoDB Broker must be running before the Web Console is started. The reason is because the Broker defines a NuoDB domain which the Web Console must connect to when it starts. All NuoDB install packages (with the exception of the TAR.GZ files) will automatically start the Broker as part of the installation. Commands Unix $ java -jar jar/nuoagent.jar --broker & Windows > start java -jar jar\nuoagent.jar --broker & Default Values Domain Name Domain Password domain bird
164 Configuration File default.properties Start the Web Console This step will start the embedded Jetty Web Server. UNIX $ java -jar jar/nuodbwebconsole.jar & WINDOWS > start java -jar jar\nuodbwebconsole.jar & Launch the Web Console Browser URL: Enter the following credentials when prompted to log in: UserName Password domain bird NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved SPACER
165 Start a Database Using the Web Console Before you Begin A NuoDB Broker must be running. The embedded Jetty Web Server must be running. See Start the NuoDB Web Console for more information. Launch the Web Console Browser URL: Enter the following credentials when promoted to log in. Domain Credentials UserName Password domain bird Start a Database 1. Click Start Database. 2. In the Start Database - Naming dialog, specify a name for the database Specify whether to allow it to be non-durable. For this example. do not check this option. Click Next at the bottom of the page.
166 4. The Configure Storage Managers screen appears. Create a Storage Manager 1. On the Start Database-Configure Storage Managers screen, select the host where the process should run. 2. Specify the directory path for the database Archive and optionally for the Journal. The Archive provides data durability; Journalling improves performance and provides a strong guarantee of durability. Note that you can specify command line options from the Other tab. (These are options for the nuodb command, which is used internally to start the storage manager process.) 3. Click Submit, and then Next at the bottom of the page. The Transaction Engine screen appears. Create a Transaction Engine 1. On the Start Database-Configure Transaction Engines screen select the host where you want the new transaction engine to run, and click Next (at the bottom of the page).
167 2. The Start Database - DBA Credentials screen appears. Type the dba for the User name and dbapw Password, and click Next. Note Note that a NuoDB database administrator is distinct from a NuoDB domain administrator. 3. The Start Database: Summary screen appears and displays details for the database, including how to connect to it by means of JDBC. Confirm that you want to create the specified database, and click Finish. After the database is created, click Close to return to the Admin screen of the Console.
168 Note that the Domain Overview - domain dialog now shows two databases (the one created by the QuickStart and the one just created). NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved SPACER
169 Specify Alert Settings Procedure for changing the default settings for the alert messages that are displayed in the home page of NuoDB Console. This task assumes that you have NuoDB Console running. You can edit and delete existing settings, and you can add new settings based on a list of predefined conditions. 1. Click the settings button for the domain, which is at the top of the page. 2. To sort the settings, or add more columns, use the Threshold pulldown menu, which is in the rightmost column of the Settings page. On the Settings page, observe the current settings. To add a new setting, click Add and select an event and specify a message. For example, to generate an alert when a process becomes available, add process.ended to the list. To be notified that a database has been created, add database.create.success to the list. To edit a current setting, select the setting and click Edit. To delete a current setting, select the setting and click Delete. NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved SPACER
170 webapp.properties Defines properties for NuoDB Console. The properties in webapp.properties and default.properties must be consistent. Windows Windows users must have write permissions to the NuoDB directory in order to save changes to the webapp.properties file. See Wri te Permissions in Windows for instructions on granting directory-level write permissions in Windows. Using Property Files Edit the etc\webapp.properties (Windows), etc/webapp.properties (Linux/Mac) file to specify properties, or to specify a different source of properties, for NuoDB Console, which is a web-based application. To specify a different source of properties set the set the system property "properties" to a different file, such as FILE: java -Dproperties=FILE -jar nuodbwebconsole.jar Browser Connections All addresses can optionally include a port number using the syntax host:port. The default port where the web app is to be available is webapp.port = Administrative Account By default the administrative account to use for the initial broker connection is as follows: domain.admin = domain domain.password = bird Typically you would create a new account and credentials for your particular deployment. Properties Listing The following code listing is the text of the webapp.properties file.
171 ## The properties for NuoDB Console. To use a different set of properties # set the system property "properties" to a different file: ## java -Dproperties=FILE nuodbwebconsole.jar # # The default values for each property are shown in this file. All addresses # can optionally include a port number using the syntax host:port. # # The port where the web app should be available. By default, this would webapp.port = 8080 # # The.war files for the application content and the service implementation # that together provide the console functionality. A relative path will be # resolved relative to the jar file that uses these. # webapp.appwar = nuowebapp.war webapp.wswar = nuowebservice.war # # The broker to connect through to manage the domain domain.broker = localhost # The administrative account to use for the initial broker connection... in # a typical deployment a new account should be created using NuoDB Manager and # then those credentials should be used here # domain.admin = domain domain.password = bird NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved SPACER
172 Storefront Demo The Storefront demo is a Java application showcasing key benefits of NuoDB v1.1: Use the Simulated User Setup and Node Setup forms to increase the number of customer workloads and NuoDB nodes Multiple Tenancy. Launch multiple stores with the same NuoDB nodes. Click Show DDL and you ll have the scripts to populate and alter your additional databases. Variable Workloads. Dynamically change the mix of OLTP and analytic transactions. Use the Simulated Users form to change the ratio of back office to shopper workloads. You can access the Storefront demo from the Console Home tab. Note NuoDB v1.1 or later must be installed in order to access the Console. More Information Launch the demo Get the source code Simulated User Setup Storefront GUI Elements Multi-Tenancy Adding Addtional Storage Managers and Transactions Engines Adding Muti-Tenancy Databases Using Storefront DDLs in Multi-tenancy Databases To launch the Storefront Demo: Open a browser to The NuoDB Console opens. Toward the bottom right of the page, click Storefront. The Carousel scrolls to the Store Front Demo. Click Open Storefront Demo to launch the demo. The source code for the Storefront Web app is available on GitHub. You can use the source code to modify the app or run against a different database.
173 To access the Storefront web app source files: If the NuoDB Console is not already up, open a browser tab to From the navigation bar, choose Demos, and then in the Storefront panel click GitHub. NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved SPACER
174 Multi-Tenancy
175 Adding Multi-Tenancy Databases To add additional Storefront databases to the schema: Navigate to the Console > Admin tab. In the Domain Overview gadget, click Start Database. The [Start Database] Naming screen appears. 3. Provide a name for your database and click Next. The [Start Database] Configure Storage Managers screen appears. A new database is created by naming it. In this example, we ll name it Storefront2. 4. Choose an archive directory for the database from the list view of available hosts. 5. Provide a path for the archive directory in the Archive Directory textbox, and click Submit. The Storage Manager archive directory is configured. Additional parameters are also configurable from this dialog. To access it again, deselect the Host and select it again. The Configure Storage Manager dialog re-opens. 6.
176 6. Click Next. The Configure Transaction Engines screen appears Select a host for the TE from the list of available hosts, and click Next. The DBA Credentials screen appears. Provide DBA credentials for new database, select Confirm tat you want to create this database, and click Finish. The database is created. 9. Repeat steps 1-8 to provision each additional database. NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved SPACER
177 Adding Storage Managers and Transactions Engines To add Transaction Engines or Storage Manager: 1. Open a browser window to then click the Admin tab, and in the Domain Overview gadget, click the Databases li nk. If you are not logged in the Domain, you will land on at the Admin/Login dialog, and must login to the domain and then navigate to the Admin tab. Provide the domain credentials for the Storefront Demo (you most likely installed it to the quickstart domain): Domain_Username: quickstart Domain Password: quickstart The Admin > Databases screen opens. 2. In the Databases, click Storefront. The Database: Storefront screen appears In the Database section, click Add Process The Add Process dialog appears.
178 4. In the General tab, choose: Database: Storefront [ or other multi-tenancy DB ] Host: Select a Host from the list Type: Transaction Engine or Storage Manager Commit Mode: Local or Remote 5. Click Submit to add the process (TE or SM) to the database. 6. Repeat step 3-4 for each additional TE or SM you want to add. NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved SPACER
179 Using Storefront DDLs in Multi-Tenancy DBs To use the Storefront DDLs in newly created (multi-tenancy) databases: This procedure assumes additional databases have been created for the Storefront Demo. If they haven t, follow the steps in To add additional databases to the Storefront schema, to do so. 1. Open the Storefront Demo and NuoDB Console ( in separate browser windows. Note The Console opens to the Explorer tab. 2. In the Storefront Demo tab, click the Control Panel button to make sure you re in the right place, and then click the DDL button. 3. The Storefront DDL textbox opens. Select and copy a DDL statement you would like to use, then switch browser tabs to the NuoDB Console > Explorer window. 4. Move to the Console > Explorer browser tab, and in the Database Hierarchy, double-click the Storefront2 database or whatever you named it in this example, Storefront2 is new database), and click Login. User: StorefrontUser2 Password: StorefrontUser2
180 The Storefront2 Schemas and Security directories become visible in the Database Hierarchy tree. 5. In Database Hierarchy, click New and paste a Storefront DDL statement into the Query window. Note Unless specifically configured otherwise, SQL statements must end with a semicolon.
181 6. Click Execute to run the query. If you are not already logged into the Domain, you will be prompted to do so before the query can run. In this example we have installed the Storefront Demo in the quickstart domain. Domain_Username: quickstart Domain Password: quickstart 7. Repeat steps 3, 5 and 6 for each DDL statement. NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved SPACER
182 Simulated User Setup Use the Simulated Users form to change the ratio of back office to shopper workloads. 1. Click the Load 900 Real Products (with pictures) button -or- Generate 5000 random products (no pictures) to load products into the database. Product data is loaded into the database. 2. Add users in the #Users column and click Update Users. NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved SPACER
183 Storefront Status Bar Control Panel The control panel is the home page of the demo where the Simulated User Setup Shopping Site Opens the Storefront shopping site. Items can be browsed, reviewed, added to the shopping cart, quantities adjusted, and cart checking out (credit card information is not collected or processed in this demo). Service calls/sec. Service Calls per Second Graphical representation of the number of service methods being called per second. Click the + button to view a graphical breakdown by service method: addproduct addprodcutreview addtocart checkout getcategories getcustomercart getorcreatecustomer getproductdetails getproducts getstroefrontstats updatecart Service Processing Time Service processing time is the amount of time it takes to execute the service method on the web server side. This includes database transaction time (with network latency) plus any business logic processing time on the web server side. Store items in carts Four graphical displays: Total Items in Shopping Carts Items Purchased per Second Active Customer Sessions (20 min. expiry) Reviews per Second Simulator active users Two simulations are presented: Active Simulated Users Simulated Steps per Second Click the +/- button to toggle the view between aggregate and segmented views. Segmented Views The segments displayed for each view are as follows: Active Simulated Users Back office: Analyst Customer: Browsing & reviews Customer: Fast purchaser [ needs definition ] Customer: Instant purchaser [ needs definition ] Customer: Slow purchaser
184 Simulated Steps per Second ADMIN_RUN_REPORT BROWSE BROWSE_CATEGORY BROWSE_NEXT_PAGE BROWSE_SORT CART_CHECKOUT CART_UPDATE CART_VIEW PRODUCT_ADD_REVIEW PRODUCTPADD_TO_CART PRODUCT_VIEW_DETAILS NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved SPACER
185 3rd Party Utilities SQL Workbench/J SQuirreL Universal SQL DbVisualizer for NuoDB JDBC Driver NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved SPACER
186 DbVisualizer for NuoDB JDBC Driver NuoDB has full JDBC support which allows you to use 3rd party tools such as DbVisualizer with minimal configuration. Configure DbVisualizer with the NuoDB JDBC driver 1. Download and install DbVisualizer from their website: 2. Start DB Visualizer if it isn't already running and cancel out of the New Connection Wizard if it starts. 3. Select: Tools \ Driver Manager \ Create New Driver (icon) 4. Specify the following fields: Name NuoDB jdbc:com.nuodb://localhost/[database_name] URL Format -orjdbc:com.nuodb://localhost/[database_name]?schema= [schema_name] Example: jdbc:com.nuodb://localhost/test?schema=user Driver Class Automatically entered when setting the Driver File Path. 5. Set the Driver File Path by selecting the User Specified Tab \ folder (icon) and browse to the install location of the NuoDB JDBC Driver #Driver Location: Linux \ Mac $ /opt/nuodb/jar/nuodbjdbc.jar Windows > C:\Program Files\NuoDB\jar\nuodbjdbc.jar Configure DbVisualizer connection to your NuoDB Database 1. Select Database \ Create a Database Connection 2. Enter a Connection Alias, such as the database name
187 3. Click Next 4. Select the NuoDB Driver from the drivers dropdown list. 5. Click Next 6. Specify the following fields: Database URL Database UserID Database Password Auto Commit Save Database Password Permission Mode jdbc:com.nuodb://localhost/<database name> <your UID> <your PWD> Accept default Accept default Accept default 7. Click Finish DbVisualizer should now automatically connect to your NuoDB Database. If DbVisualizer fails to connect you should receive an error in the Connection Message field at the bottom of the interface with details regarding the failure. NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved SPACER
188 OLD_DbVisualizer for NuoDB JDBC Driver How to configure DbVisualizer for NuoDB JDBC driver Since NuoDB has full JDBC support, you can use tools such as DbVisualizer with minimal configuration. The most important task is to configure DbVisualizer to use the NuoDB JDBC driver Download DbVisualizer from their website: Copy the NuoDB JDBC driver into the DbVisualizer installation directory. Setup DbVisualizer to use the NuoDB driver a. b. Open the Driver Manager Specify the following fields: URL Format (the name of the database) jdbc:com.nuodb://localhost/[database_name] -orjdbc:com.nuodb://localhost/[database_name]?schema=[schema_name] Example: jdbc:com.nuodb://localhost/mydatabase?schema=myschema Driver Class com.nuodb.jdbc.driver 4. Open a database by creating a connection using the DbVisualizer connection wizard: 5. Database > Create Database Connection Follow the steps in the wizard. Choose the NuoDB driver
189 6. Connect to the database using the connection form: 7. Browse/Interact with the NuoDB database as you like.
190 NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved SPACER
191 SQL Workbench/J How to use SQL Workbench/J with NuoDB 1. To use the SQL Workbench/J Universal SQL client with NuoDB, download and configure SQL Workbench/J a. Download SQL Workbench/J from: b. Install SQL Workbench/J according to the instructions on the website. Note that the steps differ according to platform. 2. Add a driver using the Manage Drivers dialog and configure as required with the following settings as needed: Name Example URL Website URL Extra Class Path NuoDB jdbc:com.nuodb://localhost/test %NUODB_ROOT%\lib\nuodbjdbc.jar (Windows) $NUODB_ROOT/lib/nuodbjdbc.jar (UNIX) Class Name com.nuodb.jdbc.driver 3. On the Select Connection Profile dialog, use the settings shown: (this example shows UNIX pathname for the URL) 4. Start working with your database. You can browse tables, insert rows, and edit values. NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved SPACER
192 SQuirreL Universal SQL How to use SQuirreL tool For Java users NuoDB supports both a Hibernate dialect and sample application that makes use of Hibernate and the NuoDB Hibernate dialect. 1. To use the SQuirreL Universal SQL client with NuoDB, download and configure SQuirreL a. Download SQuirreL from: b. Install SQuirreL by running the following command java -jar <downloaded install file> c. Choose the Base, Standard and Optional Plugin Data Import packs Run SQuirreL using the script that the installer created (typically as a menu or desktop shortcut) Click the Drivers tab, add a new driver, and configure with the following settings: Name Example URL Website URL Extra Class Path NuoDB jdbc:com.nuodb://localhost/test %NUODB_ROOT%\jar\nuodbjdbc.jar (Windows) $NUODB_ROOT/jar/nuodbjdbc.jar (UNIX) Class Name com.nuodb.jdbc.driver Create an Alias for NuoDB by clicking the Aliases tab and then clicking Create New Alias. Fill out the Add New Alias dialog. Select Auto logon and Connect at Startup The following settings are specific to NuoDB: > Name Driver URL NuoDB NuoDB jdbc.com.nuodb://<host> NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved SPACER
193 SQL Reference The SQL language is central to using NuoDB. All applications that communicate with an instance of NuoDB do so by sending SQL statements to the server, regardless of the user interface of the application. Summary of SQL Supported by NuoDB SQL Reference Pages SQL Language Elements and Transactions NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved SPACER
194 Summary of SQL Supported by NuoDB SQL Keyword WikiDoc page Supported - Mathmatical Operators Supported!= Numeric comparison operators Supported * Mathmatical Operators Supported / Mathmatical Operators Supported % Mathmatical Operators Supported + Mathmatical Operators Supported < Comparison Operators Supported < Numeric comparison operators Supported <= Comparison Operators Supported <= Numeric comparison operators Supported = Comparison Operators Supported = Numeric comparison operators Supported > Comparison Operators Supported > Numeric comparison operators Supported >= Comparison Operators Supported >= Numeric comparison operators Supported String Concatenation Supported ALL Compliance with SQL Standard Supported ALTER DOMAIN SQL Reference Pages Supported ALTER SEQUENCE SQL Reference Pages Supported ALTER TABLE SQL Reference Pages Supported ALTER TRIGGER SQL Reference Pages Supported ALTER USER SQL Reference Pages Supported AND Logical Operators Supported AS Compliance with SQL Standard; SELECT Supported AUTOCOMMIT Transactions and Isolation Levels Supported AUTOCOMMIT SQL Reference Pages Supported AVG Compliance with SQL Standard Supported Basic date and time Compliance wth SQL Standard Basic flagging Compliance wth SQL Standard Not supported Basic information schema Compliance wth SQL Standard Supported Basic integrity constraints Compliance wth SQL Standard Basic joined table Compliance wth SQL Standard Supported
195 Basic predicates and search conditions Compliance wth SQL Standard Paritally implemented Basic query expressions Compliance wth SQL Standard Paritally implemented Basic Query Specification Compliance wth SQL Standard Not supported Basic schema manipulation Compliance wth SQL Standard Not yet implemented Basic SQL-invoked ruotines Compliance wth SQL Standard Not supported BETWEEN Comparison Operators Supported BETWEEN Compliance with SQL Standard Supported BIGINT BINARY BINARY LARGE OBJECT BINARY VARYING Standard SQL Datatype Keywords Supported Standard SQL Datatype Keywords Supported Standard SQL Datatype Keywords Supported Standard SQL Datatype Keywords Supported Supported Supported Supported Supported BlobRef() Undocumented function Supported BOOLEAN Standard SQL Datatype Keywords Supported Supported CALL Compliance wth SQL Standard Not supported CASE Conditional Expressions Supported CASE (expression) CASE (searched) CASE (simple) Standard SQL Datatype Keywords Supported Standard SQL Datatype Keywords Supported Standard SQL Datatype Keywords Supported Supported Supported Supported CAST Value Expressions Supported CHAR_LENGTH() CHAR_LENGTH Function Supported CHARACTER CHARACTER LARGE OBJECT CHARACTER VARYING Standard SQL Datatype Keywords Supported Standard SQL Datatype Keywords Supported Standard SQL Datatype Keywords Supported Supported Supported Supported CHARACTER_LENGTH USING OCTETS Compliance wth SQL Standard Supported CHECK Compliance with SQL Standard Supported CHECK_CONSTRAINTS Compliance wth SQL Standard Not supported CLOSE Compliance wth SQL Standard Not supported
196 CLOSE Compliance wth SQL Standard Not supported COALESCE Conditional Expressions Supported COLUMNS VIEW Compliance with SQL Standard Supported COMMIT Compliance with SQL Standard Supported COMMIT SQL Reference Pages Supported CONSISTENT_READ Compliance wth SQL Standard Same as SERIALIZABLE COUNT Compliance with SQL Standard Supported CREATE DATABASE SQL Reference Pages Supported CREATE DOMAIN SQL Reference Pages Supported CREATE INDEX SQL Reference Pages Supported CREATE PROCEDURE SQL Reference Pages Supported CREATE ROLE SQL Reference Pages Supported CREATE SCHEMA SQL Reference Pages Supported CREATE SEQUENCE SQL Reference Pages Supported CREATE TABLE Compliance with SQL Standard Supported CREATE TABLE SQL Reference Pages Supported CREATE TRIGGER SQL Reference Pages Supported CREATE TYPE Compliance wth SQL Standard Not supported CREATE USER SQL Reference Pages Supported CREATE VIEW SQL Reference Pages Supported CURRENT_DATE Compliance wth SQL Standard Supported w/ alternative syntax CURRENT_SCHEMA clause in SELECT CURRENT_USER clause in SELECT CURSOR Compliance wth SQL Standard Not supported DATE DECIMAL Standard SQL Datatype Keywords Supported Standard SQL Datatype Keywords Supported Supported Supported DECLARE CURSOR Compliance wth SQL Standard Not supported Defaults (explict) Compliance wth SQL Standard Not yet implemented DEFAULT CREATE DOMAIN Supported DEFAULT GRANT Supported DEFAULT INSERT Supported DELETE SQL Reference Pages Supported DELETE (positioned) Compliance wth SQL Standard Not supported DELETE (searched)
197 DISTINCT Compliance with SQL Standard; clause in SELECT Supported DOUBLE Numeric Types Supported DOUBLE PRECISION DOUBLE PRECISION Standard SQL Datatype Keywords Supported Standard SQL Datatype Keywords Supported Supported Supported DROP DATABASE SQL Reference Pages Supported DROP DOMAIN SQL Reference Pages Supported DROP INDEX SQL Reference Pages Supported DROP PROCEDURE SQL Reference Pages Supported DROP ROLE SQL Reference Pages Supported DROP SCHEMA SQL Reference Pages Supported DROP SEQUENCE SQL Reference Pages Supported DROP TABLE Compliance with SQL Standard Supported DROP TABLE SQL Reference Pages Supported DROP TRIGGER SQL Reference Pages Supported DROP USER SQL Reference Pages Supported DROP VIEW Compliance with SQL Standard Supported DROP VIEW SQL Reference Pages Supported EXCEPT DISTINCT Compliance wth SQL Standard Not supported EXCEPT VIEW Compliance wth SQL Standard Not supported EXISTS Compliance with SQL Standard Supported EXPLAIN SQL Reference Pages Supported FETCH Compliance wth SQL Standard; SELECT Not supported FOREIGN KEY Compliance wth SQL Standard Ignored (NO ACTION default) FOR UPDATE clause in SELECT FROM Compliance with SQL Standard Supported FROM DATE Date, Time, and TimeStamp Conversions Supported FROM TIME Date, Time, and TimeStamp Conversions Supported FROM TIMESTAMP Date, Time, and TimeStamp Conversions Supported FULL [OUTER] JOIN SELECT Not yet implemented Function invocation Compliance wth SQL Standard Not supported GENERATED ALWAYS AS IDENTITY CREATE SEQUENCE Supported GENERATED ALWAYS AS IDENTITY CREATE TABLE Supported GENERATED BY DEFAULT AS IDENTITY CREATE TABLE Supported
198 GetCommitMode() GetTransactionEndEvent() GetTransactionStartEvent() GRANT Compliance with SQL Standard Partially implemented GRANT SQL Reference Pages Supported GRANT OPTION Compliance with SQL Standard Supported GROUP BY Compliance with SQL Standard; SELECT Supported GROUP BY in queries with grouped views Compliance wth SQL Standard Not yet implemented GROUP BY subqueries Compliance wth SQL Standard Supported HAVING Compliance with SQL Standard; SELECT Supported HAVING in queries with grouped views Compliance wth SQL Standard Not yet implemented HAVING subqueries Compliance wth SQL Standard Supported IN Conditional Expressions Supported IN Compliance with SQL Standard Supported INNER Compliance with SQL Standard Supported INNER JOIN Compliance with SQL Standard Supported INSERT Compliance with SQL Standard Supported INSERT SQL Reference Pages Supported LEFT OUTER JOIN Compliance with SQL Standard; SELECT Supported LIKE Compliance with SQL Standard Supported LIMIT clause in SELECT LOCAL TIME Compliance wth SQL Standard Not supported LOCAL TIMESTAMP Compliance wth SQL Standard Supported w/ alternative syntax LOWER() Functions Supported MAX Compliance with SQL Standard Supported MIN Compliance with SQL Standard Supported MOD() FUNCTIONS Supported Multiple tables in queries w/grouped views Compliance wth SQL Standard Not yet implemented NOT Logical Operators Supported NOT NULL Compliance with SQL Standard Supported NOW Date and Time Functions Supported NULL Compliance with SQL Standard Supported NULLIF Conditional Expressions Supported NUMERIC Standard SQL Datatype Keywords Supported Supported
199 nuodb-mirgration dump NuoDB Migrator nuosql nuodb-mirgration load NuoDB Migrator nuosql OFFSET clause in SELECT OPEN Compliance wth SQL Standard Not supported ORDER BY Compliance with SQL Standard; SELECT Supported ORDER BY Logical Operators Supported ORDER BY Compliance with SQL Standard Supported PARAMETERS view Compliance wth SQL Standard Not supported POSITION Compliance wth SQL Standard Not supported POWER() FUNCTIONS Supported PRIMARY KEY constraints Compliance with SQL Standard Supported READ ONLY Compliance wth SQL Standard Supported READ WRITER Compliance wth SQL Standard Supported REFERENCES Compliance wth SQL Standard Not supported REFERENTIAL_CONSTRAINTS VIEW Compliance wth SQL Standard Not supported RELEASE SQL Reference Pages Supported REPLACE SQL Reference Pages Supported RESTRICT Compliance with SQL Standard Not supported RETURN Compliance wth SQL Standard Not supported REVOKE Compliance with SQL Standard Supported REVOKE SQL Reference Pages Supported RIGHT JOIN SELECT Not yet implemented ROLLBACK Compliance with SQL Standard Supported ROLLBACK SQL Reference Pages Supported ROUTINES view Compliance wth SQL Standard Not supported SAVEPOINT SQL Reference Pages Supported SchemaName() Undocumented function Supported SELECT SQL Reference Pages Supported SELECT Compliance with SQL Standard Supported SELECT Compliance wth SQL Standard Supported, (single row, GROUP BY, HAVING, grouped views) SELECT (single row) SELECT DISTINCT Compliance with SQL Standard Supported SET SQL Reference Pages Supported SET Compliance wth SQL Standard Supported functions supported in queries with grouped views)
200 SET TRANSACTION Compliance with SQL Standard Supported SHOW SQL Reference Pages Supported SMALLINT Standard SQL Datatype Keywords Supported Supported SQL_FEATURES view Compliance wth SQL Standard Not supported SQL_LANGUAGES view Compliance wth SQL Standard Not supported SQL_SIZING view Compliance wth SQL Standard Not supported SQLSTATE Compliance wth SQL Standard Not supported SQRT() FUNCTIONS Supported START TRANSACTION SQL Reference Pages Supported Stored Procedures Not yet implemented STRING String Types SUBSTR() SUBSTR Function Supported SUBSTRING() Compliance with SQL Standard Supported SUM Compliance with SQL Standard Supported TABLE_CONSTRAINTS VIEW Compliance with SQL Standard Supported TABLES VIEW Compliance with SQL Standard Supported TIME Compliance wth SQL Standard Supported TIMESTAMP Standard SQL Datatype Keywords Supported Supported TODAY Date and Time Functions Supported TOMORROW Date and Time Functions Supported TRIM Compliance wth SQL Standard Not supported TRUNCATE SQL Reference Pages Supported TRUNCATE TABLE TRUNCATE TABLE UDF with no overloading Compliance wth SQL Standard Not supported UNION DISTINCT Compliance with SQL Standard DISTINCT is ignored UNION VIEW Compliance wth SQL Standard Not supported UPDATE Compliance with SQL Standard table level supported UPDATE Compliance with SQL Standard column level not supported UPDATE SQL Reference Pages Supported UPDATE (positioned) Compliance wth SQL Standard Not supported UPDATE (searched) UPGRADE SQL Reference Pages Supported UPPER() FUNCTIONS Supported USE SQL Reference Pages Supported
201 User defined stored procedures Compliance wth SQL Standard Not supported USER_DEFINED_TYPES Compliance wth SQL Standard Not supported VIEW Compliance with SQL Standard Supported WHERE Supported WHERE in queries with grouped views Compliance wth SQL Standard Not yet implemented WITH GRANT OPTION Compliance wth SQL Standard Not yet implemented WITH HOLD cursors Compliance wth SQL Standard Not supported YESTERDAY Date and Time Functions Supported NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved SPACER
202 SQL Reference Pages NuoDB SQL Statements ALTER DOMAIN ALTER SEQUENCE ALTER TABLE ALTER TRIGGER ALTER USER AUTOCOMMIT COMMIT CREATE DATABASE CREATE DOMAIN CREATE INDEX CREATE PROCEDURE CREATE ROLE CREATE SCHEMA CREATE SEQUENCE CREATE TABLE CREATE TRIGGER CREATE USER CREATE VIEW DELETE DROP DATABASE DROP DOMAIN DROP INDEX DROP PROCEDURE DROP ROLE DROP SCHEMA DROP SEQUENCE DROP TABLE DROP TRIGGER DROP USER DROP VIEW EXPLAIN GRANT
203 INSERT RELEASE REPLACE REVOKE ROLLBACK SAVEPOINT SELECT SET SHOW START TRANSACTION TRUNCATE TABLE UPDATE UPGRADE USE NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved SPACER
204 ALTER DOMAIN Syntax ALTER DOMAIN name { SET DEFAULT expression DROP DEFAULT } ALTER DOMAIN name { SET DROP } NOT NULL ALTER DOMAIN name ADD domain_constraint [ NOT VALID ] ALTER DOMAIN name DROP CONSTRAINT constraint_name [ RESTRICT CASCADE ] Description ALTER DOMAIN changes the definition of an existing domain (not yet implemented). You must own the domain to use ALTER DOMAIN. NuoDB supports the following forms: SET DROP DEFAULT SET DROP NOT NULL ADD domain_constraint [ NOT VALID ] You can suppress the checks by adding the new constraint (domai n_constraint) using the NOT VALID option. Later you can make it valid using ALTER DOMAIN... VALIDATE CONSTRAINT. DROP CONSTRAINT Sets or removes the default value for a domain. Defaults only apply to subsequent INSERT commands; they do not affect rows that are already in a table using the domain. Changes whether or not a domain is specified to allow NULL values or to reject NULL values. You can only use SET NOT NULL if the columns using the domain contain no null values. Adds a new constraint to a domain using the same syntax as CREATE DOMAIN. NuoDB always checks newly inserted or updated rows against all constraints, even those marked NOT VALID. NOT VALID is only accepted for CHECK constraints. Drops constraints on a domain. Parameters name domain_constraint constraint_name Name (possibly schema-qualified) of an existing domain to alter New domain constraint for the domain. Name of an existing constraint to drop. Examples # To add a NOT NULL constraint to a domain ALTER DOMAIN zipcode SET NOT NULL;
205 # To remove a NOT NULL constraint from a domain ALTER DOMAIN zipcode DROP NOT NULL; # To add a check constraint to a domain ALTER DOMAIN zipcode ADD CONSTRAINT zipchk CHECK (char_length(value) = 5); # To remove a check constraint from a domain ALTER DOMAIN zipcode DROP CONSTRAINT zipchk; NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved SPACER
206 ALTER SEQUENCE Synopsis ALTER SEQUENCE sequence START [WITH] value Parameters sequence value Name of an existing sequence to alter New starting value for sequence Description ALTER SEQUENCE changes the starting value of an existing sequence. Refer to CREATE SEQUENCE for a further description of valid arguments. Examples # To change the starting value for an existing sequence ALTER SEQUENCE nextcustomer START WITH 300; NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved SPACER
207 ALTER TABLE Syntax ALTER TABLE table_name ADD PRIMARY KEY (column_name) ALTER TABLE table_name ADD COLUMN column_namecolumn_type ALTER TABLE table_name DROP COLUMN column_name Description ALTER TABLE changes the definition of an existing table. Primary Key Use ALTER TABLE to add a new PRIMARY KEY to a table. If PRIMARY KEY is specified, and the columns are not already marked NOT NULL, then ALTER TABLE attempts to do set them to NOT NULL. Check constraints, unique constraints, and not null constraints are enforced, but referential constraints (FOREIGN KEY) are not. Add Column, Drop Column ALTER TABLE DROP COLUMN does not drop constraints. ALTER TABLE DROP CONSTRAINT is not supported. You can also use ALTER TABLE to add and drop columns, but see the following note. Important You can also use ALTER TABLE table_name DROP COLUMN column_name to drop a column, but only if you drop all constraints that include the column. Otherwise the column is dropped but the constraints are not dropped, and further operations on the table fail. You cannot drop a column that is part of an index unless the index has been removed. Parameters table_name column_name Name (possibly schema-qualified) of an existing table to alter. Name of a new or existing column. NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved SPACER
208 ALTER TRIGGER Syntax ALTER TRIGGER trigger_name FOR table_name [ ACTIVE ] [ INACTIVE ] Parameters trigger_name table_name Name of an existing trigger to alter. Name of the table on which this trigger acts. Description Use ALTER TRIGGER to specify whether a trigger should be activated or not. You must own the table to enable or disable triggers associated with it. ACTIVE enables a trigger, and INACTIVE disables a trigger. Refer to CREATE TRIGGER for a further description of valid arguments. Example # Disable a trigger ALTER TRIGGER customer_audit_trigger FOR customer INACTIVE;
209 # Create two tables # CREATE TABLE t1 (f1 STRING); CREATE TABLE t2 (f1 STRING); # Create a trigger for each table # CREATE TRIGGER tr1 FOR t1 ACTIVE BEFORE INSERT AS INSERT INTO t2 VALUES ('tr1'); END_TRIGGER; CREATE TRIGGER tr2 FOR t1 INACTIVE BEFORE INSERT AS INSERT INTO t2 VALUES ('tr2'); END_TRIGGER; SELECT * FROM system.triggers WHERE TABLENAME = 't1'; INSERT INTO t1 VALUES (1); SELECT * FROM t2; # Alter both triggers ALTER TRIGGER tr1 FOR t1 INACTIVE; ALTER TRIGGER tr2 FOR t1 ACTIVE; COMMIT; SELECT * FROM SYSTEM.TRIGGERS WHERE TABLENAME = 't1'; INSERT INTO t1 VALUES (1); SELECT * FROM t2; ## ## ERROR CONDITIONS # ALTER TRIGGER nosuchtrigger FOR t1 INACTIVE; ALTER TRIGGER tr1 FOR nosuchtable INACTIVE; NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved SPACER
210 ALTER USER Syntax ALTER USER username PASSWORD password Description Use ALTER USER to change the attributes of a NuoDB user account. Note Use CREATE USER to add new users, and DROP USER to remove a user. Parameters username password Name of the user whose attributes are to be altered. The new password to be used for this account. Example ALTER USER davide PASSWORD 'hu8jmn3'; NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved SPACER
211 AUTOCOMMIT Synopsis AUTOCOMMIT [ ON OFF ] Description AUTOCOMMIT is enabled by default. If AUTOCOMMIT is specified as ON, the changes made by each statement are automatically committed as soon as the statement is run. To enable grouping of multiple data manipulation SQL commands into a single atomic transaction, specify AUTOCOMMIT OFF instead. When AUTOCOMMIT is ON, each statement causes NuoDB to start a new transaction and commit the transaction when the statement completes. If your application requires that several changes succeed or fail as a group, you must explicitly set AUTOCOMMIT OFF; by default it is ON. For example, if the application requires that a deposit in one account matches a withdrawal from another account, it should set AUTOCOMMIT OFF or risk inconsistent results. Specifying AUTOCOMMIT as OFF can improve performance (there is a cost to starting and committing transactions). See also, Using AUTOCOMMIT. Examples # The first set of transactions are committed because AUTOCOMMIT is ON. SHOW AUTOCOMMIT; Autocommit is on CREATE TABLE t (N int); INSERT INTO t VALUES (1); SELECT * FROM t; N -- 1
212 # Setting AUTOCOMMIT OFF after the first set of transactions means that the second set of transactions are not committed. AUTOCOMMIT OFF; INSERT INTO t VALUES (2); SELECT * FROM t; N # ROLLBACK discards the second insertion (there is only one row in the table after ROLLBACK). ROLLBACK; SELECT * FROM t; N -- 1 # You can explicitly COMMIT the current transaction while AUTOCOMMIT is OFF. INSERT INTO t VALUES (2) COMMIT; SELECT * FROM t; N ROLLBACK; SELECT * FROM t; N NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved SPACER
213 COMMIT Syntax COMMIT [ WORK ] Parameters WORK is an optional keyword that has no effect. Description COMMIT commits the current transaction. All changes made by the transaction become visible to others and are guaranteed to be durable if a crash occurs. Use ROLLBACK to stop and undo a transaction. You can rollback to a savepoint, but you cannot commit a savepoint. A COMMIT implicitly releases all named savepoints. See SAVEPOINT for more information. Examples # To make all changes permanent COMMIT WORK; NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved SPACER
214 CREATE DATABASE Use NuoDB Console or NuoDB Manager to create and drop databases; you cannot use the NuoDB SQL client for this purpose. NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved SPACER
215 CREATE DOMAIN Syntax CREATE DOMAIN domain_name [AS] data_type [ [NOT] NULL ] [ DEFAULT default_value ] Parameters domain_name data_type DEFAULT default_value Name (optionally schema-qualified) of a domain to be created. Underlying data type of the domain. The DEFAULT clause specifies a default value for columns of the domain data type. The value is any variable-free expression (but subselects are not allowed). The data type of the default expression must match the data type of the domain. NuoDB uses the default expression in any insert operation that does not specify a value for the column. If there is no default for a domain, then the default is NULL. Note If a default value is specified for a particular column, it overrides any default associated with the domain. In turn, the domain default overrides any default value associated with the underlying data type. Description Creates a SQL domain. (Not to be confused with a NuoDB domain. For the difference, see the Glossary.) Use CREATE DOMAIN to register a new data domain for use in the current database. The user who defines a domain becomes its owner. Note Note that a NuoDB SQL domain is distinct from a NuoDB domain. See the Glossary. Usage Domains are useful for specifying as an abstraction common columns between tables into a single location for maintenance. Examples # Create two domains that are used in the flight example. # CREATE DOMAIN airport_code string; CREATE DOMAIN airline_code string; CREATE DOMAIN Identifier number;
216 # Create and use a domain for product names. # CREATE DOMAIN name_type char(50) DEFAULT 'NuoDB'; CREATE TABLE company (name name_type, product name_type); INSERT INTO company (product) VALUES ('one'),('two'); SELECT * FROM company; name product 'NuoDB' one 'NuoDB' two NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved SPACER
217 CREATE INDEX Syntax CREATE [ UNIQUE ] INDEX index_name ON table ( column [,...] ) Parameters index_name table UNIQUE column Name of the index to be created. No schema name can be included here; the index is always created in the same schema as its parent table. Name (optionally schema-qualified) of the table to be indexed. Causes the system to check for duplicate values in the table when the index is created (if data already exist) and each time data is added. Attempts to insert or update data which would result in duplicate entries generate an error. Name of a column of the table. Description CREATE INDEX constructs an index index_name on the specified table. NuoDB provides B-tree indexes. Use DROP INDEX to remove an index. Examples # Define an index based on four columns of the flights table. # CREATE INDEX flt_idx ON flights (origin, destination, flight_date, scheduled_departure); NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved SPACER
218 CREATE PROCEDURE Return the exact string to use to recreate a stored procedure (Not yet implemented) NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved SPACER
219 CREATE ROLE Syntax CREATE ROLE name Description A user gains privileges by assuming one or more roles, as permitted by the DBA. CREATE ROLE adds a new role to a NuoDB database. A role is an entity that can own database objects and have database privileges. It is recommended that you create roles with privileges and assign roles to users, rather than assign privileges directly to users. You must be a database owner to use the CREATE ROLE command. Parameters name Name of the new role. Notes To change the attributes of a role, use DROP ROLE to remove a role and create a new one. The recommended approach to add and remove members of roles that are being used as groups is to use GRANT and REVOKE. Example # Create a role for data base administrator. # CREATE ROLE dba; NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved SPACER
220 CREATE SCHEMA Syntax CREATE SCHEMA [schemaname] Parameters schemaname Name of a schema to be created. If not specified, by default the name is USER. Description CREATE SCHEMA enters a new schema into the current database. The schema name must be distinct from the name of any existing schema in the current database. If you create a table, view, domain, or sequence, and you wish to use the current schema you do not have to specify the schema explicitly. A schema is essentially a namespace; it contains named objects (tables, data types, functions, and operators) whose names may duplicate those of other objects existing in other schemas. Named objects are accessed either by qualifying their names with the schema name as a prefix, or by setting a search path that includes the desired schema(s). Unqualified objects are created in the current schema. Notes To create a schema, the you must have CREATE privilege for the current database. Owners of the database bypass this requirement. Schemas may also be created by declaring them with the USE statement. Use DROP SCHEMA to remove a schema. Example # Create a schema # CREATE SCHEMA newschema; NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved SPACER
221 CREATE SEQUENCE Syntax CREATE SEQUENCE seqname [ START WITH value ] Description CREATE SEQUENCE supports a mechanism in the database that creates unique numbers automatically, a mechanism which is called a SEQUENCE in the SQL Standard. To avoid interference among transactions, sequences are outside transaction control. The command enters a new sequence number into the current database starting with a specified value. A sequence is a source of unique values. Examples # Create a sequence called customerupdater starting at 101 # CREATE SEQUENCE customerupdater START WITH 101; # Get the next value for a sequence named customerupdater to use in an INSERT operation. # CREATE TABLE t1 (id integer GENERATED ALWAYS AS IDENTITY(customerUpdater), name string); INSERT INTO t1 (name) VALUES ('me'), ('you'); SELECT * FROM t1; ID NAME me 102 you INSERT INTO t1 (name) VALUES ('him'), ('her'); SELECT * FROM t1; ID NAME me 102 you 103 him 104 her Note: For more information on GENERATED ALWAYS AS IDENTITY, see CREATE TABLE NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved SPACER
222 CREATE TABLE Syntax CREATE TABLE [schema_name.]table_name ( { column_name { data_type domain } [ DEFAULT default_expr ] [ column_constraint [,... ] ] } [,... ] ) where column_constraint is: { GENERATED ALWAYS AS IDENTITY GENERATED BY DEFAULT AS IDENTITY NOT NULL NULL [ CHECK (expression)] REFERENCES reftable [ ( refcolumn ) ] [ ON DELETE action ] } Description CREATE TABLE creates a new, initially empty table in the current database. The table is owned by the user issuing the command. CREATE TABLE also supports CHECK statements over the entire table. If a schema name is specified (for example, CREATE TABLE myschema.mytable...) then the table is created in the specified schema. Otherwise it is created in the default schema. A table cannot have more than columns. (In practice, the effective limit is lower because of record-length constraints). Check constraints, unique constraints, and not null constraints are enforced, but referential constraints (FOREIGN KEY) are not. GENERATED ALWAYS AS IDENTITY clause You can use the GENERATED ALWAYS AS IDENTITY clause to create a sequence for a table when you create it. In this case NuoDB creates a sequence for the table and assigns the next value for the sequence. Dropping the table makes the sequence go away. Note If a column is defined as GENERATED ALWAYS, a value cannot be passed in for that column. You can also specify an identity name, as shown: CREATE TABLE t1 (f1 integer GENERATED ALWAYS AS IDENTITY (i1)); SELECT * FROM system.sequences; SCHEMA SEQUENCENAME AWH I1
223 You can use GENERATED ALWAYS AS IDENTITY to improve performance for inserts and updates. When you specify this clause the database itself is responsible for generating unique values for the column; this makes index operations against the column complete more quickly. In other words, strictly from the performance point of view, it is typically faster to perform inserts and updates against a table whose primary key is GENERATED ALWAYS AS IDENTITY than one whose keys are provided by the client. Note You can specify this clause only when a table is defined. You cannot import a table and then assert that a particular column is unique and should be autogenerated henceforth. Parameters table_name column_name data_type domain DEFAULT default_expr Name (optionally schema-qualified) of the table to be created. Name of a column to be created in the new table. The data type of the column. The data type specifies the length and scale factor for the column. Name of a domain that defines the characteristics of this column The DEFAULT clause assigns a default value for the column. The value expression, default_expr, cannot include a variable, subselect or cross-references to other columns in the current table. The data type of the default expression must be comparable with the data type of the column. For example, the default expression for a numeric value must evaluate to a number, and the default expression for a timestamp must evaluate to a timestamp. The default expression is used in any insert operation that does not specify a value for the column. If there is no default for a column, then the default is NULL, unless the column is constrained to be NOT NULL, in which case a value must be supplied for the column. NOT NULL NULL CHECK (expression) The column is not allowed to contain NULL values. The column is allowed to contain NULL values. This is the default. CHECK clauses specify integrity constraints or tests that must be satisfied by new or updated rows to enable an insert or update operation to succeed. CHECK constraints are satisfied if they resolve to 'true' or 'unknown'. Each constraint must be an expression producing a Boolean result. A condition appearing within a column definition should reference that column's value only, while a condition appearing as a table constraint may reference multiple columns. CHECK expressions cannot contain sub-selects nor refer to variables other than columns of the current row. Example SQL> CREATE TABLE schema1.t1 (f1 INTEGER DEFAULT 123, f2 STRING DEFAULT 'abc'); SQL> SHOW TABLE schema1.t1; Found table T1 in schema SCHEMA1 F1 integer F2 string
224 NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved SPACER
225 CREATE TRIGGER Syntax CREATE TRIGGER name [FOR] table { [ BEFORE AFTER ] event } [ POSITION number ] [ ACTIVE INACTIVE ] AS [ statements ] END_TRIGGER Parameters name table event number statements Name to give the new trigger. This must be distinct from the name of any other trigger for the same table. Name of the table the trigger is for. The operation that causes the trigger to fire. One of INSERT, DELETE or UPDATE. Specifies the order in which a trigger executes on a given table. Definition of actions to perform as part of the trigger. One or more of the following: INSERT UPDATE DELETE IF ( boolean_expression ) statements [ ELSE statements ] END_IF THROW string_expression SELECT does not modify any rows so you can not create SELECT triggers. Use views instead of triggers. ACTIVE enables a trigger, and INACTIVE disables a trigger. Description CREATE TRIGGER enters a new trigger into the current database. A trigger is a database object that is attached to a table. It is fired only when an INSERT, UPDATE or DELETE occurs. You specify the modification action(s) that fire the trigger when it is created. NuoDB automatically executes a batch of SQL code when the trigger is fired. The trigger can be specified to fire before the specified action is attempted, or after the specified action (event) has occurred: Trigger Actuated before the Operation Executes Before an operation means before constraints are checked, as well as before an INSERT, UPDATE or DELETE is attempted. For INSERT and UPDATE operations, the trigger either skips the operation for the current row, or changes the row being inserted. Trigger Actuated after the Operation Executed After the event means after constraints are checked and after the INSERT, UPDATE or DELETE has completed. If the trigger fires after the event, all changes, including the last insertion, update, or deletion, are visible to the trigger.
226 Notes Triggers make use of two special tables: NEW is an alias for a table that contains the data referenced in an INSERT before it is actually committed to the database. OLD is an alias for a table that contains the data in the underlying table referenced in a DELETE before it is actually removed from the database. When an UPDATE is issued both tables are used. More specifically, the new data referenced in the UPDATE statement is contained in the first table, and the data that is being updated is contained in the second table. An UPDATE trigger is used to perform an action after an update is made on a table. Refer to the DROP TRIGGER command for information on how to remove triggers. NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved SPACER
227 CREATE USER Syntax CREATE USER username PASSWORD 'password' Description CREATE USER adds a new user to a NuoDB database. Use DROP USER to remove a user. Use GRANT to grant privileges to users. Parameters username password Name of the user. Sets the user's password. The password can be changed later, using ALTER USER. Example # Create a user with a password # CREATE USER davide PASSWORD 'jw8s0f4'; NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved SPACER
228 CREATE VIEW Syntax CREATE VIEW [schema.]view [ ( column name list ) ] AS SELECT query Parameters view column name list query Name (optionally schema-qualified) of a view to be created. An optional list of names to be used for columns of the view. If specified, these names override the column names that would be based on the SQL query. An SQL query (that is, a SELECT statement) which provides the columns and rows of the view. Description Defines a new view. Note limitations with SELECT. CREATE VIEW defines a view, which is not physically materialized. Instead, a query rewrite rule is automatically generated to support SELECT operations on views. If a schema name is specified (for example, CREATE VIEW myschema.myview...) then the view is created in the specified schema; otherwise it is created in the current schema. The view name can be the same as names for sequences and indexes. It must be distinct from the name of any other view or table. Use DROP VIEW to drop views. To change a view, drop and recreate it. Examples
229 # Create a simple view. SQL> SELECT * FROM t1; ID NAME me 102 you 103 him 104 her SQL> CREATE VIEW viewt1 AS SELECT id FROM t1; SQL> SELECT * FROM viewt1; ID NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved SPACER
230 DELETE Syntax DELETE FROM [schema].table [ WHERE condition ]; Parameters table condition Name (optionally schema-qualified) of an existing table. A selection query that returns the rows to be deleted. Description DELETE removes rows from the specified table as specified by the WHERE clause. If the condition (WHERE clause) is absent, the effect is to delete all rows in the table. The result is a valid, but empty table. Note TRUNCATE TABLE provides a faster mechanism to remove all rows from a table. You must have write access to the table in order to modify it, as well as read access to any table whose values are read in the condition. Examples # Delete any flights that do not leave from, or arrive at, known airports, and also delete flights that are not part of a known airline. # DELETE FROM flights WHERE NOT EXISTS (SELECT airport_code FROM airports a WHERE a.airport_code = destination) OR NOT EXISTS (SELECT airport_code FROM airports a WHERE a.airport_code = origin) OR NOT EXISTS (SELECT airline_code FROM airlines al WHERE al.airline_code = airline_code); NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved SPACER
231 DROP DATABASE Use NuoDB Console to create and drop databases; you cannot use the NuoDB SQL client for this purpose. NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved SPACER
232 DROP DOMAIN Syntax DROP DOMAIN [IF EXISTS] [SCHEMA. ] [ name ] DROP DOMAIN [SCHEMA.] [name ] [IF EXISTS] Description Removes a SQL domain from the database. (Not to be confused with a NuoDB domain. For the difference, see the Glossary.) You must own the domain to drop it. If the domain does not exist, and you specify IF EXISTS, NuoDB does not generate an error. Otherwise, if the domain does not exist, an error is generated. Dropping a domain does not cascade to dropping columns defined in terms of that domain. That is, if any column in any table is defined in terms of the domain specified to be dropped, the definition of that column remains valid and includes all attributes of the dropped domain. This behavior complies with SQL2008. Examples # Drop domain with IF EXISTS condition before specifying the domain DROP DOMAIN IF EXISTS nosuchdomain; # Drop domain with IF EXISTS condition after specifying the domain DROP DOMAIN nosuchdomain IF EXISTS; # Removes the Identifier domain DROP DOMAIN Identifier; NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved SPACER
233 DROP INDEX Syntax DROP INDEX index_name [IF EXISTS] Parameters index_name Name of an index to remove. Description DROP INDEX drops an existing index from the database system. To execute this command you must be the owner of the index. If the index does not exist and you specify IF EXISTS, NuoDB does not generate an error. Otherwise an error is generated if the index does not exist. Refer to CREATE INDEX for information on how to create indexes. Example # Remove the title_idx index DROP INDEX title_idx; NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved SPACER
234 DROP PROCEDURE Remove a specified procedure or function from storage NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved SPACER
235 DROP ROLE Syntax DROP ROLE role_name [ IF EXISTS ] DROP ROLE [ IF EXISTS ] role_name Description Use the DROP ROLE statement to remove a role from the database. When you drop a role, NuoDB revokes it from all users and roles to whom it has been granted and removes it from the database. User sessions in which the role is already enabled are not affected. If the role does not exist and you specify IF EXISTS, NuoDB does not generate an error. Otherwise, if the role does not exist, an error is generated. Examples # Drop the dba role # DROP ROLE dba; # Drop role using IF EXISTS syntax. # Note: the IF EXISTS argument can be placed before or after the the role_name being dropped. # DROP ROLE nosuchrole IF EXISTS; DROP ROLE IF EXISTS nosuchrole; NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved SPACER
236 DROP SCHEMA Syntax DROP SCHEMA name [ CASCADE RESTRICT ] [ IF EXISTS ] DROP SCHEMA [ CASCADE RESTRICT] [IF EXISTS ] name Parameters name CASCADE RESTRICT IF EXISTS Name of a schema. Automatically drop objects (tables, functions, and others) that are contained in the schema. Refuse to drop the schema if it contains any objects. This is the default. If the schema does not exist and you specify IF EXISTS, NuoDB does not generate an error. Otherwise, if the schema does not exist, an error is generated. An empty schema is treated as if it does not exist. Description DROP SCHEMA removes schemas from the database. Refer to the CREATE SCHEMA statement for information on how to create a schema. Examples ## Create table and domain in schema1 ## # CREATE TABLE schema1.t1 (f1 INTEGER); CREATE DOMAIN schema1.d1 INTEGER; # Drop schema1 and all objects contained therein # DROP SCHEMA schema1 CASCADE; ## Drop schema using IF EXISTS to avoid error generation ## # DROP SCHEMA IF EXISTS nosuchschema; DROP SCHEMA nosuchschema IF EXISTS; ## Ensure the schema isn't dropped if it contains any objects ## # DROP SCHEMA schema1 RESTRICT; NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved
237 SPACER
238 DROP SEQUENCE Syntax DROP SEQUENCE [ IF EXISTS ] [SCHEMA. ] sequence_name [IF EXISTS ] Parameters sequence_name IF EXISTS Name (optionally schema-qualified) of a sequence. If the sequence does not exist and you specify IF EXISTS, NuoDB does not generate an error. Otherwise, if the sequence does not exist, an error is generated. Description Use the DROP SEQUENCE statement to remove a sequence from the database. You can also use this statement to restart a sequence by dropping and then re-creating it. Example ## Drop sequence using this IF EXISTS argument ## # Note: IF EXISTS can precede or follow the sequence_name DROP SEQUENCE IF EXISTS nosuchsequence; DROP SEQUENCE nosuchsequence IF EXISTS; ## Drop sequence s1 ## DROP SEQUENCE s1; NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved SPACER
239 DROP TABLE Syntax DROP TABLE [IF EXISTS] [CASCADE RESTRICT] [SCHEMA.] tablename [IF EXISTS] [CASCADE RESTRICT] Parameters tablename CASCADE RESTRICT IF EXISTS Name (optionally schema-qualified) of an existing table to drop. Automatically drop objects that depend on the table (such as views). Refuse to drop the table if there are any dependent objects. This is the default. If the table does not exist and you specify IF EXISTS, NuoDB does not generate an error. Otherwise, if the table does not exist, an error is generated. Description Use the DROP TABLE statement to remove the table and all its data from the database entirely. Only its owner may remove a table. A table may be emptied of rows, but not removed, by using DELETE. You can also use TRUNCATE TABLE. DROP TABLE always removes any indexes, triggers, and constraints that exist for the target table. Examples ## Drop table with error if it does nto exist ## DROP TABLE nosuchtable; ## Error avoidance ## DROP TABLE IF EXISTS nosuchtable; ## Cleanup ## # Drops table and all objects dependent on it DROP SCHEMA schema1 CASCADE; NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved SPACER
240 DROP TRIGGER Syntax DROP TRIGGER trigger_name [ IF EXISTS ] Parameters trigger_name table IF EXISTS Name of an existing trigger. Name (optionally schema-qualified) of a table. If the trigger does not exist, and you specify IF EXISTS, NuoDB does not generate an error. Otherwise, if the trigger does not exist, an error is generated. Description Use the DROP TRIGGER statement to remove a database trigger from the database. The trigger must be in the current schema, or you must have the DROP ANY TRIGGER system privilege. To execute this command the current user must be the owner of the table for which the trigger is defined. Examples ## Avoid error if trigger is nonexistent ## DROP TRIGGER IF EXISTS nosuchtrigger; DROP TRIGGER nosuchtrigger IF EXISTS; ## With error if trigger doesn't exist ## DROP TRIGGER nosuchtrigger; NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved SPACER
241 DROP USER Syntax DROP USER name[ IF EXISTS ] Description Use the DROP USER statement to remove a user from the database. When you drop a user, NuoDB purges all of that user's schema objects from the database. Parameters name IF EXISTS Name of a user. If the user does not exist and you specify IF EXISTS, NuoDB does not generate an error. Otherwise, if the user does not exist, an error is generated. Examples ## Create and then drop user ## CREATE USER jonathan PASSWORD 'jonathan'; DROP USER jonathan; ## Error gemerated if user doesn't exist ## DROP USER nosuchuser; ## No errors ## DROP USER u1 IF EXISTS; NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved SPACER
242 DROP VIEW Syntax DROP VIEW [IF EXISTS] [CASCADE RESTRICT] [SCHEMA.] viewname [IF EXISTS] [CASCADE RESTRICT] Parameters viewname CASCADE RESTRICT IF EXISTS Name (optionally schema-qualified) of an existing view Automatically drop objects that depend on the view (such as other views) Refuse to drop the view if there are any dependent objects. This is the default. If the view does not exist and you specify IF EXISTS, NuoDB does not generate an error. Otherwise, if the view does not exist, an error is generated. Description DROP VIEW drops an existing view from the database. To execute this command you must be the owner of the view. You can change the definition of a view by dropping and re-creating it. Notes Refer to CREATE VIEW for information on how to create views. Examples ## Create table and view, then drop view ## CREATE TABLE t1 (f1 INTEGER); CREATE VIEW v1 AS SELECT f1 FROM t1; DROP VIEW v1; ## Error if view doesn't exist ## DROP VIEW nosuchview; ## No errors if view doesn't exist ## DROP VIEW nosuchview IF EXISTS; NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved
243 SPACER
244 EXPLAIN Syntax EXPLAIN select_statement where select_statement is any syntactically correct SELECT statement. Description Determines whether or not an index is used in processing a SELECT statement. The EXPLAIN statement generates information about how a SELECT query is processed in terms of fields and indexes. Exhaustive means no index is used. Otherwise details about the indexes used are displayed. If an index is not used, the NuoDB SQL client scans the entire table, a process which can affect performance. Examples
245 ## Three examples: no index, query matches index, query deosn't match index ## # ## 1. A simple query (select * from hockey) does not use an index. ## SQL> EXPLAIN SELECT * FROM hockey; Select List Field HOCKEY.HOCKEY.ID (1) Field HOCKEY.HOCKEY.NUMBER (1) Field HOCKEY.HOCKEY.NAME (1) Field HOCKEY.HOCKEY.POSITION (1) Field HOCKEY.HOCKEY.TEAM (1) Exhaustive HOCKEY.HOCKEY (1) SQL> SELECT * FROM hockey WHERE id=25; ID NUMBER NAME POSITION TEAM MAX SUMMIT Fan Bruins ## 2. The select_statement contains a WHERE clause that matches an index, so an index is used. ## SQL> EXPLAIN SELECT * from hockey WHERE id=25; Select List Field HOCKEY.HOCKEY.ID (1) Field HOCKEY.HOCKEY.NUMBER (1) Field HOCKEY.HOCKEY.NAME (1) Field HOCKEY.HOCKEY.POSITION (1) Field HOCKEY.HOCKEY.TEAM (1) Boolean sieve Eql Field HOCKEY.HOCKEY.ID (1) "25" (integer) Inversion HOCKEY.HOCKEY (1) Bitmap index HOCKEY..PRIMARY_KEY "25" (integer) ## 3. WHERE clause does not match index ## SQL> EXPLAIN SELECT * FROM hockey WHERE number <> 20; Select List Field HOCKEY.HOCKEY.ID (1) Field HOCKEY.HOCKEY.NUMBER (1) Field HOCKEY.HOCKEY.NAME (1) Field HOCKEY.HOCKEY.POSITION (1) Field HOCKEY.HOCKEY.TEAM (1) Boolean sieve Neq Field HOCKEY.HOCKEY.NUMBER (1) "20" (integer) Exhaustive HOCKEY.HOCKEY (1) NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved SPACER
246 GRANT Syntax GRANT rolename [,...] TO username DEFAULT GRANT { SELECT INSERT UPDATE DELETE EXECUTE ALTER GRANT ALL [ PRIVILEGES ] } ON [ TABLE ] tablename TO ROLE rolename [,...] GRANT { SELECT INSERT UPDATE DELETE EXECUTE ALTER GRANT ALL [ PRIVILEGES ] } ON [ TABLE ] tablename TO username [,...] Description GRANT defines access. It is recommended that you use the GRANT statement to grant privileges to roles (rather than users) and then assign roles to users. Users can have several roles, each of which, by default, are active or inactive at any point in time. Active roles are the only roles available to a user at a given time. To specify that a user should have a role as active by default, use the DEFAULT keyword when specifying the role. The GRANT command gives specific permissions on an object (table, view, sequence, database, function, procedural language, or schema) to one or more roles. These permissions are added to those already granted, if any. You do not have to grant privileges to the creator of an object, because the creator has all privileges by default. (The creator could, however, choose to revoke some of his own privileges for safety.) Notes Use the REVOKE command to revoke access privileges. Database administrators can access all objects regardless of object privilege settings. To grant privileges to only a few columns, you must create a view having the desired columns and then grant privileges to that view. Examples ## Assign admin role to a new user. By default all privileges are active. ## CREATE ROLE admin; GRANT ALL ON hockey TO ROLE admin; CREATE USER esther PASSWORD 'esther22'; GRANT admin TO esther DEFAULT; ## Grant SELECT privileges to a new user. ## CREATE USER alta PASSWORD 'glenn'; GRANT SELECT ON hockey TO alta;
247 NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved SPACER
248 INSERT Syntax INSERT INTO table [ ( column [,...] ) ] VALUES ( expression [,...] )[, (expression [,...])... SELECT query ] INSERT INTO table DEFAULT VALUES Parameters table Name (optionally schema-qualified) of an existing table. column Name of a column in table. expression A valid expression or value to assign to column. query A valid query. Refer to the SELECT statement for a further description of valid arguments. Description Use the INSERT statement to add rows to a table. INSERT allows you to insert new rows into a table. You can insert a single row at a time or several rows as a result of a query. The columns in the target list may be listed in any order. Each column not present in the target list is inserted using a default value, either a declared DEFAULT value or NULL. NuoDB rejects the new row if a NULL is inserted into a column declared NOT NULL. If the expression for each column is not of the correct data type, automatic type coercion is attempted. DEFAULT Use the DEFAULT keyword to insert a default value that you have defined for a column. Privileges For you to insert rows into a table, you must have the INSERT object privilege on the table. You must have INSERT privilege to a table in order to append to it, as well as SELECT privilege on any table specified in a WHERE clause. Examples
249 ## Add a column for addresses to the tickets table, and insert a value ## ALTER TABLE tickets ADD COLUMN address varchar(30); INSERT INTO tickets (address) VALUES ('703 main street') ## Define a table with a default value for the dayweather column and insert this value to the table. ## SQL> CREATE TABLE days (daynumber bigint GENERATED BY DEFAULT PRIMARY KEY, dayweather string default 'partly cloudy'); SQL> INSERT INTO days (daynumber, dayweather) values (); SQL> INSERT INTO days (daynumber) values (); SQL> INSERT INTO days (dayweather) values ('sunny'); SQL> INSERT INTO days values (); SQL> INSERT INTO days default values; SQL> INSERT INTO days (daynumber, dayweather) values (432, default); SQL> SELECT * FROM days; DAYNUMBER DAYWEATHER partly cloudy 10 partly cloudy 11 sunny 12 partly cloudy 13 partly cloudy 432 partly cloudy NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved SPACER
250 RELEASE Syntax RELEASE SAVEPONT savepoint_name Parameters savepoint_name name of the savepoint Description Releases a savepoint. See SAVEPOINT. Example ## Create and release savepoint ## AUTOCOMMIT off; CREATE TABLE t1 (f1 INTEGER); START TRANSACTION; INSERT INTO t1 VALUES (1); SAVEPOINT s1; INSERT INTO t1 VALUES (2); RELEASE SAVEPOINT s1; SELECT * FROM t1; COMMIT; ## Error generated if savepoint does not exit ## RELEASE SAVEPOINT nosuchsavepoint; NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved SPACER
251 REPLACE Syntax REPLACE [INTO] [SCHEMA.]table_name [ ( column [,...] ) ] VALUES ( expression [,...] ) [, (expression [,...]) SELECT query Parameters table_name Name (optionally schema-qualified) of an existing table. column Name of a column in table_name. Must include the primary key if replacing values in an existing row. expression query A valid expression or value to replace the current value. A valid query. Refer to the SELECT statement for a description of valid arguments. Description Replaces values in a table with new values. Use REPLACE to update or replace values in a table. If you specify a value with a primary key NuoDB attempts to update an existing row. If the row does not exist, the replacement values are inserted as a new row. (Primary keys are always NOT NULL.) You can replace a single row at a time. The columns in the target list may be specified in any order. If the expression for each column is not of the correct data type, automatic type coercion is attempted. Examples
252 ## with and without a column list ## SQL> CREATE TABLE t1 (f1 INTEGER PRIMARY KEY, f2 INTEGER); SQL> REPLACE INTO t1 (f1, f2) VALUES (1,2); SQL> SELECT * FROM t1; F1 F SQL> REPLACE INTO t1 VALUES (1,3); SQL> REPLACE INTO t1 VALUES (3,4); SQL> SELECT * FROM t1; F1 F ## with primary key ## CREATE TABLE t3 (f1 INTEGER PRIMARY KEY, f2 STRING); INSERT INTO t3 VALUES (1,'abc'); REPLACE INTO t3 VALUES (1,'cde'); SELECT * FROM t3; ## with multipart primary keys ## SQL> CREATE TABLE t5 (f1 INTEGER, f2 INTEGER, f3 STRING, PRIMARY KEY (f1,f2)); SQL> INSERT INTO t5 VALUES (1,2,'abc'); SQL> REPLACE INTO t5 VALUES (1,2,'cde'); SQL> REPLACE INTO t5 VALUES (2,2,'xyz'); SQL> REPLACE INTO t5 VALUES (1,1,'klm'); SQL> SELECT * FROM t5; F1 F2 F cde 2 2 xyz 1 1 klm ## ERRORS ## SQL> REPLACE INTO nosuchtable VALUES (1); can't find table "NOSUCHTABLE" SQL: REPLACE INTO nosuchtable VALUES (1); SQL> REPLACE INTO t1 (f1, f2) VALUES (1); too few values specified in the value list SQL> REPLACE INTO t1 (f1) VALUES (); too few values specified in the value list SQL> REPLACE INTO t1 (f2) VALUES (1,2,3); too many values specified in the value list SQL> REPLACE INTO t1 SELECT 1, 2, 3 FROM DUAL; count mismatch between field list and select list SQL> REPLACE INTO t1 (f1, f2) SELECT 1 FROM DUAL; count mismatch between field list and select list SQL> CREATE TABLE t10 (f1 INTEGER); SQL> REPLACE INTO t10 VALUES (1); no primary key for replace table "T10"
253 NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved SPACER
254 REVOKE Syntax REVOKE ROLE rolename FROM username REVOKE privileges ON [ TABLE ] tablename FROM { username ROLE rolename} [,...] Description Removes access privileges. Use the REVOKE statement to remove roles and privileges from users and roles. Example # Remove admin role privileges for a user # CREATE USER alta password '1922'; CREATE USER admin password '0724'; CREATE ROLE admin; GRANT admin TO admin; GRANT admin TO alta; REVOKE admin FROM alta; NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved SPACER
255 ROLLBACK Syntax ROLLBACK [ WORK ] ROLLBACK TO SAVEPOINT savepoint_name Parameters [ WORK ] user-defined transaction name savepoint_name Name of savepoint that you want to be able to specify with ROLLBACK TO SAVEPOINT. Changes made after the savepoint are undone. Description Stops and ends the current transaction. Use the ROLLBACK statement to stop a transaction and undo work done in the current transaction, or undo the work done after a specified savepoint. ROLLBACK rolls back the current transaction and causes all the updates made by the transaction to be discarded. ROLLBACK with no arguments releases all named savepoints within the transaction. Notes NuoDB recommends that you explicitly end transactions in application programs using either a COMMIT or ROLLBACK statement. If you do not explicitly commit the transaction and the program terminates abnormally, then NuoDB rolls back the current uncommitted transaction. To roll back your current transaction, no privileges are necessary. Use COMMIT to terminate a transaction explicitly if AUTOCOMMIT is off, or if you have used START TRANSACTION. See SAVEPOINT for more information about savepoints. Examples
256 ## transaction committed automatically ## SQL> show autocommit; Autocommit is on SQL> create table t (N int); SQL> insert into t values (1); SQL> select * from t; N -- 1 ## AUTOCOMMIT OFF makes rollback possible ## SQL> AUTOCOMMIT off; SQL> INSERT INTO t VALUES (2); SQL> select * from t; N SQL> ROLLBACK; SQL> SELECT * FROM t; N -- 1 NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved SPACER
257 SAVEPOINT Syntax SAVEPOINT savepoint_name RELEASE SAVEPOINT savepoint_name ROLLBACK TO SAVEPOINT savepoint_name ROLLBACK Parameters savepoint_name Name of savepoint that you want to be able to specify with ROLLBACK TO SAVEPOINT. Description Marks and names a point within a transaction to use with ROLLBACK and RELEASE. Use SAVEPOINT to mark a point (that is, a savepoint) within an explicit transaction and specify a name for it. Note AUTOCOMMIT must be OFF to enable transaction savepoints. Use RELEASE to explicitly release the specified savepoint. No COMMIT or ROLLBACK occurs when releasing a savepoint. A COMMIT implicitly releases all named savepoints and commits all uncommitted data. ROLLBACK TO SAVEPOINT to a named savepoint releases all savepoints back to that named savepoint. (A ROLLBACK or COMMIT with no arguments releases all named savepoints within the transaction. ) Examples
258 ## Errors ## SQL> SHOW AUTOCOMMIT Autocommit is on SQL> CREATE TABLE t (n int); SQL> INSERT INTO t values (1); SQL> SAVEPOINT first; SQL> INSERT INTO t VALUES (2); SQL> SELECT * FROM t; N SQL> rollback to savepoint first; savepoint "FIRST" is not defined ################### ## with Autocommit off ## ################### SQL> AUTOCOMMIT off; SQL> CREATE TABLE t (n int); SQL> INSERT INTO t VALUES (1); SQL> SAVEPOINT first; SQL> INSERT INTO t VALUES (2); SQL> SELECT * FROM t; N SQL> ROLLBACK TO SAVEPOINT first; SQL> SELECT * FROM t; N -- 1 SQL> INSERT INTO t VALUES(3); SQL> SELECT * FROM t; N SQL> ROLLBACK to SAVEPOINT first; SQL> SELECT * FROM t; N -- 1 SQL> SAVEPOINT second; SQL> INSERT INTO t VALUES (3); SQL> SELECT * FROM t; N SQL> RELEASE SAVEPOINT second; SQL> COMMIT;
259 NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved SPACER
260 SELECT Syntax SELECT * select_item [AS] select_item] [,...] FROM from_list [ WHERE condition ] [ GROUP BY group_list [,...] [ HAVING condition [,...] ] ] [ UNION [ ALL DISTINCT ] select ] [ ORDER BY order_list [ ASC DESC] [,...] ] [ LIMIT { count [OFFSET] } { OFFSET count } [ OFFSET start [ROW[S]]] [ FETCH [FIRST NEXT count [ROW[S]] [ONLY] ][ OFFSET start [ROW[S]]] [ FOR UPDATE ] Parameters select_item column expression literal from_list { qualified_ data_source [,...] qualified_data_source [ join_clause qu alified_data_source [ on_clause]...] condition group_list Boolean expression giving a result of true or false. See WHERE and HAVING clauses. Expressions specifying rows to include in the group. select Select statement with all features except ORDER BY, OFFSET/FETCH, and FOR UPDATE clauses. order_list start count Expressions specifying how to sort rows. NB: You cannot use Column ordinal position references in an ORDER BY clause. Number of rows to skip before starting to return rows Maximum number of rows to return. Fewer are returned if the query itself yields fewer rows. column [{ source_name source_ alias}.] column_name source_name source_alias column_name Name of a table, view or procedure directly listed in the from_list. Alternate name for a data source Name of a column from a data source expression string_expression numeric_expression boolean_expression item_alias Alternate name for select_item that can differentiate it from other se lect_items that have the same name, or give a name to an expression. qualified_data_source data_source [AS] source_alias data_source [ schema. ] base_table [ schema.] view [ schema.] procedure derive d_table derived_table ( select ) [AS] source_alias schema Name of the schema that contains the data source
261 Outputs rows The complete set of rows resulting from the query specification. Description SELECT retrieves rows from zero or more tables. An abstract version of the processing steps for a SELECT statement is as follows: All elements in the FROM list are computed. If more than one element is specified in the FROM list, they are joined together. If the WHERE clause is specified, all rows that do not satisfy the condition are eliminated from the output. If the GROUP BY clause is specified, the output is aggregated into groups of rows that match on one or more values. If the HAVING clause is also present, NuoDB eliminates groups that do not satisfy the given condition. The actual output rows are computed using the SELECT output expressions for each selected row. The UNION operator combines the output of multiple SELECT statements to form a single result set. The UNION operator returns all rows that are in one or both of the result sets. Duplicate rows are eliminated unless ALL is specified. If the ORDER BY clause is specified, the returned rows are sorted in the specified order. If ORDER BY is not given, the rows are returned in whatever order the system finds fastest to produce. DISTINCT eliminates duplicate rows from the result. ALL (the default) returns all candidate rows, including duplicates. If the OFFSET or FETCH clause is specified, the SELECT statement returns a subset of the result rows. If FOR UPDATE is specified, the SELECT statement locks the selected rows against concurrent updates. Note You must have SELECT privilege on a table to read its values. The use of FOR UPDATE requires UPDATE privilege as well. SELECT AS AS temporarily assigns a table column a new name, giving you the ability to make adjustments to the presentation of query result. You can label results more accurately without permanently renaming table columns. For example, SQL> select * from t1; S1 S b a b a SQL> select s1 AS "Name", s2 AS "Address" FROM t1; Name Address b a b a FROM clause The FROM clause specifies one or more data sources for the SELECT. If the select statement contains no restrictions in its ON or WHERE clause, the result is the full cross product (Cartesian join) of all the sources. Typically, qualification conditions are added to restrict the returned rows to a small subset of the Cartesian join. ednote: join seems to be buried; figure out how to get it up on its own somewhere The FROM clause can contain the following elements:
262 from_list Data source. Sources can be joined with explicit join_types, or in a comma separated list. (The comma separated list was deprecated in SQL-92.) data_source derived_table alias join_type Either a derived table or the name of a table or view. Name of the view or table can be qualified with a schema name. select statement enclosed in parentheses. The data sources within the derived table can be qualified with a schema name. Substitute name for the FROM item containing the alias. An alias is used for brevity or to eliminate ambiguity for self-joins (where the same table is scanned multiple times). When an alias is provided, it completely hides the actual name of the table or function. For example given FROM foo AS f, the remainder of the SELECT must refer to this FROM item as f not foo. A column alias list can be written to provide substitute names for one or more columns of the table. One of the following: [ INNER ] JOIN LEFT [ OUTER ] JOIN RIGHT [ OUTER ] JOIN FULL [ OUTER ] JOIN For the INNER and OUTER join types, a join condition may be specified in an ON join_condition, or in the WHERE clause. A JOIN clause combines two data sources. INNER JOIN produces pairs or records from the two data sources, matched by the conditions in the WHERE clause and ON clause. LEFT OUTER JOIN returns all rows from the data source before it, and matching rows from the data source that follows. Matching is again based on the contents of the ON clause. Rows from the first data source that have no matching rows in the following data source represent the values that would have come from that source as nulls. If a matching condition is specified in the WHERE clause only rows from first data source that do not match that condition will not be included in the result. Conversely, RIGHT OUTER JOIN returns all the joined rows, plus one row for each unmatched right-hand row (extended with nulls on the left). This is just a notational convenience, since you could convert it to a LEFT OUTER JOIN by switching the left and right inputs. FULL OUTER JOIN returns all the joined rows, plus one row for each unmatched left-hand row (extended with nulls on the right), plus one row for each unmatched right-hand row (extended with nulls on the left). Note RIGHT JOIN and FULL [OUTER] JOIN are not yet implemented. Using them returns an error of the following form:join type is not yet implemented.
263 ON join_condition An expression resulting in a value of type boolean (similar to a WHERE clause) that specifies which rows in a join are considered to match. The join_condition in the ON clause should include only Boolean values that describe the relationship between the data sources being joined. WHERE clause The optional WHERE clause has the general form: WHERE condition A where condition is any expression that evaluates to a result of type boolean. Any row that does not satisfy this condition is eliminated from the output. A row satisfies the condition if it returns true when the actual row values are substituted for any variable references. Note Aggregate functions (MIN, MAX, AVG, SUM, COUNT) are not allowed as part of an expression in a WHERE clause. GROUP BY clause The optional GROUP BY clause has the general form GROUP BY group_list [,...] GROUP BY condenses into a single row all selected rows that share the same values for the grouped expressions. expression can be a column name, or the alias or ordinal number of an output column (SELECT list item). Aggregate functions, if any are used, are computed across all rows making up each group, producing a separate value for each group. Without GROUP BY, an aggregate produces a single value computed across all the selected rows. When GROUP BY is present, the expressions on a SELECT list cannot refer to ungrouped columns, except within aggregate functions. Otherwise there would be more than one possible value to return for an ungrouped column. HAVING Clause The optional HAVING clause has the following general form, where condition is the same as specified for the WHERE clause. GROUP BY group_list HAVING condition HAVING eliminates group rows that do not satisfy the condition. HAVING is different from WHERE as follows: WHERE filters individual rows before the application of GROUP BY, while HAVING filters group rows created by GROUP BY. GROUP BY is required. Unless the reference appears within an aggregate function each column referenced in condition must unambiguously reference a grouping column. SELECT List The SELECT list is specified between the key words SELECT and FROM. The list specifies expressions that form the output rows of the SELECT statement. The expressions can (and usually do) refer to columns computed in the FROM clause. Instead of an expression, you can use an asterisk ( * ) in the output list as a shorthand for all the columns of the selected rows. Also, you can
264 write table_name.* as a shorthand for the columns coming from just that table. UNION clause The UNION clause has this general form: select_statement UNION [ ALL DISTINCT ] select_statement ORDER BY clause The optional ORDER BY clause has the following general form, where expression can be the name or ordinal number of a column (SELECT list item). : ORDER BY expression [ ASC DESC] [,...] The ORDER BY clause causes the result rows to be sorted according to the specified expressions. If two rows are equal according to the leftmost expression, they are compared according to the next expression and so on. If they are equal according to all specified expressions, they are returned in an implementation-dependent order. It is also possible to use columns that do not appear in the SELECT result list. Thus the following statement is valid: SELECT name FROM distributors ORDER BY code; A limitation of this feature is that an ORDER BY clause applying to the result of a UNION clause may specify only an output column name or number, not an expression. One may add the key word ASC (ascending) or DESC (descending) after any expression in the ORDER BY clause. If not specified, ASC is assumed by default. OFFSET and LIMIT OFFSET specifies a number of rows to skip before starting to return rows. OFFSET 0 is the same as omitting the OFFSET clause. If both OFFSET and LIMIT are specified, then OFFSET rows are skipped before starting to count the LIMIT rows that are returned. When using LIMIT, you should use ORDER BY in order to obtain a deterministic ordering of the result set. Without ORDER BY, the order of the result set is not guaranteed. In other words, to get repeatable results from a query that includes a LIMIT or FETCH, you should include an ORDER BY clause. DISTINCT clause If DISTINCT is specified, all duplicate rows are removed from the result set (one row is kept from each group of duplicates). ALL specifies the opposite: all rows are kept; that is the default. FETCH clause The FETCH clause consists of two independent sub-clauses: FETCH [FIRST NEXT count [ROW[S]] [ONLY] [ OFFSET start [ROW[S]]] count specifies the maximum number of rows to return, while start specifies the number of rows to skip before starting to return rows. When both are specified, start rows are skipped before starting to count the count rows to be returned. When using FETCH, it is a good idea to use an ORDER BY clause that constrains the result rows into a unique order. Otherwise you get an unpredictable subset of the query's rows. For example you intend to ask for the tenth through twentieth rows, but without ORDER BY the order of the results is unpredictable. Note that OFFSET is optional. If it is absent, rows are fetched starting from row 1 up to the limit specified with FETCH.
265 FOR UPDATE clause The FOR UPDATE clause has the following form: FOR UPDATE FOR UPDATE causes the rows retrieved by the SELECT statement to be locked as though for update. This prevents them from being modified or deleted by other transactions until the current transaction ends. That is, other transactions that attempt UPDATE, DELETE, or SELECT FOR UPDATE of these rows are blocked until the current transaction ends. Also, if an UPDATE, DELETE, or SELECT FOR UPDATE from another transaction has already locked a selected row or rows, SELECT FOR UPDATE waits for the other transaction to complete. When the other transaction completes, the waiting transaction will proceed if the other transaction rolled back, otherwise it will get an error message in the default isolation level. In write-committed or read-committed isolation levels, the waiting transaction will read the most recently committed version of the record and can proceed with its update. FOR UPDATE cannot be used in contexts, such as aggregation, where returned rows cannot be clearly identified with individual table rows. CURRENT_USER, CURRENT_SCHEMA functions CURRENT_USER is a system information function, which returns the user name of the current execution context. Similarly, CURRENT_SCHEMA returns the name of the current schema. For example, the following results are generated if you have run the QuickStart script: SQL> select current_user from dual; --- DBA SQL> select current_schema from dual; HOCKEY NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved SPACER
266 SET Syntax SET {CONSISTENT_READ WRITE_COMMITTED READ_COMMITTED}; Description Set variables define system behavior. Use the SET command to change run-time configuration parameters. The isolation level of a transaction determines the data that the transaction can see when other transactions are running concurrently. The setting is in effect with the start of the next transaction, and stays in effect until the level is reset with another SET command. The following settings are supported: CONSISTENT_READ (the default) Same as SERIALIZABLE. At this level a transaction that tries to update or delete a record that was updated by a concurrent transaction waits for the concurrent transaction to end. If the concurrent transaction fails, NuoDB automatically retries the update for the waiting transaction, and, in the absence of other conflicts, succeeds. If the concurrent transaction is committed, NuoDB generates an update conflict error for the waiting transaction. The waiting transaction can then either roll back and retry its operations, or continue. If it continues and retries the change of the conflicting record NuoDB generates an error. WRITE_COMMITTED At this level every update or delete statement is preceded by a SELECT..FOR UPDATE that operates differently from an ordinary SELECT. Ordinarily, a SELECT returns the version of the record that was committed when the transaction started. If you set WRITE_COMMITTED, a SELECT..FOR UPDATE returns the most recent version of the record and creates a new version without changing any values. If the most recent version of the record is not yet committed, the SELECT..FOR UPDATE waits until the transaction that created it finishes, then returns the most recent committed version. Note: At the level of WRITE_COMMITTED, NuoDB operates in both READ_COMMITTED as well aswrite_committed. If you want only READ_COMMITTED, use the READ_COMMITTED instead of WRITE_COMMITTED. READ_COMMITTED At this level NuoDB allows a running transaction to see the most recently committed version of each record, regardless of whether that record was visible at the time the transaction started. As a result, running the same query twice can produce different results. Note: With one exception the behavior of NuoDB at the READ_COMMITTED level is like READ_COMMITTED isolation in other relational databases. The exception is the handling of conflicts between transactions that update or delete the same record. A NuoDB transaction that attempts to update or delete a record that was updated by a concurrent transaction generates an update conflict error, just as if the isolation level were set to the default (CONSISTENT_READ).
267 NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved SPACER
268 SHOW Syntax SHOW [ SCHEMAS TABLES DOMAINS SEQUENCES AUTOCOMMIT ] SHOW name SHOW TABLE [schema.]name SHOW DOMAIN [schema.]name SHOW SEQUENCE [schema.]name SHOW SCHEMA name Description SHOW displays information about schemas, tables, domains, and status of AUTOCOMMIT isolation level. You can also use SHOW to determine the status of the setting for AUTOCOMMIT. By default SHOW uses the current schema if none is specified. SHOW commands do not require a semi-colon to execute. If NuoDB cannot find a table with the exact name that is specified it performs as follows: Searches for tables with similar names in the current schema, and then in all schemas. Searches for tables that match the first few characters of the specified name, in the current schema, and then in all schemas. Generates a list of tables with same initial letter as the specified name. Note Keep in mind that a SQL domain is not the same as a NuoDB administrative domain. An SQL domain is a set of types that are named and can be used as a group as if they are one type. Examples ## SHOW displays current settings ## SQL> SHOW autocommit state is off semicolon completion is required current schema is ENGINEERS ## SHOW SCHEMAS displays all schemas containing tables ## SQL> SHOW SCHEMAS; Schemas containing tables ENGINEERS HOCKEY SYSTEM ## SHOW TABLES displays all tables in the current schema ## SQL> SHOW TABLES Tables in schema ENGINEERS ENGINEERS ## SHOW DOMAINS displays the domains in the current schema ## ## Note: SHOW DOMAINS refers to SQL Domains, and not to NuoDB Domains. ## A SQL Domain is a named, user-defined set of valid values. Domains are dependent on the Schema to which they belong. ## A NuoDB Domain is a collection of NuoDB hosts that have been provisioned to work together to support one or more NuoDB databases. SQL> SHOW domains
269 No domains found in schema ENGINEERS ## SHOW SEQUENCES displays sequences in current schema ## SQL> SHOW SEQUENCES Sequences in schema HOCKEY CUSTOMERUPDATER HOCKEY$IDENTITY_SEQUENCE ## SHOW AUTOCOMMIT displays the current status of the AUTOCOMMIT isolation level [ On Off ] SQL> SHOW AUTOCOMMIT Autocommit is off ## SHOW name displays the named object and context(s) in the database ## SQL> SHOW hockey These tables start with HOCKEY schema: HOCKEY table: HOCKEY Domain HOCKEY not found anywhere! Sequence HOCKEY not found anywhere! ## SHOW TABLE [schema.]name displays the schema and columns of the table specified ## SQL> SHOW TABLE hockey.hockey Found table HOCKEY in schema HOCKEY ID integer NUMBER integer NAME string POSITION string TEAM string Index: HOCKEY..PRIMARY_KEY ID Index: PLAYER_IDX NUMBER NAME TEAM ## SHOW DOMAIN[schema.]name displays the specified domain ## ## Note: SHOW DOMAINS refers to SQL Domains, and not to NuoDB Domains. ## A SQL Domain is a named, user-defined set of valid values. Domains are dependent on the Schema to which they belong. ## A NuoDB Domain is a collection of NuoDB hosts that have been provisioned to work together to support one or more NuoDB databases. SQL> CREATE DOMAIN name_types char(50) default 'NuoDB'; SQL> SHOW DOMAIN name_types Found domain NAME_TYPES in schema HOCKEY domain NAME_TYPES is char ## SHOW SEQUENCE [schema.]name displays the specified sequence ## SQL> SHOW SEQUENCE customerupdater; Found sequence CUSTOMERUPDATER in schema HOCKEY
270 ## SHOW SCHEMA name displays specified schema ## SQL> show sequence customerupdater; Found sequence CUSTOMERUPDATER in schema HOCKEY NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved SPACER
271 START TRANSACTION Syntax START TRANSACTION { [ READ { WRITE ONLY } [, ] ] [ ISOLATION LEVEL { [ READ { COMMITTED UNCOMMITTED } ] [ WRITE { COMMITTED UNCOMMITTED } ] [ SERIALIZABLE ] } ] } Parameters None Description START TRANSACTION starts a transaction block. If the first statement you submit is START TRANSACTION, NuoDB starts an explicit transaction with AUTOCOMMIT off. AUTOCOMMIT remains disabled until the transaction is ended with either a COMMIT or ROLLBACK using the specified isolation level. If you execute a select, insert, update or other command and there is no transaction running, NuoDB starts a transaction as CONSISTENT_READ. See also Transactions and Isolation Levels Example
272 ## A transaction is started as read only (line 14), and the transaction fails at UPDATE. ## A subsequent transaction is started as read write and the update succeeds. SQL> START TRANSACTION; SQL> USE foo; SQL> CREATE TABLE t1 (n1 integer); SQL> INSERT INTO t1 (n1) VALUES (1), (2), (3); SQL> SELECT * FROM t1; N SQL> COMMIT; SQL> START TRANSACTION read only; SQL> UPDATE t1 set n1=n1+10; Read only transactions cannot change data SQL> COMMIT; SQL> START TRANSACTION read write; SQL> UPDATE t1 set n1=n1+10; SQL> SELECT * FROM t1; N NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved SPACER
273 TRUNCATE TABLE Syntax TRUNCATE TABLE tablename Parameters name Name (optionally schema-qualified) of the table to be truncated. Description Empties a table. TRUNCATE TABLE quickly removes all rows from a table. It has the same effect as an unqualified DELETE but since it does not actually scan the table it is faster. This can be useful on large tables. Although TRUNCATE TABLE can be executed inside a transaction block, there is no way to roll it back. Example ## Truncate the table bigtable TRUNCATE TABLE bigtable; NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved SPACER
274 UPDATE Update rows of a table Synopsis UPDATE [ schema.] table SET column = expression [,...] [WHERE condition ] Parameters table Name (optionally schema-qualified) of an existing table. column Name of a column in table. expression condition A valid expression or value to assign to column. Refer to the SELECT statement for a further description of the WHERE clause. Description UPDATE changes the values of the columns specified for all rows that meet the requirements specified by the WHERE condition clause. You are required only to specify the columns to be modified. Columns not specified by SET remain unchanged. You must have write access to the table in order to modify it, as well as read access to any table whose values are specified in the WHERE condition. Examples Establish a ticket number for a particular seat on a particular flight update Seats set ticket_id = 346 where flight_id = 844 and seat_number = 24 NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved SPACER
275 UPGRADE Syntax UPGRADE TABLE [schema_name.]table_name ( { column_name { data_type domain } [ DEFAULT default_expr ] [ column_constraint [,... ] ] table_constraint } [,... ] ) UPGRADE [UNIQUE ] INDEX index_name ON table ( column [,...] ) Description Changes or creates tables and indexes. (NuoDB extension). Use UPGRADE TABLE to change an existing table or, if the named table does not exist, create a new table. See the syntax for CREATE TABLE for more details. UPGRADE TABLE does not drop existing fields. You can use UPGRADE on a single table. Similarly use UPGRADE INDEX to change an existing index or create a new one. You can also convert an index from non-unique to unique, but you cannot make a unique index non-unique. It will add columns to an index. Note UPGRADE is a NuoDB extension to the SQL standard. Examples
276 ## Create a table, pet, using UPGRADE, and insert values. SQL> UPGRADE TABLE pets (name string, age number, weight integer); SQL> SHOW TABLES; Tables in schema AWH PETS SQL> INSERT INTO pets (name,age, weight) VALUES ('Amanda',6,26); SQL> SELECT * FROM pets; NAME AGE WEIGHT Amanda 6 26 ## Create an index based on the age column for the pets table. SQL> UPGRADE INDEX petage on pets(age); SQL> INSERT INTO pets (name, age, weight) VALUES ('Wryly',10,40); SQL> SELECT * FROM pets; NAME AGE WEIGHT Amanda 6 26 Wryly SQL> SHOW TABLE pets; Schema AWH Table PETS NAME string AGE number WEIGHT integer Index: PETAGE AGE NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved SPACER
277 USE Syntax USE name_of_schema Description USE specifies a schema as the default for the current connection to the NuoDB SQL client. If the schema does not exist, USE creates it. A NuoDB database has one or more schemas. Each table, view, domain, index, and sequence is part of a particular schema. While you are using the default schema specified by the USE command, you can reference these objects with an unqualified name. Use a qualified name to reference entities in schemas other than the default. Examples # Make hockey the default schema. # SQL> USE hockey; SQL> SELECT number FROM hockey WHERE number >40; NUMBER
278 # Create a schema using USE SQL> SHOW SCHEMAS Schemas containing tables DOC HOCKEY SYSTEM # Create schema 'example' SQL> USE example; # Although the schema <database>.example exists and is the default context for the current connection, it will not show because it does not contain any tables. SQL> SHOW SCHEMAS; Schemas containing tables DOC HOCKEY SYSTEM # Create a table for <database>.example SQL> CREATE TABLE t3 (f1 INTEGER DEFAULT 123, f2 STRING DEFAULT 'abc'); # <database>.example is now returned as one of the schemas in the database SQL> SHOW SCHEMAS; Schemas containing tables DOC EXAMPLE HOCKEY SYSTEM SQL> NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved SPACER
279 SQL Language Elements and Transactions Reference information about data types, operations, access, variables, indexes, and data type conversion, compliance with SQL standard, isolation levels. Data Types Supported By NuoDB Describes NuoDB extensions, how character and numeric types are handled, date and time. Domains There is a distinction between a NuoDB administrative domain, which contains databases, and a SQL domain. Operators and Operations Describes NuoDB logical and comparison operators. Functions List of SQL Functions Expressions Describes value and conditional expressions. Object Privileges Become the administrator (owner) of a database when you create the first transaction engine for it. Transactions and Isolation Levels NuoDB supports several levels of transaction isolation and is based on Multi-Version Concurrency (MVCC). Internationalization and Localization Requirements to handle character strings in UTF-8, as stored in the NuoDB database. Making the Transition to a NuoDB Database Migration notes and tools Compliance with SQL Standard The following table describes NuoDB compliance against core standard SQL-99 features. (Note: This list is currently incomplete and subject to change.) NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved SPACER
280 Datatypes Supported by NuoDB Describes NuoDB extensions, how character and numeric types are handled, date and time. NuoDB Extensions Types supported as extensions to the standard. Standard SQL Datatype Keywords Supported List of keywords of the predefined data types that are supported by SQL 2008 as well as those supported by NuoDB. String Types Numeric Types Details about numeric data types, which include integer, fixed point types, and floating point types. NUMBER is a NuoDB extension that differs from the SQL standard definition for this fixed point type. Date, Time, and TimeStamp Conversions Table from the 2008 SQL Standard showing data type conversions, related to time, that are supported and not supported by NuoDB. NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved SPACER
281 NuoDB Extensions Types supported as extensions to the standard. NuoDB supports the following types as extensions to the standard: String is a character string of arbitrary length. Number is a numeric value of arbitrary length and scale. Binary with no length is an arbitrarily long string of bytes. (The standard specifies Binary with no length as a single byte.) NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved SPACER
282 Standard SQL Datatype Keywords Supported List of keywords of the predefined data types that are supported by SQL 2008 as well as those supported by NuoDB. Kind of datatype Basic types SQL 2008 Datatype Keywords supported by the NuoDB SQL client Character string types CHARACTER? character [(<n> [characters])] CHARACTER VARYING? CHARACTER LARGE OBJECT character varying [(<n> [characters])] varchar [(<n> [characters])] Character Large Object [(<n>{k M G}]) Char Large Object [(<n>{k M G}]) CLOB [(<n>{k M G})] National Character [(<n> [characters])] National Char [(<n> [characters])] NChar [(<n> [characters])] National Character Varying (<n> [characters]) National Char Varying (<n> [characters]) National Character Large Object [(<n>{k M G})] NChar Large Object [(<n>{k M G})] NCLOB [(<n>{k M G})] Notes To create a CLOB use Connecti on::createclob(), which is specified in the NuoDB C++ API Reference. Although it is supported, NuoDB recommends that you avoid specifying a size limit for blobs and clobs. Specifying a limit can have a negative effect on performance; risks the possibility that assignment to a field does not fit the size specified, and has no benefit. Binary string types BINARY? Binary [(<n>)] BINARY VARYING Binary Varying [(<n>)] Binary Large Object [(<n>{k M G})] BLOB [(<n>{k M G})] Notes To create a CLOB use Connecti on::createclob(), which is
283 BINARY LARGE OBJECT specified in the NuoDB C++ API. Although it is supported, NuoDB recommends that you avoid specifying a size limit for blobs and clobs. Specifying a limit can have a negative effect on performance; risks the possibility that assignment to a field does not fit the size specified, and has no benefit. Exact numeric types NUMERIC? Numeric (<n> [,<n>]) DECIMAL? SMALLINT? INTEGER? BIGINT DOUBLE PRECISION Decimal (<n> [,<n>]) DEC (<n> [,<n>]) SmallInt Integer Int Approximate numeric types REAL Real BigInt DOUBLE PRECISION Float Double Precision Note NuoDB recommends the use of Double Precision rather than Float. Boolean type BOOLEAN boolean Datetime types DATE date TIME? TIMESTAMP time [(<n>)] timestamp [(<n>)] Notes Values for n can be any value from 0-9. For example you can specify TIMESTAMP(3). The precision default for TIMESTAMP is 6 and for TIME is 0 (zero). All TIME and TIMESTAMP values are stored as absolute points in time. NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved
284 SPACER
285 String Types NuoDB handles String types as potentially unlimited in length. NuoDB recommends that you use String instead of char types. There is no storage penalty for using String, so most application developers should use String rather than char or varchar. For varchar character types, NuoDB checks and supports the defined length. Characters are all stored in UTF-8. An empty string or a string containing only spaces, assigned to a numeric value, becomes zero. NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved SPACER
286 Date, Time, and TimeStamp Conversions Table from the 2008 SQL Standard showing data type conversions, related to time, that are supported and not supported by NuoDB. To Date To Time To TimeStamp From Date Trivial Not supported Copy year, month, and day; set hour, minute, and second to 0 (zero) From Time Not supported Trivial Copy date fields from CURRENT_ DATE and time fields from source value. From TimeStamp Copy date fields from source value Copy time fields from source value. Trivial NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved SPACER
287 Numeric Types Details about numeric data types, which include integer, fixed point types, and floating point types. NUMBER is a NuoDB extension that differs from the SQL standard definition for this fixed point type. Overview There are two general numeric types: About Storage in SQL Numeric data does not have a concept of storage length. Partly because of this, the data storage algorithm does not impose a penalty for specifying the size of a field as larger than actually required. Integer Types: SMALLINT, INTEGER, BIGINT Range of values for integer types are as follows: Type Lowest Highest SMALLINT INTEGER BIGINT If you assign a DOUBLE to an integer type, or if you cast it to an integer type, it is rounded to an integer type. The rounding is to the nearest value, where.5 and higher are rounded up. For example, CAST(0.5 TO INTEGER) returns 1. Fixed Point Types: NUMERIC, DECIMAL, NUMBER NUMERIC and DECIMAL types are functionally equivalent in NuoDB. In a NUMERIC or DECIMAL fixed point type, the precision and scale are usually specified using the following syntax: NUMERIC [ (precision [,scale]) ] DECIMAL [ (precision [,scale]) ] where precision is the number of digits in the number scale is the number of digits to the right of the decimal point in the number For example, a column declared: DECIMAL(6,4) has values with 6 digits, 4 of which are after the decimal point, such as Limits for fixed point types are determined by the specified precision and scale. If the value specified has greater precision or scale, but lies within the ranges listed in the following table, then NuoDB allows it to be inserted. Type Lowest Highest DECIMAL NUMERIC, DECIMAL NUMERIC(1) to DECIMAL NUMERIC(4) DECIMAL NUMERIC( p,s) where p <= E-s 32767E-s DECIMAL NUMERIC(5) to DECIMAL NUMERIC(9) DECIMAL NUMERIC( p,s) where 5 <= p <= E-s E-s
288 DECIMAL NUMERIC(10) to DECIMAL NUMERIC(19) DECIMAL NUMERIC( p,s) where 10 <= p < = E-s E-s DECIMAL NUMERIC( p) where p > 19 -(2 ^320 )-1 (2 ^320 )-1 DECIMAL NUMERIC( p,s) where p >19 -(2 ^320-1) * 10^-s (2^320-1 ) * 10^-s Values with fixed point type, and precision minus scale greater than 19, have larger ranges than INTEGER types. After 19 digits these values are stored using an internal data type designed for large integers, allowing larger ranges than INTEGER types, and not restricted to ranges specified for BIGINT. You can think of the NuoDB data type NUMBER as a DECIMAL or NUMERIC type without a specified maximum precision and scale. Thus it is limited as shown in the following table. Type Lowest Highest NUMBER n where n * 10 ^scale = -(2 ^320 )-1 n where n * 10 ^ scale = (2 ^320 )-1 Floating Point Types: DOUBLE NuoDB supports DOUBLE as a floating type. The following table shows the range of values for DOUBLE: Type Lowest Highest DOUBLE E E E E+308 About NaN, Inf, -Inf NuoDB SQL supports NaN, Inf, -Inf, and Null as values for DOUBLE. There is no concept of -Nan. The order of values with regard to ORDER BY, from lowest to highest, is Null, Nan, -Inf, Inf. When comparing (that is, if Nan or Null is greater than or less than any other value) the comparison always returns false. For example:
289 SQL> select * from t2; S inf nan inf SQL> select * from t2 where s1>0; S inf NuoDB treats FLOAT values the same as DOUBLE. Specifying (float)nan is the same as specifying (double)nan. Aggregate functions supported by NuoDB include COUNT, AVG and SUM. These functions work with NaN, Inf, and -Inf as shown in the following table. COUNT works as expected. AVG and SUM report values as described in the following table, based on the kind of values specified as column values. Kind of Values in Column NaN Inf -Inf Any combination of NaN, Inf, or -Inf Kind of Value Reported NaN Inf -Inf Nan NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved SPACER
290 Datatypes [old] <HIDDEN> NuoDB Extensions Data types supported as extensions to the standard. NuoDB supports the following types as extensions to the standard: String is a character string of arbitrary length. Number is a numeric value of arbitrary length and scale. Binary with no length is an arbitrarily long string of bytes. (The standard specifies Binary with no length as a single byte.) SQL Data Type Keywords List of keywords of the predefined data types that are supported by SQL 2008 as well as those supported by NuoDB. Kind of datatype Basic types SQL 2008 Datatype Keywords supported by the NuoDB SQL client Character string types CHARACTER? character [(<n> [characters])] CHARACTER VARYING? CHARACTER LARGE OBJECT character varying [(<n> [characters])] varchar [(<n> [characters])] Character Large Object [(<n>{k M G}]) Char Large Object [(<n>{k M G}]) CLOB [(<n>{k M G})] National Character [(<n> [characters])] National Char [(<n> [characters])] NChar [(<n> [characters])] National Character Varying (<n> [characters]) National Char Varying (<n> [characters]) National Character Large Object [(<n>{k M G})] NChar Large Object [(<n>{k M G})] NCLOB [(<n>{k M G})] Notes To create a CLOB use Connect ion::createclob(), which is specified in the NuoDB C++ API. Although it is supported, NuoDB recommends that you avoid specifying a size limit for blobs and clobs. Specifying a limit can have a negative effect on performance; risks the possibility that assignment to a field does not fit the size specified, and has no benefit. Binary string types BINARY? Binary [(<n>)] BINARY VARYING Binary Varying [(<n>)] Binary Large Object [(<n>{k M G})]
291 BINARY LARGE OBJECT BLOB [(<n>{k M G})] Notes To create a CLOB use Connect ion::createclob(), which is specified in the NuoDB C++ API. Although it is supported, NuoDB recommends that you avoid specifying a size limit for blobs and clobs. Specifying a limit can have a negative effect on performance; risks the possibility that assignment to a field does not fit the size specified, and has no benefit. Exact numeric types NUMERIC? Numeric (<n> [,<n>]) DECIMAL? SMALLINT? INTEGER? BIGINT DOUBLE PRECISION Decimal (<n> [,<n>]) DEC (<n> [,<n>]) SmallInt Integer Int Approximate numeric types REAL Real BigInt DOUBLE PRECISION Float Double Precision Note NuoDB recommends the use of Double Precision rather than Float. Boolean type BOOLEAN boolean Datetime types DATE date TIME? time [(<n>)] timestamp [(<n>)] Notes Values for n can be any value from 0-9. For example you can specify TIMESTAMP(3). The precision default for TIMESTAMP is 6 and for TIME is 0 (zero). All TIME and TIMESTAMP values are stored as absolute points in time.
292 TIMESTAMP String Types NuoDB handles String types as potentially unlimited in length. NuoDB recommends that you use String instead of char types. There is no storage penalty for using String, so most application developers should use String rather than char or varchar. For varchar character types, NuoDB checks and supports the defined length. Characters are all stored in UTF-8. An empty string or a string containing only spaces, assigned to a numeric value, becomes zero. NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved SPACER
293 Domains There is a distinction between a NuoDB administrative domain, which contains databases, and a SQL domain. Administrative domain A NuoDB administrative domain is a collection of hosts that have been provisioned to work together to support NuoDB databases. The hosts are a set of machines or cloud instances that are under the same physical management. The expectation is that there will be one group of people who are responsible for physically provisioning the domain and another group who manage databases. SQL domain SQL domains support a type of abstraction that can be referenced in many SQL tables. A change to the domain causes a corresponding change in the tables. NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved SPACER
294 Operators and Operations Describes NuoDB logical and comparison operators. Logical Operators Comparison Operators Numeric Operations Describes NuoDB extensions, how character and numeric types are handled, as well as standard data types and domains. NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved SPACER
295 Logical Operators NuoDB supports the following logical operators: AND, OR, NOT. NuoDB uses a three-valued logic system with true, false, and null, which represents unknown. See the following tables. a b a AND b a OR b TRUE TRUE TRUE TRUE TRUE FALSE FALSE TRUE TRUE NULL NULL TRUE FALSE FALSE FALSE FALSE FALSE NULL FALSE NULL NULL NULL NULL NULL a TRUE FALSE NULL NOT a FALSE TRUE NULL The operators AND and OR are commutative, that is, you can switch the left and right operand without affecting the result. NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved SPACER
296 Comparison Operators Comparison operators are supported for all supported data types. All comparison operators are binary operators that return values of type boolean; expressions like 1 < 2 < 3 are not valid (because there is no < operator to compare a Boolean value with 3). NuoDB supports the comparison operators described in the following table: Operator Description < less than > greater than <= less than or equal to >= greater than or equal to = equal BETWEEN In addition to the comparison operators, the special BETWEEN construct is available: a BETWEEN x AND y is equivalent to a >= x AND a <= y Notice that BETWEEN treats the endpoint values as included in the range. NOT BETWEEN does the opposite comparison: a NOT BETWEEN x AND y is equivalent to a < x OR a > y To check whether a value is or is not null, use the constructs: expression IS NULL expression IS NOT NULL NOTE: Do not write expression = NULL because NULL is not "equal to" NULL. (The null value represents an unknown value, and it is not known whether two unknown values are equal.) This behavior conforms to the SQL standard. BETWEEN Conditional Expression Specify fields based on values within a specified range Character String Comparison LIKE NOT LIKE Condition Perform pattern matching. CONTAINING Operator String comparison NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved SPACER
297 BETWEEN Conditional Expression Specify fields based on values within a specified range Syntax [NOT] BETWEEN startpoint AND endpoint where startpoint defines the first value in the range and endpoint defines the last value in the range. Description The BETWEEN conditional expression is true if the first value expression is between the second and third value expression, inclusive. If you precede the BETWEEN expression with the optional NOT qualifier, the condition is true if there are no fields with values within the range you specify (with the second and third value expression). Example The following example demonstrates the use of the BETWEEN conditional expression with a numeric field. # Select rows from the hockey table, choosing numbers where the value for number contains a value greater than or equal to 10 and less than or equal to 20. # SELECT number FROM hockey WHERE number BETWEEN 10 AND 20; NUMBER Related reference Character String Comparison LIKE NOT LIKE Condition CONTAINING Operator NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved SPACER
298 Character String Comparison Character string comparison operators are described in the following table: Operator Usage Description = 'string' = 'comparison' A comparison returning true if string matches comparison identically <> 'string' <> 'comparison' A comparison returning true if string does not match!= 'string' <> 'comparison' A comparison returning true if string does not match < 'string' < 'comparison' A comparison returning true if string should be sorted alphabetically before comparison <= 'string' <= 'comparison' A comparison returning true if string should be sorted alphabetically before comparison, or if the values are identical > 'string' > 'comparison' A comparison returning true if string should be sorted alphabetically after comparison >= 'string' >= 'comparison' A comparison returning true if string should be sorted alphabetically after comparison, or if the values are identical NOTE: NuoDB does not support the!= comparison operator NuoDB supports the LIKE NOT LIKE keywords, which call the like() function, and are sometimes referred to as string comparison operators. Related reference BETWEEN Conditional Expression LIKE NOT LIKE Condition CONTAINING Operator NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved SPACER
299 LIKE NOT LIKE Condition Perform pattern matching. Synopsis LIKE string [escape character ESCAPE] pattern Description The LIKE condition allows you to use wild cards in the WHERE clause of SELECT, INSERT, UPDATE, or DELETE statements. This allows you to perform pattern matching. The LIKE condition can be used in any valid SQL statement. The patterns that you can choose from are: % (percent sign) allows you to match any string of any length (including zero length) _ (underscore) allows you to match on a single character NOTE The LIKE pattern can be specified with multi-byte national characters, except for the (optional) ESCAPE character, which must be ASCII. Examples How to find all team members who play defense. SQL> select * from hockey where position like 'D%'; NUMBER NAME POSITION TEAM MATT BARTKOWSKI Defense Bruins 55 JOHNNY BOYCHUK Defense Bruins 33 ZDENO CHARA Defense Bruins 14 JOE CORVO Defense Bruins 21 ANDREW FERENCE Defense Bruins 47 STEVEN KAMPFER Defense Bruins 54 ADAM MCQUAID Defense Bruins 44 DENNIS SEIDENBERG Defense Bruins
300 Find team members who are not forwards. SQL> select * from hockey where position not like 'Forward'; NUMBER NAME POSITION TEAM MATT BARTKOWSKI Defense Bruins 55 JOHNNY BOYCHUK Defense Bruins 33 ZDENO CHARA Defense Bruins 14 JOE CORVO Defense Bruins 21 ANDREW FERENCE Defense Bruins 47 STEVEN KAMPFER Defense Bruins 54 ADAM MCQUAID Defense Bruins 44 DENNIS SEIDENBERG Defense Bruins 40 TUUKKA RASK Goalie Bruins 30 TIM THOMAS Goalie Bruins 1 MAX SUMMIT Fan Bruins Find team members with numbers in the 40's. SQL> select * from hockey where number like '4_'; NUMBER NAME POSITION TEAM DAVID KREJCI Forward Bruins 49 RICH PEVERLEY Forward Bruins 43 MATT BARTKOWSKI Defense Bruins 47 STEVEN KAMPFER Defense Bruins 44 DENNIS SEIDENBERG Defense Bruins 40 TUUKKA RASK Goalie Bruins Related reference BETWEEN Conditional Expression Character String Comparison CONTAINING Operator NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved SPACER
301 CONTAINING Operator String comparison Synopsis string CONTAINING NOT CONTAINING pattern Description Generates a case-insensitive search for a partial match. Examples
302 Select names that contain a specific letter. SQL> use hockey; SQL> select * from hockey; NUMBER NAME POSITION TEAM PATRICE BERGERON Forward Bruins 11 GREGORY CAMPBELL Forward Bruins 38 JORDAN CARON Forward Bruins 18 NATHAN HORTON Forward Bruins 23 CHRIS KELLY Forward Bruins 46 DAVID KREJCI Forward Bruins 17 MILAN LUCIC Forward Bruins 63 BRAD MARCHAND Forward Bruins 20 DANIEL PAILLE Forward Bruins 49 RICH PEVERLEY Forward Bruins 67 BENOIT POULIOT Forward Bruins 91 MARC SAVARD Forward Bruins 19 TYLER SEGUIN Forward Bruins 22 SHAWN THORNTON Forward Bruins 43 MATT BARTKOWSKI Defense Bruins 55 JOHNNY BOYCHUK Defense Bruins 33 ZDENO CHARA Defense Bruins 14 JOE CORVO Defense Bruins 21 ANDREW FERENCE Defense Bruins 47 STEVEN KAMPFER Defense Bruins 54 ADAM MCQUAID Defense Bruins 44 DENNIS SEIDENBERG Defense Bruins 40 TUUKKA RASK Goalie Bruins 30 TIM THOMAS Goalie Bruins 1 MAX SUMMIT Fan Bruins SQL> select name from hockey where name containing 'O'; NAME PATRICE BERGERON GREGORY CAMPBELL JORDAN CARON NATHAN HORTON BENOIT POULIOT SHAWN THORNTON MATT BARTKOWSKI JOHNNY BOYCHUK ZDENO CHARA JOE CORVO TIM THOMAS Related reference BETWEEN Conditional Expression Character String Comparison LIKE NOT LIKE Condition NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved
303 SPACER
304 Numeric Operations Describes NuoDB extensions, how character and numeric types are handled, as well as standard data types and domains. NuoDB supports the following kinds of numeric operators:: Mathematical operators Numeric comparison operators Mathematical operators affect one or two values, perform a mathematical operation, and return a value of a numeric data type. Numeric comparison operators draw a conclusion based on two numeric values (such as whether one is larger than the other) and returns a value of type boolean, set to either true or false. Mathematical operators Numeric comparison operators Use comparison operators to compare values of types such as integer to one another. They always return a value of type boolean. NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved SPACER
305 Mathematical operators You can use mathematical operators in the target list, in the WHERE clause of a SELECT statement, or anywhere else a numeric result may be appropriate. This sometimes will include the ORDER BY clause, a JOIN qualifier, or a GROUP BY clause. See the following table for a list of the mathematical operators supported by NuoDB. Operator Usage Description + a + b Addition of numeric quantities a and b - a - b Subtraction of numeric quantity b from a * a * b Multiplication of numeric quantities a and b / a / b Division of numeric quantity a by b % a % b Modulus, or remainder, from dividing a by b NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved SPACER
306 Numeric comparison operators Use comparison operators to compare values of types such as integer to one another. They always return a value of type boolean. These operators are most commonly used in the WHERE clause, but may be used anywhere in a SQL statement where a value of type boolean would be valid. Operator Description < Less-than, returns true if the value to the left is smaller than the value to the right > Greater-than, returns true if the value to the left is greater than the value to the right <= Less-than or equal-to, returns true if the value to the left is smaller, or equal to, in quantity than the value to the right >= Greater-than or equal-to, returns true if the value to the left is greater, or equal to, in quantity than the value to the right = Equal-to, returns true if the values to the left and right of the operator are equivalent!= Not equal-to NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved SPACER
307 Functions List of SQL Functions Introduction In syntax descriptions for SQL functions, arguments are indicated by their data types. For example a character is required as the argument for LOWER, as shown: LOWER (char)> Table 1. Name of Function Syntax Returns Example Description LOWER LOWER (char) char Returns char with all letters uppercase SELECT LOWER('MR. SCOTT MCMILLAN') "Lowercase" FROM DUAL; Lowercase mr. scott mcmillan Expressions used as arguments must be constant, variable, or column of character data. UPPER UPPER (char) char Returns char with all letters uppercase The following example returns a string in uppercase: SELECT UPPER('Large') "Uppercase" FROM DUAL; Upper LARGE Expressions used as arguments must be constant, variable, or column of character data. LOWER is not implemented with international characters; it works only with characters in the ASCII range 'a' to 'z' and 'A' to 'Z'. SQRT SQRT (number) float SQL> SELECT SQRT (4.0), SQRT(9.9) FROM DUAL; Returns square root value for the specified numeric expression (same as power =.5) POWER POWER (number, power) float Returns the exponential value for the numeric expression SQL> SELECT POWER(2.0, 3.0), POWER (3.0, 2.0) FROM DUAL; Each argument can be any numeric expression
308 MOD MOD (dividend, divisor) INT Returns remainder of the division from two integer values SQL> SELECT MOD(20,3) FROM DUAL; Dividend and divisor must each be integers. - 2 CHAR_LENGTH Function Returns the number of characters or bytes in a specified string SUBSTR Function Selects all characters beginning at a specified position until the end of the string (or for an optionally provided length). String Concatenation Date and Time Functions Syntax and examples of date and time functions. NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved SPACER
309 CHAR_LENGTH Function Syntax CHAR[ACTER]_LENGTH ( string) Parameters string Either a quoted string or a column of string type (such as CHAR, VARCHAR, or others) Returns The number of characters or bytes in a specified string Example # Discover rows in hockey table that do not have names specified. SELECT number, name FROM hockey WHERE char_length (name)=0; NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved SPACER
310 SUBSTR Function Syntax SUBSTR(str, pos [,len]) Parameters SUBSTR(str, pos) Select all characters in the string starting at position pos. SUBSTR(str, pos, len) Select all characters in the string starting at pos and continuing len number of characters. Remarks Selects all characters beginning at a specified position until the end of the string (or for an optionally provided length). Example # Select names of hockey players who are goalies. SELECT name FROM hockey WHERE (substr(position,1)='goalie'); NAME TUUKKA RASK TIM THOMAS NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved SPACER
311 String Concatenation Syntax <string> < string> Remarks Returns concatenated string. Use the text concatenation operator ( ) to format output results. Use it anywhere a constant value is allowed in an SQL statement. Values may be repeatedly concatenated in a single statement by appending the operator after each appended string constant or identifier. Example SELECT FirstName ' ' LastName AS FullName FROM Customers NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved SPACER
312 Date and Time Functions Syntax and examples of date and time functions. NuoDB provides timestamp information to the microsecond (6 decimal places). The following table describes support for date and time functions Purpose of function Implementation in NuoDB Example of Usage Current date NuoDB supports literals ('now', 'today', 'yesterday' and 'tomorrow') that can be used as values for date. SQL> create table BirthDates (Name string, BirthDate date); SQL> insert into BirthDates values ('Glenn','today'); SQL> select * from BirthDates ; NAME BIRTHDATE Glenn Difference between two dates. Implemented as date arithmetic. SQL> create table T1 (f1 date, f2 date, f3 date, f4 integer, f5 integer, f6 integer); SQL> insert into T1 (f1, f2, f3) values ('today', 'tomorrow', 'yesterday'); SQL> select * from T1; F1 F2 F3 F4 F5 F <null> <null> <null> SQL> update T1 set f4=f2-f1; SQL> select f4, f5, f6 from T1; F4 F5 F <null> <null> Calculate a new date by adding an interval to an existing date Use arithmetic symbols SQL> select f1, f1+4 as FourDaysFromNow from T1; F1 FOURDAYSFROMNOW
313 Current Time NuoDB supports 'now' as a literal that can be used as a value for time. SQL> select cast('now' as time) as MYTIME, cast('now' as date) as MYDATE, cast('now' as timestamp) as MYTIMESTAMP from dual; MYTIME MYDATE MYTIMESTAMP :21: :21: Current Timestamp NuoDB supports literals ('now', 'today', 'yesterday' and 'tomorrow') that can be used as values for timestamp. NOTES: The following expressions are equivalent: NOW() cast('now' as timestamp) NuoDB defines 'now' as the time when the function is executed. This definition may differ from other databases you have used. SQL> create table ChangeLog (Name string, Change string, When timestamp); SQL> insert into ChangeLog values ('me', 'everything', 'now'); SQL> select * from ChangeLog; NAME CHANGE WHEN me everything :23:02 SQL> select cast('now' as timestamp) from dual; :11: SQL> select cast(cast( as bigint) as date) from dual; QUARTER(date), Return quarter for date. Not standard. Not supported WEEK(date), Return week of year for date. Not standard. Not supported DAYNAME(date) Return day of week for date. DAYOFMONTH(date) Return day of month for date. DAYOFYEAR(date) Return day of year for date. MONTH(date), Return month of year for date. Not supported Not supported Not supported Not standard. Not supported
314 NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved SPACER
315 Expressions Describes value and conditional expressions. Value Expressions Conditional Expressions NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved SPACER
316 Value Expressions A type cast specifies a conversion from one data type to another. NuoDB supports type cast according to the following syntax: CAST ( expression AS type) CAST value AS data_type CAST (arrivaldate AS string) NuoDB rounds scaled numbers during conversions. The rounding is to the nearest value, where.5 and higher are rounded up. For example, C AST(0.5 TO INTEGER) returns 1. Related reference Conditional Expressions NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved SPACER
317 Conditional Expressions NuoDB supports CASE, COALESCE, NULLIF, and IN as described in the following table: CASE CASE WHEN condition THEN result [WHEN...] [ELSE result] END Use a CASE clause wherever an expression is valid. condition is an expression that returns a boolean result. If the result is true, then the value of the CASE expression is the result that follows the condition. If the result is false, any subsequent WHEN clauses are searched in the same manner. If no WHEN condition is true then the value of the case expression is the result in the ELSE clause. If the ELSE clause is omitted and no condition matches, the result is null. COALESCE COALESCE( value [,...]) Returns the first of its arguments that is not null. Null is returned only if all arguments are null. It is often used to substitute a default value for null values when data is retrieved for display. Like a CASE expression, COALESCE will not evaluate arguments that are not needed to determine the result (that is, arguments to the right of the first non-null argument are not evaluated). NULLIF NULLIF( value1, value2) Returns a null value if value1 and value2 ar e equal; otherwise it returns value1 IN WHERE coldata IN (x1,x2,x3,...) is equivalent to the following: WHERE (coldata=x1 or coldata=x2 or coldata=x3). Checks if the specified column data is a member of the specified list. It can be used with WHERE, CHECK, and creation of views. Like COALESCE and CASE, WHERE.. IN does not evaluate arguments that are not needed to determine the result (that is, arguments to the right of the first non-null argument are not evaluated). Related reference Value Expressions NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved SPACER
318 Object Privileges Become the administrator (owner) of a database when you create the first transaction engine for it. A password is required for users of the NuoDB SQL client ( nuosql ). The first user is known as the database administrator. Use the --dba-user and --dba-password option to make these specifications when you start the first transaction engine and then use them as needed. After you launch the first transaction engine, start the client as the database administrator to create new users and privileges. NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved SPACER
319 Transactions and Isolation Levels NuoDB supports several levels of transaction isolation and is based on Multi-Version Concurrency (MVCC). Multi-Version Concurrency (MVCC) is a form of concurrency control that uses multiple versions of records to provide a consistent view of the data to each transaction and to prevent concurrent transactions from overwriting each other's changes. Under MVCC, readers do not block writers, and vice-versa. NuoDB supports the following isolation levels. Note that READ_WRITE and READ_ONLY must be specified explicitly by the transaction statement. AUTOCOMMIT is ON by default. Name of Isolation Level Description Performance Trade-offs and Comments CONSISTENT_READ WRITE_COMMITTED READ_COMMITTED Each transaction sees the state of the database as it was when the transaction started, plus changes made by that transaction. Each transaction sees the state of the database as it was when the transaction started, plus its own changes, except in the case of a SELECT FOR UPDATE. A transaction always reads the most recently committed version of a record. CONSISTENT_READ produces more update conflicts, but provides complete isolation from changes made by other transactions. WRITE_COMMITTED maintains the complete isolation of each transaction for simple SELECT statements, but can breach the isolation for SELECT FOR UPDATE, update, and delete statements. In an update intensive application, WRITE_COMMITTED transactions get fewer errors on update than CONSISTENT_READ transactions. READ_COMMITTED transactions offer no guarantee of isolation, but are very familiar to users of database systems that do not implement concurrency through MVCC. For applications that must run on multiple database systems, including those that are not based on MVCC, the READ_COMMITTED level provides compatible behavior. CONSISTENT_READ When a transaction running at the CONSISTENT_READ isolation level attempts to update or delete a record that has been changed by a concurrent transaction, it waits for the other transaction to complete. When it completes, the waiting transaction succeeds in its update only if the previous transaction rolled back. Otherwise, the waiting transaction gets an error. How the waiting transaction handles the error depends on the logic of the application. If the logic requires updating that particular record, then the application must rollback the transaction that got the error and retry it. If not, then the transaction can succeed. For example, at the CONSISTENT_READ isolation level, the following transaction query gets the same value back, even if other transactions have updated the value of seatsavailable. SELECT seatsavailable FROM flights WHERE flightnumber = 23 AND flightdate = 'today' Note The CONSISTENT_READ isolation level is the same as SERIALIZABLE, a name that is used in the SQL standard. "Every isolation level guarantees that no update is lost. The highest isolation level, SERIALIZABLE, guarantees serializable executi on, meaning that the effect of SQL-transactions that overlap in time is the same as the effect they would have had, had they not overlapped in time. " SQL Standard, Part 1: Framework (SQL/Framework), sec. 4.8 Communication between an SQL-agent
320 and an SQL-server. WRITE_COMMITTED Applications that depend on updating the same record repeatedly are difficult to run at the CONSISTENT_READ isolation level; there are usually frequent failures because of conflicting updates. For example, an application that assigns unique part numbers by incrementing a master part number generator gets frequent update conflicts. NuoDB supports WRITE_COMMITTED, which is a lower level of transaction isolation that avoids update conflicts at the expense of read consistency. When a transaction in WRITE_COMMITTED isolation level executes a SELECT FOR UPDATE statement and the record being selected has been updated by a concurrent transaction, it waits for the first transaction to complete, then, if the transaction commits, it reads the newest version of the record. So, for example, the NuoDB sample flights application could keep a single value for the number of seats available on a flight and reduce it by one each time a seat is booked. Suppose the following query returns a value of 45 for a particular transaction. SELECT seatsavailable FROM flights WHERE flightnumber = 23 AND flightdate = 'today' Suppose the same transaction runs the same query except it adds a "for update" qualifier. SELECT seatsavailable FROM flights WHERE flightnumber = 23 AND flightdate = 'today' FOR UPDATE In this case the query might return 44, that is, the FOR UPDATE leads to a different result. Here's why the results differ: At the CONSISTENT_READ isolation level, when a transaction issues the same query more than once, it gets the same results, unless the transaction itself has made a change that affects the query. At the WRITE_COMMITTED isolation level, SELECT queries in a transaction also return consistent results aside from changes that it made, except if SELECT queries have a FOR UPDATE qualifier. If FOR UPDATE is specified as part of the transaction, and there is a record that has been changed by a concurrent transaction, the reader waits for the update to complete, then reads the most recently committed record version. In other words, it "looks ahead" and finds a value it depends on and waits for that value to be updated. For example, at the WRITE_COMMITTED level, the following update statement waits for any concurrent changes to be committed, then applies the update to the most recent version of the record. UPDATE flights SET seatsavailable = seatsavailable - 1 WHERE flightnumber = 23 AND flightdate = 'today' In the same situation, a CONSISTENT_READ transaction would get an update conflict error. The WRITE_COMMITTED level trades absolute consistency for higher throughput in update-intensive applications. Note NuoDB supports an alternative method of creating unique values, called SEQUENCES, which is defined by the SQL standard. See, 2008 SQL Standard, Part 11: Information and Definition Schemas (SQL/Schemata) READ_COMMITTED NuoDB also supports a transaction isolation level called READ_COMMITTED. At this level, a transaction always reads the most recently committed version of a record. The following query could return 45 the first time it is run in a transaction, 43 the next time, and 25 the third time, depending on the number of times the record was updated between the running of the statement.
321 SELECT seatsavailable FROM flights WHERE flightnumber = 23 AND flightdate ='today' For data such as seats available in a flight-booking application, these results are good. For a different application, such as one that reconciles financial accounts, having values change during the life span of a transaction makes it almost impossible to generate consistent results. At the READ_COMMITTED isolation level, NuoDB handles update conflicts in the same way that it handles them at the WRITE_COMMITTED level. That is, when a transaction attempts to update a record that was updated by a concurrent transaction, it waits for that transaction to commit, then updates the most recent version of the record. Using AUTOCOMMIT The JDBC Specification requires that default transactions be executed at the AUTOCOMMIT level, meaning that each statement ends in an implicit commit. For JDBC connections, NuoDB automatically issues a commit at the end of each statement. At this level, update conflicts and deadlocks are less frequent than when a transaction must be explicitly ended. However, an autocommit transaction can not guarantee that two related changes succeed or fail together. Note Use SHOW AUTOCOMMIT to display the current status of AUTOCOMMIT as an isolation level. By default AUTOCOMMIT is ON. READ_WRITE and READ_ONLY NuoDB accepts qualifiers that specify explicitly the operations allowed by a transaction, such as READ_WRITE and READ_ONLY. A transaction may only select records; it cannot insert, update, or delete records, regardless of the privileges granted to the user. Errors In all three isolation levels, errors on the database side are returned to the application, which decides whether to rollback the transaction. As long as the application maintains its connection with the NuoDB database, it maintains control of its transactions. If NuoDB discovers that it has lost its connection with an application, changes made by uncommitted transactions belonging to that application are rolled back. Defaults In NuoDB, SQL statements execute only in the context of a transaction. If there is no active transaction when an application issues a statement to NuoDB, it creates a transaction at the CONSISTENT_READ isolation level with a qualifier of READ_WRITE: this means that the transaction can both read and change records. For applications that use the JDBC interface, the transaction is also in AUTOCOMMIT level by default, meaning that NuoDB automatically issues a commit at the end of each statement. If your JDBC application requires that several changes succeed or fail as a group, you must explicitly set AUTOCOMMIT to be off. General Performance Trade-offs The performance of the three isolation levels is approximately equivalent. Relationship to java.sql Levels Compare NuoDB With java.sql.connection Transaction Isolation Levels NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved SPACER
322 Relationship to java.sql Levels Compare NuoDB With java.sql.connection Transaction Isolation Levels The JDBC interface provides five transaction isolation levels. NuoDB does not support all of the levels. NuoDB also supports two additional levels that are not in the JDBC standard. The following table describes the levels that are supported by NuoDB. ID JDBC Constant NuoDB support Description 0 Connection.TRANSACTION_ NONE 1 Connection.TRANSACTION_ READ_UNCOMMITTED 2 Connection.TRANSACTION_ READ_COMMITTED 4 Connection.TRANSACTION_ REPEATABLE_READ 8 Connection.TRANSACTION_ SERIALIZABLE 5 com.nuodb.jdbc.transactionisol ation.transaction_ WRITE_COMMITTED 7 com.nuodb.jdbc.transactionisol ation.transaction_ CONSISTENT_READ no no yes no yes (Becomes CONSISTENT_READ in NuoDB) yes yes No Transactions Dirty reads, non-repeatable reads and phantom reads can occur. Dirty reads are prevented; non-repeatable reads and phantom reads can occur. Dirty reads are prevented; non-repeatable reads happen after writes; phantom reads can occur. Dirty reads, non-repeatable reads and phantom reads are prevented. NuoDB only. Dirty reads are prevented; non-repeatable reads and phantom reads can occur in SELECT FOR UPDATE queries NuoDB only. Native level. Repeatable reads, no phantoms, but some write anomalies that would not occur if the transactions were run in a single series. CONSISTENT_READ is same as SERIALIZABLE. NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved SPACER
323 Internationalization and Localization Requirements to handle character strings in UTF-8, as stored in the NuoDB database. All character strings in the NuoDB database are stored in UTF-8 format. Your client application must take care of conversion to and from UTF-8 of input data and output data. You can handle this in the client application by setting the LANG and LC_ALL environment variables to the encoding you are using. Note that these settings are required to interact with nuosql, or any other command line client by means of stdin and stdout, as well as for a client reading from a file that has a non-default encoding. On Windows, you may also be required to use the CHCP command. All C++ clients must call setlocale() with an empty string to initialize the client with information about the current locale settings. For example: setlocale(lc_all, ""); NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved SPACER
324 Migration Notes Making the Transition to a NuoDB Database Migration notes and tools Distinction between a schema and a database Specifying a connection using JDBC with legacy databases NuoDB Migrator NuoDB Migrator is a command line interface to help domain administrators migrate a legacy database to NuoDB. It is available on GitHub: NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved SPACER
325 Distinction between a schema and a database Specifying a connection using JDBC with legacy databases NuoDB makes a distinction between a database and schema. In contrast, some database vendors have only schemas, but they refer to the schemas as databases. This inconsistency can become an issue when specifying a connection using a JDBC URL. For NuoDB connections, a database is specified, but legacy databases might have specified the database using a schema name. See the following examples of this distinction: jdbc:com.nuodb://{broker}:{port}/{database}[?schema=schema] jdbc:com.mysql://{host}:{port}/{schema} Related reference NuoDB Migrator NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved SPACER
326 Compliance with SQL Standard The following table describes NuoDB compliance against core standard SQL-99 features. (Note: This list is currently incomplete and subject to change.) Feature ID Feature name Supported by NuoDB? Known limitations with NuoDB B011 Embedded Ada *) Obsolete B012 Embedded C *) Obsolete B013 Embedded COBOL *) Obsolete B014 Embedded Fortran *) Obsolete B015 Embedded MUMPS *) Obsolete B016 Embedded Pascal *) Obsolete B017 Embedded PL/I 1 *) Obsolete E011 Numeric data types Partial NUMBER is supported but defined differently from the standard. E INTEGER and SMALLINT data types (including all spellings) E REAL, DOUBLE PRECISON, and FLOAT data types E DECIMAL and NUMERIC data types Yes Yes Yes REAL and FLOAT are treated as DOUBLE E Arithmetic operators Yes E Numeric comparison Yes E Implicit casting among the numeric data types Yes E021 Character data types Yes E CHARACTER data type (including all its spellings) E CHARACTER VARYING data type (including all its spellings) Yes Yes E Character literals Partial Escape characters not yet implemented E CHARACTER_LENGTH function Yes E OCTET_LENGTH function Yes Implemented as CHARACTER_LENGTH USING OCTETS E SUBSTRING function Yes E Character concatenation Yes Issues with NULLs E UPPER and LOWER functions Yes
327 E TRIM function NO E Implicit casting among the character data types Yes E POSITION function NO E Character comparison Yes E031 Identifiers Yes SQL identifiers (table names, column names, domain names etc.) are limited to 128 characters E Delimited identifiers Yes E Lower case identifiers No Metadata tables are case-insensitive E Trailing underscore Yes E051 Basic query specification Mostly E SELECT DISTINCT Yes E GROUP BY clause Yes E GROUP BY can contain columns not in select-list E Select list items can be renamed Yes Yes E HAVING clause Yes E Qualified * in select list Partial Not supported in view definitions E Correlation names in the FROM clause E Rename columns in the FROM clause Not yet implemented NO E061 Basic predicates and search conditions Partial Partially implemented E Comparison predicate Yes E BETWEEN predicate Yes E IN predicate with list of values Yes E LIKE predicate Yes E LIKE predicate: ESCAPE clause Yes E NULL predicate Yes E Quantified comparison predicate NO E EXISTS predicate Yes E Subqueries in comparison predicate Yes
328 E Subqueries in IN predicate Yes E Subqueries in quantified comparison predicate NO E Correlated subqueries Yes E Search condition Yes E071 Basic query expressions Partial E UNION DISTINCT table operator Not yet implemented DISTINCT is disregarded E UNION ALL table operator Yes E EXCEPT DISTINCT table operator E Columns combined via table operators need not have exactly the same data type No Yes E Table operators in subqueries Yes E081 Basic Privileges Not yet implemented GRANT is partially implemented E SELECT privilege at the table level Yes E DELETE privilege Yes E INSERT privilege at the table level E UPDATE privilege at the table level E UPDATE privilege at the column level E REFERENCES privilege at the table level E REFERENCES privilege at the column level Yes Yes NO NO NO E WITH GRANT OPTION Not yet implemented GRANT assumed by default E USAGE privilege NO E EXECUTE privilege NO E091 Set functions Not yet implemented E AVG Yes E COUNT Yes E MAX Yes E MIN Yes E SUM Yes E ALL quantifier Yes
329 E DISTINCT quantifier Not yet implemented DISTINCT is disregarded E101 Basic data manipulation Yes E INSERT statement Yes E Searched UPDATE statement Yes E Searched DELETE statement Yes E111 Single row SELECT statement Partial INTO is not supported E121 Basic cursor support NO E DECLARE CURSOR NO E ORDER BY columns need not be in select list E Value expressions in ORDER BY clause Yes Yes E OPEN statement NO E Positioned UPDATE statement NO E Positioned DELETE statement NO E CLOSE statement NO E FETCH statement: implicit NEXT NO E WITH HOLD cursors NO E131 Null value support (nulls in lieu of values) Yes E141 Basic integrity constraints Yes E NOT NULL constraints Yes E UNIQUE constraints of NOT NULL columns Yes E PRIMARY KEY constraints Yes E Basic FOREIGN KEY constraint with the NO ACTION default NO You can specify FOREIGN but it is ignored. E CHECK constraints Yes E Column defaults Yes E NOT NULL inferred on PRIMARY KEY E Names in a foreign key can be specified in any order Yes NO You can specify FOREIGN but it is ignored. E151 Transaction support Yes E COMMIT statement Yes E ROLLBACK statement Yes E152 Basic SET TRANSACTION statement Yes
330 E SET TRANSACTION statement: ISOLATION LEVEL SERIALIZABLE clause E SET TRANSACTION statement: READ ONLY and READ WRITE clauses Yes Yes SERIALIZABLE is the same as CONSISTENT_READ E153 E161 Updatable queries with subqueries SQL comments using leading double minus Yes Yes E171 SQLSTATE support NO F021 Basic information schema Yes F COLUMNS view Yes F TABLES view Yes F VIEWS view Yes F TABLE_CONSTRAINTS view Yes Named TABLECONSTRAINTS F REFERENTIAL _CONSTRAINTS view NO F CHECK_CONSTRAINTS view NO F031 Basic schema manipulation Not yet implemented F CREATE TABLE statement to create persistent base tables Yes F CREATE VIEW statement Yes F GRANT statement Not yet implemented F ALTER TABLE statement: ADD COLUMN clause F DROP TABLE statement: RESTRICT clause F DROP VIEW statement: RESTRICT clause F REVOKE statement: RESTRICT clause Yes Yes Yes NO F041 Basic joined table Yes F Inner join (but not necessarily the INNER keyword) Yes F INNER keyword Yes F LEFT OUTER JOIN Yes F RIGHT OUTER JOIN NO F Outer joins can be nested Partial Parenthesis not allowed
331 F The inner table in a left or right outer join can also be used in an inner join F All comparison operators are supported (rather than just =) Yes Yes F051 Basic date and time Yes F DATE data type (including DATE literal) F TIME data type (including TIME literal) with fractional seconds precision of 0 F TIMESTAMP data type (including TIMESTAMP literal) with fractional seconds precision of 0 and 6 F Comparison predicate on DATE, TIME, and TIMESTAMP data types F Explicit CAST between datetime types and character types Yes Yes Yes Yes Yes Does not support [WITH[OUT] TIME ZONE] Does not support [WITH[OUT] TIME ZONE] F CURRENT_DATE NO Supported with alternative syntax F LOCALTIME NO Supported with alternative syntax F LOCALTIMESTAMP NO Supported with alternative syntax F081 UNION and EXCEPT in views NO Neither UNION nor EXCEPT F131 Grouped operations Partial Not yet implemented with views F WHERE, GROUP BY, and HAVING clauses supported in queries with grouped views F Multiple tables supported in queries with grouped views F Set functions supported in queries with grouped views F Subqueries with GROUP BY and HAVING clauses and grouped views F Single row SELECT with GROUP BY and HAVING clauses and grouped views Not yet implemented Not yet implemented Yes Yes Yes F201 CAST function Yes F221 Explicit defaults Not yet implemented F261 CASE expression Yes F Simple CASE yes
332 F Searched CASE yes F NULLIF yes F COALESCE yes F311 Schema definition statement Mostly F CREATE SCHEMA yes F CREATE TABLE for persistent base tables yes F CREATE VIEW yes F CREATE VIEW: WITH CHECK OPTION NO F GRANT statement Mostly F471 Scalar subquery values Not yet implemented F481 Expanded NULL predicate Yes F501 Features and conformance views NO F SQL_FEATURES view NO F SQL_SIZING view NO F SQL_LANGUAGES view NO F812 Basic flagging NO S011 Distinct data types NO CREATE TYPE not supported S USER_DEFINED_TYPES view NO T321 Basic SQL-invoked routines NO T User-defined functions with no overloading T User-defined stored procedures with no overloading NO NO T Function invocation NO T CALL statement NO T RETURN statement NO T ROUTINES view NO T PARAMETERS view NO NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved SPACER
333 Summary of SQL in NuoDB SQL Keyword/Function/Command WikiDoc page Supported - Mathmatical Operators Supported!= Numeric comparison operators Supported * Mathmatical Operators Supported / Mathmatical Operators Supported % Mathmatical Operators Supported + Mathmatical Operators Supported < Comparison Operators Supported < Numeric comparison operators Supported <= Comparison Operators Supported <= Numeric comparison operators Supported = Comparison Operators Supported = Numeric comparison operators Supported > Comparison Operators Supported > Numeric comparison operators Supported >= Comparison Operators Supported >= Numeric comparison operators Supported String Concatenation Supported ALL Compliance with SQL Standard Supported ALTER DOMAIN SQL Reference Pages Supported ALTER SEQUENCE SQL Reference Pages Supported ALTER TABLE SQL Reference Pages Supported ALTER TRIGGER SQL Reference Pages Supported ALTER USER SQL Reference Pages Supported AND Logical Operators Supported AS Compliance with SQL Standard; SELECT Supported AUTOCOMMIT Transactions and Isolation Levels Supported AUTOCOMMIT SQL Reference Pages Supported AVG Compliance with SQL Standard Supported Basic date and time Compliance wth SQL Standard Basic flagging Compliance wth SQL Standard Not supported Basic information schema Compliance wth SQL Standard Supported
334 Basic integrity constraints Compliance wth SQL Standard Basic joined table Compliance wth SQL Standard Supported Basic predicates and search conditions Compliance wth SQL Standard Paritally implemented Basic query expressions Compliance wth SQL Standard Paritally implemented Basic Query Specification Compliance wth SQL Standard Not supported Basic schema manipulation Compliance wth SQL Standard Not yet implemented Basic SQL-invoked ruotines Compliance wth SQL Standard Not supported BETWEEN Comparison Operators Supported BETWEEN Compliance with SQL Standard Supported BIGINT BINARY BINARY LARGE OBJECT BINARY VARYING Standard SQL Datatype Keywords Supported Standard SQL Datatype Keywords Supported Standard SQL Datatype Keywords Supported Standard SQL Datatype Keywords Supported Supported Supported Supported Supported BlobRef() Undocumented function Supported BOOLEAN Standard SQL Datatype Keywords Supported Supported CALL Compliance wth SQL Standard Not supported CASE Conditional Expressions Supported CASE (expression) CASE (searched) CASE (simple) Standard SQL Datatype Keywords Supported Standard SQL Datatype Keywords Supported Standard SQL Datatype Keywords Supported Supported Supported Supported CAST Value Expressions Supported CHAR_LENGTH() CHAR_LENGTH Function Supported CHARACTER CHARACTER LARGE OBJECT CHARACTER VARYING Standard SQL Datatype Keywords Supported Standard SQL Datatype Keywords Supported Standard SQL Datatype Keywords Supported Supported Supported Supported CHARACTER_LENGTH USING OCTETS Compliance wth SQL Standard Supported CHECK Compliance with SQL Standard Supported
335 CHECK_CONSTRAINTS Compliance wth SQL Standard Not supported CLOSE Compliance wth SQL Standard Not supported CLOSE Compliance wth SQL Standard Not supported COALESCE Conditional Expressions Supported COLUMNS VIEW Compliance with SQL Standard Supported COMMIT Compliance with SQL Standard Supported COMMIT SQL Reference Pages Supported CONSISTENT_READ Compliance wth SQL Standard Same as SERIALIZABLE COUNT Compliance with SQL Standard Supported CREATE DATABASE SQL Reference Pages Supported CREATE DOMAIN SQL Reference Pages Supported CREATE INDEX SQL Reference Pages Supported CREATE PROCEDURE SQL Reference Pages Supported CREATE ROLE SQL Reference Pages Supported CREATE SCHEMA SQL Reference Pages Supported CREATE SEQUENCE SQL Reference Pages Supported CREATE TABLE Compliance with SQL Standard Supported CREATE TABLE SQL Reference Pages Supported CREATE TRIGGER SQL Reference Pages Supported CREATE TYPE Compliance wth SQL Standard Not supported CREATE USER SQL Reference Pages Supported CREATE VIEW SQL Reference Pages Supported CURRENT_DATE Compliance wth SQL Standard Supported w/ alternative syntax CURRENT_SCHEMA CURRENT_USER clause in SELECT clause in SELECT CURSOR Compliance wth SQL Standard Not supported DATE DECIMAL Standard SQL Datatype Keywords Supported Standard SQL Datatype Keywords Supported Supported Supported DECLARE CURSOR Compliance wth SQL Standard Not supported Defaults (explict) Compliance wth SQL Standard Not yet implemented DEFAULT CREATE DOMAIN Supported DEFAULT GRANT Supported DEFAULT INSERT Supported DELETE SQL Reference Pages Supported
336 DELETE (positioned) Compliance wth SQL Standard Not supported DELETE (searched) DISTINCT Compliance with SQL Standard; clause in SELECT Supported DOUBLE Numeric Types Supported DOUBLE PRECISION DOUBLE PRECISION Standard SQL Datatype Keywords Supported Standard SQL Datatype Keywords Supported Supported Supported DROP DATABASE SQL Reference Pages Supported DROP DOMAIN SQL Reference Pages Supported DROP INDEX SQL Reference Pages Supported DROP PROCEDURE SQL Reference Pages Supported DROP ROLE SQL Reference Pages Supported DROP SCHEMA SQL Reference Pages Supported DROP SEQUENCE SQL Reference Pages Supported DROP TABLE Compliance with SQL Standard Supported DROP TABLE SQL Reference Pages Supported DROP TRIGGER SQL Reference Pages Supported DROP USER SQL Reference Pages Supported DROP VIEW Compliance with SQL Standard Supported DROP VIEW SQL Reference Pages Supported EXCEPT DISTINCT Compliance wth SQL Standard Not supported EXCEPT VIEW Compliance wth SQL Standard Not supported EXISTS Compliance with SQL Standard Supported EXPLAIN SQL Reference Pages Supported FETCH Compliance wth SQL Standard; SELECT Not supported FOREIGN KEY Compliance wth SQL Standard Ignored (NO ACTION default) FOR UPDATE clause in SELECT FROM Compliance with SQL Standard Supported FROM DATE Date, Time, and TimeStamp Conversions Supported FROM TIME Date, Time, and TimeStamp Conversions Supported FROM TIMESTAMP Date, Time, and TimeStamp Conversions Supported FULL [OUTER] JOIN SELECT Not yet implemented Function invocation Compliance wth SQL Standard Not supported GENERATED ALWAYS AS IDENTITY CREATE SEQUENCE Supported
337 GENERATED ALWAYS AS IDENTITY CREATE TABLE Supported GENERATED BY DEFAULT AS IDENTITY CREATE TABLE Supported GetCommitMode() Undocumented function Undocumented :: Supported GetTransactionEndEvent() Undocumented function Undocumented :: Supported GetTransactionStartEvent() Undocumented function Undocumented :: Supported GRANT Compliance with SQL Standard Partially implemented GRANT SQL Reference Pages Supported GRANT OPTION Compliance with SQL Standard Supported GROUP BY Compliance with SQL Standard; SELECT Supported GROUP BY in queries with grouped views Compliance wth SQL Standard Not yet implemented GROUP BY subqueries Compliance wth SQL Standard Supported HAVING Compliance with SQL Standard; SELECT Supported HAVING in queries with grouped views Compliance wth SQL Standard Not yet implemented HAVING subqueries Compliance wth SQL Standard Supported IN Conditional Expressions Supported IN Compliance with SQL Standard Supported INNER Compliance with SQL Standard Supported INNER JOIN Compliance with SQL Standard Supported INSERT Compliance with SQL Standard Supported INSERT SQL Reference Pages Supported LEFT OUTER JOIN Compliance with SQL Standard; SELECT Supported LIKE Compliance with SQL Standard Supported LIMIT clause in SELECT LOCAL TIME Compliance wth SQL Standard Not supported LOCAL TIMESTAMP Compliance wth SQL Standard Supported w/ alternative syntax LOWER() Functions Supported MAX Compliance with SQL Standard Supported MIN Compliance with SQL Standard Supported MOD() FUNCTIONS Supported Multiple tables in queries with grouped views Compliance wth SQL Standard Not yet implemented NOT Logical Operators Supported NOT NULL Compliance with SQL Standard Supported NOW Date and Time Functions Supported NULL Supported
338 NULL Compliance with SQL Standard Supported NULLIF Conditional Expressions Supported NUMERIC Standard SQL Datatype Keywords Supported Supported nuodb-mirgration dump NuoDB Migrator nuosql nuodb-mirgration load NuoDB Migrator nuosql OFFSET clause in SELECT OPEN Compliance wth SQL Standard Not supported ORDER BY Compliance with SQL Standard; SELECT Supported ORDER BY Logical Operators Supported ORDER BY Compliance with SQL Standard Supported PARAMETERS view Compliance wth SQL Standard Not supported POSITION Compliance wth SQL Standard Not supported POWER() FUNCTIONS Supported PRIMARY KEY constraints Compliance with SQL Standard Supported READ ONLY Compliance wth SQL Standard Supported READ WRITER Compliance wth SQL Standard Supported REFERENCES Compliance wth SQL Standard Not supported REFERENTIAL_CONSTRAINTS VIEW Compliance wth SQL Standard Not supported RELEASE SQL Reference Pages Supported REPLACE SQL Reference Pages Supported RESTRICT Compliance with SQL Standard Not supported RETURN Compliance wth SQL Standard Not supported REVOKE Compliance with SQL Standard Supported REVOKE SQL Reference Pages Supported RIGHT JOIN SELECT Not yet implemented ROLLBACK Compliance with SQL Standard Supported ROLLBACK SQL Reference Pages Supported ROUTINES view Compliance wth SQL Standard Not supported SAVEPOINT SQL Reference Pages Supported SchemaName() Undocumented function Supported SELECT SQL Reference Pages Supported SELECT Compliance with SQL Standard Supported SELECT (single row with GROUP BY Compliance wth SQL Standard Supported and HAVING and grouped views)
339 SELECT (single row) SELECT DISTINCT Compliance with SQL Standard Supported SET SQL Reference Pages Supported SET functions supported in queries Compliance wth SQL Standard Supported with grouped views SET TRANSACTION Compliance with SQL Standard Supported SHOW SQL Reference Pages Supported SMALLINT Standard SQL Datatype Keywords Supported Supported SQL_FEATURES view Compliance wth SQL Standard Not supported SQL_LANGUAGES view Compliance wth SQL Standard Not supported SQL_SIZING view Compliance wth SQL Standard Not supported SQLSTATE Compliance wth SQL Standard Not supported SQRT() FUNCTIONS Supported START TRANSACTION SQL Reference Pages Supported Stored Procedures Not yet implemented STRING String Types nuosql? SUBSTR() SUBSTR Function Supported SUBSTRING() Compliance with SQL Standard Supported SUM Compliance with SQL Standard Supported TABLE_CONSTRAINTS VIEW Compliance with SQL Standard Supported TABLES VIEW Compliance with SQL Standard Supported TIME Compliance wth SQL Standard Supported TIMESTAMP Standard SQL Datatype Keywords Supported Supported TODAY Date and Time Functions Supported TOMORROW Date and Time Functions Supported TRIM Compliance wth SQL Standard Not supported TRUNCATE SQL Reference Pages Supported TRUNCAE TABLE TRUNCATE TABLE UDF with no overloading Compliance wth SQL Standard Not supported UNION DISTINCT Compliance with SQL Standard DISTINCT is ignored UNION VIEW Compliance wth SQL Standard Not supported UPDATE Compliance with SQL Standard table level supported UPDATE Compliance with SQL Standard column level not supported UPDATE SQL Reference Pages Supported
340 UPDATE (positioned) Compliance wth SQL Standard Not supported UPDATE (searched) UPGRADE SQL Reference Pages Supported UPPER() FUNCTIONS Supported USE SQL Reference Pages Supported User defined stored procedures Compliance wth SQL Standard Not supported with no overloading USER_DEFINED_TYPES Compliance wth SQL Standard Not supported Variables? VIEW Compliance with SQL Standard Supported WHERE Supported WHERE in queries with grouped views Compliance wth SQL Standard Not yet implemented WITH GRANT OPTION Compliance wth SQL Standard Not yet implemented WITH HOLD cursors Compliance wth SQL Standard Not supported YESTERDAY Date and Time Functions Supported NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved SPACER
341 Working With Triggers Examples of creating, altering, and dropping triggers in NuoDB A trigger is a named database object that is associated with a table. It is executed when a particular event occurs for the table. For example, you can use triggers to check values before they are inserted into a table, or to perform calculations on values that are part of an update. How Triggers Work INSERT, DELETE, or UPDATE statements that execute for a table can activate a trigger for the table. You can set the trigger to activate either before or after the triggering statement. For example, you can have a trigger activate before each row that is inserted into a table or after each row that is updated. NOTE See the ALTER TRIGGER, CREATE TRIGGER, and DROP TRIGGER topics for the exact syntax for triggers. Example: Creating Triggers This code fragment shows two triggers: test1a and test1b. One of the triggers fails because of a mismatch of type definitions for a column. Create three tables (test1, test2, test3). Each of the tables has one cell (a1, a2, a3, respectively). SQL> use test; SQL> create table test1(a1 int); SQL> create table test2 (a2 int); SQL> create table test3 (a3 int not null primary key); Define a trigger that inserts 200 as the value of a2 in test2 whenever any value is inserted into test1. SQL> create trigger test1a for test1 before insert as insert into test2(a2) values(200); end_trigger; To show the results of the trigger, specify an INSERT to test1 as 100. SQL> insert into test1(a1) values (100); SQL> select * from test1; A SQL> select * from test2; A Define another trigger on test1 to insert 200 as the value of a2 in test2, and also to insert 300 as the value of a3, whenever any value is inserted into test1. SQL> create trigger test1b for test1 > before insert > as > insert into test2(a2) values(400); > insert into test3(a3) values(300); > end_trigger;
342 To show the results of the trigger, specify an INSERT to test1 as 100. Note that test2 has two rows added, because of two triggers that fired before the insert to test1. SQL> insert into test1(a1) values(100); SQL> select * from test1; A SQL> select * from test2; A SQL> select * from test3; A Example: Altering A Trigger The following code fragment depends on the code in the previous section (Example: Creating Triggers). An error occurs on the next insert into test1. Trigger test1b attempted to add a row to table test3 but failed because of a mismatch in the definition of test3(a3). (The value of test3(a3) is defined as a primary key and must be unique.) To avoid the error until you can fix the problem, deactivate the trigger that causes it, namely test1b. Show the results when you do the insert. Only the first trigger (test1a) fires. SQL> insert into test1(a1) values(100); duplicate value in unique index TEST3..PRIMARY_KEY SQL> alter trigger test1b for test1 inactive; SQL> insert into test1(a1) values(100); SQL> A SQL> select * from test2; A SQL> select * from test3; A
343 Example: Dropping A Trigger The following code fragment depends on the code in the previous section (Example: Altering A Trigger). To fix the problem with test1b you must remove it and define it again. You cannot use ALTER TRIGGER to redefine it. SQL> drop trigger test1b; Example: Using A Sequence Number In A Trigger The following code fragment depends on the code in the previous section (Example: Altering A Trigger). Fix the problem by defining the trigger using a sequence instead of an integer. SQL> create sequence test3key; SQL> create trigger test1b for test1 >before insert >as >insert into test2(a2) values (400); >insert into test3(a3) values (next value for test3key); >end_trigger; SQL> insert into test1(a1) values (100); SQL> select * from test3; A SQL> insert into test1(a1) values (100); SQL> select * from test3; A NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved SPACER
344 SQL Datatypes Numeric types Name Storage Size Description Range smallint small-range integer to integer typical choice for integer to bigint large-range integer to decimal user-specified precision, exact up to digits before the decimal point; up to digits after the decimal point numeric user-specified precision, exact up to digits before the decimal point; up to digits after the decimal point number double precision variable-precision, inexact E+308 to E-308 real variable-precision, inexact Special Characters The semicolon (;) terminates a SQL command. The asterisk (*) denotes all the fields of a table row or composite value. Comments Commenting is supported in lines that begin with either double dashes or a hash character # and extending to the end of the line. SQL> # This is a comment. SQL> -- This is another comment. SQL> Multi-line comments are supported within /* */ comment flags.
345 SQL> /* This is a multi-line comment > illustrating the use of > slash asterisk asterisk slash > comment flags */ > > SELECT * FROM hockey > WHERE Number = 1; ID NUMBER NAME POSITION TEAM MAX SUMMIT Fan Bruins SQL> NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved SPACER
346 Administration and Deployment How to administer and deploy a NuoDB project. Administration Tools Provisioning NuoDB Troubleshooting NuoDB Scaling out NuoDB Setting up in Multiple Hosts NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved SPACER
347 Administration Tools Tools that allow for the instantiation and management of a NuoDB Domain. NuoAgent NuoDB Manager NuoDB Web Console NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved SPACER
348 nuoagent Starts a NuoDB agent or broker as specified. Note: a broker is started as a service on Windows platforms, and on RPM and DEB Linux installers it is automatically started when you install the product. Syntax java -jar nuoagent.jar [options] Command Line Options When NuoDB starts an agent it determines the value for options by examining the default.properties file. Specify options on the command line only if you want to override what is in the properties file. Starting a broker or agent requires a domain password. In general, best practice is to specify values for options in default.properties instead of on the command line. Windows Windows users must have write permissions to the NuoDB directory in order to save changes to the default.properties file. See Writ e Permissions in Windows for instructions on granting directory-level write permissions in Windows. Linux On Linux platforms, adding the & (ampersand) symbol to the end of the command when starting up a new agent, informs the process to run in the background. While this is optional, it is especially important when starting up an agent remotely, as the process will otherwise end when the user logs off from the machine. Name --broker --password domain_password --peer hostname[: port] Usage Starts the agent as a connection broker. If not specified, the process starts as an agent, and you must use the peer option to specify an entry to an existing domain. A password is required to start a broker. Initially you must use the administrative password as specified in the default.propertie s for the the domainpasswordproperty. Specifies host to use as a peer connection for entering the domain. Alternatively you can specify --broadcast. --port [: port] Use the specified port instead of the default, which is bin-dir directory --advertise-alt --alt-addr address --domain name --port-range start[, end] Directory containing the nuodb executable. If the bin-dir flag is not specified, and the local directory does not contain nuodb, then the agent will be unable to start any processes. This is by design, and gives you the ability to lock down a host as a broker that cannot run any databases. Advertise alternate addresses. Associate an address with the specified peer. Name of the domain to support. Range of allowable port numbers for NuoDB processes.
349 --broadcast number_of_seconds --help --verbose --version Enable broadcast advertisement and discovery of NuoDB hosts at intervals specified by number_of_seconds. Display information about the command Enable logging Display the agent version Description A nuoagent process must run (as either an agent or a broker) on any instance where NuoDB databases are hosted. Edit the etc\default.properties (MS Windows), etc/default.properties (Linux/Mac) file to specify properties, or specify a different source of properties for an agent or broker. An agent can run as an agent or as a broker as follows: Agent Broker and Agent Keeps track of every NuoDB process running on a given machine and is the point of administration to the system. Agents are responsible for starting and monitoring NuoDB processes. At least one agent must be started as a broker as part of a NuoDB configuration. A broker manages access (from both client and administrative connections) to the NuoDB transaction engines that are configured. Examples # Provision a domain with two hosts. # Using these commands, a broker is started on each host (because the broker property is set to true as the default). On host1: $ java -jar nuoagent.jar & On host2: $ java -jar nuoagent.jar --peer host1 & default.properties The default.properties file is used to globally set configuration variables for the NuoDB Domain. Commands to Start and Stop NuoDB Brokers and Agents NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved SPACER
350 Commands to Start and Stop NuoDB Brokers and Agents A NuoDB agent can run as a broker or as an agent, depending on the options that you specify when it starts. Agents and brokers that are running are represented in your tray monitor as birds that are black when the process is running, and red if the process is shutdown. Brokers are started automatically as part of the installation process on most platforms that NuoDB supports. If you want the broker that starts by default to run instead as an agent, you have to change the specification for the broker property in the default.properties file, stop the agent (running as a broker), and restart it. See default.properties for configuration parameters. Editing default.properties in Windows Windows users must have write permissions to the NuoDB directory in order to save changes to the default.properties file. See Writ e Permissions in Windows for instructions on granting directory-level write permissions in Windows. Mac OSX To stop and start agents on Mac OSX platforms: launchctl stop com.nuodb.agent launchctl start com.nuodb.agent Linux To restart agents on Linux platforms: sudo service nuoagent restart Windows To restart agents on Windows platforms: Click Start, type services.msc in the textbox, and press Enter. Select NuoDB Agent, and click restart.
351 NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved SPACER
352 Starting and Stopping NuoDB Agents/Brokers, Web Console and Tray Monitor A NuoDB agent can run as a broker or as an agent, depending on the options that you specify when it starts. Agents and brokers that are running are represented in your tray monitor as birds that are black when the process is running, and red if the process is shutdown. All NuoDB installer packages will configure a broker to start automatically. The.tar.gz package will not configure the broker to start automatically. You can configure the broker that starts by default to run as an agent, by changing -- broker parameter to false in the default.properties f ile; stop the nuoagent service (which is currently running as a broker), and then restart the nuoagent service. See default.properties for configuration parameters. The stop/start commands for nuoagent and other NuoDB services are presented for each supported OS below. Editing default.properties in Windows Windows users must have write permissions to the NuoDB directory in order to save changes to the default.properties file. See Writ e Permissions in Windows for instructions on granting directory-level write permissions in Windows. Mac OS X Linux WIndows Mac OSX To stop and start NuoDB services on Mac OS X platforms: # Commands to stop NuoDB agent, console and tray monitor launchctl stop com.nuodb.agent launchctl stop com.nuodb.console launchctl stop com.nuodb.traymonitor # Commands to start NuoDB agent, console and tray monitor launchctl start com.nuodb.agent launchctl start com.nuodb.console launchctl start com.nuodb.traymonitor Linux Note There is no NuoDB Tray Monitor on Linux systems To stop and start NuoDB services on Linux platforms: # Commands to stop NuoDB agent and console services sudo service nuoagent stop sudo service nuoconsole stop # Commands to start NuoDB agent and console services sudo service nuoagent restart sudo service nuoconsole restart Windows To stop the NuoDB tray monitor: Right-click the NuoDB tray monitor icon and choose Exit.
353 To start the NuoDB tray monitor: # Starts the tray monitor javaw -jar "C:\Program Files\NuoDB\jar\nuodbtraymonitor.jar" "C:\Program Files\NuoDB" To start or stop NuoDB Agent or NuoConsole: 1. Click Start and type services.msc in the textbox, then press Enter. The Service dialog opens. 2. Select NuoDB Agent or NuoConsole, and then click either Stop or Restart to stop or restart the service. NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved SPACER
354 nuodb Start a NuoDB transaction engine or storage manager process. Best practice is to use NuoDB Manager or NuoDB Console instead of this command; those tools are designed to help you manage all aspects of NuoDB. Synopsis nuodb --database database_name --password database_password [ options ] Description Starts a NuoDB process, which can be a transaction engine or a storage manager, for a specified database. When you start the first transaction engine for a database, you must specify a password for the NuoDB DBA (database administrator) account. The dba username and the password created with --dba-user and --dba-password are required to create new users and privileges for the use of a NuoDB database. See Setting Up Your First Project. To create additional transaction engines a database user name and password are required. Options Option --allow-non-durable Definition By default you must start a storage manager before you can start a transaction engine when starting a database. If you specify the --allow-non-durable option you are allowed to start a transaction engine without first starting a storage manager. In this case no data is stored in an archive, unless you start a storage manager after starting the transaction engine. Avoid using the --allow-non-durable option. It can result in a loss of all data. --archive archive_location Archive directory for use by storage manager, typically specified as a full pathname in the file system. You can also specify a URL. Two types of URLs are supported: S3 and WebHDFS. Each of these URLs has its own specific format. You can not specify a URL that leads to a HTTP or an FTP site or the local filesystem. Each storage manager process must have its own archive.
355 --commit The COMMIT Protocol is specified for Transaction Engines and Storage Managers on an individual basis, during their initial creation and can be done only when using the command line based NuoDB Manager tool. The following options are entered when prompted for "Process command line options", following the dba username and password: Commit Local: TE: --commit local SM: --commit local Commit Remote without Journaling: TE: --commit remote SM: --commit remote --journal disable Commit Remote with Journaling: TE: --commit remote SM: --commit remote --journal enable Example of setting local commit protocol via the NuoDB Manager: nuodb [domain] > start process te Database: test Host: localhost Process command-line options: --dba-user dba --dba-password goalie --commit local Started: [TE] machinename/ :59364 [ pid = ] ACTIVE nuodb [domain/test] > start process sm Host: localhost Process command-line options: --dba-user dba --dba-password goalie --commit local Archive directory: /Users/evail/Desktop/test Initialize archive: true Started: [SM] machinename/ :59398 [ pid = ] ACTIVE --database database_name Name of database --dba-user DBA_account_username --dba-password DBA_account_password --enabled-ciphers [None, RC4 ] User name and password for the database administrator (DBA). Must be specified when you start the first transaction engine for a database. By default NuoDB engines use RC4 for encryption; that is, RC4 is the cipher used for all communication among NuoDB processes. Unless you change the default, your client applications must use RC4 when they connect to NuoDB. You can use the --enabled-ciphers option to enable the use of None as well, but you cannot enable only None. That is, both None and RC4 must be enabled if you want to make None available as the cipher for the client application.
356 --force Use with --archive option. Specifies that the storage manager should use an existing archive even if it means overwriting existing data. Caution Be careful about using this option. It could destroy all data in the archive. --help Displays information about the nuodb command. --initialize Use with --archive option to initialize an archive. If the specified archive has already been initialized, NuoDB generates an error. Use --initialize --force to overwrite an existing archive. Caution Be careful about using the --force option. --journal [ enable disable ] --journal-dir [ journal_location ] --journal-sleep-interval-ms integer --journal-max-file-size-bytes integer --journal-buffer-size-bytes integer --journal-reap-sec integer --journal-max-directory-entries integer --log [ filename ] --syslog log-options Journaling is required for the commit protocol for durability. If unspecified, the default is disable. Journal directory Number of milliseconds to sleep when the journal queue is empty Maximum journal file size (bytes) Default buffer size (bytes) Number of seconds wait before deleting old journal files Maximum number of directory entries in journal directory By default output is sent to STDOUT, unless you optionally specify a file name. Include absolute path when specifying. Send logging information to the system log. You must specify at least one logging option. See the following table for a list of valid logging options. Values for log-options are as follows: debug stats archive sql info tx threads services warn net gc validate error records security flush dump atoms scheduler msgs --remote-syslog log-options Send logging information to the system log at the specified remote host. You must specify at least one logging option. See the preceding table for a list of valid options. --remote-syslog-server hostname Send logging information to the server log at the specified remote host.
357 --max-http-connections integer Default is 5. Can be used only with HDFS and Amazon S3. Maximum number of concurrent HTTP requests permitted towards the same server. This option is useful when you want to the limit the number of current connections between the storage manager and the archive. --max-queries-to-log integer --mem integer[ m g ] Maximum number of slow queries to include in the log Memory threshold in bytes, unless optionally specified otherwise as megabytes (m) or gigabytes (g). Note The --mem option is used as an advisory target for the total memory in use by a single NuoDB process; NuoDB may exceed it in certain circumstances. --min-query-time-to-log integer Minimum length of time (in seconds) for a slow query to be included in the log of slow queries --node-port [ integer [,integer]] Port to use for this host, or, optionally, a range of port values. By default NuoDB determines the port to be used. --show-archive-history --verbose log-options --version Display the recent history for an archive specified with --archive. This option is useful if you have to restart storage managers, which must be restarted in reverse order of when they were shut down (the last storage manager to shut down must be the first one to be restarted). This option is primarily for internal usage. Report logging and other information to STDOUT as specified by lo g-options. You must specify at least one logging option. See the preceding table for a list of valid options. Display version information, including the build number. Using nuodb An important aspect of the nuodb command is its command line options, which you can specify with NuoDB Manager and NuoDB Console, rather than on the command line. The command implements the following services: Name of Service transaction engine (TE) storage manager (SM) Definition Runs SQL transactions on behalf of clients. Add more transaction engines to scale the database. Storage managers provide durability and redundancy. To provide redundant durability, run a storage manager on more than one host using separate physical storage for each storage manager. NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved SPACER
358 default.properties The default.properties file is used to globally set configuration variables for the NuoDB Domain. Configuration Variables Write Permissions in Windows Configuration Parameters The default.properties file can be found in the NuoDB Installation /etc directory. Note that all of these properties are optional, except for the domain password. Windows Windows users do not have write access to the NuoDB installation Directory by default. If you try to save the default.properties file without write permissions, an error message will be generated stating that another program has access to the file. This situation can be easily resolved by granting write permissions to the directory (see Write Permissions in Windows below). Write Permissions in Windows To grant write permissions in Windows: 1. Navigate to and right-click C:\Program Files\NuoDB in Windows Explorer. 2. Select Properties > Security tab > Advanced.
359 3. The Advanced Security Settings for NuoDB dialog appears. Click Change Permissions. The Change Permissions dialog opens. 4.
360 4. In Permission entires, select the user category to be granted write access, and click Edit. The Permission Entry for NuoDB dialog opens. 5. In Permissions, select Allow for Write attributes, and then click OK out of all the open dialog boxes. default.properties Parameters Name broker=(true false) Usage Specifices whether this agent shold be run as a broker. Set to false when the host is joining the domain as a Transaction Engine or as a Storage Manager. Enabled by default and set as "true". domain=( Name_of_domain) The name used to identify the domain that this agent is apart of. If a properties file cannot be found, or if it does not specify a domain name to use, NuoDB uses test as the name for the domain. For security and usability reasons the default name should be changed to something more meaningful. Enabled by default and set as "domain".
361 domainpassword= Password used, by this agent to join the domain. For security and usability reasons, the default password should be changed. Enabled by default. port= The port that this agent listens on for all incoming connections. The agent will randomly select an available port to listen on if no value is supplied. Enable this setting when you need to limit the openings in your firewall and AWS Security Policies. Disabled by default. peer= An existing peer (agent or broker) already running in the domain that this agent should connect to on startup. When joining an existing domain as an Agent or as a redundant Broker, this value should be edited with the IP or DNS of the host acting as the Broker. Disabled by default. altaddr= An alternate address to use in identifying this host. Disabled by default. advertisealt= This flag specifies whether the alternate address should be advertised instead of the locally observed network addresses. This is only meaningful for brokers, because only brokers advertise addresses to clients and admins. Disabled by default. bindir= The location of the directory with the 'nuodb' executable. This is a useful option if you have installed NuoDB using the.tar.gz file and are not uisng the default install directory. Disabled by default. portrange= start,[end] A range of port numbers that nuodb instances should be confined to. Enable this setting when you need to limit the openings in your firewall and AWS Security Policies. Disabled by default. broadcast= #### The interval (in seconds) that brokers should wait between sending out UDP # broadcast messages for local discovery, and that agents should wait to hear # those messages on startup. Disabled by default. requireconnectkey= [true] A flag specifying whether nuodb instances can only be started through this agent (as opposed to directly starting a nuodb process on the system). If this flag is true then a "connection key" is required of all nuodb instances. A connection key is only available if the process was started through a request on the agent. This is a good best-practice flag for locking down a system. Disabled by default.
362 NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved SPACER
363 Provisioning NuoDB Reference information about administering NuoDB processes from the command line. Domain Administrators Data Durability Configuration Scenarios Deployment Guidelines NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved SPACER
364 Domain Administrators NuoDB users who are domain administrators can add domain administrator accounts by using NuoDB Manager to create a new user and password. Steps 1. Start a broker, by default using the password specified in default.properties. java -jar /opt/nuodb/jar/nuoagent.jar --broker & 2. Using NuoDB Manager, create a new administrative user and password (for example, newadmin and newadminpw). java -jar /opt/nuodb/jar/nuodbmanager.jar --broker localhost --user domain --password bird nuodb [domain] > create domain administrator user newadmin password newadminpw 3. After you add the account, you can start NuoDB Manager for the domain using the new username and password. Optionally, edit the webapp.properties file to make the new account the default domain administrator for NuoDB Console. Editing default.properties in Windows Windows users must have write permissions to the NuoDB directory in order to save changes to the webapp.properties file. See Write Permissions in Windows for instructions on granting directory-level write permissions in Windows. 4. Start the NuoDB Console with the new user name and password. NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved SPACER
365 Data Durability in NuoDB NuoDB ensures durability by means of journaling by the storage manager processes. Overview NuoDB uses journaling to ensure that transactions are persisted to disk, that is, committed to physical storage. Note: You can use the command line options that are described here, but they are subject to change Commit Protocol There are three settings for the commit protocol for NuoDB transactions: Local commit Remote commit with journaling Remote commit without journaling By default the commit protocol is set to local commit. Local commit Local transaction commit does not ensure durability of transactions. When a transaction engine receives a commit request, the transaction engine asynchronously broadcasts the commit to all available storage managers. The transaction engine then acknowledges the commit to the client. Remote Commit Remote commit may be configured with or without journaling. Without journaling is the default.. Remote commit with journaling The remote commit with journaling setting means that a commit request has been received by at least one storage manager process and has been journaled. An acknowledgment that a commit has been completed is sent to the client only if and when a round trip to at least one storage manager process has been completed. Remote commit without journaling Remote commit without journaling means that there is no requirement to journal a commit request before an acknowledgment is sent. Journaling The remote commit with journaling protocol coordinates messages to the journal with transaction commits. If a storage manager process terminates unexpectedly, journaling messages are used to ensure that the archive is in a consistent state when it rejoins the database. Replication files that are required for journaling are stored in a specified journal directory; if not specified the default directory is journal in the archive directory. If journaling is enabled you can use nuodb command line options to specify the journaling directory, the maximum file size, the default buffer size, maximum number of entries for the journal, and other details. See the nuodb command reference page reference page for details about nuodb options. Note that you can specify these options from NuoDB Manager and NuoDB Console, as well as from the command line. Command Line Options for Commit Mechanisms Caution: System administrators can override the default commit settings but you must exercise care if you do so. It is especially risky to specify different settings on different transaction engines. One of the problems with inconsistent settings across transaction engines is that results for a client vary according to which engine it happens to connect and will probably be inconsistent. The following table shows the performance and safety tradeoffs for each set of options. If you do not require durability and are concerned primarily about performance you would typically specify the --commit local option. Durability Speed of Processing Commit Mechanism Override Options To Use
366 least safe fastest local --commit local middle middle remote without journaling --commit remote --journal disable safest (most durable) least fast remote with journaling --commit remote --journal enable As you do with all nuodb options, you can specify these options on the command line for nuodb, on the command line for nuodbmanager, from NuoDB Manager, and from NuoDB Web Console. NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved SPACER
367 Configuration Scenarios Describes some common configuration scenarios and the commands for enabling them from the command line. The scenarios are arranged in order of complexity and correspond to the level of licensing that you have available. Single Host Configuration Running NuoDB on a single machine; minimal single host configuration with durability. Corresponds to the configuration set up by the script that is part of the QuickStart. Multiple Host Configuration Running NuoDB across multiple machines; multi-host configuration with durability and transactional scalability Configuring Redundancy Multi-host configuration with broker redundancy, durability, data redundancy and transactional scalability Amazon AWS Multi-host configuration using Amazon AWS with durability and transactional scalability Multiple Data Centers and Cloud Regions A deployment that spans multiple data centers or cloud regions Automate Configuration Scenarios NuoDB configurations can be automated as follows. Using Amazon Web Services (AWS) Components Suggestions for running NuoDB on the cloud On all platforms, best practice is manage your domain(s) and database(s) using NuoDB Web Console or NuoDB Manager. These examples are designed to work on Linux/Mac platforms. Modify them to use them from the Command Prompt on Windows. Alternatively, on Windows you can start the NuoDB Console from the Start menu. The code snippets are designed to provide guidelines to help you meet your own requirements, not as literal code. NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved SPACER
368 Single Host Configuration Installing NuoDB on a single machine. Presents minimal single host configuration with durability. Corresponds to the configuration set up by the script that is part of the QuickStart. This configuration does the following: Uses all default settings found in the NuoDB default.properties file Starts an agent running as a broker. Starts NuoDBManager. Starts and initializes a Storage Manager and Transaction Engine. This configuration is not recommended except for small pilot projects, or for embedded scenarios. Step 1: Installation Please see Installing NuoDB if you need further details. Step 2: Connect to your Domain using nuodbmanager # By default, the NuoDB installation will automatically start a broker and domain for you. # The commands conained in this document will use the default password for that domain. # Always use the NuoDBManager utility when administering your domain and database from the command line. Linux/Mac $ java -jar /opt/nuodb/jar/nuodbmanager.jar --broker localhost --password bird Windows > java -jar c:\program Files\nuodb\jar\nuodbmanager.jar --broker localhost --password bird Step 3: Start a Storage Manager (using nuodbmanager from Step 2) # The following command will set Initialize archive to "true". # This must only be set to "true" the first time the Storage Manager is created otherwise your data will be overwritten. nuodb [domain]> start process sm Database: <DATABASE_NAME> Host: localhost Process command-line options: --dba-user <NAME> --dba-password <PASSWORD> Archive directory: <PATH_TO_YOUR_DATA_DIRECTORY> Initialize archive: true Step 4: Start a Transaction Engine (using nuodbmanager from Step 2) nuodb [domain] > start process te Database: <DATABASE_NAME> Host: localhost Process command-line options: --dba-user <NAME> --dba-password <PASSWORD>
369 Note: The first Storage Manager and first Transaction Engine must specify a database administrator user name and password. The following conceptual illustration shows this basic configuration: Related concepts Using Amazon Web Services (AWS) Components Related tasks Automate Configuration Scenarios Related information Multiple Host Configuration Configuring Redundancy Amazon AWS Multiple Data Center and Cloud Region Configuration NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved SPACER
370 Multiple Host Configuration Running NuoDB across multiple machines. Multi-host configuration with durability and transactional scalability. This configuration does the following: Edits the broker flag found in the NuoDB default.properties file Starts an agent running as broker on HOST A Starts NuoDBManager. Starts and initializes a storage manager on Host B. Starts Transaction Engines run on HOST C. You must have installed either a Developer or Professional License to run a database on more than 2 hosts. Linux/Mac The Linux/Mac example below uses Ubuntu Linux for all commands. Windows Windows users must have write permissions to the NuoDB directory in order to save changes to the default.properties file. See Writ e Permissions in Windows for instructions on granting directory-level write permissions in Windows. Step 1: Installation Please see Installing NuoDB if you need further details. Step 2: Edit the default.properties file The default.properties file contains default configuration settings for your NuoDB database. When deploying NuoDB on more than one Host, it is a best practice to edit the default.properties file to make management of your database simpler. Linux/Mac & /opt/nuodb/etc/default.properties Windows > c:\program Files\nuodb\etc\default.properties # Host A: portrange = 48005,48100 # Save your edits # Restart the nuoagent service sudo service nuoagent restart # Host B-C: broker = false peer = <Host_A_IP_ADDRESS> portrange = 48005,48100 # Save your edits # Restart the nuoagent service sudo service nuoagent restart #or port range of your choice #or port range of your choice Step 3: Connect to your Domain (Host A)
371 # By default, the NuoDB installation will automatically start a broker and domain for you. # The commands conained in this document will use the default password for that domain. # Always use the NuoDBManager utility when administering your domain and database from the command line. # Host A: Linux/Mac $ java -jar /opt/nuodb/jar/nuodbmanager.jar --broker localhost --password bird Windows > java -jar c:\program Files\nuodb\jar\nuodbmanager.jar --broker localhost --password bird Step 4: Start a Storage Manager (using nuodbmanager from Step 3) # The following command will set Initialize archive to "true". # This must only be set to "true" the first time the Storage Manager is created otherwise your data will be overwritten. nuodb [domain]> start process sm Database: <DATABASE_NAME> Host: <IP_ADDRESS_of_HOST_C> Process command-line options: --dba-user <NAME> --dba-password <PASSWORD> Archive directory: <PATH_TO_YOUR_DATA_DIRECTORY> Initialize archive: true Step 5: Start a Transaction Engine (Using nuodbmanager from Step 3) nuodb [domain] > start process te Database: <DATABASE_NAME> Host: <IP_ADDRESS_of_HOST_B> Process command-line options: --dba-user <NAME> --dba-password <PASSWORD> The following conceptual illustration shows this basic configuration:
372 Related concepts Using Amazon Web Services (AWS) Components Related tasks Automate Configuration Scenarios Related information Single Host Configuration Configuring Redundancy Amazon AWS Multiple Data Center and Cloud Region Configuration NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved SPACER
373 Configuring Redundancy Increasing resiliency and performance on multi-host configurations with broker redundancy, durability, data redundancy and transactional scalability This design is the same as the one with two storage managers with the addition of a redundant broker on one of the hosts. Note that the redundant broker runs on the same host as one of the storage managers (namely Host E). This configuration does the following: Edits the broker flag found in the NuoDB default.properties file Starts an agent running as broker on HOST A and HOST E Starts NuoDBManager. Starts and initializes Storage Managers on HOST D and HOST E. Starts Transaction Engines run on HOST B and HOST C. Note You must have installed either a Developer or Professional License to run a database on more than two hosts. Editing default.properties in Windows Windows users must have write permissions to the NuoDB directory in order to save changes to the default.properties file. See Writ e Permissions in Windows for instructions on granting directory-level write permissions in Windows. Step 1: Installation Please see Installing NuoDB if you need further details. Step 2: Edit the default.properties file The default.properties file contains default configuration settings for your NuoDB database. When deploying NuoDB on more than one Host, it is a best practice to edit the default.properties file to make management of your database simpler.
374 # File Location UNIX & /opt/nuodb/etc/default.properties WINDOWS > c:\program Files\nuodb\etc\default.properties # Host A: portrange = 48005,48100 # Save your edits # Restart the nuoagent service sudo service nuoagent restart # Host B-D: broker = false peer = <Host_A_IP_ADDRESS> portrange = 48005,48100 # Save your edits # Restart the nuoagent service sudo service nuoagent restart # Host E: peer = <Host_A_IP_ADDRESS> portrange = 48005,48100 # Save your edits # Restart the nuoagent service sudo service nuoagent restart # or port range of your choice # or port range of your choice # or port range of your choice Step 3: Connect to your Domain # By default, the NuoDB installation will automatically start a broker and domain for you. # The commands conained in this document will use the default password for that domain. # Always use the NuoDBManager utility when administering your domain and database from the command line. # Host A: UNIX $ java -jar /opt/nuodb/jar/nuodbmanager.jar --broker localhost --password bird WINDOWS > java -jar c:\program Files\nuodb\jar\nuodbmanager.jar --broker localhost --password bird Step 4: Start the Storage Managers (using nuodbmanager from Step 3)
375 # The following command will set Initialize archive to "true". # This must only be set to "true" the first time the Storage Manager is created otherwise your data will be overwritten. nuodb [domain]> start process sm Database: <DATABASE_NAME> Host: <HOST_D_IP_ADDRESS> Process command-line options: --dba-user <NAME> --dba-password <PASSWORD> Archive directory: <PATH_TO_YOUR_DATA_DIRECTORY> Initialize archive: true # Start the second Storage Manager nuodb [domain]> start process sm Database: <DATABASE_NAME> Host: <HOST_E_IP_ADDRESS> Process command-line options: Archive directory: <PATH_TO_YOUR_DATA_DIRECTORY> Initialize archive: true Step 5: Start the Transaction Engines (using nuodbmanager from Step 3) nuodb [domain] > start process te Database: <DATABASE_NAmE> Host: <HOST_B_IP_ADDRESS> Process command-line options: --dba-user <NAME> --dba-password <PASSWORD> # Start the second Transaction Engine nuodb [domain] > start process te Database: <DATABASE_NAME> Host: <HOST_C_IP_ADDRESS> Process command-line options: In this configuration a client can get a transactional and consistent view of the database by using either host either HOST_B or HOST_C path as the connect string from the client. For example, in the case of a client running on Host A: Host A > nuosql testdb@host_b Host A > nuosql testdb@host_c The following conceptual illustration shows this basic configuration:
376 Related concepts Using Amazon Web Services (AWS) Components Related tasks Automate Configuration Scenarios Related information Single Host Configuration Multiple Host Configuration Amazon AWS Multiple Data Centers and Cloud Regions NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved SPACER
377 Amazon AWS Multi-host configuration using Amazon AWS with durability and transactional scalability. NuoDB templates for use with AWS CloudFormation may be downloaded from GitHub. Installing and Running NuoDB on Amazon AWS follows the same proceedures was a local deployment wtih one imporatnt addition: on AWS you must create custom TCP rules for your security groups to allow for inbound communiction from all servers in the NuoDB domain. This configuration does the following: Configures custom TCP Rules for your Amazon Security Group Edits the broker flag found in the NuoDB default.properties file Starts an agent running as broker on HOST A Starts NuoDBManager Starts and initializes a storage manager on HOST B Starts Transaction Engines running on HOST C Note You must have installed either a Developer or Professional License to run a database on more than 2 hosts. The example below uses Ubuntu Linux for all commands. Step 1: Installation You can utilize the NuoDB AMI available on theaws Marketplace to launch your NuoDB Instance. Step 2: Configure you Amazon Security Group # For convenience all Amazon Instances that will be used for NuoDB should belong to the same security group. # Each Amazon instance that will be used with your NuoDB doamin must have its own Custom TCP rule. # From your Amazon EC2 Dashboard Go to: Network & Security \ Security Groups Select the Security group for you NuoDB Deployment Select the Inbound Tab Create a new rule: Custom TCP rule Port Range: # or port range of your choice Source: <Amazon_Instance_Private_IP> # Rememver one rule per instance Click Add Rule Click Apply Rule Change Step 3: Edit the default.properties file
378 # The default.properties file contains default configuration settings for your NuoDB database. # When deploying NuoDB on more than one Host, it is a best practice to edit the default.configuration file # to make management of your database simpler. # Host A: sudo vi /opt/nuodb/etc/default.properties # or the editor of your choice portrange = 48005,48100 # MUST match your Amazon Security Group Settings # Save your edits # Restart the nuoagent service sudo service nuoagent restart # Host B-C: sudo vi /opt/nuodb/etc/default.properties # or the editor of your choice broker = false peer = <Host_A_IP_ADDRESS> portrange = 48005,48100 # MUST match your Amazon Security Group Settings # Save your edits # Restart the nuoagent service sudo service nuoagent restart Step 4: Connect to your Domain (Host A) # By default, the NuoDB installation will automatically start a broker and domain for you. # The commands conained in this document will use the default password for that domain. # Always use the NuoDBManager utility when administering your domain and database from the command line. # Host A: java -jar /opt/nuodb/jar/nuodbmanager.jar --broker localhost --password bird Step 5: Start a Storage Manager (using nuodbmanager from Step 4) # The following command will set Initialize archive to "true". # This must only be set to "true" the first time the Storage Manager is created otherwise your data will be overwritten. nuodb [domain]> start process sm Database: <DATABASE_NAME> Host: <IP_ADDRESS_of_HOST_C> Process command-line options: --dba-user <NAME> --dba-password <PASSWORD> Archive directory: <PATH_TO_YOUR_DATA_DIRECTORY> Initialize archive: true Step 6: Start a Transaction Engine (Using nuodbmanager from Step 4)
379 nuodb [domain] > start process te Database: <DATABASE_NAME> Host: <IP_ADDRESS_of_HOST_B> Process command-line options: --dba-user <NAME> --dba-password <PASSWORD> The following conceptual illustration shows this basic configuration: Related concepts Using Amazon Web Services (AWS) Components Related tasks Automate Configuration Scenarios Related information Single Host Configuration Multiple Host Configuration Configuring Redundancy Multiple Data Centers and Cloud Region Configuration NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved SPACER
380 Multiple Data Centers and Cloud Regions A deployment that spans multiple data centers or cloud regions. A typical scenario is a web application deployment that runs in two or more geographies. In this scenario clients can be globally load-balanced to a specific data center based on their location. The following deployment scenario has hosts in the UK (uk-host1 and uk-host2) and the US (us-host1 and us-host2). The steps for this deployment are as follows: 1. Provision the four hosts by running an agent on each, starting some of them to act as brokers as well. Important In deployments with multiple brokers, the brokers must be peered to each other. Before proceeding to step 2, ensure that at least one broker from each datacenter is peered to at least one broker in every other datacenter. This would be accomplished in the example below by editing the default.properties of uk-host1 to peer to us-host 1. To deploy with high availability, peer at least one broker from each datacenter to the a broker another datacenter. For additional information, se e High Availability (HA). uk-host1 > java -jar nuoagent.jar --broker & uk-host2 > java -jar nuoagent.jar --peer uk-host1 --password domain_password & us-host1 > java -jar nuoagent.jar --broker & us-host2 > java -jar nuoagent.jar --peer us-host1 --password domain_password & 2. Configure the transaction and storage managers:
381 uk-host2 > java -jar /opt/nuodb/jar/nuodbmanager.jar --broker uk-host1 --password domain_password nuodb [domain] > start process sm host localhost database testdb Process command-line options: Archive directory:/opt/nuodb/samples/testdb Initialize archive: true uk-host1 > java -jar /opt/nuodb/jar/nuodbmanager.jar --broker uk-host1 --password domain_password nuodb [domain] > start process te host localhost database testdb Process command-line options: --dba-user dba --dba-password dba us-host2 > java -jar /opt/nuodb/jar/nuodbmanager.jar --broker us-host1 --password domain_password nuodb [domain] > start process sm host localhost database testdb Process command-line options: Archive directory:/opt/nuodb/samples/testdb Initialize archive: true us-host1 > java -jar /opt/nuodb/jar/nuodbmanager.jar --broker us-host1 --password domain_password nuodb [domain] > start process te host localhost database testdb Process command-line options: --dba-user dba --dba-password dba 3. Connect a client such as nuosql by specifying the database for the database as follows: databasename-@ brokerhost For example testdb@uk-host1 or testdb@us-host1 Some modifications may be required for this format to work in an Amazon cloud deployment. For example, with Amazon you have to accommodate the complexities of the private/public IP model that is used. Related concepts Using Amazon Web Services (AWS) Components Related tasks Automate Configuration Scenarios Related information Single Host Configuration Multiple Host Configuration Configuring Redundancy Amazon AWS
382 NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved SPACER
383 Automate Configuration Scenarios NuoDB configurations can be automated as follows. 1. Configure a host to start nuoagent at boot time. On UNIX you can run an init.d script by using a sample provided in $NUODB_ROO T/etc/nuoagent (UNIX). 2. Use options with nuodbmanager commands in a script to set up the required nuodb processes across all machines. Related concepts Using Amazon Web Services (AWS) Components Related information Single Host Configuration Multiple Host Configuration Configuring Redundancy Amazon AWS Multiple Data Center and Cloud Region Configuration NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved SPACER
384 Using Amazon Web Services (AWS) Components Suggestions for running NuoDB on the cloud You can integrate and deploy NuoDB by means of the following Amazon Web Services (AWS). Name of Service Amazon Elastic Compute Cloud (EC2) Amazon Simple Storage Service (Amazon S3) Amazon Elastic Block Store (EBS) Purpose You can launch an EC2 host using the AWS Management Console and then run a NuoDB broker on the host. Because EC2 has both an internal and external addressing scheme, you can configure connections with other brokers running on EC2 hosts in the cloud, as well as with clients outside the cloud. This feature is very useful for creating a cluster of externally-accessible brokers. NuoDB supports archive storage of serialized atoms on Amazon S3. This makes it possible for you to run storage managers in an EC2 cloud without using EBS. To support persistent storage as well as high availability and high reliability, you can run NuoDB on an instance of EC2 and attach EBS. You can configure these services to work together, or independently, to support scalable cloud applications as well as persistence and reliability of a NuoDB system. Note See the NuoDB Forum for information about launching NuoDB on AWS. Overview To run NuoDB on Amazon Elastic Compute Cloud (EC2) you launch hosts of EC2 using the AWS Management Console and then start NuoDB processes on each host as required for your particular deployment. You can easily add and remove hosts using NuoDB management tools, such as NuoDB Web Console, and the elasticity features of Amazon EC2 and NuoDB. What is Amazon EC2 Amazon Elastic Compute Cloud (Amazon EC2) is a web service that provides resizeable compute capacity in the cloud. The NuoDB documentation assumes that you are familiar with setting up Amazon EC2. For help getting started see the AWS website. EC2 has both an internal and external addressing scheme, making it possible for you to configure the cloud to allow access among the agents and brokers (using the internal scheme) as well as access to clients (using the external scheme). In other words, each host on the cloud is essentially known by two names depending on context. You specify command-line arguments to configure the address when you start each agent and broker. The following figure shows the design of an initial system running on Amazon EC2 hosts:
385 As shown, this system runs a transaction engine and an agent as a broker on an instance of Amazon EC2, and a storage manager and an agent on a second instance of Amazon EC2. The storage manager connects to Amazon S3 for data storage on the cloud. (Because Amazon EC2 does not support persistent storage on disk, consider using Amazon S3 or Amazon EBS for storage. You could also put the archive on a physical rather than a virtual host.) Amazon AMI: Running NuoDB using the Amazon AMI The Amazon AMI makes it incredibly simple to install and configure a NuoDB instance in the cloud Use Amazon S3 With NuoDB How to use Amazon S3 for archive storage of serialized atoms on NuoDB system Use Amazon EBS With NuoDB How to use EBS as an alternative to S3 Cloud Addresses: External NuoDB commands for specifying external addresses on a cloud Cloud Addresses: Internal NuoDB commands for specifying internal addresses on a cloud Related tasks Automate Configuration Scenarios Related information Single Host Configuration Multiple Host Configuration Configuring Redundancy Amazon AWS Multiple Data Center and Cloud Region Configuration NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved SPACER
386 Amazon AMI: Running NuoDB using the Amazon AMI The Amazon AMI makes it incredibly simple to install and configure a NuoDB instance in the cloud This guide provides the instruction for using the NuoDB AMI to setup a development instance of NuoDB on Amazon's EC2 Infrastructure. This configuration does the following: Configures custom TCP Rules for your Amazon Security Group. Uses all default settings found in the NuoDB default.properties file Starts an agent running as a broker. Starts NuoDBManager. Starts and initializes a Storage Manager and Transaction Engine. Starting NuoDB The AMI installation has already configured a NuoDB Domain for you so, the only remaining steps are to either start the demo database or new blank database. Start the Demo Database NuoDB ships with a small sample database named; "hockey" and a quick start script that will start the database and give you a SQL> prompt for further exploring. # You must SSH to your AWS instance to execute the following commands. # Please refer to the online AWS Documentation for how-to instructions. $ /opt/nuodb/run-quickstart Starting up a database named: test Checking for a valid version of java Found java at: /usr/bin/java Found compatible version of Java for NuoDB Skipping startup of nuoagent -- already running Skipping startup of Storage Manager for: test@localhost -- already running Skipping startup of Transaction Engine for: test@localhost -- already running Creating Sample Quickstart Schema Importing Sample Quickstart Data Capturing Sample Quickstart Database to /tmp/quickstart_capture.txt Use the 'restart' command with this file to restart the database Skipping startup of NuoDB Web Console -- already running Starting an interactive SQL session with nuosql Domain name: "domain" User: "quickstart", Password: "quickstart" Database name: "test" DBA Username: "dba", DBA Password: "goalie" Start executing SQL commands at the SQL prompt, such as: SQL> show hockey; SQL> select * from hockey; SQL> Start a New Database Step 1: Connect to your Domain using nuodbmanager
387 # You must SSH to your AWS instance to execute the following commands. # Please refer to the online AWS Documentation for how-to instructions. $ java -jar /opt/nuodb/jar/nuodbmanager.jar --broker localhost --password bird Step 2: Start a Storage Manager # The following command will set Initialize archive to "true". # This must only be set to "true" the first time the Storage Manager is created otherwise your data will be overwritten. nuodb [domain]> start process sm Database: testdb Host: localhost Process command-line options: --dba-user <NAME> --dba-password <PASSWORD> Archive directory: /var/opt/nuodb/production-archives/testdb Initialize archive: true Started: [SM] SERVER_NAME:PORT [ pid = #### ] ACTIVE Step 3: Start a Transaction Engine nuodb [domain] > start process te Database: testdb Host: localhost Process command-line options: --dba-user <NAME> --dba-password <PASSWORD> Started: [TE] SERVER_NAME:PORT [ pid = #### ] ACTIVE Step 4: Access your database nuodb [domain] > exit $ /opt/nuodb/bin/nuosql testdb@localhost --user <DBA_NAME> --password <DBA_PASSWORD> SQL> AWS Security Setup By default the NuoDB instance starts with a newly created security group named; nuodb. These settings allow for SSH and HTTP communcication to your instance and were chosen to allow for easy access to the NuoDB instance when provisioning more hosts for your NuoDB Domain. To change thes settings login to the AWS EC2 Management Console
388 Related tasks Use Amazon S3 With NuoDB Use Amazon EBS With NuoDB Related reference Cloud Addresses: External Cloud Addresses: Internal NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved SPACER
389 Use Amazon S3 With NuoDB How to use Amazon S3 for archive storage of serialized atoms on NuoDB system You can run storage managers in an EC2 cloud without using Amazon Elastic Block Service. (EBS). What is Amazon S3 Amazon S3 is a web services interface that you can use to store and retrieve any amount of data, at any time, from anywhere on the web. This documentation assumes that you are familiar with setting up Amazon S3. For more information about Amazon S3 see the Amazon Web Services website. The design of Amazon S3 fits well with the organization of a NuoDB storage manager; each NuoDB atom becomes an S3 object, and its path and filename become a key. Atoms are serialized just as they are serialized to be written to a local disk, but instead they are sent over HTTP to Amazon S Get started by signing up for Amazon Web Services (AWS) at the Amazon Web Services website. Log in to the AWS Management Console, click your name on the top of the page, and go to the Security Credentials section. Find your Access Key ID and Secret Access Key. It is recommended, but not required, that you create an Amazon S3 bucket, which is a top-level container in an Amazon S3 hierarchy. (A NuoDB archive manager can create it automatically.) Because a bucket is part of global name space, you might encounter a conflict if you use a common name. There are two URL formats available from Amazon S3. Virtual Domain Path-Style Allows you to address S3 universally across all zones Requires you to specify a zone where the S3 bucket resides 4. NuoDB supports both Virtual Domain and Path-Style URL types. Configure the NuoDB Archive Server with Amazon S3 In the following examples the format is path-style. In the first case, href=" format="html" scope="external" 5. is used for the US standard zone. Configure the storage manager by using the following URL as a value for the --archive parameter: s3://<your AccessKey ID>:<Your Secret Access Key>@<S3Bucket>.s3.amazonaws.com/<Path> 6. Alternatively use the following: s3://<your AccessKey ID>:<Your Secret Access Key>@s3.amazonaws.com/<S3Bucket>/<Path> Note If the access key within your S3 URL value contains %xx, where the xx is equivalent to a hexadecimal value between 00-7F, the sequence will be interpreted as the ASCII character associated with that hex value. This range includes only the first 127 ASCII characters and hex values beyond 7F are not affected. To "escape" this behavior follow the % symbol with 25, which is the ASCII hexadecimal value associated with this character. Note To maximize performance you should specify the same zone for both Amazon EC2 and Amazon S3 hosts. Limitations
390 Two storage managers cannot use the same Amazon S3 directory simultaneously. Amazon S3 does not provide any object locking mechanism. There is no HTTPS support. Data goes to and from Amazon S3 over a non-secured channel. There is no encryption. Memory usage on storage managers that use Amazon S3 may be higher that on an storage manager that uses just a local disk. Because it takes longer to store an atom in a remote location than on a local disk, an atom is marked as "dirty" (changed but not stored) for a longer time, preventing the garbage collector from purging it. Related tasks Use Amazon EBS With NuoDB Related reference Cloud Addresses: External Cloud Addresses: Internal Related information Amazon AMI: Running NuoDB using the Amazon AMI NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved SPACER
391 Use Amazon EBS With NuoDB How to use EBS as an alternative to S3 What is Amazon Elastic Block Store (EBS)? Amazon Elastic Block Store (EBS) provides block level storage volumes for use with Amazon EC2 hosts. For help getting started see the Amazon Web Services website. Related tasks Use Amazon S3 With NuoDB Related reference Cloud Addresses: External Cloud Addresses: Internal Related information Amazon AMI: Running NuoDB using the Amazon AMI NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved SPACER
392 Cloud Addresses: External NuoDB commands for specifying external addresses on a cloud Specifying Alternate Addresses For External Access To NuoDB By default, when you start a NuoDB agent (using the nuoagent command), the agent enters into a domain and is known by whatever locally resolvable name or address is available. In the case of EC2, the internal IP address or name is available and is used by default. To change the default, tell the agent that it has another address, which would be the externally meaningful name, using the --alt-addr option with the nuoagent command, as shown: java -jar nuoagent.jar --alt-addr ec compute-1.amazonaws.com -peer [broker] & This option causes the agent to tell all other members of the domain both its local name and the alternate name it was given by Amazon EC2. Alternatively, because Amazon makes it easy to fetch a host's external name through a single-line script, you could also have specified: java -jar nuoagent.jar --alt-addr `curl xref href=" format="html" scope="external"> \ \ --peer [broker] & Advertising the Address Once an agent is telling the brokers about both addresses, you must specify which version a given broker advertises. Do this with a second switch ( advertise-alt) used on brokers: java -jar nuoagent.jar --broker --advertise-alt --alt-addr `...` & This tells the broker to advertise the alternate address rather than the local address for all connected agents and their processes. You must use the --alt-addr option on the broker along with the advertise-alt option. Both options are required for each host that has an alternate address to be advertised. Accessing NuoDB from Outside the Cloud To provide external access to NuoDB run nuoagent with the alt-address and advertise-all options. The options described in the example create a NuoDB domain consisting of two hosts that advertise alternate, externally-meaningful addresses. Also, you can run nuosql from outside the Amazon Cloud and connect to a database running on the inside, as in the following example: nuosql test@ec compute-1.amazonaws.com Note Note that a broker advertises the alternate form for all connections, including those from other brokers and databases. Related tasks Use Amazon S3 With NuoDB
393 Use Amazon EBS With NuoDB Related reference Cloud Addresses: Internal Related information Amazon AMI: Running NuoDB using the Amazon AMI NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved SPACER
394 Cloud Addresses: Internal NuoDB commands for specifying internal addresses on a cloud Starting NuoDB Processes Within the Cloud If you want to start up multiple agents and database processes within the cloud, you typically want them to use the internal addresses. To do this, you should run some brokers with and some without the --advertise-alt option. You should point external clients to the broker(s) advertising the alternate form but use the other broker(s) when connecting internally within the NuoDB domain: host1 $ java -jar nuoagent.jar --broker --advertise-alt --alt-addr... host2 $ java -jar nuoagent.jar --broker --peer host1 --alt-addr... & host3 $ java -jar nuoagent.jar --peer host2 --alt-addr... & host4 $ java -jar nuoagent.jar --peer host2 --alt-addr... & host5 $ java -jar nuoagent.jar --broker --advertise-alt --alt-addr... & In this example five hosts are provisioned, three with brokers (host1, host2, and host 5) as follows: The brokers on host1 and host5 can be used by external clients or administrators to connect to any process in the system. The broker on host2 can be used only internally. Any new agents or servers must connect to each other through the internal addresses. Related tasks Use Amazon S3 With NuoDB Use Amazon EBS With NuoDB Related reference Cloud Addresses: External Related information Amazon AMI: Running NuoDB using the Amazon AMI NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved SPACER
395 Microsoft Azure Running NuoDB on Azure Virtual Machines. The steps for setting up and configuring an Azure VM cluster for NuoDB are as follows: Create and connect to a number of VMs in Azure Install Java JDK and NuoDB on Azure Hosts Configure NuoDB and Azure Endpoints on Azure Hosts Configure Local Firewall Settings Start a NuoDB Database Creating Azure Hosts for NuoDB To create and connect to Azure Virtual Machines: 1. In the Windows Azure portal, select the VM icon (looks like a computer monitor), and click + New at the bottom of the browser window. The New wizard starts. 2. With the Virtual Machine icon selected, click From Gallery to open a list from which you can choose the OS of choice. All options are appropriate for a NuoDB deployment except MS SQL Server, MS BizTalk Server, or the MS SharePoint Server machines. Click the Next arrow. The Virtual machine configuration screen appears. 3. Choose Version Release Date, provide a descriptive name for the VM, the core and memory configuration, and provide user credentials; then click the Next arrow. The Virtual machine mode screen appears. 4. Choose Stand Alone Virtual Machine, provide a DNS name, accept the defaults for Storage Account, and choose the Region where you would like the Host located; then click the Next arrow. The Virtual machine options screen appears. 5. Accept the default for Availability Set and select Enable PowerShell Remoting; then click the Check button to finish the wizard. 6. Provisioning for the VM starts. (Takes a while.) Repeat steps 1 5 for each additional Azure VM. Install Java JDK and NuoDB on Azure Hosts 1. Click Connect to generate an RDP file. Open the RDP file in Remote Desktop to connect and logon to your Azure VM You can remote in through Remote Desktop (Windows or Mac) or through the command line (Windows, Mac, Linux). Windows 7 has Remote Desktop already installed. Remote Desktop for Mac can be downloaded here: Command line tools for Windows PowerShell, Mac, and Linux as well as a cross-platform CLI may be found here: Open a browser in the Azure VM, and then download and install Java JDK 1.6 or later. Again, from the Azure VM browser, register for (or login if you've already registered) and download the Developer version of NuoDB. If you are deploying NuoDB in a production environment, you'll need the Pro version. Install the Developer version and then send a request here to obtain a license for the Pro edition. Launch the NuoDB install application and walk thru the installation wizard. NuoDB installs and the Console opens in a browser tab. For detailed install instructions by OS, see Installing NuoDB. Repeat steps 1-5 for each Azure VM. Configure NuoDB and Azure Endpoints on Azure Hosts Configuring NuoDB on Azure
396 It is recommended to plan out your Azure domain topology with a spreadsheet to keep track of the port assignments and DNSs for the broker, agents, transaction engines and storage managers. To configure NuoDB on Azure: 1. Identify one host to run as the broker. This host will define the NuoDB domain and all other hosts will connect to it as a peer. Hosts that run as a peer will typically manage the Transaction Engines and Storage Managers. 2. Configure Peer Hosts. On all hosts that will peer to the broker, i.e., all hosts other than the broker, edit the default.properties file to assign these hosts as peers and assign default ports, etc. Note You must have write access to the C:\Program Files\nuodb\etc directory to save the file. Parameter broker port Setting or Description false <this is the NuoDB Agent port> peer <this value must equal the full DNS of the broker host> portrange <these are the ports that the Transaction Engines or Storage Mangers will run on Note For each port noted above, you must have a corresponding Endpoint configured for each Azure NuoDB host. See Configuri ng an Azure endpoint below. 3. Save changes to default.properties, and then stop and restart the NuoDB agent service. For instructions on stopping and starting NuoDB services, see Starting and Stopping NuoDB Agents/Brokers, Web Console and Tray Monitor. 4. Repeat steps 2 3 for each host in your Azure domain. Configuring Azure Endpoints for NuoDB Hosts in Azure must have communication endpoints configured to allow for communication between VMs. As all hosts in a NuoDB database must communicate directly with each other, all hosts in an Azure deployment must have an endpoint configured for every Azure host in the NuoDB domain. What this means is that for every port and portrange value configured in the NuoDB default.properties file you must have a corresponding Azure endpoint configured. To configure an Azure Endpoint for NuoDB: 1. From the Windows Azure Management Portal, click the Virtual Machines icon to display the list of your Azure VMs, select the virtual machine that you want to configure, click Endpoints menu.
397 2. The list of endpoints for that VM appears, and should at this point only contain one for RemoteDesktop and another for PowerShell. At the bottom of the window, click Add Endpoint. 3. The Add Endpoint dialog appears. Accept the default selection of Add Endpoint, and then click the arrow to continue. Specify the details of the endpoint and then click OK (check icon) to finish configuring the endpoint. Parameter Name Protocol Public Port Private Port Description A descriptive identifier, e.g., TE1 TCP or UDP (accept the TCP default) Use a port from the portrange configured in default.properties Enter the same port chosen for the Public Port. (Both Public and Private ports should be the same.) Note The Public and Private port numbers can be different. The public port is the entry point for communication from outside of Windows Azure and is used by the Windows Azure load balancer. You can use the private port and firewall rules on the virtual machine to redirect traffic in a way that is appropriate for your application. 4. The Azure Endpoint is configured. Repeat for every port configured in the default.properties files of all NuoDB installations in your Azure domain. Configure Local Firewall Settings Local firewall settings must be configured to allow incoming and outgoing TCP communication in the ports configured in the default.properties file. Start a NuoDB Database To start a NuoDB database: 1. Use the same commands in Multiple Host Configuration to connect to your domain and start a new database.
398 NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved SPACER
399 Deployment Guidelines Reference information about failover mechanisms and other information related to the deployment of NuoDB processes. Minimal Deployment Configuration A minimally viable NuoDB deployment is one that has one broker, one transaction engine and one storage manager, all residing on a single host. This deployment configuration is not highly available, and should therefore be primarily used for non-critical purposes or testing environments. Memory Management NuoDB supports memory management using a cache management approach that is completely integrated with the NuoDB atomic architecture. Using NuoDB Console and NuoDB Manager you can specify options related to memory management (such as specifying a memory threshold) and monitor memory usage. High Availability (HA) Mitigating risk by providing redundant software and hardware components for your NuoDB system deployment Redundancy and Failover Failure of a NuoDB process, such as a broker, transaction engine, or storage manager, can affect an individual query but does not result in complete system failure. Hadoop Distributed File System (HDFS) Specify a WebHDFS directory as an archive for a NuoDB storage manager (you can assign just one storage manager to each WebHDFS directory). NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved SPACER
400 Memory Management NuoDB supports memory management using a cache management approach that is completely integrated with the NuoDB atomic architecture. Using NuoDB Console and NuoDB Manager you can specify options related to memory management (such as specifying a memory threshold) and monitor memory usage. NuoDB databases require memory for transaction engine and storage management processes. Effective memory management improves overall performance of processes that support the database. Memory is also required to meet durability requirements for transaction records. All elements of a NuoDB database (data, indexes, metadata, and transaction state) are maintained in objects called atoms, which are of various types and visible across the network. This atomic architecture makes it possible to maintain databases that would otherwise require more memory than is typically available (or feasible) on a single host. NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved SPACER
401 High Availability (HA) Deployment design guidelines to support high availability. HA mitigates risk by providing redundant software and hardware components for your NuoDB system deployment. Minimally Viable HA Deployment Configuration The minimally viable high availability deployment is one that is resilient to host failure, network partition, or other failures. Such a scenario would be one where there are three hosts: Host Broker TE SM # # # Both Host #1 and Host #2 have a broker, transaction engine and storage manger. Host #3 on has a broker and transaction engine. This domain has five nodes (three TEs and 2 SMs), and importantly, the three brokers are peered together. For any failure scenario, a majority of nodes is maintained and a broker is available to keep the database alive. In this example, the solution remains highly available without a single point of failure. Using a Virtual IP In an HA deployment, a minimum of three broker on different hosts are used. Should any host fail, two other HA brokers are available to service connection requests. The three brokers are peered. If the database is scaled, the peer address used for subsequently added host agents could be the IP address of any one of the three peered-brokers. However, standing a VIP in front of the brokers might provide an attractive alternative domain topology, in terms of database administration. By using a virtual IP, every agent or broker started after the first broker would peer using the VIP address rather than the host-specific IP address of an individual broker. Broker Recommendations for broker deployment: Run three or more broker processes, each running on separate hardware Use load balancing for requests from client applications Design your network and JDBC applications to dynamically connect to an alternate broker if the targeted broker is unavailable. Transaction Engine Recommendations for transaction engine deployment: Three or more transaction engine processes, each running on separate hardware. Configure the client application so that if it loses its connection to a transaction engine it issues a request for a new transaction engine. In this case the broker seamlessly completes the request. Transaction engines share their in-memory data with all other transaction engines in the domain. They also commit transactions to all storage managers in the domain. This architecture ensures that in-memory data is up-to-date across the domain, as well as durable. Storage Manager Recommendations for storage manager deployment: Run two or more storage manager processes, each running on separate hardware. NuoDB updates all storage manager processes in the domain as data changes. That is, if there is more than one storage manager running, each process has a full copy of the data.
402 If one storage manager becomes unavailable, all transaction engines seamlessly continue with the remaining storage managers in the domain. NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved SPACER
403 Redundancy and Failover Failure of a NuoDB process, such as a broker, transaction engine, or storage manager, can affect an individual query but does not result in complete system failure. If a broker is offline and there is not another peer broker running to serve as a backup. Existing connections to databases in the domain continue to operate. A client application cannot make new connections to a database in the domain managed by the broker. New hosts cannot be added to the domain. Existing hosts cannot be removed or monitored. If storage managers are offline A client application continues to have access to data that is held in memory on the transaction engine to which it is connected. Transactions are not durable. Data that is not in memory is not available. If all transaction engines are offline An application client cannot execute any queries against the database. The following table is a quick summary of the details above: If this process goes offline Can administer database? Make new DB Connections? Existing DB connections continue operational? Is data durable? Is there access to data on disk? Broker NO NO YES YES YES Transaction engine YES NO NO NO NO Storage manager YES YES YES NO NO NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved SPACER
404 Hadoop Distributed File System (HDFS) NuoDB can use HDFS as a storage medium for its repository, obtaining out-of-the-box replication and size scalability. To do so, Specify a WebHDFS directory as an archive for a NuoDB storage manager (you can assign just one storage manager to each WebHDFS directory). Hadoop Distributed File System (HDFS) is the primary storage system used by Hadoop applications. HDFS creates multiple replicas of data blocks and distributes them on hosts throughout a cluster to enable reliable, extremely rapid computations. NuoDB interacts with HDFS by means of WebHDFS. See the WebHDFS REST API for more informaton See the Apache Hadoop project website for more information about Hadoop. With one important exception, NuoDB works with HFDS in the same way as it works with a typical disk file system. The exception is that multiple storage managers cannot share a single HDFS directory. Attempting to specify the same directory for more than one NuoDB storage manager process can have unpredictable and potentially severe consequences. For example, sharing an HDFS directory causes processes to interfere with each other, to overwrite files that should not be overwritten, and cause conflicts that can cause NuoDB to crash. Data could be lost. Steps 1. Create a URL for the HDFS directory that you want to associate with a storage manager, using the following HDFS format. webhdfs://<username>@<hostname:port>/webhdfs/v1/<directory_name> username hostname Required.This must match the name of a user recognized by Hadoop. If not set, the server may either set the authenticated user to a default web user, if one exists, or return an error response. Required. Name of HDFS server, port, and unique directory port directory_name 2. When you start a storage manager process, use the HDFS URL as the value for the --archive directory. You can also use the following option when you start the storage manager: --max-http-connections Optional. Maximum number of concurrent connections allowed to the specified server. If not specified the default value is 5. NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved SPACER
405 Troubleshooting NuoDB Common problems and possible solutions Problems running NuoDB Web Console Make sure that a broker is running. Make sure that you have started the console by running nuodbwebconsole.jar and that it is still running. Make sure that the port specified for the console to run on is available. By default the URL is port You can change this setting by editing the webapp.port property in webapp.properties. Editing webapp.properties in Windows Windows users must have write permissions to the NuoDB directory in order to save changes to the webapp.properties file. See Write Permissions in Windows for instructions on granting directory-level write permissions in Windows. Broker advertising a database process that no longer exists Restart the broker. Broker does not have permission to access files or executables it requires When you install NuoDB, brokers are started on the following platforms: Windows: As a service running as Local System Linux: As a dedicated user, namely 'nuodb'. Mac OS X: As the user who runs the installer.this user automatically has permission to access all the processes and files that the broker requires. Otherwise, the owner of a broker process is the user who explicitly starts the broker. This user also has permission to access all the processes and files that the broker requires. Thus the owner of a broker has access automatically to files in /etc and in other areas of the install directory as required. If you encounter an error related to permissions to access a NuoDB process or folder (such as /etc), check the access settings for the processes involved. If you have started a broker as a user other than the user set as the owner by default for NuoDB processes, you could get a permissions error. The access settings for all NuoDB processes and files must match the settings for the broker process that is trying to access them. Cannot start a database It is possible that the broker is advertising a database process that no longer exists. Restart the broker You are not allowed to start a transaction engine before starting a storage manager, unless you specify the --allow-non-durable option. You can specify this option on the nuodb command line, with NuoDB Manager, or in by means of NuoDB Console. WARNING: You should avoid using the --allow-non-durable option. It can result in a loss of all data. Nodes disappear from {{show domain processes}} if the agent has been restarted All brokers should be started with the --peer option, so they can be reconnected successfully if restarted for some reason. If a broker is not started with the --peer option, and happens to be restarted for any reason, it does not rejoin the rest of the database processes and runs instead as a stand-alone entity. Errors about insufficient storage managers If you have specified --commit remote and all storage managers have failed, you may see one of the following errors:
406 insufficient storage managers to start transaction: require 1, have 0 insufficient storage managers to commit transaction: require 1, have 0 This error is generated because the transaction engine is unable to persist the transaction on the desired number of storage managers. Last storage manager terminates If the only remaining storage manager fails, NuoDB generates an exception when a transaction starts or commits. You can set an alert in NuoDB Console to be notified of this kind of event. Errors returned from JDBC Error Probable Cause What To Do "java.io.ioexception: Connection timed out" "Unknown service: SQL2" "No such database: DATABASE" "Fatal error: No nodes are available" The client was unable to connect to the URL provided for the broker within the specified timeout limit. The client connected to a NuoDB agent, but the agent is not specified as a broker. Only brokers (that is, agents running as brokers) can mediate NuoDB client connections. The database name provided in the URL does not correspond to a running database associated with a broker. The broker is unable to locate any running transaction engines for this database. Contact your NuoDB administrator for the correct connection URL. Start a broker if necessary and reconnect the client. Contact your NuoDB administrator to determine the correct database name or start a database. Contact your NuoDB administrator to restart the transaction engine and associate it with this broker. Reserved word: record_number You cannot define a field as RECORD_NUMBER. This field name is reserved for internal use by NuoDB. Log messages related to disk space and access issues Messages are sent to the log if the archive runs out of disk space or if the disk is not writable because of access issues. Storage manager process terminates unexpectedly Each archive must have a unique storage manager. If you assign two storage managers to the same archive one of the storage managers terminates. If an older storage manager process attempts to read an archive that was created with a newer version of the product, it generates an exception. Missing libraries (Joyent) In Joyent there are several copies of the shared libraries available. If your application generates a message about missing libraries (file not found) use the following setting: export LD_LIBRARY_PATH=/opt/local/nuodb/lib64:/opt/local/gcc47/lib/amd64
407 Kill a Long Running Query To kill a query, locate the EXECID of the query from the SYSTEM.CONNECTIONS table. SQL> SELECT * FROM SYSTEM.CONNECTIONS; EXECID STATEMENT NODEID CONNID USER OPEN HANDLE COUNT RUNTIME TEST select * from bigtable; n this example, you want to kill "select * from bigtable" because it seems to be hanging or is taking too long. You can use the KILL STATEMENT command and you can reference this statement in two ways, either with the EXECID or with the tuple of CONNID, HANDLE, and COUNT. SQL> KILL STATEMENT ; # or SQL> KILL STATEMENT connid 93 handle 1 count 1; If the statement is no longer running, you will get an error such as: SQL> KILL STATEMENT connid 93 handle 1 count 1; On node 4: Unable to find connection with id 93 NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved SPACER
408 How To Scale Out a NuoDB Database Multi-host configuration on five hosts with broker redundancy, durability, data redundancy and transactional scalability These instructions are for a configuration with two brokers, two storage managers, and two transaction engines. A redundant broker runs on the same host as one of the storage managers. This configuration is just one example of the unlimited number of setups that are possible. Important NuoDB must be installed on each machine before it can serve as a Host, or run Transaction Engines or Storage Managers. 1. Plan the configuration of the hosts to be configured as part of the domain. a. b. c. d. Choose a host to run a broker Choose a host to run a broker and a storage manager. Choose another host for the second storage manager. Plan to run transaction engines on each of the remaining two hosts. 2. Prepare each host to be part of the domain. a. Make sure that NuoDB is installed. b. On each host edit the default.properties file as follows: Specify whether the broker that was automatically started should run as an agent instead of a broker. Example: broker = false Specify the peer connections for each host. In this example configuration you would edit the properties for Host3, Host4, and Host5 for this purpose. Example:peer = address-of-broker Specify the port range to be used. Example: portrange = 48010, Shut down brokers on all the machines and restart them. 4. Use NuoDB Manager or NuoDB Console to add the transaction engines and storage managers, according to your plan. The following conceptual illustration shows this basic configuration:
409 NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved SPACER
410 Setup a Pilot Project on Multiple Hosts Description of a very simple NuoDB system (not intended for production). To get started you can set up a non-durable, non-production NuoDB system running on three hosts, and add hosts to improve performance. Doing this pilot project can be a prerequisite for building a NuoDB production environment and is designed to help you to: Evaluate and understand the requirements for a NuoDB system. Learn more about how to maximize performance when you eventually "go live" with a system that you use for production. The goals of this simple system are to Note: Run a broker, transaction engine, and a storage manager on separate hosts. Load data and run multiple client applications against the database (database). Use NuoDB Console (or NuoDB Manager) to observe performance statistics (such as transactions per second) while running NuoDB on the single host. Add hosts, reconnect and run multiple clients on the new hosts and notice the performance change. Optionally increase the storage for the system by adding hosts dedicated as an archive. The following step-by-step instructions assume that you have a client application that you would like to run against a database, and that you have available at least one or two additional hosts on which to run NuoDB. 1. Start a NuoDB broker on a machine that you want to set up as a NuoDB host. java -jar nuoagent.jar --broker & (For details about starting a broker see nuoagent.jar.) Use NuoDB Console (or NuoDB Manager) to start a transaction engine on a second host, and to initialize a storage manager with local storage on a third host. Use NuoDB Loader to load data to the database. Connect clients to the application using one of the drivers supported by NuoDB, such as JDBC or ODBC. Use NuoDB Console (or NuoDB Manager) to monitor the processes and observe performance of NuoDB while clients are running against the database. Use NuoDB Console (or NuoDB Manager) to configure additional hosts running transaction engines and storage managers. Connect and run more client applications against the database. On NuoDB Console (or NuoDB Manager) you can observe performance for the transaction engines running on separate hosts. At first, performance may decrease as new processes start up. You should be able to observe improved performance after this initial interval. NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved SPACER
411 Glossary Definitions of terms as used in the context of NuoDB. Term agent archive directory broker console database database object default.properties domain (NuoDB) domain (SQL) domain administrator failover Definition Part of the NuoDB management layer. Running an agent on a host makes it available as a NuoDB host. The agent starts and stops the NuoDB processes and communicates with the broker about the state of the system. Every host must have an agent and every domain must have at least one broker. An agent can also run as a broker if necessary. Provides durability of the data handled by the storage manager, for example by writing to disk. Holds a copy of the state of a NuoDB database at any given moment. Part of the NuoDB management layer. Manages access and control of transaction engines and storage managers. A broker is independent of any particular database in a NuoDB system. Part of the NuoDB management layer. Can find and manage NuoDB components that are known to brokers. The purpose of the console is to help you manage a NuoDB system. For example, from the console you can start and stop NuoDB processes across all instances of NuoDB. A variable number of processes running on a variable number of computers that serve a single database. Transaction engines and storage managers are part of the database. A database can span domains. For example, half a database could run on Amazon and half on machines at the customer site, each with separate administration of the physical machines. Any defined object in a database that is used to store or reference data. Some examples of database objects include tables, views, sequences, and indexes. Name of the file that specifies properties for cases where a property is unspecified on the nuoagent command line. A collection of NuoDB hosts that have been provisioned to work together to support NuoDB processes. You provision a host to run NuoDB by starting an agent. At that point the host is part of a domain, regardless of whether there are any other NuoDB processes running. A kind of user-defined field type defined in SQL. For example, define a domain named money as numeric(15,2). You can define fields as being of type money: create table employee (id integer, name string, salary money); User account with privileges to set up and maintain a NuoDB domain securely. Each domain administrator has a password. The ability of a NuoDB database to continue working if one or more hosts shut down, gracefully or not. Active transaction processes on failed hosts are aborted, and errors are reported to clients. Active transactions on surviving hosts are not disrupted.
412 launch a database Multiple Active Result Sets (MARS) non-durable nuodb NuoDB Loader NuoDB SQL client storage manager transaction engine Web Console To launch a database you must start a broker, a transaction engine, and a storage manager. On most platforms the installer for NuoDB starts a broker. After you start a broker use NuoDB Manager or NuoDB Console to create and manage the other processes. Allows you to run more than one batch on an open connection at the same time. A result set is active until it is either closed or the statement that created it is closed. Database that runs without a storage manager. Command that starts a transaction engine or storage manager. Loads data to and from NuoDB Started on the command line with nuosql command. Process that maintains the archive for a database. There can be any number of storage managers running in a NuoDB domain. Each storage manager is associated with exactly one database. Process that provides access to a single database. It handles requests from clients, caches data, and coordinates transactions. There may be any number of transaction engines running in a NuoDB domain. Each transaction engine is associated with exactly one database. Part of the NuoDB management layer. Can find and manage NuoDB components that are known to brokers. The purpose of the Web Console is to help you manage a NuoDB system. For example, from the console you can start and stop NuoDB processes across all hosts in the NuoDB Domain. NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved SPACER
413 Release Notes NuoDB 1.1 Delivers Major Enhancements for Microsoft.NET with LINQ adapter support NuoDB native protocol driver Open Source New Visual Studio 2012 Support Support for ASP, C#, VB w/ MSDEV IDE 64bit Support - Scalability & Performance 32-bit client supported Azure Compatibility The Windows Azure team says it themselves, "Building scalable applications in Windows Azure requires leveraging the scale-out of resources by their physical partitioning," but that doesn't mean we must endure the complexities of sharding and Federation, at least, not any longer. Developers using Azure can run NuoDB 1.1, a database that is designed from stretch to scale elastically on demand, and users can now leverage our native protocol NuoDB ADO.NET driver, and enjoy the performance benefits of Windows 64 bit support. Core Product and Performance Improvements Over 120 product issues resolved New Data Consistency tool, providing archive data validation and disk space reclamation Persistent garbage collection for MVCC Significant performance improvements across the board 20-50% improvement for insert heavy workloads Analytic style queries that are 2-3x faster Better support for concurrent DDL operations *Spoiler Alert: We're soon to publish our DBT-2 benchmark results SQL Enhancements and Improvements SQL optimizations and performance SQL compliance and correctness User Experience and Out-of-the-box Improvements NuoDB Developer Users are the focus in the new DevCenter The NuoDB Web Console integrated with DevCenter New Storefront Demo App + Scale-out Benchmark using Javascript, Java, and Hibernate SQL Explorer fully integrated into the Console NuoDB Quickstart is now browser-based, using a more broad data schema and data Product Documentation now available in a Confluence Wiki framework NuoDB Migrator is now in Beta and packaged with the product NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved SPACER
414 Bug Fixes and Improvements This lists describes issues that were fixed and improvements added in NuoDB v1.1-ga. Bug Fixes Click to here expand... DB-487 DB-1039 DB-1087 DB-1230 DB-1263 DB-1639 DB-1774 DB-1889 DB-1952 DB-1953 DB-1988 DB-2013 DB-2236 DB-2275 DB-2507 DB-2553 DB-2564 DB-2569 DB-2573 DB-2605 DB-2641 DB-2663 DB-2665 Using one or more aggregates in an expression causes it to return NULL ALTER TABLE DROP COLUMN does not drop associated constraints Granting INSERT + SELECT privilege is sufficient to execute ALTER Subqueries cause name resolution to break nuosql doesn't return error exit code when it cannot connect to the db A condition in WHERE causes inferior execution plan in a Dassault-derived query. Flight Demo Save / Import / Export RuntimeError from Ruby Driver rather than RecordNotUnique when constraint check violation mix of statistic/scalar expression in select list Confusing error - Transactional node left the chorus running without an archive, can't proceed. Valgrind warnings about possibly lost memory in the C++ client API Correlated subquery not evaluated properly if same table is used in the inner and outer query. Excel 2003 can not import NuoDB metadata from ODBC Web console: quiesce succeeds without a message, unquiesce button remains grayed out Limited error messages when a node is evicted Crash when PlatformIndex::validateContent calls PlatformIndex::createNode with invalid parameters. JIRA port: lower case field names can not be SELECT-ed from Windows uninstall left the NuoDB ODBC driver installed Slow query log needs sub-second threshold 100% CPU loop in PlatformTransactionManager::computeTransactionGroups Line Ending issues (can't change web app port number) Split information is serialized to disk on SM Assert (count < splitcount) in PlaformIndex::finishSplit during shutdown
415 DB-2668 DB-2684 Various housekeeping operations are performed for each processed row, wasting CPU Index validation failures with nightly TPCC and Flights Multi tests DB-2694 PlatformIn dex::broadcastadd Assertion upperbound->compare awaitingsplitcomplete failed DB-2696 DB-2703 DB-2757 DB-2772 DB-2791 DB-2792 DB-2796 DB-2825 DB-2832 DB-2833 DB-2834 DB-2851 DB-2855 DB-2859 DB-2862 DB-2864 DB-2865 DB-2866 DB-2867 DB-2868 DB-2870 DB-2871 DB-2873 DB-2877 DB-2879 Failure to drop index when table name and field name were delimited identifiers Failure to drop schema when using quoted identifiers NULL-able aggregate function under 'is [not] null' in the HAVING clause is ignored. Enhance Slow Query Detection Valgrind memory errors in JDBC tests jemalloc profiler breaks with smart pointer stuff node-db-nuodb does not work past v0.6.9 No new connections are accepted during long-lived DDL operations, such as CREATE INDEX Explicit DEFAULT allowed for identity columns Two nodes die if one experiences network issues Engine can block on startup. Console: No journal options visible when starting database or adding SM (process) ORDER BY does not perform proper name resolution if schema name is specified Index scans on an index with low selectivity cause a lot of backwards I/O NuoSQL client begins throwing syntax errors on valid input ruby-activerecord-nuodb-adapter README has errors/outdated information Seg Fault in PlatformObject destructor during GC Primary indexes on mixed case tables don't work Table alias not observed if schema is specified index for RemParameterMetaData getter methods off by one. TIME -> TIMESTAMP conversion error RemDatabaseMetaData::getDriverVersion() returns char * to deleted memory IS NULL on Agregate expressions always evaluates to TRUE LIMIT in a derived table causes GROUP BY to return wrong result PlatformIndex is being GC while still in use
416 DB-2882 DB-2885 DB-2892 DB-2893 DB-2895 DB-2897 DB-2905 DB-2915 DB-2917 Query 5x slower after index rebuild Unqualified field reference in select list doesn't check for ambiguity New Web Console Landing Page is not scrollable The active area of the buttons on the console home page is smaller than the actual button Assertion failed when running a number of JDBC requests in parallel Connecting to a database without dba-user causes crash Windows run-quickstart.cmd error Web Console as started by the run-quickstart.cmd script remains running after uninstall Tester: crash in Thread::~Thread called by RefObject::release DB-2918 Umbrella bug for UI issues with the Database Explorer for 1.1 DB-2920 DB-2923 DB-2929 DB-2936 DB-2939 DB-2941 DB-2944 DB-2946 DB-2951 DB-2955 DB-2957 DB-2960 DB-2966 DB-2969 DB-2970 DB-2971 DB-2978 DB-2984 PHP PDO Driver throws exception from call to PDO::lastInsertId NuoDB Ruby driver assertion failed/ruby crash Refactor value slots, slots, sorts etc... from Statement to a context so can better support Groups subselect broken - wrong ExecContext run-quickstart.cmd assumes/creates c:\temp Transaction node crashes when preparing SQL query with LIKE tests in nested WHERE Using an alias on a field that has a collation, the collation is ignored when comparing values Wrong result with OUTER JOIN and ON condition that evaluates to FALSE Valgrind warning: invalid read with a timestamp expression Invalid CREATE INDEX definition corrupts table Free license expiration date should not be shown Multiple grouped queries in a join step on one another's groupeof flag MinMaxBitmap returns incorrect results when select contains two functions on different fields select avg(f1)+f2,f2... group by f2 incorrect output (null in last row) Issues with TIME/TIMESTAMP nanos Wrong result with COUNT(DISTINCT ) and GROUP BY Duplicate entries in SYSTEM.PROPERTIES after restart DB-2937 causes timing-sensitive crash
417 DB-2987 DB-2988 DB-2989 DB-2990 DB-2991 DB-2992 DB-2993 DB-2994 DB-2995 DB-3008 DB-3010 DB-3014 DB-3016 DB-3029 DB-3030 DB-3031 Upgrade from 32-bit Windows binary to 64-bit binary fails prunsrv64.exe reported as a threat by AVG antivirus 64-bit installer fails - Attempt to create msvcr100.dll that was just created java.io.filenotfoundexception when running nuodb-migrator.bat Installer package contains a broken version of the migrator Installer places incorrect icons in the Start Menu on 32-bit windows NuoSQL, Nuoloader, Migrator are not installed on 32-bit Windows kmcneill/yellowhammer: Wrong result with COUNT on NULL value NuoRemote_VC9.DLL will not load if Visual Studio 2008 is not installed. Race condition with DDL and DML on multiple TE Need to make sure system.properties table doesn't allow duplicates SQL Explorer "autocomplete" provides incorrect suggestions Web Console: in browser's developer mode you see 'surface undefined' errors when mouse over charts Wrong result when selecting from a derived table using aggregator functions Wrong result for Count() when used inside a derived table The Archive may not write all data in the queue on shutdown DB-3046 Assertion `!availablerecords!availablerecords->isset(recordnumber)' failed in PlatformRecords::insertRecord Improvements Click here to expand... DB-375 DB-519 DB-1405 DB-1427 DB-1846 DB-2117 DB-2693 DB-2950 C++ API doesn't support BatchUpdateException SQL: Create feature/command to show current isolation mode NuoDB Console: Drill through navigation from item in the Monitor panels Legend tree C++ API added to documentation Doc: Various enhancements to NuoDB Loader (nuoloader) description Web Console: Umbrella for post-beta 9 improvements DBT2 Spends a lot of time locking for findnode under PT::transactionVisible->PTM->isKnownTransaction Change PHP PDO example to use a prepared statement.
418 Known Bugs and Limitations A list of issues that are known bugs and limitations for NuoDB. See also Mapping of NuoDB SQL to SQL 2008 Standard. Bugs Reported by NuoDB Users Click here to expand... DB-2695 DB-2699 DB-2712 DB-2724 DB-2727 DB-2734 DB-2735 DB-2737 DB-2739 DB-2748 DB-2773 DB-2780 DB-2788 DB-2793 DB-2797 DB-2810 DB-2811 DB-2820 DB-2843 DB-2845 DB-2878 SM/TE crash when loading data from CDMT - rollback problem Indexing of blobs/clobs makes it easy to exceed key length. PHP PDO Driver special chars test fails on Windows. NuoDB SilverStripe Driver search function not working. SilverStripe Driver unable to run database compiler CDMT converting MySQL/NuoDB timestamps and datetimes. NuoDB SilverStripe Driver unable to save data in cms editor fields NuoDB SilverStripe Driver unable to rename columns. Core in PlatformRecords::~PlatformRecords SilverStripe editor security tab not working. PHP PDO Driver needs to return string date and time for timestamps. Undesirable fetch of index's leafs. Update NuoDB Migrator link in online Doc Engine::destroyMasterCatalog crashes while releasing connection reference NuoDB Version Check Connection Error when using HTTP Proxy Implement PHP PDO Support for streaming BLOB/CLOBs. NuoDB System Tray error message typo View columns may not be in the order they were declared Users want a way to disable the tray monitor InList issues Management layer should keep track of who started processes DB-2887 ORDER BY breaks on BIGINT columns w/ decimal values > 16 digits DB-2888 DB-2970 DB-2995 Intuit Performance Issue: Insert Performance Significantly Degrades Over Time Issues with TIME/TIMESTAMP nanos NuoRemote_VC9.DLL will not load if Visual Studio 2008 is not installed. SQL Limitations
419 Click here to expand... Types ALTER SEQUENCE ALTER USER ALTER TABLE NuoDB SQL does not yet implement the following: interval data type numbers with fractional components with time/data arithmetic row types constructed types user-defined types [WITH[OUT] TIME ZONE] Not yet implemented. Users are not allowed to change their own passwords. ALTER TABLE DROP COLUMN does not drop constraints. ALTER TABLE DROP CONSTRAINT is not supported. CREATE PROCEDURE CREATE TRIGGER CREATE VIEW DROP PROCEDURE EXPLAIN GRANT KILL STATEMENT RENAME TABLE ROLLBACK SET START TRANSACTION UPDATE DELETE USE Not yet implemented. POSITION number is not implemented. If multiple triggers of the same kind are defined for the same event, they are fired in random order. Although you can specify GROUP BY with CREATE VIEW, it does not return correct results. The SELECT clause for a view cannot contain a HAVING clause or UNION clause. You cannot use AS SELECT * FROM when creating a view. You cannot update a view. Support for the optional list of column names is not yet implemented. Not yet implemented. The output of the EXPLAIN statement is subject to change in future releases. REFERENCES is not yet implemented. You cannot yet specify multiple database objects in a single statement when specifying or revoking privileges. Undocumented but supported. Requires information from the SYSTEM.CONNECTIONS table. Not yet implemented. NuoDB SQL does not yet implement the TRANSACTION clause with ROLLBACK. Support for setting additional run-time parameters is not yet implemented. REPEATABLE READ is not implemented. READ UNCOMMITTED is not implemented. NuoDB SQL does not yet implement the RETURNING clause with UPDATE or DELETE. NuoDB does not generate an error if you specify a schema or database that does not exist. NuoDB Company Website
420 Copyright 2013 NuoDB, Inc. All rights reserved SPACER
421 Acknowledgements Parts of the NuoDB product make use of the following third party software. EditLine Library Parts of NuoDB use the EditLine library that is: Copyright (c) 1992, 1993 The Regents of the University of California. All rights reserved. This code is derived from software contributed to Berkeley by Christos Zoulas of Cornell University. THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. PostgreSQL NuoDB SQL Reference documentation is partially based on PostgreSQL documentation. PostgreSQL is released under the PostgreSQL License, a liberal Open Source license, similar to the BSD or MIT licenses. PostgreSQL Database Management System (formerly known as Postgres, then as Postgres95) Portions Copyright (c) , The PostgreSQL Global Development Group Portions Copyright (c) 1994, The Regents of the University of California Permission to use, copy, modify, and distribute this software and its documentation for any purpose, without fee, and without a written agreement is hereby granted, provided that the above copyright notice and this paragraph and the following two paragraphs appear in all copies. IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. HSQL Development Group NuoDB API Reference documentation is partially based on HSQL Development Group documentation. COPYRIGHTS AND LICENSES (based on BSD License) For work developed by the HSQL Development Group: Copyright (c) , The HSQL Development Group All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. Neither the name of the HSQL Development Group nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL HSQL DEVELOPMENT GROUP, HSQLDB.ORG, OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
422 For work originally developed by the Hypersonic SQL Group: Copyright (c) by the Hypersonic SQL Group. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. Neither the name of the Hypersonic SQL Group nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE HYPERSONIC SQL GROUP, OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. This software consists of voluntary contributions made by many individuals on behalf of the Hypersonic SQL Group. Code Project Some NuoDB code is derived from Code Project which is licensed under a BSD License Cores NuoDB uses Lockfree Algorithms COPYRIGHTS AND LICENSES For work developed by Dimitry Vyukov Copyright (c) Dmitry Vyukov. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. Neither the name of the HSQL Development Group nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY DMITRY VYUKOV "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT S HALL DMITRY VYUKOV OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. Hockey Databank Project The information used herein was obtained free of charge from and is copyrighted by the Hockey Databank project. For more information about the Hockey Databank project please visit; NuoDB Company Website
423 Copyright 2013 NuoDB, Inc. All rights reserved SPACER
424 Documentation Download NuoDB does not ship documentation with the product however our documentation is available for download using the following links. NuoDB v1.0.2 PDF NuoDB v1.0.1 PDF NuoDB Company Website Copyright 2013 NuoDB, Inc. All rights reserved SPACER
AWS Schema Conversion Tool. User Guide Version 1.0
AWS Schema Conversion Tool User Guide AWS Schema Conversion Tool: User Guide Copyright 2016 Amazon Web Services, Inc. and/or its affiliates. All rights reserved. Amazon's trademarks and trade dress may
WhatsUp Gold v16.3 Installation and Configuration Guide
WhatsUp Gold v16.3 Installation and Configuration Guide Contents Installing and Configuring WhatsUp Gold using WhatsUp Setup Installation Overview... 1 Overview... 1 Security considerations... 2 Standard
AWS Schema Conversion Tool. User Guide Version 1.0
AWS Schema Conversion Tool User Guide AWS Schema Conversion Tool: User Guide Copyright 2016 Amazon Web Services, Inc. and/or its affiliates. All rights reserved. Amazon's trademarks and trade dress may
WhatsUp Gold v16.1 Installation and Configuration Guide
WhatsUp Gold v16.1 Installation and Configuration Guide Contents Installing and Configuring Ipswitch WhatsUp Gold v16.1 using WhatsUp Setup Installing WhatsUp Gold using WhatsUp Setup... 1 Security guidelines
1. Product Information
ORIXCLOUD BACKUP CLIENT USER MANUAL LINUX 1. Product Information Product: Orixcloud Backup Client for Linux Version: 4.1.7 1.1 System Requirements Linux (RedHat, SuSE, Debian and Debian based systems such
Quick Start Guide for VMware and Windows 7
PROPALMS VDI Version 2.1 Quick Start Guide for VMware and Windows 7 Rev. 1.1 Published: JULY-2011 1999-2011 Propalms Ltd. All rights reserved. The information contained in this document represents the
Quick Start Guide for Parallels Virtuozzo
PROPALMS VDI Version 2.1 Quick Start Guide for Parallels Virtuozzo Rev. 1.1 Published: JULY-2011 1999-2011 Propalms Ltd. All rights reserved. The information contained in this document represents the current
Online Backup Client User Manual Linux
Online Backup Client User Manual Linux 1. Product Information Product: Online Backup Client for Linux Version: 4.1.7 1.1 System Requirements Operating System Linux (RedHat, SuSE, Debian and Debian based
Online Backup Client User Manual
Online Backup Client User Manual Software version 3.21 For Linux distributions January 2011 Version 2.0 Disclaimer This document is compiled with the greatest possible care. However, errors might have
FileMaker Server 14. FileMaker Server Help
FileMaker Server 14 FileMaker Server Help 2007 2015 FileMaker, Inc. All Rights Reserved. FileMaker, Inc. 5201 Patrick Henry Drive Santa Clara, California 95054 FileMaker and FileMaker Go are trademarks
RecoveryVault Express Client User Manual
For Linux distributions Software version 4.1.7 Version 2.0 Disclaimer This document is compiled with the greatest possible care. However, errors might have been introduced caused by human mistakes or by
Sage Intelligence Financial Reporting for Sage ERP X3 Version 6.5 Installation Guide
Sage Intelligence Financial Reporting for Sage ERP X3 Version 6.5 Installation Guide Table of Contents TABLE OF CONTENTS... 3 1.0 INTRODUCTION... 1 1.1 HOW TO USE THIS GUIDE... 1 1.2 TOPIC SUMMARY...
WhatsUp Gold v16.2 Installation and Configuration Guide
WhatsUp Gold v16.2 Installation and Configuration Guide Contents Installing and Configuring Ipswitch WhatsUp Gold v16.2 using WhatsUp Setup Installing WhatsUp Gold using WhatsUp Setup... 1 Security guidelines
Online Backup Linux Client User Manual
Online Backup Linux Client User Manual Software version 4.0.x For Linux distributions August 2011 Version 1.0 Disclaimer This document is compiled with the greatest possible care. However, errors might
insync Installation Guide
insync Installation Guide 5.2 Private Cloud Druva Software June 21, 13 Copyright 2007-2013 Druva Inc. All Rights Reserved. Table of Contents Deploying insync Private Cloud... 4 Installing insync Private
Online Backup Client User Manual
For Linux distributions Software version 4.1.7 Version 2.0 Disclaimer This document is compiled with the greatest possible care. However, errors might have been introduced caused by human mistakes or by
Installation Instruction STATISTICA Enterprise Server
Installation Instruction STATISTICA Enterprise Server Notes: ❶ The installation of STATISTICA Enterprise Server entails two parts: a) a server installation, and b) workstation installations on each of
System Administration Training Guide. S100 Installation and Site Management
System Administration Training Guide S100 Installation and Site Management Table of contents System Requirements for Acumatica ERP 4.2... 5 Learning Objects:... 5 Web Browser... 5 Server Software... 5
VERSION 9.02 INSTALLATION GUIDE. www.pacifictimesheet.com
VERSION 9.02 INSTALLATION GUIDE www.pacifictimesheet.com PACIFIC TIMESHEET INSTALLATION GUIDE INTRODUCTION... 4 BUNDLED SOFTWARE... 4 LICENSE KEY... 4 SYSTEM REQUIREMENTS... 5 INSTALLING PACIFIC TIMESHEET
HYPERION SYSTEM 9 N-TIER INSTALLATION GUIDE MASTER DATA MANAGEMENT RELEASE 9.2
HYPERION SYSTEM 9 MASTER DATA MANAGEMENT RELEASE 9.2 N-TIER INSTALLATION GUIDE P/N: DM90192000 Copyright 2005-2006 Hyperion Solutions Corporation. All rights reserved. Hyperion, the Hyperion logo, and
MarkLogic Server. Installation Guide for All Platforms. MarkLogic 8 February, 2015. Copyright 2015 MarkLogic Corporation. All rights reserved.
Installation Guide for All Platforms 1 MarkLogic 8 February, 2015 Last Revised: 8.0-4, November, 2015 Copyright 2015 MarkLogic Corporation. All rights reserved. Table of Contents Table of Contents Installation
Veritas Cluster Server Database Agent for Microsoft SQL Configuration Guide
Veritas Cluster Server Database Agent for Microsoft SQL Configuration Guide Windows 2000, Windows Server 2003 5.0 11293743 Veritas Cluster Server Database Agent for Microsoft SQL Configuration Guide Copyright
FileMaker Server 7. Administrator s Guide. For Windows and Mac OS
FileMaker Server 7 Administrator s Guide For Windows and Mac OS 1994-2004, FileMaker, Inc. All Rights Reserved. FileMaker, Inc. 5201 Patrick Henry Drive Santa Clara, California 95054 FileMaker is a trademark
FileMaker Server 11. FileMaker Server Help
FileMaker Server 11 FileMaker Server Help 2010 FileMaker, Inc. All Rights Reserved. FileMaker, Inc. 5201 Patrick Henry Drive Santa Clara, California 95054 FileMaker is a trademark of FileMaker, Inc. registered
NSi Mobile Installation Guide. Version 6.2
NSi Mobile Installation Guide Version 6.2 Revision History Version Date 1.0 October 2, 2012 2.0 September 18, 2013 2 CONTENTS TABLE OF CONTENTS PREFACE... 5 Purpose of this Document... 5 Version Compatibility...
Installation Guide for Pulse on Windows Server 2008R2
MadCap Software Installation Guide for Pulse on Windows Server 2008R2 Pulse Copyright 2014 MadCap Software. All rights reserved. Information in this document is subject to change without notice. The software
User Manual. Onsight Management Suite Version 5.1. Another Innovation by Librestream
User Manual Onsight Management Suite Version 5.1 Another Innovation by Librestream Doc #: 400075-06 May 2012 Information in this document is subject to change without notice. Reproduction in any manner
Installing The SysAidTM Server Locally
Installing The SysAidTM Server Locally Document Updated: 17 October 2010 Introduction SysAid is available in two editions: a fully on-demand ASP solution and an installed, in-house solution for your server.
safend a w a v e s y s t e m s c o m p a n y
safend a w a v e s y s t e m s c o m p a n y SAFEND Data Protection Suite Installation Guide Version 3.4.5 Important Notice This guide is delivered subject to the following conditions and restrictions:
Installing and Configuring WhatsUp Gold
Installing and Configuring WhatsUp Gold This guide provides information about installing and configuring WhatsUp Gold v14.2, including instructions on how to run the WhatsUp web interface through an Internet
SC-T35/SC-T45/SC-T46/SC-T47 ViewSonic Device Manager User Guide
SC-T35/SC-T45/SC-T46/SC-T47 ViewSonic Device Manager User Guide Copyright and Trademark Statements 2014 ViewSonic Computer Corp. All rights reserved. This document contains proprietary information that
FileMaker Server 10 Help
FileMaker Server 10 Help 2007-2009 FileMaker, Inc. All Rights Reserved. FileMaker, Inc. 5201 Patrick Henry Drive Santa Clara, California 95054 FileMaker, the file folder logo, Bento and the Bento logo
DS License Server V6R2013x
DS License Server V6R2013x DS License Server V6R2013x Installation and Configuration Guide Contains JAVA SE RUNTIME ENVIRONMENT (JRE) VERSION 7 Contains IBM(R) 64-bit SDK for AIX(TM), Java(TM) Technology
Embarcadero Performance Center 2.7 Installation Guide
Embarcadero Performance Center 2.7 Installation Guide Copyright 1994-2009 Embarcadero Technologies, Inc. Embarcadero Technologies, Inc. 100 California Street, 12th Floor San Francisco, CA 94111 U.S.A.
Reconfiguring VMware vsphere Update Manager
Reconfiguring VMware vsphere Update Manager vsphere Update Manager 6.0 This document supports the version of each product listed and supports all subsequent versions until the document is replaced by a
Installation Guide for Pulse on Windows Server 2012
MadCap Software Installation Guide for Pulse on Windows Server 2012 Pulse Copyright 2014 MadCap Software. All rights reserved. Information in this document is subject to change without notice. The software
AVALANCHE MC 5.3 AND DATABASE MANAGEMENT SYSTEMS
AVALANCHE MC 5.3 AND DATABASE MANAGEMENT SYSTEMS Avalanche Mobility Center (MC) offers support for other database management systems (DBMS) as alternatives to the built-in PostgreSQL DBMS. This was prompted
OnCommand Performance Manager 1.1
OnCommand Performance Manager 1.1 Installation and Setup Guide For Red Hat Enterprise Linux NetApp, Inc. 495 East Java Drive Sunnyvale, CA 94089 U.S. Telephone: +1 (408) 822-6000 Fax: +1 (408) 822-4501
Verax Service Desk Installation Guide for UNIX and Windows
Verax Service Desk Installation Guide for UNIX and Windows March 2015 Version 1.8.7 and higher Verax Service Desk Installation Guide 2 Contact Information: E-mail: [email protected] Internet: http://www.veraxsystems.com/
Copyright 2014 SolarWinds Worldwide, LLC. All rights reserved worldwide. No part of this document may be reproduced by any means nor modified,
Copyright 2014 SolarWinds Worldwide, LLC. All rights reserved worldwide. No part of this document may be reproduced by any means nor modified, decompiled, disassembled, published or distributed, in whole
Enterprise Manager. Version 6.2. Installation Guide
Enterprise Manager Version 6.2 Installation Guide Enterprise Manager 6.2 Installation Guide Document Number 680-028-014 Revision Date Description A August 2012 Initial release to support version 6.2.1
WebSphere Business Monitor V7.0: Clustering Single cluster deployment environment pattern
Copyright IBM Corporation 2010 All rights reserved WebSphere Business Monitor V7.0: Clustering Single cluster deployment environment pattern What this exercise is about... 2 Exercise requirements... 2
Setting up the Oracle Warehouse Builder Project. Topics. Overview. Purpose
Setting up the Oracle Warehouse Builder Project Purpose In this tutorial, you setup and configure the project environment for Oracle Warehouse Builder 10g Release 2. You create a Warehouse Builder repository
Matisse Installation Guide for MS Windows
Matisse Installation Guide for MS Windows July 2013 Matisse Installation Guide for MS Windows Copyright 2013 Matisse Software Inc. All Rights Reserved. This manual and the software described in it are
Installation Guide. SAP Control Center 3.3
Installation Guide SAP Control Center 3.3 DOCUMENT ID: DC01002-01-0330-01 LAST REVISED: November 2013 Copyright 2013 by SAP AG or an SAP affiliate company. All rights reserved. No part of this publication
Deploying System Center 2012 R2 Configuration Manager
Deploying System Center 2012 R2 Configuration Manager This document is for informational purposes only. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED, OR STATUTORY, AS TO THE INFORMATION IN THIS DOCUMENT.
ACTIVE DIRECTORY DEPLOYMENT
ACTIVE DIRECTORY DEPLOYMENT CASAS Technical Support 800.255.1036 2009 Comprehensive Adult Student Assessment Systems. All rights reserved. Version 031809 CONTENTS 1. INTRODUCTION... 1 1.1 LAN PREREQUISITES...
Introweb Remote Backup Client for Mac OS X User Manual. Version 3.20
Introweb Remote Backup Client for Mac OS X User Manual Version 3.20 1. Contents 1. Contents...2 2. Product Information...4 3. Benefits...4 4. Features...5 5. System Requirements...6 6. Setup...7 6.1. Setup
JAMF Software Server Installation Guide for Linux. Version 8.6
JAMF Software Server Installation Guide for Linux Version 8.6 JAMF Software, LLC 2012 JAMF Software, LLC. All rights reserved. JAMF Software has made all efforts to ensure that this guide is accurate.
Kaseya Server Instal ation User Guide June 6, 2008
Kaseya Server Installation User Guide June 6, 2008 About Kaseya Kaseya is a global provider of IT automation software for IT Solution Providers and Public and Private Sector IT organizations. Kaseya's
4cast Client Specification and Installation
4cast Client Specification and Installation Version 2015.00 10 November 2014 Innovative Solutions for Education Management www.drakelane.co.uk System requirements The client requires Administrative rights
FileMaker 12. ODBC and JDBC Guide
FileMaker 12 ODBC and JDBC Guide 2004 2012 FileMaker, Inc. All Rights Reserved. FileMaker, Inc. 5201 Patrick Henry Drive Santa Clara, California 95054 FileMaker and Bento are trademarks of FileMaker, Inc.
STATISTICA VERSION 10 STATISTICA ENTERPRISE SERVER INSTALLATION INSTRUCTIONS
Notes: STATISTICA VERSION 10 STATISTICA ENTERPRISE SERVER INSTALLATION INSTRUCTIONS 1. The installation of the STATISTICA Enterprise Server entails two parts: a) a server installation, and b) workstation
DOCSVAULT Document Management System for everyone
Installation Guide DOCSVAULT Document Management System for everyone 9 v Desktop and Web Client v On Premises Solution v Intelligent Data Capture v Email Automation v Workflow & Record Retention Installing
Metalogix Replicator. Quick Start Guide. Publication Date: May 14, 2015
Metalogix Replicator Quick Start Guide Publication Date: May 14, 2015 Copyright Metalogix International GmbH, 2002-2015. All Rights Reserved. This software is protected by copyright law and international
DS License Server. Installation and Configuration Guide. 3DEXPERIENCE R2014x
DS License Server Installation and Configuration Guide 3DEXPERIENCE R2014x Contains JAVA SE RUNTIME ENVIRONMENT (JRE) VERSION 7 Contains IBM(R) 64-bit SDK for AIX(TM), Java(TM) Technology Edition, Version
Installation Instruction STATISTICA Enterprise Small Business
Installation Instruction STATISTICA Enterprise Small Business Notes: ❶ The installation of STATISTICA Enterprise Small Business entails two parts: a) a server installation, and b) workstation installations
STATISTICA VERSION 9 STATISTICA ENTERPRISE INSTALLATION INSTRUCTIONS FOR USE WITH TERMINAL SERVER
Notes: STATISTICA VERSION 9 STATISTICA ENTERPRISE INSTALLATION INSTRUCTIONS FOR USE WITH TERMINAL SERVER 1. These instructions focus on installation on Windows Terminal Server (WTS), but are applicable
XenClient Enterprise Synchronizer Installation Guide
XenClient Enterprise Synchronizer Installation Guide Version 5.1.0 March 26, 2014 Table of Contents About this Guide...3 Hardware, Software and Browser Requirements...3 BIOS Settings...4 Adding Hyper-V
Getting Started with ESXi Embedded
ESXi 4.1 Embedded vcenter Server 4.1 This document supports the version of each product listed and supports all subsequent versions until the document is replaced by a new edition. To check for more recent
File Auditor for NAS, Net App Edition
File Auditor for NAS, Net App Edition Installation Guide Revision 1.2 - July 2015 This guide provides a short introduction to the installation and initial configuration of NTP Software File Auditor for
NTP Software File Auditor for NAS, EMC Edition
NTP Software File Auditor for NAS, EMC Edition Installation Guide June 2012 This guide provides a short introduction to the installation and initial configuration of NTP Software File Auditor for NAS,
User's Guide - Beta 1 Draft
IBM Tivoli Composite Application Manager for Microsoft Applications: Microsoft Cluster Server Agent vnext User's Guide - Beta 1 Draft SC27-2316-05 IBM Tivoli Composite Application Manager for Microsoft
OneStop Reporting 3.7 Installation Guide. Updated: 2013-01-31
OneStop Reporting 3.7 Installation Guide Updated: 2013-01-31 Copyright OneStop Reporting AS www.onestopreporting.com Table of Contents System Requirements... 1 Obtaining the Software... 2 Obtaining Your
Spectrum Technology Platform. Version 9.0. Spectrum Spatial Administration Guide
Spectrum Technology Platform Version 9.0 Spectrum Spatial Administration Guide Contents Chapter 1: Introduction...7 Welcome and Overview...8 Chapter 2: Configuring Your System...9 Changing the Default
IBM WebSphere Application Server Version 7.0
IBM WebSphere Application Server Version 7.0 Centralized Installation Manager for IBM WebSphere Application Server Network Deployment Version 7.0 Note: Before using this information, be sure to read the
Metalogix SharePoint Backup. Advanced Installation Guide. Publication Date: August 24, 2015
Metalogix SharePoint Backup Publication Date: August 24, 2015 All Rights Reserved. This software is protected by copyright law and international treaties. Unauthorized reproduction or distribution of this
QuickStart Guide for Managing Computers. Version 9.2
QuickStart Guide for Managing Computers Version 9.2 JAMF Software, LLC 2013 JAMF Software, LLC. All rights reserved. JAMF Software has made all efforts to ensure that this guide is accurate. JAMF Software
STATISTICA VERSION 12 STATISTICA ENTERPRISE SMALL BUSINESS INSTALLATION INSTRUCTIONS
STATISTICA VERSION 12 STATISTICA ENTERPRISE SMALL BUSINESS INSTALLATION INSTRUCTIONS Notes 1. The installation of STATISTICA Enterprise Small Business entails two parts: a) a server installation, and b)
http://docs.trendmicro.com
Trend Micro Incorporated reserves the right to make changes to this document and to the products described herein without notice. Before installing and using the product, please review the readme files,
ARIS Server Installation and Administration Guide ARIS. Version 9.6 - Service Release 1
ARIS Server Installation and Administration Guide ARIS Version 9.6 - Service Release 1 June 2014 This document applies to ARIS Version 9.6 SR1 and to all subsequent releases. Specifications contained herein
LAE 5.1. Windows Server Installation Guide. Version 1.0
LAE 5.1 Windows Server Installation Guide Copyright THE CONTENTS OF THIS DOCUMENT ARE THE COPYRIGHT OF LIMITED. ALL RIGHTS RESERVED. THIS DOCUMENT OR PARTS THEREOF MAY NOT BE REPRODUCED IN ANY FORM WITHOUT
FileMaker Server 8. Administrator s Guide
FileMaker Server 8 Administrator s Guide 1994-2005 FileMaker, Inc. All Rights Reserved. FileMaker, Inc. 5201 Patrick Henry Drive Santa Clara, California 95054 FileMaker is a trademark of FileMaker, Inc.,
SQL Server Solutions GETTING STARTED WITH. SQL Safe Backup
SQL Server Solutions GETTING STARTED WITH SQL Safe Backup Purpose of this document Due to its depth and potential for customization, there are often parts of SQL Safe Backup that are overlooked during
FileMaker Server 15. Getting Started Guide
FileMaker Server 15 Getting Started Guide 2007 2016 FileMaker, Inc. All Rights Reserved. FileMaker, Inc. 5201 Patrick Henry Drive Santa Clara, California 95054 FileMaker and FileMaker Go are trademarks
Setting up SQL Translation Framework OBE for Database 12cR1
Setting up SQL Translation Framework OBE for Database 12cR1 Overview Purpose This tutorial shows you how to use have an environment ready to demo the new Oracle Database 12c feature, SQL Translation Framework,
Installation Guide. Help Desk Manager. Version v12.1.0
Installation Guide Help Desk Manager Version v12.1.0 Documentation published: March 12, 2014 Contents Introduction to Help Desk Manager 3 Help Desk Manager Key Features 3 Do-It-Yourself Installation and
Informatica Cloud & Redshift Getting Started User Guide
Informatica Cloud & Redshift Getting Started User Guide 2014 Informatica Corporation. No part of this document may be reproduced or transmitted in any form, by any means (electronic, photocopying, recording
Product Manual. MDM On Premise Installation Version 8.1. Last Updated: 06/07/15
Product Manual MDM On Premise Installation Version 8.1 Last Updated: 06/07/15 Parallels IP Holdings GmbH Vordergasse 59 8200 Schaffhausen Switzerland Tel: + 41 52 632 0411 Fax: + 41 52 672 2010 www.parallels.com
NETWRIX CHANGE NOTIFIER
NETWRIX CHANGE NOTIFIER FOR SQL SERVER QUICK-START GUIDE Product Version: 2.6.194 February 2014. Legal Notice The information in this publication is furnished for information use only, and does not constitute
Team Foundation Server 2013 Installation Guide
Team Foundation Server 2013 Installation Guide Page 1 of 164 Team Foundation Server 2013 Installation Guide Benjamin Day [email protected] v1.1.0 May 28, 2014 Team Foundation Server 2013 Installation Guide
Archive Attender Version 3.5
Archive Attender Version 3.5 Getting Started Guide Sherpa Software (800) 255-5155 www.sherpasoftware.com Page 1 Under the copyright laws, neither the documentation nor the software can be copied, photocopied,
National Fire Incident Reporting System (NFIRS 5.0) Configuration Tool User's Guide
National Fire Incident Reporting System (NFIRS 5.0) Configuration Tool User's Guide NFIRS 5.0 Software Version 5.6 1/7/2009 Department of Homeland Security Federal Emergency Management Agency United States
How To Install Powerpoint 6 On A Windows Server With A Powerpoint 2.5 (Powerpoint) And Powerpoint 3.5.5 On A Microsoft Powerpoint 4.5 Powerpoint (Powerpoints) And A Powerpoints 2
DocAve 6 Service Pack 1 Installation Guide Revision C Issued September 2012 1 Table of Contents About the Installation Guide... 4 Submitting Documentation Feedback to AvePoint... 4 Before You Begin...
Nexio Connectus with Nexio G-Scribe
Nexio Connectus with Nexio G-Scribe 2.1.2 3/20/2014 Edition: A 2.1.2 Publication Information 2014 Imagine Communications. Proprietary and Confidential. Imagine Communications considers this document and
Reconfiguring VMware vsphere Update Manager
Reconfiguring VMware vsphere Update Manager vsphere Update Manager 5.5 This document supports the version of each product listed and supports all subsequent versions until the document is replaced by a
Installing and Using the vnios Trial
Installing and Using the vnios Trial The vnios Trial is a software package designed for efficient evaluation of the Infoblox vnios appliance platform. Providing the complete suite of DNS, DHCP and IPAM
026-1010 Rev 7 06-OCT-2011. Site Manager Installation Guide
026-1010 Rev 7 06-OCT-2011 Site Manager Installation Guide Retail Solutions 3240 Town Point Drive NW, Suite 100 Kennesaw, GA 30144, USA Phone: 770-425-2724 Fax: 770-425-9319 Table of Contents 1 SERVER
FlexSim LAN License Server
FlexSim LAN License Server Installation Instructions Rev. 20150318 Table of Contents Introduction... 2 Using lmtools... 2 1. Download the installation files... 3 2. Install the license server... 4 3. Connecting
WhatsUp Gold v16.1 Database Migration and Management Guide Learn how to migrate a WhatsUp Gold database from Microsoft SQL Server 2008 R2 Express
WhatsUp Gold v16.1 Database Migration and Management Guide Learn how to migrate a WhatsUp Gold database from Microsoft SQL Server 2008 R2 Express Edition to Microsoft SQL Server 2005, 2008, or 2008 R2
Bitrix Site Manager ASP.NET. Installation Guide
Bitrix Site Manager ASP.NET Installation Guide Contents Introduction... 4 Chapter 1. Checking for IIS Installation... 5 Chapter 2. Using An Archive File to Install Bitrix Site Manager ASP.NET... 7 Preliminary
Getting Started with Attunity CloudBeam for Azure SQL Data Warehouse BYOL
Getting Started with Attunity CloudBeam for Azure SQL Data Warehouse BYOL Overview This short guide explains how to use Attunity CloudBeam to replicate data from your on premises database to Microsoft
INSTALL AND CONFIGURATION GUIDE. Atlas 5.1 for Microsoft Dynamics AX
INSTALL AND CONFIGURATION GUIDE Atlas 5.1 for Microsoft Dynamics AX COPYRIGHT NOTICE Copyright 2012, Globe Software Pty Ltd, All rights reserved. Trademarks Dynamics AX, IntelliMorph, and X++ have been
CYCLOPE let s talk productivity
Cyclope 6 Installation Guide CYCLOPE let s talk productivity Cyclope Employee Surveillance Solution is provided by Cyclope Series 2003-2014 1 P age Table of Contents 1. Cyclope Employee Surveillance Solution
Pearl Echo Installation Checklist
Pearl Echo Installation Checklist Use this checklist to enter critical installation and setup information that will be required to install Pearl Echo in your network. For detailed deployment instructions
Tivoli Endpoint Manager for Remote Control Version 8 Release 2. User s Guide
Tivoli Endpoint Manager for Remote Control Version 8 Release 2 User s Guide Tivoli Endpoint Manager for Remote Control Version 8 Release 2 User s Guide Note Before using this information and the product
TECHNICAL DOCUMENTATION SPECOPS DEPLOY / APP 4.7 DOCUMENTATION
TECHNICAL DOCUMENTATION SPECOPS DEPLOY / APP 4.7 DOCUMENTATION Contents 1. Getting Started... 4 1.1 Specops Deploy Supported Configurations... 4 2. Specops Deploy and Active Directory...5 3. Specops Deploy
FileMaker 11. ODBC and JDBC Guide
FileMaker 11 ODBC and JDBC Guide 2004 2010 FileMaker, Inc. All Rights Reserved. FileMaker, Inc. 5201 Patrick Henry Drive Santa Clara, California 95054 FileMaker is a trademark of FileMaker, Inc. registered
Sophos for Microsoft SharePoint startup guide
Sophos for Microsoft SharePoint startup guide Product version: 2.0 Document date: March 2011 Contents 1 About this guide...3 2 About Sophos for Microsoft SharePoint...3 3 System requirements...3 4 Planning
This guide specifies the required and supported system elements for the application.
System Requirements Contents System Requirements... 2 Supported Operating Systems and Databases...2 Features with Additional Software Requirements... 2 Hardware Requirements... 4 Database Prerequisites...
