Using Net

This chapter contains general information for working in the Ingres Net environment. It explains how to connect to remote databases and which SQL commands are valid with Ingres Net. This chapter also includes a general discussion of how the system perceives you, the user, when you are working in a remote database.

Previous Topic

Next Topic

Connecting to Remote Databases

In general, Ingres Net provides users with transparent access to remote databases. It is only when the connection is first established that you must specify the node on which the database resides and, in some circumstances, the type of server. After you are connected, you can work in the database as if it were local; no further reference to its location is necessary.

Note: If a default remote node is defined on the local instance, you do not have to specify a vnode name when you make a connection to that node. For information about using this feature, see Default Remote Nodes.

Previous Topic

Next Topic

Database Access Syntax—Connect to Remote Database

The syntax for accessing a remote database through an operating system-level command is:

command vnode::dbname[/server_class]

where:

Example:

This command runs the terminal monitor (sql) and connects using vnode "production" to the customerdb database:

sql production::customerdb

Previous Topic

Next Topic

Dynamic Vnode Specification—Connect to Remote Node

When connecting to a remote node, you can specify a dynamic vnode instead of a vnode name. The dynamic vnode specification includes the connection data, user authorization, and attributes that are associated with a remote node.

Note: A dynamic vnode can be used wherever a vnode is allowed, unless otherwise stated.

A dynamic vnode specification has the following format:

@host,protocol,port[;attribute=value{;attribute=value}][[user,password]]

Examples of dynamic vnode specification:

This command runs the terminal monitor (sql) and connects to node hosta using protocol tcp_ip to remote Ingres symbolic port II. The login and password are Johnny and secretpwd. The remote database name is customerdb:

sql @hosta,tcp_ip,II[Johnny,secretpwd]::customerdb

This command does the same as the previous example and uses an attribute to set up a direct connection:

sql @hosta,tcp_ip,II;connection_type=direct[Johnny,secretpwd]::customerdb

Previous Topic

Next Topic

Server Classes

If you do not specify a server class when connecting to a database, Ingres assumes a default. The default is the value in default_server_class on the remote instance (ingres, unless defined otherwise).

Valid Ingres server classes are as follows:

To view or change the default server class value, use the Configure Name Server screen of the Configuration-By-Forms (cbf) utility, or the Parameters Page, Name Server Component in Configuration Manager (vcbf).

The server class for the DBMS Server (default is ingres) and Star Server (default is star) can also be changed. This is typically done to distinguish between multiple DBMS or Star servers that have different sets of parameters, so that users can connect to a specific server using an assigned server class name.

Additional server types are added to this list as additional Enterprise Access or EDBC products are developed. Check the Readme file for the most up-to-date set of products.

Previous Topic

Next Topic

Using the SQL Connect Statement with Net

If you are using the connect statement in an application, connect to a database on a remote instance using the following syntax:

exec sql connect 'vnode::dbname[/server_class]'

Note: The vnode can be either a vnode name or a dynamic vnode specification (@host+).

You must use the single quotes around the designation of the vnode and database names (and server class, if applicable). For example, assume that you have an application residing on "napoleon" that wants to open a session with the database "advertisers" on "eugenie." The following statement performs this task (assuming also that "lady" is a valid vnode name for "eugenie"):

exec sql connect 'lady::advertisers';

Note that a server class is not specified in this statement; therefore the default server class defined on "eugenie" is used.

If the target database is accessed through an Enterprise Access or EDBC products, be sure to include the appropriate keyword for the server class. For example:

exec sql connect 'lady::advertisers/db2';

If the target database is accessed through Ingres Star, be sure to include the appropriate keyword for the server class. For example:

exec sql connect 'lady::advertisers/star';

When you are working over Ingres Net, you can use the -u flag with a command to imitate another user provided the User ID that you are working under on the remote node has the SECURITY privilege.

Previous Topic

Next Topic

Commands and Net

You can run any of the following Ingres commands against a remote database:

abf

imageapp

report

accessdb

ingmenu

sql

compform

isql

sreport

copyapp

netutil

unloaddb

copydb

printform

upgradedb

copyform

qfb

upgradefe

copyrep

query

vifred

dclgen

rbf

vision

Note: The optimizedb command works across Ingres Net only if the client and server machines have identical architectures. Do not use this command across Ingres Net if the client and server have different architectures.

You cannot run the following Ingres commands against a remote database:

createdb

destroydb

iimonitor

iinamu

lockstat

logstat

statdump

sysmod

usermod

verifydb

 

 

For additional information on commands, see the Command Reference Guide.


© 2007 Ingres Corporation. All rights reserved.