Changes between Version 4 and Version 5 of Ticket #84, comment 3


Ignore:
Timestamp:
May 28, 2018 7:55:11 AM (7 years ago)
Author:
cedric
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #84, comment 3

    v4 v5  
    9696}}} 
    9797 
     98The first trials didn't work. I'll have to split my databases in several components. 
     99Size of databases 
    98100 
     101{{{ 
     102SELECT d.datname AS Name,  pg_catalog.pg_get_userbyid(d.datdba) AS Owner, 
     103    CASE WHEN pg_catalog.has_database_privilege(d.datname, 'CONNECT') 
     104        THEN pg_catalog.pg_size_pretty(pg_catalog.pg_database_size(d.datname)) 
     105        ELSE 'No Access' 
     106    END AS SIZE 
     107FROM pg_catalog.pg_database d 
     108    ORDER BY 
     109    CASE WHEN pg_catalog.has_database_privilege(d.datname, 'CONNECT') 
     110        THEN pg_catalog.pg_database_size(d.datname) 
     111        ELSE NULL 
     112    END DESC -- nulls first 
     113    LIMIT 20 
     114}}} 
     115 
     116| table_name | size | 
     117| eda2|10 GB| 
     118|eda2.1|3305 MB| 
     119 
     120 
     121---------------------- 
     122= CREATE database EDA2.0 on the new postgres 9.6 server = 
     123   
     124{{{   
     125createdb -U postgres -h 1.100.1.6 eda2.0 
     126psql -d eda2.0 -h 1.100.1.6 -p 5434 --c "CREATE EXTENSION postgis;" 
     127psql -d eda2.0 -h 1.100.1.6 -p 5434 -c "CREATE EXTENSION postgis_topology;" 
     128}}} 
     129>>If you plan to restore an old backup from prior versions in this new db, run: 
     130>> psql -d [yourdatabase] -f legacy.sql 
     131>>You can later run uninstall_legacy.sql to get rid of the deprecated functions after you are done with restoring and cleanup. 
     132> Let's see if that works before 
     133 
     134The .bat file, change schema and backupfile 
     135{{{ 
     136set PGPORT=5432 
     137set PGHOST=1.100.1.6 
     138set PGUSER=postgres 
     139set PGPASSWORD=supersecret 
     140set THEDBSOURCE=eda2 
     141set THEDEBDESTINATION=eda2.0 
     142set PGHOST=1.100.1.6 
     143set BACKUPFILE=anglian.backup 
     144set SCHEMA = anglian 
     145set PGINSTALL=C:\Program Files\PostgreSQL\9.6 
     146set PATH=%PATH%;"%PGINSTALL%\bin" 
     147pg_dump --schema %SCHEMA% --file %BACKUPFILE% --verbose -Fc -b %THEDBSOURCE%  
     148set PGPORT=5434 
     149perl "%PGINSTALL%\utils\postgis_restore.pl" "%BACKUPFILE%" | psql %THEDB% 2> errors.txt 
     150}}} 
     151 
     152 
     153 
     154list schema 
     155{{{#!sh 
     156psql -U postgres -h w3.eptb-vilaine.fr eda2 
     157eda2=# \dn 
     158}}} 
     159 
     160anglian             
     161 bd_map              
     162 belge               
     163 ccm21               
     164 clc                 
     165 dbeel               
     166 dbeel_nomenclature  
     167 dmeer2003           
     168 ecoregion2003       
     169 europe              
     170 european_wise2008   
     171 france              
     172 geobs2010           
     173 ia                  
     174 ireland             
     175 onema               
     176 oria                
     177 public              
     178 temperature         
     179 tidal               
     180 uga2010             
     181 uk                  
     182 vilaine             
     183 wrbd