3 Connecting to a TimesTen Database

You can connect to a TimesTen database after you install and start SQL Developer.

This chapter focuses on the steps necessary to connect to a TimesTen database in SQL Developer. The topics include:

Defining a TimesTen database named connection

To create a named connection to a TimesTen database, ensure that you are on the main SQL Developer page.

  1. Right-click the Connections node and select New Connection.

    Figure 3-1 Creating a new connection

    Description of Figure 3-1 follows
    Description of ''Figure 3-1 Creating a new connection''

    The New/Select Database Connection dialog appears.

  2. Select the TimesTen tab.

    Figure 3-2 New database connection

    Description of Figure 3-2 follows
    Description of ''Figure 3-2 New database connection''

    You are ready to enter information for the connection.

  3. In the Connection Name field, enter the connection name.

  4. In the Username field, enter the TimesTen user. If you use the TimesTen database to cache data from an Oracle database, enter the TimesTen cache manager user name. If you use the TimesTen database to load data from an Oracle database, enter the TimesTen user name that has SELECT privileges on the Oracle database tables that you want to load.

  5. In the Password field, enter the password for the TimesTen user.

    To save the password, choose Save Password. If you save the password, you will not be prompted for the password on subsequent connections to the TimesTen database.

  6. To allow TimesTen to issue an implicit commit after DML statements, select the Autocommit check box. By default, the Autocommit check box is selected.

  7. Select a connection type from the Connection Type drop-down list. The following types of connections are available:

    Note:

    Caching data from an Oracle database is not supported by TimesTen Scaleout databases.

    Figure 3-3 New connection type

    Description of Figure 3-3 follows
    Description of ''Figure 3-3 New connection type''

    You are now ready to define your new connection.

DSN

The DSN connection type allows you to connect to databases by specifying a DSN. The DSN must exist in your .odbc.ini on Linux or UNIX and the ODBC Data Source Administrator on Windows. Before defining a DSN connection in SQL Developer, ensure that you have completed the steps up to step 7 from "Defining a TimesTen database named connection".

Note:

For a TimesTen Scaleout database, use the ttGridAdmin gridClientExport command to export every client DSN available for the grid into a flat file. Then, import the client DSNs into the TimesTen client system where SQL Developer is installed. For more information, see "Establishing client connections from a TimesTen Client" in the Oracle TimesTen In-Memory Database Scaleout User's Guide.

Note:

For more information about defining DSNs for TimesTen databases, see "Specifying Data Source Names to identify TimesTen databases" in the Oracle TimesTen In-Memory Database Operations Guide.
  1. Select a predefined DSN that references the TimesTen database from the DSN drop-down list. You can select either a Data Manager DSN to establish a direct connection or a client DSN to establish a client/server connection.

  2. In the Connection Attributes field, enter the attributes for the DSN. The Connection Attributes field is not required. Each attribute setting must be separated by a semicolon. If you do not specify any connection attributes, TimesTen uses the connection attributes specified in the DSN.

    For more information about connection attributes, see "Connection Attributes" in the Oracle TimesTen In-Memory Database Reference.

  3. To cache data from an Oracle database or load data from an Oracle database into a TimesTen database, select the Enable Cache/Load tables from Oracle database check box.

  4. In the Oracle Database Password field, enter the Oracle database password for the Oracle database user. The Oracle database user must be the same user as the TimesTen user you specified in the Username field. This text field is only available if you selected the Enable Cache/Load tables from Oracle database check box.

  5. In the Oracle Net Service Name field, enter the Oracle database net service name for the Oracle database. This text field is only available if you selected the Enable Cache/Load tables from Oracle database check box.

  6. Click Save to save the connection name under the Connections node.

    Figure 3-4 Save DSN connection

    Description of Figure 3-4 follows
    Description of ''Figure 3-4 Save DSN connection''

    Your connection is saved. You can establish connections to the database using the settings in the named connection without having to specify the values in the fields of the New/Select Database Connection dialog box again.

  7. Click Connect.

    SQL Developer is connected to your TimesTen database.

    For more information about creating and managing database connections in SQL Developer, see the Oracle SQL Developer User's Guide.

Easy Client/Server

The easy client/server connection type allows you to connect to local and remote TimesTen databases without having to define a client DSN. Before defining an easy client/server connection in SQL Developer, ensure that you have completed the steps up to step 7 from "Defining a TimesTen database named connection".

Note:

