Escolar Documentos
Profissional Documentos
Cultura Documentos
December 2012
The product or products described in this book are licensed products of Teradata Corporation or its affiliates.
Teradata, Active Enterprise Intelligence, Applications-Within, Aprimo, Aprimo Marketing Studio, Aster, BYNET, Claraview, DecisionCast, Gridscale,
MyCommerce, Raising Intelligence, Smarter. Faster. Wins., SQL-MapReduce, Teradata Decision Experts, "Teradata Labs" logo, "Teradata Raising
Intelligence" logo, Teradata ServiceConnect, Teradata Source Experts, "Teradata The Best Decision Possible" logo, The Best Decision Possible,
WebAnalyst, and Xkoto are trademarks or registered trademarks of Teradata Corporation or its affiliates in the United States and other countries.
Adaptec and SCSISelect are trademarks or registered trademarks of Adaptec, Inc.
AMD Opteron and Opteron are trademarks of Advanced Micro Devices, Inc.
Apache, Apache Hadoop, Hadoop, and the yellow elephant logo are either registered trademarks or trademarks of the Apache Software Foundation
in the United States and/or other countries.
Axeda is a registered trademark of Axeda Corporation. Axeda Agents, Axeda Applications, Axeda Policy Manager, Axeda Enterprise, Axeda Access,
Axeda Software Management, Axeda Service, Axeda ServiceLink, and Firewall-Friendly are trademarks and Maximum Results and Maximum
Support are servicemarks of Axeda Corporation.
Data Domain, EMC, PowerPath, SRDF, and Symmetrix are registered trademarks of EMC Corporation.
GoldenGate is a trademark of Oracle.
Hewlett-Packard and HP are registered trademarks of Hewlett-Packard Company.
Hortonworks, the Hortonworks logo and other Hortonworks trademarks are trademarks of Hortonworks Inc. in the United States and other
countries.
Intel, Pentium, and XEON are registered trademarks of Intel Corporation.
IBM, CICS, RACF, Tivoli, and z/OS are registered trademarks of International Business Machines Corporation.
Linux is a registered trademark of Linus Torvalds.
LSI is a registered trademark of LSI Corporation.
Microsoft, Active Directory, Windows, Windows NT, and Windows Server are registered trademarks of Microsoft Corporation in the United States
and other countries.
NetVault is a trademark or registered trademark of Quest Software, Inc. in the United States and/or other countries.
Novell and SUSE are registered trademarks of Novell, Inc., in the United States and other countries.
Oracle, Java, and Solaris are registered trademarks of Oracle and/or its affiliates.
QLogic and SANbox are trademarks or registered trademarks of QLogic Corporation.
Red Hat is a trademark of Red Hat, Inc., registered in the U.S. and other countries. Used under license.
SAS and SAS/C are trademarks or registered trademarks of SAS Institute Inc.
SPARC is a registered trademark of SPARC International, Inc.
Symantec, NetBackup, and VERITAS are trademarks or registered trademarks of Symantec Corporation or its affiliates in the United States and
other countries.
Unicode is a registered trademark of Unicode, Inc. in the United States and other countries.
UNIX is a registered trademark of The Open Group in the United States and other countries.
Other product and company names mentioned herein may be the trademarks of their respective owners.
THE INFORMATION CONTAINED IN THIS DOCUMENT IS PROVIDED ON AN "AS-IS" BASIS, WITHOUT WARRANTY OF ANY KIND, EITHER
EXPRESS OR IMPLIED, INCLUDING THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR
NON-INFRINGEMENT. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OF IMPLIED WARRANTIES, SO THE ABOVE EXCLUSION
MAY NOT APPLY TO YOU. IN NO EVENT WILL TERADATA CORPORATION BE LIABLE FOR ANY INDIRECT, DIRECT, SPECIAL, INCIDENTAL,
OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS OR LOST SAVINGS, EVEN IF EXPRESSLY ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
The information contained in this document may contain references or cross-references to features, functions, products, or services that are not
announced or available in your country. Such references do not imply that Teradata Corporation intends to announce such features, functions,
products, or services in your country. Please consult your local Teradata Corporation representative for those features, functions, products, or
services available in your country.
Information contained in this document may contain technical inaccuracies or typographical errors. Information may be changed or updated
without notice. Teradata Corporation may also make improvements or changes in the products or services described in this information at any time
without notice.
To maintain the quality of our products and services, we would like your comments on the accuracy, clarity, organization, and value of this document.
Please email: teradata-books@lists.teradata.com.
Any comments or materials (collectively referred to as "Feedback") sent to Teradata Corporation will be deemed non-confidential. Teradata
Corporation will have no obligation of any kind with respect to Feedback and will be free to use, reproduce, disclose, exhibit, display, transform,
create derivative works of, and distribute the Feedback and derivative works thereof without limitation on a royalty-free basis. Further, Teradata
Corporation will be free to use any ideas, concepts, know-how, or techniques contained in such Feedback for any purpose whatsoever, including
developing, manufacturing, or marketing products or services incorporating Feedback.
Aster Database provides Open Database Connectivity (ODBC) and Java Database
Connectivity (JDBC) drivers for connecting business intelligence (BI) tools. This section
explains how to connect BI tools using the Aster Database drivers.
General tips:
General Tips for Connecting Clients to Aster Database (page 6).
For example, if you will use an SSH client (e.g., putty) to run ACT or ncluster_loader, make
sure you set the SSH clients default character set to UTF-8.
ODBC Driver
Teradata Aster provides a standard ODBC driver for Aster Database that is compatible with
Microsoft Windows and Linux.
The Aster Database ODBC driver may change in any Aster Database release. For this reason, with each new edition of
Aster Database, you should reinstall the driver and recompile your applications that include the driver.
Procedure
1 On the machine where you will install the driver, make sure you have installed the
Microsoft Visual C++ 2008 Redistributable Package (x86). If its not installed, download it
from Microsoft now (choose the version that fits your architecture: 32-bit or 64-bit), and
install it. (Note that Microsoft also offers newer versions of the package, such as the
Microsoft Visual C++ 2010 Redistributable Package (x86). Teradata Aster has not tested
compatibility with these later versions!)
2 Get the Aster Database ODBC driver package (nClusterODBCInstaller_i386.msi for
32-bit Windows or nClusterODBCInstaller_x64.msi for 64-bit Windows) in one of
these ways:
a Copy the package from your queen node. On the queen, you can find the installers in /
home/beehive/clients_all/win32 or in /home/beehive/clients_all/win64.
3 If you are upgrading, use the Windows Add/Remove Programs tool to uninstall the old
version.
4 Copy the ODBC driver to the client machine and run the executable (for 32-bit, use
nClusterODBCInstaller_i386.msi or, for 64-bit, use
nClusterODBCInstaller_x64.msi). A setup wizard will walk you through the
installation of Aster Database ODBC as one of the available data sources on your
computer.
5 From the Windows Control Panel, double-click Administrative Tools to open the
Administrative Tools window.
6 Double-click the Data Sources (ODBC) option to open the ODBC Data Source
Administrator dialog box.
7 Click the System DSN tab, and click Add to open the Create New Data Source dialog box.
8 Select the Aster Data ODBC Driver for nCluster data source from the list.
9 Click Finish. The Aster Database Login window appears.
Bytea As Varchar: The current login window does not provide a check box for specifying
that values in a column of datatype bytea should be retrieved in a character
representation (as opposed to the default binary representation) but you can set this
later in the Windows registry. See Optional ODBC Setting for bytea-Stored Data on
page 10.
11 Click OK to save the data source information.
12 Click Test Connection to test the connectivity to the database. If the connection is successful,
the Aster Database Login window closes automatically.
13 If this window does not close automatically, click OK.
Your ODBC setup is complete. Now, in your applications that will query Aster Database, you
may connect to Aster Database as an ODBC data source.
For a 64-bit ODBC driver running on 64-bit Windows, and for 32-
bit driver on 32-bit Windows
Set the flag by adding it to the Windows registry entry for the DSN. Using a registry editor,
add this line to the registry, taking care to first replace <DSN-NAME> with your Data Source
name:
[HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBC.INI\<DSN-NAME>]
"ByteaAsVarchar"="1"
Prerequisites
1 The Aster Database ODBC driver requires libgcc 3.4.6 or higher.
2 On UNIX/Linux systems, the Aster Database ODBC driver requires a driver manager.
Teradata Aster recommends that you use the unixODBC driver manager, version 2.2.12,
which is compatible with the Aster Database standard ODBC driver for UNIX,
libAsterDriver_unixODBC.so. Teradata Aster also supports the iODBC driver
manager, version 3.52.3, but if you use the iODBC manager, you must use a different
version of the Aster Database ODBC driver, called libAsterDriver.so. No other
combination of drivers and driver managers is supported!
4 Check the installation by typing the following command. This prints version information
and lists the names and locations of the configuration files you will need to install or set
up.
# odbcinst -j
If your unixODBC installation is not working properly, check the instructions at http://
www.unixodbc.org/ for help.
Next Step: Proceed to the next section, Configure the ODBC Driver on Linux/Solaris/
MacOS.
Warning! For MacOS, the Aster Database ODBC Driver supports only MacOS version 10.5 or earlier.
1 Download the Aster Database ODBC driver bundle for your platform. You can get this
from Teradata Asters website or from your queen node. Do one of the following:
Go to ftp.asterdata.com. Find the appropriate bundle for your release and operating
system (for example, clients-odbc-linux64.tar.gz for a 64-bit Linux machine)
and download it to your machine.
Connect to your queen node and copy the appropriate driver bundle from /home/
beehive/clients_all. The bundles are in the OS-specific directories, linux32/,
linux64/, mac/, solaris64 /, solaris-sparc/, solaris-x86/, win32/, and win64/.
2 Extract the bundle into the directory where you want to install drivers. In this example,
well assume you will install the driver in /usr/local/lib. Once extracted, you will see
the directory, stage/, that includes the driver.
3 Change to the Aster Database driver directory:
# cd stage/clients-odbc-linux64
4 Edit your LD_LIBRARY_PATH or DYLD_LIBRARY_PATH environment variable, adding the
Aster Database driver directory path to it. This folder has the path <install
location>/stage/clients-odbc-linux64/Libs. Edit the appropriate environment
settings file to do this (for example, edit the ~/.bashrc file if you want to set it for the
current user on a typical Linux environment). For this example, we will set it for the
current session only. To follow this example, type the export command shown below.
(Note that for MacOS only, the environment variable is called DYLD_LIBRARY_PATH, not
LD_LIBRARY_PATH.)
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib/stage/clients-
odbc-linux64/Libs
5 Add or edit the ODBCSYSINI environment variable, setting it to the directory where your
ODBC connection settings files (odbc.ini and odbcinst.ini) will reside. To follow this
example, lets assume we are working as user mjones and will save the configuration files
to our home directory /home/mjones.
export ODBCSYSINI=/home/mjones
6 Check that the Aster Database ODBC driver library can find all its dependencies.
Assuming we have installed in /usr/local/lib, we would type (on Linux or Solaris):
# cd /usr/local/lib
# ldd stage/clients-odbc-linux64/ODBCDriver/ \
libAsterDriver_unixODBC.so
On MacOS, we would type:
# cd /usr/local/lib
# otool -L stage/clients-odbc-linux64/ODBCDriver/ \
libAsterDriver_unixODBC.dylib
If no not found messages appear, then all the required libraries have been linked. We
require libgcc 3.4.6 or higher.
ErrorMessagesPath=/usr/local/lib/stage/clients-odbc-linux64/ErrorMessages
Tip! At this point, you can run odbcinst -j to find out where the ODBC driver expects to find its configuration files.
3 ErrorMessagesPath=/usr/local/lib/stage/clients-odbc-linux64/ErrorMessages
4 In a text editor, edit the odbc.ini file, making the following changes:
a Set SERVER to the hostname or IP address of your Aster Database queen.
b Set PORT to 2406, the standard port on which your Aster Database queen listens for
client connections.
c Set DATABASE to the name of the database in Aster Database you want to connect to.
d Optionally, you may set UID and PWD to your Aster Database SQL username and
password, respectively.
e Finally, Teradata Aster recommends that you add the setting,
NumericAndDecimalAsDouble=1.
f If you retrieve bytea-stored data through the ODBC driver, you can specify whether
values in a column of datatype bytea will be retrieved in a character representation, or
in the default binary representation. To have the ODBC driver to retrieve values in
character representation, add the setting, ByteaAsVarchar=1 to your odbc.ini; if
you leave it unset, the driver preserves the binary output representation of bytea data.
g Optionally, you can set a number of other database connection behavior settings.
These include enable_quoted_identifiers (see Quoted-Identifier Handling on
page 28), enable_backslash_escapes: See Escape Character Handling on
page 28.
For this example, we set the contents of odbc.ini to read:
Tip! You can have multiple data sources. The name Aster Database ODBC for nCluster DSN in the odbc.ini file
is just a default name that Teradata Aster has given to the sample data source. You can rename this source and add
more, as shown in this example:
[my_1st_source]
Driver=AsterDriver
SERVER=10.50.52.100
...
[my_2nd_source]
Driver=AsterDriver
SERVER=10.42.43.100
...
5 In a text editor, edit the odbcinst.ini file, setting the Driver parameter to the Aster
Database driver directory path. For this example, we set the contents of odbcinst.ini to
read:
[AsterDriver]
Driver=/usr/local/lib/stage/clients-odbc-linux64/ODBCDriver/
libAsterDriver_unixODBC.so
IconvEncoding=UCS-4LE
[AsterDriver]
Driver=/usr/local/lib/stage/clients-odbc-linux64/ODBCDriver/
libAsterDriver_unixODBC.dylib
IconvEncoding=UCS-4LE
3 Set-up is complete.
Troubleshooting
If after installation you cannot connect:
1 Find the library libodbcinst.so and note its path.
2 Set the LD_LIBRARY_PATH environment variable so that it includes the directory that
contains libodbcinst.so. For example, if the library is in /usr/lib64, then you will
type:
export LD_LIBRARY_PATH=/usr/lib64:$LD_LIBRARY_PATH
#!/usr/bin/perl
use DBI;
use DBD::ODBC;
$dbh->do("BEGIN");
$dbh->do("set random_page_cost to '4'");
$dbh->do("set enable_seqscan to 'off'");
$dbh->disconnect;
PHP
To set up PHP:
1 Make sure Apache is installed and make note of the directory. For this example, we will
assume Apache is installed at /usr/local/apache
2 Ensure that unixODBC has been installed as described above.
3 Download the source for PHP 5.2.16 and extract it to the desired directory. The following
setup instructions should be used for PHP:
$ CFLAGS="-DSIZEOF_LONG=8" ./configure --with-apxs2=/usr/local/
apache/bin/apxs --with-zlib --with-unixODBC --with-pdo-odbc=unixODBC
$ make && make install
$ cp -p .libs/libphp5.so /usr/local/apache/modules
2 To make sure that the ODBCSYSINI environment variable is available when PHP calls are
made, use the following line in your PHP code:
#given ODBCSYSINI is to be set to /etc then:
putenv("ODBCSYSINI=/etc")
Tip! You should not set up your own PHP or use /etc/init.d/apachectl on the queen for your own web
pages.
Differences Between the 5.0.3 JDBC Driver and the Legacy JDBC Driver
These are important differences between the 5.0.3 JDBC driver and the legacy JDBC driver:
JDBC only supports scrollable forward cursors. Only the con.createStatement
(ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY) and
connection.createStatement() functions are supported. The Other parameter values like
ResultSet.TYPE_SCROLL_INSENSITIVE and ResultSet.CONCUR_UPDATABLE are not
supported.
The executeBatch() function throws a SQL exception (java.sql.SQLException).
Use the Java -classpath flag at the command line to add the paths to the CLASSPATH
environment variable. For example, if you place the JAR files in /usr/jars, then add the
path like this:
java -classpath /usr/my_program /usr/jars/
or
Add the paths to the driver to the CLASSPATH environment variable. For example:
export CLASSPATH=/usr/jars/:$CLASSPATH
2 In your application:
a Import the java.sql package like this:
import java.sql.*;
b Load the driver using the Class.forName() method:
Class.forName("com.asterdata.ncluster.Driver");
c Define the username, password, and url (including the host, port, and database)
parameters, which are needed to connect to the database. For example:
String username = "user";
String password = "password";
String url = "jdbc:ncluster://myhost:2406/database";
For more information about the URL format, see Required Parameters on page 21.
d Get a Connection instance from JDBC using the DriverManager.getConnection()
method:
try
{
Connection conn =
DriverManager.getConnection(url, username, password);
}
catch (SQLException ex)
{
// could not connect
}
NOTE: The getConnection method throws a No driver available SQLException
exception if CLASSPATH does not contain the path for the JDBC driver, or if the
parameters are incorrect.
Required Parameters
To establish a connection to an Aster Database using the Aster Database JDBC driver, you
must provide the driver with the URL to use to connect to the database. The URL has this
format:
jdbc:ncluster://<Host:Port>/<Database>
Host Optional The name of the server where the database resides.
To specify an IPv6 address, enclose the this parameter in square
brackets. For example:
jdbc:ncluster://[::1]:2406/nCluster
Default is localhost.
Port Optional The port number that the database server is listening on.
Default is 2406.
In addition, to the URL, you must also provide the username and password needed to access
the Aster Database, which you can get from your Aster Database administrator.
Optional Parameters
You can set the Autocommit and fetch_count settings for the connection in the URL by adding
the autocommit and fetch_count parameters. See Frequently Used JDBC Settings on
page 22. If your application will query large tables, you should set autocommit to false, and
you should declare a fetch_count for the connection. By doing this, you enable the
connection to use distributed cursors for improved performance.
Tip! When working with ResultSets of type ResultSet.TYPE_FORWARD_ONLY, you cannot scroll back-
wards, nor can you jump to any location in the ResultSet other than the next row.
4 In the Statement object, you must pass a single query, not multiple queries strung together
with semicolons.
5 You must set the statements fetch_count using the Statement.setFetchSize(int
rows) command. This instructs the driver to fetch the specified number of rows at a time
from the database. If the fetch size is not set, the driver fetches the full set of rows that
match the query.
6 To help ensure a quick response when a page of rows is exhausted, the JDBC driver, by
default, pre-fetches and caches ten pages of results from the database. A page is one
fetch_count worth of rows. You can set the number of pages to be pre-fetched, or you can
disable pre-fetching if desired.
Tip! In the example below, we set the Autocommit setting and the FetchSize setting using the setAutoCom-
mit() and setFetchSize() methods, but you also have the option of setting these in the JDBC connection
parameters when you make the connection. See Frequently Used JDBC Settings on page 22.
while (rs.next()) {
System.out.print("a row was returned.");
}
rs.close();
Disabling Cursors
Cursors are enabled by default. To turn them off, set the FetchSize to zero. Assuming a
statement st and a ResultSet rs, you would do this as shown here:
st.setFetchSize(0);
rs = st.executeQuery("SELECT * FROM mytable");
while (rs.next()) {
System.out.print("many rows were returned.");
}
System.out.println("getIdentifierQuoteString:
"+meta.getIdentifierQuoteString());
System.out.println("\ngetSQLKeywords: "+meta.getSQLKeywords());
System.out.println("\ngetNumericFunctions: "+meta.getNumericFunctions());
System.out.println("\ngetStringFunctions :
"+meta.getStringFunctions());
System.out.println("getSystemFunctions : "+meta.getSystemFunctions());
System.out.println("getTimeDateFunctions :
"+meta.getTimeDateFunctions());
System.out.println("getSearchStringEscape :
"+meta.getSearchStringEscape());
System.out.println("getExtraNameCharacters :
"+meta.getExtraNameCharacters());
System.out.println("getCatalogTerm : "+meta.getCatalogTerm());
System.out.println("getCatalogSeparator :
"+meta.getCatalogSeparator());
System.out.println("getURL : "+meta.getURL());
System.out.println("getUserName : "+meta.getUserName());
System.out.println("getMaxCursorNameLength :
"+meta.getMaxCursorNameLength());
System.out.println("getMaxSchemaNameLength :
"+meta.getMaxSchemaNameLength());
System.out.println("getMaxProcedureNameLength :
"+meta.getMaxProcedureNameLength());
System.out.println("getMaxCatalogNameLength :
"+meta.getMaxCatalogNameLength());
System.out.println("getMaxColumnsInIndex :
"+meta.getMaxColumnsInIndex());
System.out.println("supportsSubqueriesInComparisons :
"+meta.supportsSubqueriesInComparisons());
System.out.println("getMaxConnections : "+meta.getMaxConnections());
System.out.println("getMaxColumnsInTable :
"+meta.getMaxColumnsInTable());
System.out.println("isReadOnly : "+meta.isReadOnly());
System.out.println("\ngetCatalogs:");
ResultSet res = meta.getCatalogs();
while (res.next()) {
System.out.println(res.getString(1));
}
System.out.println("\ngetTables:");
res.close();
res = meta.getTables(null,null,"%",null);
while (res.next()) {
System.out.println(res.getString(1) +res.getString(2) +res.getString(3)
+res.getString(4));
}
System.out.println("");
res.close();
res = meta.getTableTypes();
System.out.println("\ngetTableTypes:");
while (res.next()) {
System.out.println(res.getString(1));
}
res.close();
Statement stmt=con.createStatement();
ResultSet rs = stmt.executeQuery("select count(*) from page_views");
while (rs.next()) {
System.out.println(rs.getInt(1));
}
rs.close();
stmt.close();
con.close();
} catch(SQLException ex) {
System.err.println("SQLException: " + ex.getMessage());
}
}else{
System.out.println("Could not Get Connection");
}
}
public static Connection getJDBCConnection(){
try {
Class.forName("com.asterdata.ncluster.Driver");
} catch(java.lang.ClassNotFoundException e) {
System.err.print("ClassNotFoundException: ");
System.err.println(e.getMessage());
}
try {
con = DriverManager.getConnection(url,userid, password);
} catch(SQLException ex) {
System.err.println("SQLException: " + ex.getMessage());
}
return con;
}
}
Quoted-Identifier Handling
enable_quoted_identifiers: This setting affects the way Aster Database processes strings
enclosed in double-quote characters ("..."). With enable_quoted_identifiers='on' (the
default), Aster Database follows the standard behavior of interpreting each double-quoted
string as an identifier (a column, table, schema, or function name). With
enable_quoted_identifiers='off', each double-quoted string is interpreted as a literal
string constant. Any printable character may be represented in a double-quoted string. See
Quoted Identifiers on page 916.
These can be set in the DSN configuration (i.e., the odbc.ini file or Windows registry).
Alternatively, a connecting application may set these options in the connection string when
connecting without a registered DSN.
COPY FROM/TO
Semantics and overall flow of execution for COPY is the same as for the Aster Database Loader
Tool. See Aster Database Loader Tool on page 375.
Syntax
COPY table [(column list)] FROM <quoted file name> ...COPY attributes
or
COPY table [(column list)] TO <quoted file name> ...COPY attributes
The COPY command accepts a quoted file name and streams the data into or out of Aster
Database using the Aster Database Loader Tool protocol for maximum throughput. For more
detailed syntax, see COPY (page 711).
INSTALL
The INSTALL command is similar to the ACT command \install <FILE> [[<SCHEMA>/
]<FILE_ALIAS>] on page 127, and supports SQL-MR security semantics. See SQL-
MapReduce Security on page 246.
Syntax
INSTALL FILE <quoted file name> [[<schema>/]<file alias>]
The schema name must be quoted if it contains spaces or mixed case.
The file alias must be quoted.
UNINSTALL
The UNINSTALL command supports SQL-MR security semantics. See SQL-MapReduce
Security on page 246.
Syntax
UNINSTALL FILE <quoted file name> [[<schema>/]<file alias>]
The schema name must be quoted if it contains spaces or mixed case.
The file alias must be quoted.
DOWNLOAD
The DOWNLOAD command is similar to the ACT command \download [[<SCHEMA>/
]<FILE_ALIAS>] <FILE> on page 127, and supports SQL-MR security semantics. See SQL-
MapReduce Security on page 246.
Syntax
DOWNLOAD FILE <quoted file name> [[<schema>/]<file alias>]
The schema name must be quoted if it contains spaces or mixed case.
The file alias must be quoted.
Important note for upgraders: Most pre-version-4.6 Aster Database drivers and the pre-4.6 ACT client do not
support SSL. During your upgrade to Aster Database 4.6, you must replace all Aster Database drivers and ACT cli-
ents that connect to your Aster Database installation.
Port Number
The Aster Database queen port number for SSL connections is the same as the regular client
connection port: 2406. Port 2406 is multiplexed to support both secure sockets layer (SSL)
connections and unencrypted connections.
Self-signed PEM certificate (that is, the base64-encoded ASCII representation of the
certificate only; this is the version of the certificate that starts with "-----BEGIN
CERTIFICATE-----" and ends with "-----END CERTIFICATE-----"). The default one is /
home/beehive/certs/server.cert
Another copy of the self-signed certificate, also in PEM format, but this time formatted in
X.509 structure. Note! This file may be missing from your Aster Database installation. To
work around this problem, you must create the default PEM file from the server.cert
file, saving it as /home/beehive/certs/server.pem. To create it, log in to the queen as
root, change directories to /home/beehive/certs, and type:
# openssl x509 -in server.cert -text >> server.pem
The queens SSL-related settings (see SSL Settings Reference on page 31) in the Aster
Database queen configuration file, /home/beehive/config/procmgmtConfigs/
coordinator.cfg
On the client side, the files related to SSL and its configuration are:
Copy of the queens public key in PEM format. This is a copy of the queens server.pem.
For example, you might save it as /home/mjones/certs/server.pem
The clients SSL-related settings (see Client-Side SSL Settings on page 32), stored:
for Linux, in the clients odbc.ini file; and
for Windows, in the ODBC parameter fields of the registry
Queen-Side Settings
Make the following settings on the queen:
disallowPeerWithoutCertificates=false
allowSelfSignedPeer=true
trustedCAFileName=/home/beehive/certs/server.pem
sslCertificatePath=/home/beehive/certs/server.cert
sslPrivateKeyPath=/home/beehive/certs/server.key
sslFileType=1 (A value of 1 means SSL_FILETYPE_PEM.)
Ensure that secureWrites is set to false
Ensure that secureMuleServer is set to true
There is no need to set the trustedCAPath parameter.
Client-Side Settings
Make the following settings on each ODBC client:
EnableSSL=1
SSLEncryptReads=0
SSLAllowSelfSignedPeer=1
SSLFileType=SSL_FILETYPE_PEM
There is no need to set the other SSL settings such as SSLPrivateKeyPath.
Queen-Side Settings
Make the following settings on the queen:
secureWrites=true
Client-Side Settings
Make the following settings on each ODBC client:
SSLEncryptReads=1
Queen-Side Settings
Make the following settings on the queen:
1 Set up Aster Database user authentication as explained in Set Up Active Directory
Authentication with Single Sign-On on page 336.
2 Configure the queen SSL configuration flags as described in one of the scenarios above
which you are planning on implementing. (For example, see Scenario 1: Allowing
connections from clients without certificates on page 33
Client-Side Settings
Do the following:
1 Set the flags in the clients ODBC configuration file or registry as described in your chosen
scenario from above.
2 Set the EnableSSO flag in the clients ODBC configuration file:
EnableSSO=1
3 If EnableSSO is set to 1, you must also:
Ensure that ServerIP is set to the fully qualified domain name of the Aster Database
queen and not to an IP address.
For 64-bit Linux machines: The ODBC driver assumes that libvas-gssapi.so is
present at /opt/quest/lib64/. If /opt/quest/lib64/libvas-gssapi.so does
not exist, locate libvas-gssapi.so by referring to the VAS documentation and set
the GSSPath parameter to point to the installed location of libvas-gssapi.so. For
example, if libvas-gssapi.so is deployed at /usr/lib64, then the GSSPath
parameter needs to be set to /usr/lib64 in the ODBC.ini config file as shown below:
GSSPath=/usr/lib64
For 32-bit Linux machines: The ODBC driver assumes that libvas-gssapi.so is
present at /opt/quest/lib/. If /opt/quest/lib/libvas-gssapi.so does not
exist, locate libvas-gssapi.so by referring to the VAS documentation and set the
GSSPath parameter to point to the installed location of libvas-gssapi.so. For
example, if libvas-gssapi.so is deployed at /usr/lib, then the GSSPath parameter
needs to be set to /usr/lib in the ODBC.ini config file as shown below:
GSSPath=/usr/lib
Sample ODBC.INI:
This sample assumes your queen machine is called cqueen.asterengqa.com and that you
are following Scenario 1 (outlined earlier in this chapter):
[ODBC Data Sources]
AsterTest=AsterDriverTest
[AsterTest]
Driver=AsterDriverTest
SERVER=cqueen.asterengqa.com
DATABASE=beehive
PORT=2406
UID=testuser13
PWD=testuser133
SQLSupportedConversions=3
NumericAndDecimalAsDouble=1
EnableSSO=0
GSSPath=
EnableSSL=1
SSLEncryptReads=0
SSLAllowSelfSignedPeer=1
SSLFileType=SSL_FILETYPE_PEM
SSLPrivateKeyPath=
SSLCertificatePath=
SSLTrustedCADir=
SSLTrustedCAFilename=
Sample ODBCINST.INI:
This sample assumes you have installed the driver in /Drivers/AsterDriver/ODBCDriver:
[AsterDriverTest]
Driver=/Drivers/AsterDriver/ODBCDriver/libAsterDriver_unixODBC.so
IconvEncoding=UCS-4LE
Sample aster.ini:
This sample assumes you want to log error messages in /Drivers/AsterDriver:
[driver]
DriverManagerEncoding=UTF-32
DSILogging=1
ErrorMessagesPath=/Drivers/AsterDriver/ErrorMessages
Details for setting the values in the registry are given below. Choose the section that fits your
needs and client type:
Adding a driver to a Windows 32-bit operating system, below.
Adding a 64-bit driver to a Windows 64-bit operating system on page 38
Adding a 32-bit driver to a Windows 64 bit operating system on page 39
[HKEY_LOCAL_MACHINE\SOFTWARE\ODBC]
[HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBCINST.INI]
[HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBCINST.INI\AsterDriver32]
"Driver"="C:\\AsterDriver-Win32\\ODBCDriver\\AsterDataODBCDSII.dll"
[HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBCINST.INI\ODBC Drivers]
"AsterDriver32"="Installed"
[HKEY_LOCAL_MACHINE\SOFTWARE\Aster]
[HKEY_LOCAL_MACHINE\SOFTWARE\Aster\Driver]
"DSILogging"="0"
"ErrorMessagesPath"="C:\\AsterDriver-Win32\\ErrorMessages"
"DriverManagerEncoding"="UTF-16"
The values in the keys above can be modified depending on where the driver is located on the
local machine and what the name of the driver should be. The values above are based on the
assumption that the driver folder is at "C:\AsterDriver-Win32" and the name of the driver is
"AsterDriver32". For an example .reg file that makes these settings, contact Teradata support.
"EnableSSO"="0"
[HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBC.INI\ODBC Data Sources]
"AsterDSN32"="AsterDriver32"
[HKEY_LOCAL_MACHINE\SOFTWARE\ODBC]
[HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBCINST.INI]
[HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBCINST.INI\AsterDriver64]
"Driver"="C:\\AsterDriver-Win64\\ODBCDriver\\AsterDataODBCDSII.dll"
[HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBCINST.INI\ODBC Drivers]
"AsterDriver64"="Installed"
[HKEY_LOCAL_MACHINE\SOFTWARE\Aster]
[HKEY_LOCAL_MACHINE\SOFTWARE\Aster\Driver]
"DSILogging"="0"
"ErrorMessagesPath"="C:\\AsterDriver-Win64\\ErrorMessages"
"DriverManagerEncoding"="UTF-16"
Above, the name of the DSN for the 64-bit driver is AsterDSN64. The server being connected
to is 10.51.12.100.
[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\ODBC]
[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\ODBC\ODBCINST.INI]
[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\ODBC\ODBCINST.INI\AsterDriver32
]
"Driver"="C:\\AsterDriver-Win32\\ODBCDriver\\AsterDataODBCDSII.dll"
[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\ODBC\ODBCINST.INI\ODBC Drivers]
"AsterDriver32"="Installed"
[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Aster]
[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Aster\Driver]
"DSILogging"="0"
"ErrorMessagesPath"="C:\\AsterDriver-Win32\\ErrorMessages"
"DriverManagerEncoding"="UTF-16"
The values in the keys above can be modified depending on where the driver is located on the
local machine and what the name of the driver should be. The values above are based on the
assumption that the driver folder is at "C:\AsterDriver-Win32" for 32 bit drivers and the name
of the driver is "AsterDriver32". For an example .reg file that makes these settings, contact
Teradata support.
"SSLFileType"="SSL_FILETYPE_PEM"
"SSLPrivateKeyPath"="\"\""
"SSLCertificatePath"="\"\""
"SSLTrustedCADir"="\"\""
"SSLTrustedCAFilename"="\"\""
[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\ODBC\ODBC.INI\ODBC Data
Sources]
"AsterDSN32"="AsterDriver32"
Above, the name of the DSN for the 32-bit driver is AsterDSN32. The server being connected
to is 10.51.12.100.
Creating Certificates
openssl req \-new \-x509 \-nodes \-sha1 \-days 365 \-key host.key >
host.cert
JDBC Issues
Infinity and Negative Infinity Timestamp Conversion
The JDBC driver converts 'infinity' and '-infinity' to specific TimeStamp values (a very large
and a very tiny TimeStamp) which can cause unexpected results on the client side.
Aqua Data Studio and other client tools, like SQL Assistant JAVA edition also have this issue.
These tools do not support 'infinity' and '-infinity' in the timestamp datatype. If they
encounter these values, they will display specific TimeStamp values (a very large and a very
tiny TimeStamp).
AquaFolds ADS lets you perform DDL operations and query data interactively, and it
provides tools that help you write and manage queries efficiently. ADS is a third-party tool
available for purchase from Aqua Fold directly.
Aster Database is compatible with ADS version 10.0.2 with patch ads-10.0.7_03-patch.zip.
Install ADS
This section explains how to install ADS on your client workstation and connect to an Aster
Database.
1 Download Aqua Data Studio version 10.0.2 or later from http://www.aquafold.com/
downloads.html
2 Install Aqua Data Studio on your client workstation as explained in your version of the
Aqua Data Studio documentation at http://docs.aquafold.com/
aquadatastudio_11_documentation.html
Versions
MicroStrategy 9 or later is required, and Aster Database 3.0.1 or later is required.
Platforms Supported
Aster Database supports Intelligence Server clients running on Windows XP and Windows
Vista with the Aster Database ODBC driver for Windows.
Limitations
Aster Database is only certified as a warehouse with MicroStrategy. Aster Database cannot be
used as a repository.
Set-up Instructions
To connect MicroStrategy to Aster Database, follow the steps below.
Prerequisites
Make sure the following patches are applied to your MicroStrategy installation:
MicroStrategy 8: Contact MicroStrategy Customer support for
DATABASE.PDS file that's certified with Aster Database
DTMAPPING.PDS file that's certified with Aster Database
MicroStrategy 9: Contact MicroStrategy Customer support for
DTMAPPING.PDS file that works with Aster Database
MicroStrategy 9.0.1 and above: No changes required
Install Drivers
On the client machine where MicroStrategy runs, install the database drivers:
1 Install the Aster Database ODBC driver. This is available in the /home/beehive/clients
directory on your Aster Database queen. See ODBC Driver on page 7 for installation
instructions.
2 Install the MicroStrategy VLDB driver, version 9 or later.
[aster]
Driver=/usr/local/lib/stage/<client_directory_for_OS>/ODBCDriver/
libAsterDriver_unixODBC.so
SERVER=<server_ip>
PORT=2406
DATABASE=<database>
UID=<uid>
PWD=<passwd>
IconvEncoding=UCS-4LE
Best Practices
By following the guidelines below, you can avoid common errors in Aster Database-
MicroStrategy integration.
Schema changes
If your schema contains NUMERIC(X,0) type columns, you should replace these with
INT or BIGINT type columns for a higher probability of success with existing
MicroStrategy reports.
For your small- to medium-sized tables that have no BIGINT or INT columns, you should
create the tables in Aster Database as replicated dimension tables. This takes more space in
the cluster, but works better with MicroStrategy.
Operational items
When pointing an existing MicroStrategy report from another database to Aster Database, the
warehouse schema should be UPDATED the first time when pointed to an Aster Database
Instance. This updates the metadata inside MicroStrategy for correct MicroStrategy columns.
This is particularly important when a schema is ported from some other database to Aster
Database.
A ODBC 7
ODBC for Perl scripts 16
Active Directory authentication
distributed cursors 24
SSL connections and 34
drivers 6
Aster Database
JDBC 19
connecting, overview 6
ODBC 7
Aster Database configuration settings
ODBC for Perl scripts 16
SQL behavior 28
B E
backslash E prefix 28
allow backslash escapes 28 enable_quoted_identifiers 28
bytea encryption 30
handling bytea data in ODBC 10 of query results 33
SSL for ODBC 30
escape character
C allow backslash escapes 28
certificate 40 export
for ODBC connection 40 JDBC driver 19
character set, default 6 ODBC driver 7
characters, special 6
client J
recommended client settings 6
Java
client settings, recommended 6
JDBC statements 40
client-side cursors in JDBC 23
JDBC 19
configuration
connecting through JDBC 21
queen system parameters 35
cursors in 23
configuration settings
SQL behavior 28 driver 19
connect 6 how to write applications that use JDBC 40
JDBC driver 19 query example 41
MicroStrategy 43 sample test program 25
ODBC driver 7
connecting 6 L
overview 6 loading
through JDBC 21 JDBC driver 19
coordinator.cfg 35 ODBC driver 7
cursor
distributed 24
JDBC, cursors in 23
M
customizing SQL behavior 28 MicroStrategy, connections for 43
D O
data ODBC 7
encrypting data traffic 33 bytea handling 10
database drivers 6 driver 7
JDBC 19 ODBC driver
R
recommended client settings 6
reporting tools
MicroStrategy 43
S
security
SSL for ODBC 30
settings
enable_backslash_escapes 28
enable_quoted_identifiers 28
SQL settings 28
SSL connection settings 31
SQL
customizing SQL behavior 28
parameters that set SQL behavior 28
SSL 30
with Active Directory authentication 34
SSL for ODBC 30
certificates for 40
client settings 32
common configuration scenarios 32
encryption of query results 33
how to set up on client 35
how to set up on queen 35
queen settings 31
reference to Aster Database SSL settings 31
SSO for ODBC connections 34
Statement in JDBC 40