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.

SQL - Quick Start with Explorer Sections of NuoDB - Query NuoDB Database 14 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.

SQL - Quick Start with Explorer Sections of NuoDB - Query NuoDB Database 15 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.

SQL - Quick Start with Explorer Sections of NuoDB - Query NuoDB Database 18

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.

SQL - Quick Start with Explorer Sections of NuoDB - Query NuoDB Database 19

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.

SQL - Quick Start with Explorer Sections of NuoDB - Query NuoDB Database 25

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

SQL - Quick Start with Explorer Sections of NuoDB - Query NuoDB Database 20

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.

SQL - Quick Start with Explorer Sections of NuoDB - Query NuoDB Database 21

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.

SQL - Quick Start with Explorer Sections of NuoDB - Query NuoDB Database 26

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. SQL - Quick Start with Explorer Sections of NuoDB - Query NuoDB Database 27

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.

SQL - Quick Start with Explorer Sections of NuoDB - Query NuoDB Database 28

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.

SQL - Quick Start with Explorer Sections of NuoDB - Query NuoDB Database 29

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 (https://blog.sqlauthority.com)

 

NuoDB
Previous Post
SQL – Quick Start with Admin Sections of NuoDB – Manage NuoDB Database
Next Post
SQL SERVER – Weekly Series – Memory Lane – #033

Related Posts

5 Comments. Leave new

  • Links to previous posts missing?

    Reply
  • 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

    Reply
    • Nuruddin Arroniry
      June 18, 2013 12:00 pm

      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

      Reply
  • Avinash reddy munnangi
    June 14, 2013 10:27 am

    excellent pinal sir thanks for sharing this type of posts to all

    Reply
  • 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

    Reply

Leave a Reply