HP 3PAR StoreServ 7400 2-node HP 3PAR System Reporter 3.1.0 Software User& - Page 224

Dumping the Entire Database

Page 224 highlights

NOTE: When executing sysbck.exe from any other directory on Windows, ensure that the PATH environment variable is set to the System Reporter root directory path (by default, this path is C:\Program Files\3par). Dumping the Entire Database When you want to extract a large part of the database, it may be more efficient, both in time and disk space, to dump the entire database instead of using sysbck. The method for dumping the entire database depends on the database type. The process for SQLite is described in "Dumping the Entire SQLite Database" (page 224) while the process for MySQL is described in "Dumping the Entire MySQL Database" (page 224). For Oracle and MS SQL, please refer to the Oracle or Microsoft documentation. Dumping the Entire SQLite Database The SQLite database is just a file (by default C:\Program Files\3par\System Reporter\ inservstats\inservstats.db on Windows and /var/inservstats/inservstats on Linux). However, if there are other files in the same directory created by SQLite, such as a journal file (inservstats.db-journal) you cannot just copy the database file to another location and open it as an SQLite database. The presence of the other files, such as the journal file, indicates that the database is not in a consistent state. The recommended way to get a copy is to follow these steps: 1. Stop the HP 3PAR System Reporter sampler service (Windows) or daemon (Linux) so that the database is not active while you are making the copy. 2. If there is no other file (such as the journal file), the database is now consistent and you can just copy the inservstats.db file. 3. If there is another file (such as the journal file), the database is still inconsistent. In this case, you must first open the database with SQLite which will automatically apply the journal changes. The easiest way to do this is to generate a report from the database using a web browser. The web server will open the database, the journal changes will be automatically applied, and the journal file will be automatically deleted. Then you can copy the database file. 4. After the database file has been copied, you can restart the HP 3PAR System Reporter sampler service (Windows) or daemon (Linux). NOTE: Ideally, when extracting data for HP support from an SQLite database, use sysbck without the default dbouttype parameter. Dumping the Entire MySQL Database To create a dump of a MySQL database use the mysqldump program as follows # mysqldump --host=hostname --user=username --password=passwd --opt dbname > dbname.sql This creates a text file called dbname.sql that contains SQL commands to create the tables and insert the data into the tables. You can simply source this file into MySQL to recreate the entire database. NOTE: When dumping data from a large database that is to be backed up to a different location than the source, it is best to use sysbck as the data will be stored in multiple 2 GB files (if necessary), and is easier to manage. 224 Troubleshooting System Reporter

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57
  • 58
  • 59
  • 60
  • 61
  • 62
  • 63
  • 64
  • 65
  • 66
  • 67
  • 68
  • 69
  • 70
  • 71
  • 72
  • 73
  • 74
  • 75
  • 76
  • 77
  • 78
  • 79
  • 80
  • 81
  • 82
  • 83
  • 84
  • 85
  • 86
  • 87
  • 88
  • 89
  • 90
  • 91
  • 92
  • 93
  • 94
  • 95
  • 96
  • 97
  • 98
  • 99
  • 100
  • 101
  • 102
  • 103
  • 104
  • 105
  • 106
  • 107
  • 108
  • 109
  • 110
  • 111
  • 112
  • 113
  • 114
  • 115
  • 116
  • 117
  • 118
  • 119
  • 120
  • 121
  • 122
  • 123
  • 124
  • 125
  • 126
  • 127
  • 128
  • 129
  • 130
  • 131
  • 132
  • 133
  • 134
  • 135
  • 136
  • 137
  • 138
  • 139
  • 140
  • 141
  • 142
  • 143
  • 144
  • 145
  • 146
  • 147
  • 148
  • 149
  • 150
  • 151
  • 152
  • 153
  • 154
  • 155
  • 156
  • 157
  • 158
  • 159
  • 160
  • 161
  • 162
  • 163
  • 164
  • 165
  • 166
  • 167
  • 168
  • 169
  • 170
  • 171
  • 172
  • 173
  • 174
  • 175
  • 176
  • 177
  • 178
  • 179
  • 180
  • 181
  • 182
  • 183
  • 184
  • 185
  • 186
  • 187
  • 188
  • 189
  • 190
  • 191
  • 192
  • 193
  • 194
  • 195
  • 196
  • 197
  • 198
  • 199
  • 200
  • 201
  • 202
  • 203
  • 204
  • 205
  • 206
  • 207
  • 208
  • 209
  • 210
  • 211
  • 212
  • 213
  • 214
  • 215
  • 216
  • 217
  • 218
  • 219
  • 220
  • 221
  • 222
  • 223
  • 224
  • 225
  • 226
  • 227
  • 228
  • 229
  • 230
  • 231

NOTE:
When executing
sysbck.exe
from any other directory on Windows, ensure that the
PATH environment variable is set to the System Reporter root directory path (by default, this path
is
C:\Program Files\3par
).
Dumping the Entire Database
When you want to extract a large part of the database, it may be more efficient, both in time and
disk space, to dump the entire database instead of using
sysbck
. The method for dumping the
entire database depends on the database type. The process for SQLite is described in
“Dumping
the Entire SQLite Database” (page 224)
while the process for MySQL is described in
“Dumping the
Entire MySQL Database” (page 224)
. For Oracle and MS SQL, please refer to the Oracle or Microsoft
documentation.
Dumping the Entire SQLite Database
The SQLite database is just a file (by default
C:\Program Files\3par\System Reporter\
inservstats\inservstats.db
on Windows and
/var/inservstats/inservstats
on
Linux). However, if there are other files in the same directory created by SQLite, such as a journal
file (
inservstats.db-journal
) you cannot just copy the database file to another location and
open it as an SQLite database. The presence of the other files, such as the journal file, indicates
that the database is not in a consistent state. The recommended way to get a copy is to follow
these steps:
1.
Stop the HP 3PAR System Reporter sampler service (Windows) or daemon (Linux) so that the
database is not active while you are making the copy.
2.
If there is no other file (such as the journal file), the database is now consistent and you can
just copy the
inservstats.db
file.
3.
If there is another file (such as the journal file), the database is still inconsistent. In this case,
you must first open the database with SQLite which will automatically apply the journal
changes. The easiest way to do this is to generate a report from the database using a web
browser. The web server will open the database, the journal changes will be automatically
applied, and the journal file will be automatically deleted. Then you can copy the database
file.
4.
After the database file has been copied, you can restart the HP 3PAR System Reporter sampler
service (Windows) or daemon (Linux).
NOTE:
Ideally, when extracting data for HP support from an SQLite database, use
sysbck
without the default
dbouttype
parameter.
Dumping the Entire MySQL Database
To create a dump of a MySQL database use the
mysqldump
program as follows
# mysqldump --host=hostname --user=username --password=passwd --opt dbname > dbname.sql
This creates a text file called
dbname.sql
that contains SQL commands to create the tables and
insert the data into the tables. You can simply source this file into MySQL to recreate the entire
database.
NOTE:
When dumping data from a large database that is to be backed up to a different location
than the source, it is best to use
sysbck
as the data will be stored in multiple 2 GB files (if
necessary), and is easier to manage.
224
Troubleshooting System Reporter