Vertica Sample Database Installation

Source: Internet
Author: User
Tags generator log log administrator password

1. Introduction to the sample database:

Vertica, like a traditional database, comes with a sample database--vmart sample database, which is a multi-schema database. This data is a database that may be used in large supermarkets (Vmart) to access products, customers, employees, and outlets and store information. When you use this example, you can create, run, optimize, and test a multi-schema database.

Vmart contains the schema:

Public (automatically created in all new Vertica databases)

Store

Online_sales

Vmart database location and script:

If Vertica has been installed from the RPM package, the Vmart schema will be installed under the/opt/vertica/examples/vmart_schema path. Contains a few scripts that can help us get started quickly:

2. Installing the Vmart sample database

Here are two ways to install the database:

    • Create the database using the Quick Install method and start the database immediately.
    • Use the Administrative Tools interface to install a database that is both advanced and simple.

Note: Both of these installations create a database named Vmart. If you try two installation methods at the same time, you will need to either delete the Vmart database you created earlier or create a subsequent database with a new name. However, it is strongly recommended that you create only one sample database at a time to avoid causing unexpected results. This tutorial uses the queries provided by Vertica, but you can follow the same set of steps when you create your own design and use your own query files later.

Here's how to do this:

Using scripts for quick installation

The script used to perform the quick installation is in/opt/vertica/sbin and is named Install_example. This script creates a database on the default port (5433), generates data, creates schemas and default super-casts, and loads data. The folder also contains a delete_example script that is used to stop and delete the database.

1. In the terminal window, log in as the database administrator.
$ su-dbadmin
Password: (Enter password)
2. Change to the/examples directory.
$ cd/opt/vertica/examples
3. Run the installation script:
$/opt/vertica/sbin/install_example Vmart

execution, the following log information appears

At the same time, in the/opt/vertica/examples/log log path, the file ExampleInstall.txt records the detailed log. If there is an error in executing the above command, you can read the logging information first.

If the above steps are executed correctly, the sample database has been created, and the following is done using the provided script to create the schema and import the data (let's skip ahead and go back to the other way to create the sample database)

Advanced Installation

To perform an advanced and simple installation, set up the Vmart sample database environment, and then use the administrative tools or the management console to create the database

Note: If you have installed the Vmart database using the Express installation method, you will not be able to complete the following steps because the database is already created.

First, set up the sample environment

1. Stop planning to install all databases running on the same host as the sample database.
If you are unsure if there are other databases running, run the Administrative tools and select View cluster status (View Cluster state). The State column should display a down value on the pre-existing database. If the database is running, click Stop Database in the main menu of the Administrative Tools interface, and then click OK (OK).
2. In the terminal window, log in as a database administrator:
$ su-dbadmin
Password:
3. Change to the/vmart_schema directory.
$ cd/opt/vertica/examples/vmart_schema
Do not change the directory while following the tutorial. Some of the steps are to be performed in a specific directory.

There is no difference between this step and the first installation, and the following is the focus:

4. Run the sample Data generator.
$./vmart_gen

Let the program run with the default parameters, which you can view in the Readme file. If the Vmart_gen executable is not working properly, recompile it as described below, and then run the Sample Data generator script again.

$ g++ Vmart_gen.cpp-o Vmart_gen
$ chmod +x Vmart_gen
$./vmart_gen

Ii. Creating a sample database

Creating sample data using the Administration tools see

1. Run the management tools;

$/opt/vertica/bin/admintools
or type AdminTools directly

2. In the main menu of the Administration tool, click the Configuration menu, and then click OK.
3. Click Create Database, and then click OK.
4. Name the database Vmart and click OK.
5. Click OK (OK) to skip the password and click Yes to confirm.
You do not need to enter the database administrator password in this tutorial. However, when you create a production database, be sure to specify an administrator password. Otherwise, the database will be permanently set to trust Authentication (no password exists).
6. Select the hosts you want to include from your Vertica cluster and click OK.
7. Click OK (OK) to select the default path for the data directory and catalog directory.
8. Because this tutorial uses a single-host cluster, the system displays a k-safety warning. Click OK (OK).
9. Click Yes (yes) to create the database.
10. Click OK (OK) to close the database Vmart successfully created (database Vmart createdsuccessfully) message.
If you are interested you can also use the admin console to create a sample database, which is not described here

Here, two ways to configure the sample data Vmart have been completed. Here is the connection database, execution of several scripts to create schema import data

The first and second scenario configuration databases have to perform the following operations.

Running a Vmart_define_schema.sql script runs a script that defines the Vmart schema and creates the table. You must run this script before you load the data into the Vmart database.

You have created schemas and tables, and you can now load the data into a table by running the Vmart_load_data.sql script. This script loads the 15. tbl text files in Opt/vertica/examples/vmart_schema into the table created by Vmart_design_schema.sql.

The log information output will be available at the time of execution

Finally, let's look at a table and test to see if the sample database is available.

SELECT fat_content
From (SELECT DISTINCT fat_content
From Product_dimension
WHERE department_description
In (' Dairy ')) as food
ORDER by Fat_content
LIMIT 5;

Vertica Sample Database Installation

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.