Home

Search this site:
 

Horshack’s
very
own site

 

This is Bavaria, Germany!
You will find links to Perl,
bootdisks for system administration,
a lot of Linux,
Windows administration
and some personal belongings.
Working with Centura Gupta Databases

Working with Centura Gupta Databases

Centura seems to be a very good and stable database for small and mediumsize databases. I have to deal with it only when exporting things, exploring the database, transfer the contents to MySQL.
A lot of things have to be done in the program SQLTALK. The native database administrator-user (also called dba) is the user sysadm, don't forget semicolon to close SQL-commands.

Getting rid of logfiles

There are logfiles beside the real big database-file. You can let Centura-DB work them into the database-file like this:

Start SQL-Talk
Login to database

update benutzer set login_name=login_name;
commit;

Close SQL-Talk
Stop Database-Server
 
 

Sample commands to explore the database

# all tables in the database
select creator, name from sysadm.systables;
# or this:
select distinct tbname from sysadm.syscolumns;
# all tables without system tables
select distinct tbname from sysadm.syscolumns where tbname not like 'SYS%';
# explore how a table is built, which fields, how long etc.
select name, colno, coltype, length from sysadm.syscolumns
where tbname = 'ATABLENAME';

Exporting from Centura

You can export only the database schema to a textfile. The file is a usual SQL-textfile. But, it's Centura-SQL. See later in this page how to convert that to MySQL

# Export schema of the database as SQL into a file
unload schema c:\temp\create.sql;
# Export everything in the database
unload database c:\temp\whole_database.sql;

You can export a single table to an ASCII-file. But this is also Centura-SQL. Very bad is that it does not export as simple "insert into...". But give it a try:

# Unload a single table, tablename is mediengrp
unload SQL c:\temp\single_mediengrp.txt mediengrp;

Then you can export the whole database to an ASCII-file. But this is also Centura-SQL. Very bad is that it does not export as simple "insert into...". But give it a try:

# Export everything in the database
unload database c:\temp\whole_database.sql;

Importing schema and data into Centura

  1. Start SqlTalk
  2. log in to the database as sysadm without a password
  3. and give this command:
    load SQL c:\temp\your_exportfile.sql

Converting the exported database schema to MySQL

The "unload schema" creates a file with CenturaSQL which is not MySQL. This file converts the SQL-commands for MySQL-input: schema2mysql.pl

 

Make a database without logfiles running again

This is from Kevin McGlinchey written at comp.databases.gupta:

Try the following:
  1. Get into SqlTalk
  2. When the dialog appears that asks for Database, User and Password, click "Cancel" You will still be in SqlTalk. Type the following commands into SqlTalk;
  3. set server <put_your_server_(not_database)_name here>;
  4. Rollforward <put_your_database_name_here> to end;
    SqlBase will say some things here. Ignore it
  5. Rollforward <put_your_database_name_here> to end;
    Yes, this is the same command as in 4) above executed again.
    SqlBase will now say something like: "The log file 22.LOG could not be found.
    Use the RESTORE LOGS command to restore this log and continue the rollforward process.
    If this log is not available,use the ROLLFORWARD <database> END command to complete the recovery process." Ignore this also (unless you DO have access to the logs...).
  6. Rollforward <put_your_database_name_here> end;
    SqlBase will respond with "rollforward completed" You should now be able to connect to your database.

Drop database completely

  1. Start SqlTalk
  2. set server server1;
  3. Do not login to the database
  4. drop database bobsbase

Creating a new, empty database

  1. Open SqlTalk
  2. Don't log in to a database, because the database you will create in as second does not yet exist
  3. set server server1; and execute
  4. create database bobsbase; and execute
  5. install database bobsbase; and execute to create the needed lines in sql.ini
Now a directory called c:\program files\gupta\bobsbase was created and the file start.dbs copied into this directory and renamed to bobsdatabase.dbs. In the file sql.ini there is an additional line in Sektion [dbnt5sv] like this: "DBNAME=bobsbase,SQLWS32"
  1. Open SqlTalk again
  2. Log into database and change password for user sysdba (default password: sysdba)
  3. maybe: set server server1; and execute
  4. Menu Session - Connect, database=bobsbase, user=sysdba, password=sysdba -> connect
  5. This is the command to change the password
    alter password "sysdba" to "newpassword"

Connecting through a tunnel

Centura listens on TCP-Port 2155.

Sample sql.ini for TCP-connection with ODBC

[WIN32CLIENT]
clientname=lockerroom
;CLIENTRUNTIMEDIR="C:\SQLBASE"

[WIN32CLIENT.DLL]
; library for TCP
COMDLL=SQLWS32
;COMDLL=SQLAPIPE
;COMDLL=SQLWSSPX
;COMDLL=SQLSPX32
; library for ODBC-connection
COMDLL=SQLODB32


[WIN32CLIENT.APIPE]
;AUTOSTARTSERVERPATH="C:\SQLBASE\DBNTSRV.EXE"
SERVERPATH=SERVER1


[WIN32CLIENT.WS32]
; SERVERPATH=SQLBASE-SERVERNAME,IP-ADRESSE/DB-NAME,*
SERVERPATH=SERVER1,192.168.1.1/LIBRARY,*


[WIN32CLIENT.SPX32]

[WIN32CLIENT.WSSPX]


; needed for ODBC
[odbcrtr]
odbctrace=off
longbuffer=32000
odbctracefile=
enablemultipleconnections=off
Impressum