1 Star 2 Fork 0

zhangbo / 气象数据处理

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
databasescript 5.93 KB
一键复制 编辑 原始数据 按行查看 历史
zhangbo 提交于 2022-01-02 22:20 . 代码提交
sudo gedit /etc/postgresql/9.5/main/postgresql.conf
将 #listen_addresses = 'localhost' 的注释去掉并改为 listen_addresses = '*'
sudo gedit /etc/postgresql/9.5/main/pg_hba.conf
在文件末尾添加: host all all 0.0.0.0 0.0.0.0 md5 ,表示允许任何IP连接
sudo /etc/init.d/postgresql restart
create user goldwind password 'Dbadmin123';
create database newras owner goldwind;
create database littler owner goldwind;
INSERT INTO "datakeeper_datasetmold" ("name","desc","note","schema","classname","tags","update_dt") VALUES ('wrf','wrf','wrf','wrf','datasets.dataset_molds.FG_WRF_S3.fg_wrf.FG_WRF_Dataset','fg_wrf','2016-05-05');
GO
INSERT INTO "datakeeper_datasetmold" ("name","desc","note","schema","classname","tags","update_dt") VALUES ('merra','merra','merra','merra',' datasets.dataset_molds.FG_MERRA_S3.fg_merra.FG_Merra_Dataset','fg_merra','2016-05-05');
GO
INSERT INTO "depot_depot" ("name","path","fstype","reserved","max_size","free_size","create_dt","access_dt","modify_dt") VALUES ('depottest','s3://windres-datasets/','s3','1',1024000,1024,'2017-06-24 12:55:36','2017-06-24 12:55:36','2017-06-24 12:55:37');
INSERT INTO "datakeeper_dataset" ("name","desc","creator","version","priority","public","free","protect_data","mold_id","info_json","depot_id","custom_root_path","size","update_dt") VALUES ('gw-c9a3','gw-c9a3','zb','1',1,'1','1','1','wrf','{
"name":"gw-c9a3",
"WRF_version": "",
"levels": ["10", "70", "80", "100"],
"years": ["2016"],
"begdt": "2016-01-01 01",
"enddt": "2023-12-31 23",
"wps_namelist": "/home/zb/work/glyc/googlemap/namelist.wps",
"pt_format":"h5","pd_stat_format":"nc","pm_stat_format":"nc","py_stat_format":"nc",
"domain_info": {
"1": {"available": true,
"priority": 1,
"trim": 0,
"trim_bottom": 0,
"trim_left": 0,
"trim_right": 0,
"trim_top": 0},
"2": {"available": true,
"priority": 2,
"trim": 0,
"trim_bottom": 0,
"trim_left": 0,
"trim_right": 0,
"trim_top": 0},
"3": {"available": true,
"priority": 3,
"trim": 0,
"trim_bottom": 0,
"trim_left": 0,
"trim_right": 0,
"trim_top": 0},
"4": {"available": true,
"priority": 4,
"trim": 0,
"trim_bottom": 0,
"trim_left": 0,
"trim_right": 0,
"trim_top": 0},
"5": {"available": true,
"priority": 5,
"trim": 0,
"trim_bottom": 0,
"trim_left": 0,
"trim_right": 0,
"trim_top": 0},
"6": {"available": true,
"priority": 6,
"trim": 0,
"trim_bottom": 0,
"trim_left": 0,
"trim_right": 0,
"trim_top": 0},
"7": {"available": true,
"priority": 7,
"trim": 0,
"trim_bottom": 0,
"trim_left": 0,
"trim_right": 0,
"trim_top": 0}
}
}','depottest','/home/zb/work/glyc/googlemap/namelist.wps',10000000,'2017-06-24 12:56:50');
GO
CREATE OR REPLACE VIEW "public"."littler_point_round" AS
SELECT round(littler_littlepoint.latitude) AS latitude,
round(littler_littlepoint.longitude) AS longitude,
avg(littler_littlepoint.elevation) AS elevation
FROM littler_littlepoint
GROUP BY round(littler_littlepoint.latitude), round(littler_littlepoint.longitude);
CREATE OR REPLACE VIEW "public"."littler_point_round_minus025" AS
SELECT (round((littler_littlepoint.latitude / (5)::double precision)) * (5)::double precision) AS latitude,
(round((littler_littlepoint.longitude / (5)::double precision)) * (5)::double precision) AS longitude,
avg(littler_littlepoint.elevation) AS elevation
FROM littler_littlepoint
GROUP BY (round((littler_littlepoint.latitude / (5)::double precision)) * (5)::double precision), (round((littler_littlepoint.longitude / (5)::double precision)) * (5)::double precision);
CREATE OR REPLACE VIEW "public"."littler_point_round_minus1" AS
SELECT round((littler_littlepoint.latitude)::numeric, (-1)) AS latitude,
round((littler_littlepoint.longitude)::numeric, (-1)) AS longitude,
avg(littler_littlepoint.elevation) AS elevation
FROM littler_littlepoint
GROUP BY round((littler_littlepoint.latitude)::numeric, (-1)), round((littler_littlepoint.longitude)::numeric, (-1));
pg_dump -h 10.1.248.100 -p 5432 -U goldwind newras > /home/zb/20170830backup_file 备份
psql -h 10.1.248.100 -U goldwind -d newras < 20170830backup_file 恢复
1
https://gitee.com/zhangbosss/meteorological-data-processing.git
git@gitee.com:zhangbosss/meteorological-data-processing.git
zhangbosss
meteorological-data-processing
气象数据处理
master

搜索帮助