For a TimesTen Scaleout database, the Easy Client/Server connection enables you to connect to a single data instance. If the data instance is unreachable the connection fails, which makes the Easy/Client connection type suitable only for testing purposes.
  1. In the Server Host Name field, enter the name or the IP address of the TimesTen server host.

  2. In the Server DSN field, enter the DSN of the TimesTen database that is located on the TimesTen server host.

  3. In the Server Port field, enter the TCP port of the TimesTen server. You can use the ttStatus utility to find the TCP port of your TimesTen server.

    In the following example, the server port number is 53396. This example is part of a sample output from the ttStatus utility.

    TimesTen server pid 24379 started on port 53396
    

    For more information about the ttStatus utility, see "ttStatus" in the Oracle TimesTen In-Memory Database Reference.

  4. In the Client Timeout(s) field, enter the TTC_TIMEOUT connection attribute. Setting this attribute is optional. A value of 0 indicates that client/server operations should not timeout. If this attribute is not set, the default timeout period is 60 seconds.For more information, see "TTC_Timeout" in the Oracle TimesTen In-Memory Database Reference.

  5. To cache data from an Oracle database or load data from an Oracle database into a TimesTen database, select the Enable Cache/Load tables from Oracle database check box.

  6. In the Oracle Database Password field, enter the Oracle database password for the Oracle database user. The Oracle database user must be the same user as the TimesTen user you specified in the Username field. This text field is only available if you selected the Enable Cache/Load tables from Oracle database check box.

  7. In the Oracle Net Service Name field, enter the Oracle database net service name for the Oracle database. This text field is only available if you selected the Enable Cache/Load tables from Oracle database check box.

  8. Click Save to save the connection name under the Connections node.

    Figure 3-5 Save easy client/server connection

    Description of Figure 3-5 follows
    Description of ''Figure 3-5 Save easy client/server connection''

    Your connection is saved. You can establish connections to the database using the settings in the named connection without having to specify the values in the fields of the New/Select Database Connection dialog box again.

  9. Click Connect.

    SQL Developer is connected to your TimesTen database.

    For more information about creating and managing database connections in SQL Developer, see the Oracle SQL Developer User's Guide.

Advanced

The advanced connection type allows you to define a connection string to connect to your TimesTen database. Before defining an advanced connection in SQL Developer, ensure that you have completed the steps up to step 7 from "Defining a TimesTen database named connection".

  1. Select a driver type for the TimesTen database from the Driver Type option. Select either Client/server to establish a client/server connection or Direct to establish a direct connection.

  2. In the Connection string field, enter a connection string to define the DSN and set attributes for the DSN. If you choose Client/Server as the Driver Type specify the server host, server port, and DSN. Each attribute setting must be separated by a semicolon. Do not delimit the connection string with a pair of double quotation marks.

    For a TimesTen Scaleout database, ensure that you specify all of the TTC_SERVERn connection attributes for your database connectable. The TTC_SERVERn is the network address and TCP port number of the data instances on which your database is distributed. Use the ttGridAdmin gridClientExport command to view all of the connectables of your TimesTen Scaleout databases. For example, a valid connection string for a TimesTen Scaleout database might look like:

    TTC_SERVER1=host1.example.com/6625;TTC_SERVER2=host2.example.com/6625;TTC_SERVER3=host3.example.com/6625;TTC_SERVER4=host4.example.com/6625;TTC_SERVER_DSN=database1;UID=timesten;
    

    For information on the ttGridAdmin utility and the format and contents of a connection string, see "ttGridAdmin" in the Oracle TimesTen In-Memory Database Reference. and "Connecting to a database using a connection string" in the Oracle TimesTen In-Memory Database Operations Guide, respectively.

  3. To cache data from an Oracle database or load data from an Oracle database into a TimesTen database, select the Enable Cache/Load tables from Oracle database check box.

  4. In the Oracle Database Password field, enter the Oracle database password for the Oracle database user. The Oracle database user must be the same user as the TimesTen user you specified in the Username field. This text field is only available if you selected the Enable Cache/Load tables from Oracle database check box.

  5. In the Oracle Net Service Name field, enter the Oracle database net service name for the Oracle database. This text field is only available if you selected the Enable Cache/Load tables from Oracle database check box.

  6. Click Save to save the connection name under the Connections node.

    Figure 3-6 Save advanced connection

    Description of Figure 3-6 follows
    Description of ''Figure 3-6 Save advanced connection''

    Your connection is saved. You can establish connections to the database using the settings in the named connection without having to specify the values in the fields of the New/Select Database Connection dialog box again.

  7. Click Connect.

    SQL Developer is connected to your TimesTen database.

    For more information about creating and managing database connections in SQL Developer, see the Oracle SQL Developer User's Guide.

Using an existing TimesTen database named connection

If a named connection for the TimesTen database exists under the Connections node, then right-click the node of the connection name and select Connect, or click the + to the left of the connection name's node.

Figure 3-7 Viewing a TimesTen connection

Description of Figure 3-7 follows
Description of ''Figure 3-7 Viewing a TimesTen connection ''

If the Connection Information dialog appears, in the Username field, enter the TimesTen user name. In the Password field, enter the password for the user.

Click OK.

Figure 3-8 Connection Information dialog

Description of Figure 3-8 follows
Description of ''Figure 3-8 Connection Information dialog''

After you connect to a TimesTen database, you can browse existing objects or create new objects such as tables, indexes, views, sequences, synonyms, PL/SQL packages, procedures and functions and so on. For information about creating database objects, see the Oracle SQL Developer User's Guide.

Disconnecting an existing TimesTen database connection

To disconnect an existing connection from a TimesTen database, choose the Connections tab. Right-click the node of the connection name and select Disconnect.

For more information, see Figure 3-7, "Viewing a TimesTen connection".