![Sybase 12.5.1 Скачать руководство пользователя страница 113](http://html1.mh-extra.com/html/sybase/12-5-1/12-5-1_user-manual_1416501113.webp)
CHAPTER 5 Data Files
User’s Guide
99
Bulk copy example
This section describes how to pass historical data files to the Bulk Copy (
bcp
)
utility to populate Adaptive Server tables.
To store recorded data in an Adaptive Server table by using
bcp
, you must first
create a table for each view defined for the session. In the table, create a
separate column for each of the data items that comprise the view. The first
column for each table, which stores the date and time of the sample, must be of
the
datetime
datatype.
If no data is returned for a view during a sample interval while Historical
Server is recording, a placeholder record is written to the view’s data file. This
record contains the timestamp of the sample followed by a comma-separated
list of empty values. For this reason, it is recommended that all but the first
column be defined to allow nulls.
You may simplify the process of creating tables by having the Historical Server
create a script file for you. Use the
script_type
parameter of the
hs_create_recording_session
command.
After you create the tables on Adaptive Server, you can use the
bcp
utility to
import data from the view data files to their respective tables. Run the
following command once for each data file for which you want to import the
data into an Adaptive Server table:
bcp [[
database_name
.]
owner
.]
table_name
in
view_data_file
-c [ -e
errfile
] [-U
username
]
[-P
password
] [-S
sqlserver
] -t,
where:
•
database_name is the name of the database where the tables to hold the
imported data are located.
•
owner is the name of the table’s owner (presumedly your own user name
in the database that contains the table).
•
table_name is the name of the database table into which the data from the
view’s data file is to be imported.
•
view_data_file is the name of the data file for the view.
•
errfile is the name of an error file in which any rows that could not be
transferred to the database table are to be stored.
•
username is the login name to Adaptive Server.
•
password is the password of the username.
Содержание 12.5.1
Страница 1: ...User s Guide Historical Server 12 5 1...
Страница 14: ...xiv Historical Server...
Страница 46: ...Configuring multiple instances of Historical Server 32 Historical Server...
Страница 56: ...Starting and stopping Historical Server on Windows NT 42 Historical Server...
Страница 102: ...hs_terminate_recording 88 Historical Server...
Страница 204: ...Transaction activity 190 Historical Server...