SQL – Quick Start with Explorer Sections of NuoDB – Query NuoDB Database

This is the third post in the series of the blog posts I am writing about NuoDB. NuoDB is very innovative and easy-to-use product. I can clearly see how one can scale-out NuoDB with so much ease and confidence. In my very first blog post we discussed how we can install NuoDB (link), and in my second post I discussed how we can manage the NuoDB database transaction engines and storage managers with a few clicks (link).

Note: You can Download NuoDB from here.

In this post, we will learn how we can use the Explorer feature of NuoDB to do various SQL operations. NuoDB has a browser-based Explorer, which is very powerful and has many of the features any IDE would normally have. Let us see how it works in the following step-by-step tutorial.

Let us go to the NuoDBNuoDB Console by typing the following URL in your browser: http://localhost:8080/

It will bring you to the QuickStart screen. Make sure that you have created the sample database. If you have not created sample database, click on Create Database and create it successfully.

Now go to the NuoDB Explorer by clicking on the main tab, and it will ask you for your domain username and password. Enter the username as a domain and password as a bird. Alternatively you can also enter username as a quickstart and password as a quickstart.

Once you enter the password you will be able to see the databases. In our example we have installed the Sample Database hence you will see the Test database in our Database Hierarchy screen.

When you click on database it will ask for the database login. Note that Database Login is different from Domain login and you will have to enter your database login over here. In our case the database username is dba and password is goalie.

Once you enter a valid username and password it will display your database. Further expand your database and you will notice various objects in your database.

Once you explore various objects, select any database and click on Open.

When you click on execute, it will display the SQL script to select the data from the table. The autogenerated script displays entire result set from the database.

The NuoDB Explorer is very powerful and makes the life of developers very easy. If you click on List SQL Statements it will list all the available SQL statements right away in Query Editor. You can see the popup window in following image.

Here is the cool thing for geeks. You can even click on Query Plan and it will display the text based query plan as well. In case of a SELECT, the query plan will be much simpler, however, when we write complex queries it will be very interesting. We can use the query plan tab for performance tuning of the database.

Here is another feature, when we click on List Tables in NuoDB Explorer.  It lists all the available tables in the query editor. This is very helpful when we are writing a long complex query.

Here is a relatively complex example I have built using Inner Join syntax. Right below I have displayed the Query Plan. The query plan displays all the little details related to the query.

Well, we just wrote multi-table query and executed it against the NuoDB database. You can use the NuoDB Admin section and do various analyses of the query and its performance.

NuoDB is a distributed database built on a patented emergent architecture with full support for SQL and ACID guarantees.  It allows you to add Transaction Engine processes to a running system to improve the performance of your system.  You can also add a second Storage Engine to your running system for redundancy purposes.  Conversely, you can shut down processes when you don’t need the extra database resources.

NuoDB also provides developers and administrators with a single intuitive interface for centrally monitoring deployments.

If you have read my blog posts and have not tried out NuoDB, I strongly suggest that you download it today and catch up with the learnings with me. Trust me though the product is very powerful, it is extremely easy to learn and use.

Reference: Pinal Dave (http://blog.sqlauthority.com)

 

About these ads

11 thoughts on “SQL – Quick Start with Explorer Sections of NuoDB – Query NuoDB Database

  1. Above before the screen “Database Login” you show another screen which already shows the Database name “test” then why does it again challenges me for “Database Login” when I already know which Databases I have.

    Either your steps are incorrect OR one of the screen needs update
    Please let us know

    Like

    • on the main tab (Console -> Home) just click “start quickstart”. there you can find create database. database name test is a default name, you can change it there

      Like

  2. Hello Jack,

    This is Elisabete and I'm a Tech Support Engineer over at NuoDB.

    In the first login screen, we are being prompted to log into the domain, using the default domain username/password of domain/bird. A domain begins with a single host running a "Broker" service (begins running immediately upon installation) and grows to include any host running either a Broker/Agent service, that has peered itself to another Broker within the domain.

    Once inside the domain, we can view a list of all NuoDB databases (grouped Transaction Engines and Storage Managers) running within that domain. To access the content contained in each database, we must next provide the associated DBA username/password. In the case of the "Test" database created by running the Quickstart script, this DBA username/password is dba/goalie. This is what you are seeing with the second login screen.

    Upon creating a new NuoDB database, you would designate the DBA upon starting up the first NuoDB Transaction Engine. Please see my example of how this is done via the NuoDB Manager tool, below:

    $ java -jar jar/nuodbmanager.jar ––broker localhost ––password bird

    nuodb [domain] > show domain summary

    Hosts:
    [broker] localhost/<Host_IP>:<Broker_Port>
    Database: test
    [SM] <Host_DNS>/<Host_IP>:<SM_Port> [ pid = 4007 ] RUNNING
    [TE] <Host_DNS>/<Host_IP>:<TE_Port> [ pid = 4014 ] RUNNING

    nuodb [domain] > start process sm
    Database: <my_new_db>
    Host: <localhost>
    Process command-line options:   
    Archive directory: </Path/to/Archive/Directory>            
    Initialize archive: true
    Started: [SM] <Host_DNS>/<Host_IP>:<SM_Port> [ pid = 4052 ] ACTIVE

    nuodb [domain/my_new_db] > start process te
    Host: localhost
    Process command-line options: ––dba-user new_dba ––dba-password new_password
    Started: [TE] <Host_DNS>/<Host_IP>:<TE_Port> [ pid = 4053 ] ACTIVE

    nuodb [domain/my_new_db] > show domain summary

    Hosts:
    [broker] localhost/<Host_IP>:<Broker_Port>

    Database: my_new_db
    [SM] <Host_DNS>/<Host_IP>:<SM_Port> [ pid = 4052 ] RUNNING
    [TE] <Host_DNS>/<Host_IP>:<TE_Port> [ pid = 4053 ] RUNNING

    Database: test
    [SM] <Host_DNS>/<Host_IP>:<SM_Port> [ pid = 4007 ] RUNNING
    [TE] <Host_DNS>/<Host_IP>:<TE_Port> [ pid = 4014 ] RUNNING

    I hope this is helpful. If you have additional questions, please check out the resources available in our newly created Developer Center or feel free to send us an email at support@nuodb.com.

    Thank you,
    Elisabete

    Like

  3. Pingback: SQL – Migrate Database from SQL Server to NuoDB – A Quick Tutorial | Journey to SQL Authority with Pinal Dave

  4. Pingback: SQL – NuoDB and Third Party Explorer – SQuirreL SQL Client, SQL Workbench/J and DbVisualizer | Journey to SQL Authority with Pinal Dave

  5. Pingback: SQL SERVER – NuoDB in Sixty Seconds – SQL in Sixty Seconds #053 | Journey to SQL Authority with Pinal Dave

  6. Pingback: SQL – Contest to Get The Date – Win USD 50 Amazon Gift Cards and Cool Gift | Journey to SQL Authority with Pinal Dave

  7. Pingback: SQL – What is the latest Version of NuoDB? – A Quick Contest to Get Amazon Gift Cards | Journey to SQL Authority with Pinal Dave

  8. Pingback: SQL – Download NuoDB and Qualify for FREE Amazon Gift Cards | Journey to SQL Authority with Pinal Dave

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s