"Fossies" - the Fresh Open Source Software Archive 
Member "netxms-3.8.166/src/server/tools/nxdbmgr/nxdbmgr.h" (23 Feb 2021, 3183 Bytes) of package /linux/misc/netxms-3.8.166.tar.gz:
As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style:
standard) with prefixed line numbers and
code folding option.
Alternatively you can here
view or
download the uninterpreted source code file.
For more information about "nxdbmgr.h" see the
Fossies "Dox" file reference documentation.
1 /*
2 ** nxdbmgr - NetXMS database manager
3 ** Copyright (C) 2004-2019 Victor Kirhenshtein
4 **
5 ** This program is free software; you can redistribute it and/or modify
6 ** it under the terms of the GNU General Public License as published by
7 ** the Free Software Foundation; either version 2 of the License, or
8 ** (at your option) any later version.
9 **
10 ** This program is distributed in the hope that it will be useful,
11 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
12 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 ** GNU General Public License for more details.
14 **
15 ** You should have received a copy of the GNU General Public License
16 ** along with this program; if not, write to the Free Software
17 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18 **
19 ** File: nxdbmgr.h
20 **
21 **/
22
23 #ifndef _nxdbmgr_h_
24 #define _nxdbmgr_h_
25
26 #include <nms_common.h>
27 #include <nms_util.h>
28 #include <uuid.h>
29 #include <nxsrvapi.h>
30 #include <nxdbapi.h>
31 #include <netxmsdb.h>
32 #include <nxdbmgr_tools.h>
33
34 /**
35 * Column identifier (table.column)
36 */
37 struct COLUMN_IDENTIFIER
38 {
39 const TCHAR *table;
40 const char *column;
41 };
42
43 //
44 // Functions
45 //
46
47 DB_HANDLE ConnectToDatabase();
48 void CheckDatabase();
49 void InitDatabase(const char *pszInitFile);
50 bool ClearDatabase(bool preMigration);
51 void ExportDatabase(char *file, const StringList& excludedTables, const StringList& includedTables);
52 void ImportDatabase(const char *file, const StringList& excludedTables, const StringList& includedTables);
53 void MigrateDatabase(const TCHAR *sourceConfig, TCHAR *destConfFields, const StringList& excludedTables, const StringList& includedTables);
54 void UpgradeDatabase();
55 void UnlockDatabase();
56 void ReindexIData();
57
58 bool ExecSQLBatch(const char *pszFile, bool showOutput);
59 bool ValidateDatabase();
60
61 bool SetMajorSchemaVersion(INT32 nextMajor, INT32 nextMinor);
62 bool SetMinorSchemaVersion(INT32 nextMinor);
63 INT32 GetSchemaLevelForMajorVersion(INT32 major);
64 bool SetSchemaLevelForMajorVersion(INT32 major, INT32 level);
65
66 void RegisterOnlineUpgrade(int major, int minor);
67 void UnregisterOnlineUpgrade(int major, int minor);
68 bool IsOnlineUpgradePending();
69 void RunPendingOnlineUpgrades();
70
71 IntegerArray<uint32_t> *GetDataCollectionTargets();
72 bool IsDataTableExist(const TCHAR *format, UINT32 id);
73
74 BOOL CreateIDataTable(DWORD nodeId);
75 BOOL CreateTDataTable(DWORD nodeId);
76 BOOL CreateTDataTable_preV281(DWORD nodeId);
77
78 void ResetSystemAccount();
79
80 bool LoadServerModules(TCHAR *moduleLoadList);
81 bool EnumerateModuleTables(bool (*handler)(const TCHAR *, void *), void *userData);
82 bool EnumerateModuleSchemas(bool (*handler)(const TCHAR *, void *), void *userData);
83 bool UpgradeModuleSchemas();
84 bool CheckModuleSchemas();
85
86 bool IsColumnIntegerFixNeeded(const TCHAR *table, const char *name);
87 bool IsTimestampColumn(const TCHAR *table, const char *name);
88
89 bool LoadDataCollectionObjects();
90 const TCHAR *GetDCObjectStorageClass(uint32_t id);
91
92 /**
93 * Global variables
94 */
95 extern bool g_isGuiMode;
96 extern bool g_checkData;
97 extern bool g_checkDataTablesOnly;
98 extern bool g_dataOnlyMigration;
99 extern bool g_skipDataMigration;
100 extern bool g_skipDataSchemaMigration;
101 extern int g_migrationTxnSize;
102
103 #endif