Using directory access servers

A directory access server is a remote server that gives you access to the local file structure of the computer running the database server. Once you are connected to the directory access server, you use proxy tables to access any subdirectories on the computer. Database users must have an external login to use the directory access server.

You cannot alter a directory access server after it is created. If you need to change a directory access server, you must drop it and recreate it with different settings. You must first drop any proxy tables that reference the directory access server and then recreate them after recreating the directory access server.

The following describes the format of the proxy table.

  • permissions VARCHAR(10)   A Posix-style permission string such as "drwxrwxrwx".

  • size BIGINT   The size of the file in bytes.

  • access_date_time TIMESTAMP   The date and time the file was last accessed (for example, 2010-02-08 11:00:24.000).

  • modified_date_time TIMESTAMP   The date and time the file was last modified (for example, 2009-07-28 10:50:11.000 ).

  • create_date_time TIMESTAMP   The date and time the file was created (for example, 2008-12-18 10:32:26.000).

  • owner VARCHAR(20)   The user ID of the file's creator (for example, "root" on Linux). For Windows, this value is always "0".

  • file_name VARCHAR(260)   The name of the file, including a relative path (for example, bin\perl.exe).

  • contents LONG VARBINARY   The contents of the file when this column is explicitly referenced in the result set.

Note

Executing a SELECT * statement from a proxy table that is mapped to a directory access server returns an empty string in the contents column. The database server behaves this way because in most cases the intention is not to retrieve the contents of each file in the directory structure and the files could potentially be large.

However, if the contents column is explicitly specified either in the select list, the WHERE clause, or any other portion of the query, then the file contents are fetched.

It is recommended that an application performs a SELECT * statement to retrieve the list of files and information about each file (such as the size or modified time). The application can then execute a SELECT contents WHERE filename=... to fetch the contents of a particular file.


Create directory access servers
Drop directory access servers