Bulk copy example
100
Historical Server
•
sqlserver is the name of Adaptive Server.
•
-t, specifies the column terminators as being commas.
The default row terminator when using the
-c
option is a \n (new line) character
used by data files. Therefore, you do not need to specify the
-r
option. If you do
specify the record terminator option (
-r
), be sure to avoid the special
significance the backslash (\) character has by including another backslash, i.e.,
-r\\n
.
For more information about
bcp
, see the Utilities Guide.
Example
Suppose you want to record, once every second, the reads, writes, and total I/O
per device on an Adaptive Server that is monitored by the SMS1100 Monitor
Server. You can use the following steps to record the data, create a table to
accept the data, and then use the
bcp
utility to import the data into the table. In
this example, the view data file that is created by Historical Server for the view
is d1_1_device_io.
1
Use
isql
to log in to Historical Server.
2
Record the data by using the following commands:
hs_create_recording_session SMS1100, 1
go
hs_create_view device_io,
"device name", "value for sample",
"device reads", "value for sample",
"device writes", "value for sample",
"device i/o", "value for sample"
go
hs_initiate_recording
go
3
Use
isql
to log in to Adaptive Server. Because the recording session
contains only one view (“device_io”), create just one table in the
pubs2
database to store data for that view by using the following Transact-SQL
commands:
use pubs2
go
create table device_io
(
sample_time
datetime
not null,
Summary of Contents for 12.5.1
Page 1: ...User s Guide Historical Server 12 5 1...
Page 14: ...xiv Historical Server...
Page 46: ...Configuring multiple instances of Historical Server 32 Historical Server...
Page 56: ...Starting and stopping Historical Server on Windows NT 42 Historical Server...
Page 102: ...hs_terminate_recording 88 Historical Server...