Create Database

Teradata Studio
Enthusiast

Create Database

I'm new on Teradata, I want to know how to create the new database on Teradata. Also, want to know the servername,  password and username other than 'dbc'. because if want to  create a new table in 'dbc' database.It gets an error.

3 REPLIES
Junior Contributor

Re: Create Database

DBC is the root user in Teradata, it's the the owner of all metadata, nobody can create tables in it.

 

As DBC should not be used for daily work you first create a new user:

CREATE USER sysdba AS PERM=1e+09, PASSWORD=mypassword; -- 1 GB

Then logon as sydba and create a database:

CREATE DATABASE myDB AS PERM = 500e+06; -- 0.5 GB

In fact Users and Databases are almost the same in Teradata, both are similar to SCHEMAs in Standard SQL (with an assigned maximum size).

 

I suggest reading the chapter About Databases and Users in Teradata in the Database Administration manual.

 

Enthusiast

Re: Create Database

Thanx buddy, I can run both the queries and it is working, User created successfully but I find where I can create a database when I run CREATE DATABASE query? 

Highlighted
Junior Contributor

Re: Create Database

When you loged on as SYSDBA and created that database it's a child of SYSDBA.

 

You can set it as this session's default database using DATABASE myDB; or qualify the table names myDB.myTable.