How do I make a new database?

Release notes for Servoy betas

How do I make a new database?

Postby idoctor » Tue Apr 06, 2004 7:31 am

I know this is basic but........

I exported my solution and saved it someplace where it would not get overwritten. Downloaded and installed RC11. I tried to import my old solution and was told that I needed to create the database. I am stuck because I do not know how to make a new database in iAnyWhere. Do I need to download some tools from I AnyWhere? Which tool do I use to make a new database?

John McCann
idoctor
 
Posts: 254
Joined: Sun Sep 28, 2003 6:37 pm

Postby maarten » Tue Apr 06, 2004 10:38 am

Download SQL Anywhere Studio.
There's a good admin tool in there (Sybase Central)

http://www.ianywhere.com/downloads/sqlany.html
Maarten Berkenbosch
User avatar
maarten
 
Posts: 797
Joined: Wed Apr 23, 2003 10:52 pm
Location: Amersfoort, Netherlands

Postby Jan Aleman » Tue Apr 06, 2004 11:24 am

Additional NOTE to the above: after creating the database you must add it to the file sybase.config located in the sybase_db directory.

Sybase Central can be downloaded for free and you can use it for many administrative functions. More documentation about the external tools will appear in the next version of our documentation.

You can also create databases on the command line/prompt:

1. open a terminal (linux, unix, os x) or a command prompt
2. change directory to your Servoy installation directory
3. change directory to the sybase_db directory inside you Servoy directory
4. a. On mac os x set your DYLD_LIBRARY path to this directory
Using bash:
Code: Select all
export DYLD_LIBRARY_PATH=/path/to/sybase_db

for example:
Code: Select all
export DYLD_LIBRARY_PATH=/Applications/Servoy/sybase_db

Using tcsh:
Code: Select all
setenv  DYLD_LIBRARY_PATH /path/to/sybase_db

example:
Code: Select all
setenv  DYLD_LIBRARY_PATH /Applications/Servoy/sybase_db

b. On Linux/Unix:
Using bash:
Code: Select all
export LD_LIBRARY_PATH=/path/to/sybase_db

for example:
Code: Select all
export LD_LIBRARY_PATH=/usr/local/servoy/sybase_db

Using tcsh:
Code: Select all
setenv  LD_LIBRARY_PATH /path/to/sybase_db

example:
Code: Select all
setenv  LD_LIBRARY_PATH /usr/local/servoy/sybase_db

c. On Windows:
Code: Select all
set ASANY9=\path to sybase_db

for example:
Code: Select all
set ASANY9=c:\Program Files\Servoy\sybase_db

5. create the database using the following command:
a. On OS X, Linux and Unix:
Code: Select all
./dbinit -t <name>.log -z UTF8 <name>.db

b. On windows:
Code: Select all
dbinit.exe -t <name>.log -z UTF8 <name>.db


add the databse to the sybase.config file in the sybase_db directory. If you created the database in the database directory create a line like this:

Code: Select all
database/mydb.db


if you created it somewhere else put the full path to the database in the config file.

Finally make sure you have stopped the database server for it to automatically start the database when Servoy launches. On Windows: right click the SQL tray icon and choose Exit. On Mac, Linux, Unix: kill the dbsrv* processes. You can also stop the database using dbstop in the sybase_db directory:

Code: Select all
./dbstop -c "eng=servoy_repository;uid=DBA;pwd=SQL"
Jan Aleman
Servoy
Jan Aleman
 
Posts: 2083
Joined: Wed Apr 23, 2003 9:49 pm
Location: Planet Earth

Postby drookwood » Wed Apr 07, 2004 10:34 am

I'm having trouble doing this: I have created a new database in the servoy_repository server using sybase central which seems to go fine - the new databse is listed in the servoy_repository tree along with crm etc. , I have then added the name to the sybase_db file but cannot create a connection from servoy prefs - I get a login failed error (using the standard dba and sql combination) when I try. I cannot see anyway in sybase central to confirm what username and password are being set when a new database is created.

