[pg91@db1 pg91_9.4]$ /opt/pgsql_9.4.1/bin/pg_upgrade -c --link -b /opt/pgsql_9.1.14/bin -B /opt/pgsql_9.4.1/bin -d /database/pg91/pg_root -D /database/pg91_9.4/pg_root *failure* Consult the last few lines of "pg_upgrade_server.log"for the probable cause of the failure. Performing Consistency Checks on Old Live Server ------------------------------------------------ Checking cluster versions ok Checking database user is a superuser ok Checking for prepared transactions ok Checking for reg* system OID user data types ok Checking for contrib/isn with bigint-passing mismatch ok Checking for invalid "line" user columns ok Checking for presence of required libraries fatal Your installation references loadable libraries that are missing from the new installation. You can add these libraries to the new installation, orremove the functions using them from the old installation. A list of problem libraries is in the file: loadable_libraries.txt Failure, exiting
[pg91@db1 pg91_9.4]$ cat loadable_libraries.txt Could not loadlibrary"$libdir/pg_tokenize" ERROR:could notaccessfile"$libdir/pg_tokenize": No such fileordirectory
[root@db1 pg_tokenize]#exportPGHOME=/opt/pgsql_9.4.1 [root@db1 pg_tokenize]#exportPATH=$PGHOME/bin:$PATH:. [root@db1 pg_tokenize]#exportLD_LIBRARY_PATH=$PGHOME/lib:/lib64:/usr/lib64:/usr/local/lib64:/lib:/usr/lib:/usr/local/lib [root@db1 pg_tokenize]# make [root@db1 pg_tokenize]# make install
再次编译通过
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
[pg91@db1 ~]$ /opt/pgsql_9.4.1/bin/pg_upgrade -c --link -b /opt/pgsql_9.1.14/bin -B /opt/pgsql_9.4.1/bin -d /database/pg91/pg_root -D /database/pg91_9.4/pg_root *failure* Consult the last few lines of "pg_upgrade_server.log"for the probable cause of the failure. Performing Consistency Checks on Old Live Server ------------------------------------------------ Checking cluster versions ok Checking database user is a superuser ok Checking for prepared transactions ok Checking for reg* system OID user data types ok Checking for contrib/isn with bigint-passing mismatch ok Checking for invalid "line" user columns ok Checking for presence of required libraries ok Checking database user is a superuser ok Checking for prepared transactions ok *Clusters are compatible*
[pg91@db1 ~]$ /opt/pgsql_9.4.1/bin/pg_upgrade --link -b /opt/pgsql_9.1.14/bin -B /opt/pgsql_9.4.1/bin -d /database/pg91/pg_root -D /database/pg91_9.4/pg_root Performing Consistency Checks ----------------------------- Checking cluster versions ok Checking database user is a superuser ok Checking for prepared transactions ok Checking for reg* system OID user data types ok Checking for contrib/isn with bigint-passing mismatch ok Checking for invalid "line" user columns ok Creating dump ofglobal objects ok Creating dump of database schemas ok Checking for presence of required libraries ok Checking database user is a superuser ok Checking for prepared transactions ok If pg_upgrade fails after this point, you must re-initdb the new cluster before continuing. Performing Upgrade ------------------ Analyzing all rows in the new cluster ok Freezing all rows on the new cluster ok Deleting files fromnew pg_clog ok Copying old pg_clog tonew server ok Setting next transaction ID and epoch fornew cluster ok Deleting files fromnew pg_multixact/offsets ok Setting oldest multixact ID onnew cluster ok Resetting WAL archives ok Setting frozenxid and minmxid counters innew cluster ok Restoring global objects in the new cluster ok Adding support functions tonew cluster ok Restoring database schemas in the new cluster ok Setting minmxid counter innew cluster ok Creating newly-required TOAST tables ok Removing support functions fromnew cluster ok Adding ".old" suffix to old global/pg_control ok If you want to start the old cluster, you will need to remove the ".old" suffix from /database/pg91/pg_root/global/pg_control.old. Because "link" mode was used, the old cluster cannot be safely started once the new cluster has been started. Linking user relation files ok Setting next OID fornew cluster ok Sync data directory to disk ok Creating script to analyze new cluster ok Creating script todelete old cluster ok Upgrade Complete ---------------- Optimizer statistics are not transferred by pg_upgrade so, once you start the new server, consider running: analyze_new_cluster.sh Running this script will delete the old cluster's data files: delete_old_cluster.sh