Running Sybase IQ

Now you are ready to test your installation. This section tells how to start and stop the server.

Starting the sample database

To start the sample database installed with the product, click Start on the Taskbar, and select Programs | Sybase | Adaptive Server IQ 12.7 | Start IQ Demo Database.

This command starts the asiqdemo database using the server name <yourhost>_asiqdemo, where <yourhost> is the name of the system where you are running Sybase IQ.

NoteIf Adaptive Server Anywhere is installed on the same subnet as Sybase IQ, you must change the default port number for IQ; both products use the default port of 2638. First, set a new port number in the %ASDIR%\scripts\default.cfg file. Then update each IQ database configuration file (for example, %ASDIR%\demo\asiqdemo.cfg) by changing the port number in the following line:

-x tcpip{port=2638}

Change to an unused number, for example, 4444:

-x tcpip{port=4444}

Running interactive SQL queries

StepsStarting DBISQL and running queries:

  1. Select Start > Programs > Sybase > Adaptive Server IQ 12.7 > Interactive SQL Java.

  2. The Connect dialog box appears. Type “DBA” without the quotes for the User ID, then press <TAB> and type “SQL” for the Password.

  3. On the Database tab, type “<hostname>_dbname:<portnumber>” as the Server name.

    For example, if your host machine is fiona and you are using port number 1870, use the following Server name for the sample database:

    fiona_asiqdemo:2870
    
  4. Tab to Database name and type the name of the database.

  5. Tab to Database file and type the path to the .db file.

  6. When you work with a database, all your requests and commands go through a driver to the database itself. Sybase Central and Interactive SQL support two main types of drivers: a JDBC driver (called jConnect) and an ODBC driver (called iAnywhere JDBC Driver). Both are included with Sybase IQ.

    As a general rule, the jConnect driver cannot use ODBC data sources. However, Sybase Central and Interactive SQL are special cases. When you use the jConnect driver in either of them, you can specify an ODBC data source to establish a connection.

    Sybase jConnect is a fully supported, fully featured JDBC driver. This driver is platform independent and offers better performance than iAnywhere JDBC Driver. It is enabled by default.

    The iAnywhere JDBC Driver driver is a Sun product and is available solely as an alternative method of connecting. The jConnect driver is recommended over iAnywhere JDBC Driver.

    Select jConnect or iAnywhere JDBC Driver and click OK to connect to the database.

  7. The Interactive SQL window is split into 3 subwindows. In the top window (SQL Statements), type:

    SELECT * FROM employee
    
  8. Click the right-facing triangle button to execute.

Creating databases

To create your own databases, start and connect to the utility database, as described in the Sybase IQ System Administration Guide.

Starting your own databases

To start your own databases, use the start_asiq utility.

To run start_asiq, at the Command Prompt, change to a folder where you have write privileges and use the following command format:

start_asiq @configuration_filename.cfg dbname

This command starts the database and sets parameters named in the (optional) configuration (.cfg) file.

You can use a configuration file to specify options that you want to set whenever you start your server. A configuration file for the sample database is installed in the %ASDIR%\demo directory as an example. For details about configuration files, see “Configuring the Sybase IQ Server”.

NoteThe directory where the server is started becomes the default directory for all server files created by Sybase IQ.

For example, to start the demo database, use these commands:

C:\> cd %ASIQDIR%\demo
start_asiq @asiqdemo.cfg asiqdemo.db

NoteThe server name cannot start with a number.

Using defaults in %ASDIR%\scripts\default.cfg, the start_asiq utility sets any required environment variables that have not been set and sets parameters that govern Sybase IQ to the recommended defaults. (You may use a configuration file to override these defaults.) If you start your server using any command other than start_asiq, or if your configuration file is encrypted, you must specify the following parameters:

Table 2-1: Parameters set by start_asiq

Parameter

Value

Description

-c

32MB on 32-bit platforms 48MB on 64-bit platforms

Catalog store cache size

-gc

20

Checkpoint interval

-gd

all

Allows all users to start the database by connecting

-gl

all

Allows all users to load or unload tables

-gm

10

Default number of connections

-gp

4096

Catalog store page size

-ti

4400

Client time-out set to 72 hours. Prevents users with long queries from being logged off over a long weekend.

NoteDo not discard this document after installing Sybase IQ. You may need these required parameters later.

For a complete list and description of start-up parameters, see “The database server” in Chapter 1 of the Sybase IQ Utility Guide.

If you have Sybase Central, you can use the Start Database Server wizard, as documented in the Introduction to Sybase IQ, instead of start_asiq.

The server process runs in the background. It sends output to a server log file, %ASLOGDIR%\servername.NNN.srvlog, where NNN is the number of times the server has been started. For example, %ASLOGDIR%\fiona.123.srvlog.

Stopping servers

To stop a server, click the Sybase IQ icon to open the server window, then click Shutdown. You can also stop a server using the STOP ENGINE command from DBISQL or any front-end client, or using the Stop utility, as documented in the Sybase IQ Reference Manual, Chapter 4, “Database Administration Utilities.”

NoteWhen you stop a server using the DBSTOP command, you need to specify the same parameters used to start that server.