Where am I going wrong?
David Rookwood

SAN Developer
drookwood
 
Posts: 290
Joined: Tue Nov 11, 2003 7:08 pm
Location: Somerset, UK

Postby Jan Aleman » Wed Apr 07, 2004 11:11 am

did you edit the sybase.config file? I assume you did although you say you edited sybase_db. What entry did you add to that file? where is your .db file locate? does the file extension match? did you stop the database server before reconnecting to it in Servoy (close servoy, stop the db server, then launch servoy) dba/sql is the default login.
Jan Aleman
Servoy
Jan Aleman
 
Posts: 2083
Joined: Wed Apr 23, 2003 9:49 pm
Location: Planet Earth

Postby drookwood » Wed Apr 07, 2004 11:38 am

did you edit the sybase.config file?

Sorry - I did mean the config file. I added the database name 'flow' and the .db extension to match the entries for crm etc.

I did not stop the server before attempting to reconnect to servoy - in the end I needed to restart my machine and after the restart the server was not running and I could create the connection. All now working correctly - thanks again for the prompt reply.
David Rookwood

SAN Developer
drookwood
 
Posts: 290
Joined: Tue Nov 11, 2003 7:08 pm
Location: Somerset, UK

Postby Harry Catharell » Tue Apr 27, 2004 11:05 am

OSX 10.3.3
Servoy Developer
R2 2.0 rc13-build 272
Sybase Central 4.2.0.2047
I am experiencing a problem creating a new database using Sybase Central.
I have Servoy loaded with iAnywhere server running and open Sybase Central
I have connected to servoy_repository server and can see : repository, user_data etc databases.
I use the create database wizard and choose to create a database on servoy_repository server.
I choose to create : /Applications/Servoy/database/membership.db
Click on Finish and it runs through its create process and shows as 'completed'

But, I cannot then see the database within the servoy_repository tree in Sybase Central !
Am I missing out some obvious activity here ?

Thanks
Harry
Harry Catharell
 
Posts: 812
Joined: Fri Sep 26, 2003 10:23 am
Location: Milton Keynes, England

Postby Jan Aleman » Tue Apr 27, 2004 11:21 am

you don't need to see it there. In fact by default you won't see it. All you need to do now is close all apps add the database to sybase.config, stop all sybase processes and relaunch servoy to start using it.
Jan Aleman
Servoy
Jan Aleman
 
Posts: 2083
Joined: Wed Apr 23, 2003 9:49 pm
Location: Planet Earth

Postby Harry Catharell » Tue Apr 27, 2004 12:44 pm

Thanks Jan.

All appeared as it should once I had killed the Sybase process and then opened Servoy and created a DBServer entry.

I still find it disconcerting that you do not see the database in the tree once created in SybaseCentral !

Harry
Harry Catharell
 
Posts: 812
Joined: Fri Sep 26, 2003 10:23 am
Location: Milton Keynes, England

Postby Jan Aleman » Tue Apr 27, 2004 1:23 pm

Harry Catharell wrote:I still find it disconcerting that you do not see the database in the tree once created in SybaseCentral !

You should if you connect to it.
Click connect (icon in the top icon bar), fill in username and password, on the second tab point to the database file (not server and don't fill in any other options)
Jan Aleman
Servoy
Jan Aleman
 
Posts: 2083
Joined: Wed Apr 23, 2003 9:49 pm
Location: Planet Earth

Postby Harry Catharell » Tue Apr 27, 2004 3:32 pm

Pardon Jan, I mean that I could not see the database at the point that I had created it within Sybase Central and clicked on the 'close' button once Sybase had completed its setup process.

I could connect to and administer the database inside Sybase Central once I had quit the Sybase process, restarted Servoy and then relaunched Sybase Central.
Harry Catharell
 
Posts: 812
Joined: Fri Sep 26, 2003 10:23 am
Location: Milton Keynes, England


Return to Latest Releases

Who is online

Users browsing this forum: No registered users and 5 guests