• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 3602
  • Last Modified:

informix

How to create a database in INFORMIX?
I am new to DBA staff, buit I need to know that  ASAP
0
kaput007
Asked:
kaput007
2 Solutions
 
qz8dswCommented:
0
 
Goodangel MatopeSoftware ArchitectCommented:
Here is a Database Creation statement I use in production:

CREATE DATABASE empdblive WITH LOG;

That will create a database with a logging. If you want to create a database with no logging just use

CREATE DATABASE empdblive;

Once you have created the database, you may want to create tables in it. I usually create a single script that creates my entire schema, stored procedures, and triggers, so that if I want to recreate a database, I just use that one script.

the following script will create a database and a single table in it.

-----Creating the database
CREATE DATABASE empdblive WITH LOG;
DATABASE empdblive; -- making the new database the active database

CREATE TABLE tblemployee(
     emp_key       integer,
     last_name      char(30) not null,
     first_name      char(30) not null,
     middle_name char(30) not null,
     emp_type smallint,
     department      integer)
IN dbspace1 (or whatever your db space is called)
EXTENT SIZE 30554
NEXT SIZE 30554
LOCK MODE ROW;

It is possible to even create stored procedures and triggers in the same script to create a fully operational database in one fell swoop! :-)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Network Scalability - Handle Complex Environments

Monitor your entire network from a single platform. Free 30 Day Trial Now!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now