概述

EnterpriseDB是全球唯一一家提供基于PostgreSQL企业级产品与服务的厂商
EnterpriseDB是PostgreSQL的一个分支,在PostgreSQL基础上,针对企业级应用进行了专门的优化,同时,增加了一系列如动态 性能调优(DynaTune)、EDB Loader、高效批量SQL处理等高级特性;在众多功能亮点中,EnterpriseDB的兼容性技术尤为惹眼,可以兼容oracle的数据库,目前,IBM 的DB2的数据库直接用EnterpriseDB的兼容包。

下载

EDB官网 www.enterprisedb.com
下载需要申请账号密码
本来是想选择最新的PG11,但是系统版本只是支持Windows,这里我们选择的是10.5,可以安装在Linux 64位系统上。

安装

将安装包上传

将安装包上传到已经准备好的系统上,并赋予执行权限

  1. [root@stephen opt]# chmod +x edb-as10-server-10.5.12-1-linux-x64.run

执行run安装文件

  1. [root@stephen opt]# ./edb-as10-server-10.5.12-1-linux-x64.run
  2. ----------------------------------------------------------------------------
  3. Welcome to the EDB Postgres Advanced Server Setup Wizard.
  4. ----------------------------------------------------------------------------
  5. Please read the following License Agreement. You must accept the terms of this
  6. agreement before continuing with the installation.
  7. Press [Enter] to continue:
  8. Limited Use Software License Agreement
  9. Version 2.9
  10. ............................................(忽略这些声明)
  11. Press [Enter] to continue:
  12. Do you accept this license? [y/n]: y
  13. ----------------------------------------------------------------------------
  14. Please specify the directory where EDB Postgres Advanced Server will be
  15. installed.
  16. Installation Directory [/opt/edb/as10]: /opt/edb/as10
  17. # 选择要安装到的路径,全路径,如例
  18. ----------------------------------------------------------------------------
  19. Select the components you want to install; clear the components you do not want
  20. to install. Click Next when you are ready to continue.
  21. # 手动选择一些需要安装的东西,这里我随便选了几样,可以根据需要选择安装
  22. EDB Postgres Advanced Server [Y/n] :y
  23. pgAdmin 4 [Y/n] :y
  24. StackBuilder Plus [Y/n] :n
  25. Command Line Tools [Y/n] :y
  26. Is the selection above correct? [Y/n]: y
  27. ----------------------------------------------------------------------------
  28. Additional Directories
  29. Please select a directory under which to store your data.
  30. Data Directory [/opt/edb/as10/data]: /sas_pgdata
  31. Please select a directory under which to store your Write-Ahead Logs.
  32. Write-Ahead Log (WAL) Directory [/opt/edb/as10/data/pg_wal]: /opt/edb/as10/data/pg_wal
  33. # 这里是选择wal放的地方,理论上来说最好是将这个放在pgdata的位置,也就是数据目录里,我安装的时候没太注意,不过影响也不大,各位在安装的时候推荐放在数据目录下
  34. ----------------------------------------------------------------------------
  35. Advanced Server Dialect
  36. EDB Postgres Advanced Server can be configured in one of two "Dialects" - 1) Compatible with Oracle or 2) Compatible with Postgres.
  37. If you select Compatible with Oracle, Advanced Server will be configured with appropriate data type conversions, time and date formats, Oracle-styled operators, dictionary views and more. This makes it easier to migrate or write new applications that are more compatible with the Oracle database.
  38. If you select Compatible with Postgres, Advanced Server will be configured with standard PostgeSQL data types, time/date formats and operators.
  39. Advanced Server Dialect
  40. [1] Compatible with Oracle
  41. [2] Compatible with Postgres
  42. Please choose an option [1] : 2
  43. #这里是选择高级服务器可以配置两种方言(Dialects),我更熟悉PG一点,所以选择2
  44. ----------------------------------------------------------------------------
  45. Please provide a password for the database superuser (postgres). A locked Unix
  46. user account (postgres) will be created if not present.
  47. #给postgres超级用户一个密码
  48. Password :
  49. Retype Password :
  50. ----------------------------------------------------------------------------
  51. Additional Configuration
  52. Please select the port number the server should listen on.
  53. Port [5432]: 5444
  54. # 因为安装的系统还有一个postgres数据库,选择换一个端口进行安装
  55. Select the locale to be used by the new database cluster.
  56. Locale
  57. Please choose an option [1] :
  58. Would you like to install sample tables and procedures?
  59. Install sample tables and procedures. [Y/n]: y
  60. ----------------------------------------------------------------------------
  61. Dynatune Dynamic Tuning:
  62. Server Utilization
  63. Please select the type of server to determine the amount of system resources
  64. that may be utilized:
  65. #请选择服务器类型以确定系统资源的数量
  66. #[1]开发(例如开发人员的笔记本电脑)
  67. #[2]通用(例如web或应用服务器)
  68. #[3]专用的(只运行高级服务器的服务器)
  69. #这里我们只是安装测试,所以就选择1
  70. [1] Development (e.g. a developer's laptop)
  71. [2] General Purpose (e.g. a web or application server)
  72. [3] Dedicated (a server running only Advanced Server)
  73. Please choose an option [2] : 1
  74. ----------------------------------------------------------------------------
  75. Dynatune Dynamic Tuning:
  76. Workload Profile
  77. Please select the type of workload this server will be used for:
  78. #选择工作概要
  79. #[1]事务处理(OLTP系统)
  80. #[2]通用(OLTP和报告工作负载)
  81. #[3]报告(复杂查询或OLAP工作负载)
  82. #选择安装数据库用来做工作的类型,我这里这里选择2
  83. [1] Transaction Processing (OLTP systems)
  84. [2] General Purpose (OLTP and reporting workloads)
  85. [3] Reporting (Complex queries or OLAP workloads)
  86. Please choose an option [1] : 2
  87. ----------------------------------------------------------------------------
  88. Pre Installation Summary
  89. The following settings will be used for the installation::
  90. Installation Directory: /opt/edb/as10
  91. Server Installation Directory: /opt/edb/as10
  92. Data Directory: /sas_pgdata
  93. WAL Directory: /opt/edb/as10/data/pg_wal
  94. Database Port: 5432
  95. Database Superuser: postgres
  96. Operating System Account: postgres
  97. Database Service: edb-as-10
  98. Command Line Tools Installation Directory: /opt/edb/as10
  99. pgAdmin4 Installation Directory: /opt/edb/as10/pgAdmin4
  100. Press [Enter] to continue:
  101. #确认安装信息
  102. ----------------------------------------------------------------------------
  103. Setup is now ready to begin installing EDB Postgres Advanced Server on your
  104. computer.
  105. Do you want to continue? [Y/n]: y
  106. ----------------------------------------------------------------------------
  107. Please wait while Setup installs EDB Postgres Advanced Server on your computer.
  108. Installing EDB Postgres Advanced Server
  109. 0% ______________ 50% ______________ 100%
  110. #########################################
  111. ----------------------------------------------------------------------------
  112. Setup has finished installing EDB Postgres Advanced Server on your computer.
  113. #安装完毕

配置环境

新建用户edb

为了方便使用和管理,我们新建edb用户来使用edb。

  1. useradd -U edb

然后将安装好的安装目录和数据目录赋予用户权限

  1. chown -R edb:edb /opt/edb/
  2. chown -R edb:edb /sas_pgdata

配置环境变量

将新建的环境变量加到.bash_profile中

  1. export PATH=/opt/edb/as10/bin:$PATH
  2. export LD_LIBRARY_PATH=/opt/edb/as10/lib:$LD_LIBRARY_PATH
  3. export PGDATA=/sas_pgdata
  4. export PGHOST=/tmp

启动edb数据库

启动数据库

  1. [edb@stephen ~]$ pg_ctl start
  2. waiting for server to start....2018-12-03 11:01:01 CST LOG: listening on IPv4 address "0.0.0.0", port 5444
  3. 2018-12-03 11:01:01 CST LOG: listening on IPv6 address "::", port 5444
  4. 2018-12-03 11:01:01 CST LOG: listening on Unix socket "/tmp/.s.PGSQL.5444"
  5. 2018-12-03 11:01:01 CST LOG: redirecting log output to logging collector process
  6. 2018-12-03 11:01:01 CST HINT: Future log output will appear in directory "log".
  7. done
  8. server started

查看数据库是否正常

  1. [edb@stephen ~]$ psql -Upostgres
  2. Password for user postgres:
  3. psql.bin (10.5.12)
  4. Type "help" for help.
  5. postgres=#
  6. postgres=# \d
  7. List of relations
  8. Schema | Name | Type | Owner
  9. --------+------------+----------+----------
  10. public | dept | table | postgres
  11. public | emp | table | postgres
  12. public | jobhist | table | postgres
  13. public | next_empno | sequence | postgres
  14. public | salesemp | view | postgres
  15. (5 rows)
  16. postgres=# \l
  17. List of databases
  18. Name | Owner | Encoding | Collate | Ctype | ICU | Access privileges
  19. -----------+----------+----------+-------------+-------------+-----+-----------------------
  20. postgres | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 | |
  21. template0 | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 | | =c/postgres +
  22. | | | | | | postgres=CTc/postgres
  23. template1 | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 | | =c/postgres +
  24. | | | | | | postgres=CTc/postgres
  25. (3 rows)
  26. postgres=# \q

查看数据库后台进程是否正常

  1. [edb@stephen ~]$ ps -ef|grep edb
  2. postgres 3668 1 0 10:45 ? 00:00:00 /opt/edb/as10/bin/edb-postgres -D /sas_pgdata
  3. root 4007 2079 0 10:57 pts/1 00:00:00 su - edb
  4. edb 4008 4007 0 10:57 pts/1 00:00:00 -bash
  5. edb 4112 1 0 11:01 pts/1 00:00:00 /opt/edb/as10/bin/edb-postgres
  6. edb 4113 4112 0 11:01 ? 00:00:00 postgres: logger process
  7. edb 4129 4112 0 11:01 ? 00:00:00 postgres: checkpointer process
  8. edb 4130 4112 0 11:01 ? 00:00:00 postgres: writer process
  9. edb 4131 4112 0 11:01 ? 00:00:00 postgres: wal writer process
  10. edb 4132 4112 0 11:01 ? 00:00:00 postgres: autovacuum launcher process
  11. edb 4133 4112 0 11:01 ? 00:00:00 postgres: stats collector process
  12. edb 4134 4112 0 11:01 ? 00:00:00 postgres: bgworker: dbms_aq launcher
  13. edb 4135 4112 0 11:01 ? 00:00:00 postgres: bgworker: logical replication launcher
  14. edb 4165 4008 0 11:02 pts/1 00:00:00 ps -ef
  15. edb 4166 4008 0 11:02 pts/1 00:00:00 grep --color=auto edb
本站文章,未经作者同意,请勿转载,如需转载,请邮件customer@csudata.com.
0 评论  
添加一条新评论