Browse Source

Merge branch 'master' of 47.103.61.198:darren/DDWiki

master
qdjjx 5 years ago
parent
commit
bc64870058

实践/后端/项目/工厂模式.md → 实践/后端/项目/12.工厂模式.md View File


实践/后端/项目/时序数据库.md → 实践/后端/项目/13.时序数据库.md View File


实践/后端/项目/InfluxDB操作.md → 实践/后端/项目/14.InfluxDB操作.md View File

@@ -97,3 +97,51 @@ time           ip          value
97 97
   创建了表temperature,machine为tag-key,type和external为field-key
98 98
   ```
99 99
 
100
+**删除数据库**
101
+```
102
+DROP DATABASE <database_name>
103
+```
104
+**从索引中删除序列**
105
+```
106
+从单个测量中删除所有系列:
107
+DROP SERIES FROM "h2o_feet"
108
+从单个测量中删除具有特定标记对的系列:
109
+DROP SERIES FROM "h2o_feet" WHERE "location" = 'santa_monica'
110
+从数据库中的所有度量中删除系列中具有特定标记对的所有点:
111
+ DROP SERIES WHERE "location" = 'santa_monica'
112
+ 成功的DROP SERIES查询返回空结果。
113
+```
114
+**使用Delete删除系列**
115
+```
116
+删除与测量相关的所有数据h2o_feet:
117
+DELETE FROM "h2o_feet"
118
+删除与测量相关的所有数据h2o_quality以及标记randtag等于的位置3:
119
+DELETE FROM "h2o_quality" WHERE "randtag" = '3'
120
+删除2016年1月1日之前发生的数据库中的所有数据:
121
+DELETE WHERE time < '2016-01-01'
122
+```
123
+**使用Drop measurement 删除测量值**
124
+```
125
+DROP MEASUREMENT <measurement_name>
126
+```
127
+**创建保留策略**
128
+```
129
+CREATE RETENTION POLICY "one_day_only" ON "NOAA_water_database" DURATION 23h60m REPLICATION 1 DEFAULT
130
+
131
+```
132
+**修改保留策略**
133
+``` 
134
+创建策略
135
+CREATE RETENTION POLICY "what_is_time" ON "NOAA_water_database" DURATION 2d REPLICATION 1
136
+
137
+修改策略
138
+ALTER RETENTION POLICY "what_is_time" ON "NOAA_water_database" DURATION 3w SHARD DURATION 2h DEFAULT
139
+
140
+```
141
+**删除保留策略**
142
+```
143
+DROP RETENTION POLICY <retention_policy_name> ON <database_name>
144
+
145
+删除保留策略what_is_time的NOAA_water_database数据库:
146
+DROP RETENTION POLICY "what_is_time" ON "NOAA_water_database"
147
+```

Loading…
Cancel
Save