日本語版マニュアル
In the following descriptions, a term refers to any word or group of words that are language keywords, user-supplied values, literals, etc. A term’s exact meaning depends upon the context in which it is used.
Italic font introduces a new term, typically in the sentence that defines it for the first time.
Fixed-width (mono-spaced) font is used for terms that must be given literally such as SQL commands, specific table and column names used in the examples, programming language keywords, etc. For example, SELECT * FROM emp;
Italic fixed-width font is used for terms for which the user must substitute values in actual usage. For example, DELETE FROM table_name;
Square brackets [ ] denote that one or none of the enclosed terms may be substituted. For example, [ a | b ] means choose one of “a” or “b” or neither of the two.
Braces {} denote that exactly one of the enclosed alternatives must be specified. For example, { a | b } means exactly one of “a” or “b” must be specified.
Ellipses ... denote that the preceding term may be repeated. For example, [ a | b ] ... means that you may have the sequence, “b a a b a”.
Note: The data directory of a production database should not be stored on an NFS file system.
You can use yum to install the epel-release package:
Please note that you may need to enable the [extras] repository definition in the CentOS-Base.repo file (located in /etc/yum.repos.d).
If yum cannot access a repository that contains epel-release, you will get an error message:
If you receive this error, you can download the EPEL rpm package, and install it manually. To manually install EPEL, download the rpm package, assume superuser privileges, navigate into the directory that contains the package, and install EPEL with the command:
You must install xterm, konsole, or gnome-terminal before executing any console-based program installed by EnterpriseDB installers.
Installing the server package creates a database superuser named enterprisedb. The user is assigned a user ID (UID) and a group ID (GID) of 26. The user has no default password; use the passwd command to assign a password for the user. The default shell for the user is bash, and the user's home directory is /var/lib/edb/as11.
By default, Advanced Server logging is configured to write files to the log subdirectory of the data directory, rotating the files each day and retaining one week of log entries. You can customize the logging behavior of the server by modifying the postgresql.conf file; for more information about modifying the postgresql.conf file, please see Section 6.2.
The repository configuration file is named edb.repo. The file resides in /etc/yum.repos.d.
After creating the edb.repo file, use your choice of editor to ensure that the value of the enabled parameter is 1, and replace the username and password placeholders in the baseurl specification with the name and password of a registered EnterpriseDB user.
baseurl=https://<username>:<password>@yum.enterprisedb.com/edb/redhat/rhel-$releasever-$basearch
After saving your changes to the configuration file, you can use yum install command to install Advanced Server. For example, to install the server and its core components, use the command:
You can also use the yum search command to access a list of the packages that are currently available from your configured repository. Open a command line, assume superuser privileges, and enter:
yum search package
Where package is the search term that specifies the name (or partial name) of a package. The repository search will return a list of available packages that include the specified search term.
The edb-as11-server-client package contains client programs and utilities that you can use to access and manage Advanced Server.
The edb-as11-contrib package installs contributed tools and utilities that are distributed with Advanced Server. Files for these modules are installed in:
Documentation: /usr/edb/as11/share/doc
Loadable modules: /usr/edb/as11/lib
Binaries: /usr/edb/as11/bin
The edb-as11-server-core package includes the programs needed to create the core functionality behind the Advanced Server database.
The edb-as11-server-devel package contains the header files and libraries needed to compile C or C++ applications that directly interact with an Advanced Server server and the ecpg or ecpgPlus C preprocessor.
The edb-as11-server-docs package installs the readme file.
The edb-as11-server-libs package provides the essential shared libraries for any Advanced Server client program or interface.
The edb-as11-server-plperl package installs the PL/Perl procedural language for Advanced Server. Please note that the edb-as11-server-plperl package is dependent on the platform-supplied version of Perl.
The edb-as11-server-plpython package installs the PL/Python procedural language for Advanced Server. Please note that the edb-as11-server-plpython package is dependent on the platform-supplied version of Python.
The edb-as11-pltcl package installs the PL/Tcl procedural language for Advanced Server. Please note that the edb-as11-pltcl package is dependent on the platform-supplied version of TCL.
The edb-edbplus package contains the files required to install the EDB*Plus command line client. EDB*Plus commands are compatible with Oracle's SQL*Plus.
The edb-jdbc package includes the .jar files needed for Java programs to access an Advanced Server database.
The edb-migrationtoolkit package installs Migration Toolkit, facilitating migration to an Advanced Server database from Oracle, PostgreSQL, MySQL, Sybase and SQL Server.
The edb-oci package installs the EnterpriseDB Open Client library, allowing applications that use the Oracle Call Interface API to connect to an Advanced Server database.
The edb-pem package installs Management Tool that efficiently manages, monitor, and tune large Postgres deployments from a single remote GUI console.
yum will update the edb.repo file to enable access to the current EDB repository, configured to connect with the credentials specified in your edb.repo file. Then, you can use yum to upgrade all packages whose names include the expression edb:
Please note that the yum upgrade command will only perform an update between minor releases; to update between major releases, you must use pg_upgrade.
Each command creates a repository configuration file in the /etc/zypp/repos.d directory. The files are named:
After creating the repository configuration files, use the zypper refresh command to refresh the metadata on your SLES host to include the EnterpriseDB repositories.
When prompted for a User Name and Password, provide your connection credentials for the EnterpriseDB repository. If you need credentials, contact EnterpriseDB at:
zypper refresh
zypper install edb-pem-server
sh -c 'echo "deb https://username:password@apt.enterprisedb.com/$(lsb_release -cs)-edb/ $(lsb_release -cs) main" > /etc/apt/sources.list.d/edb-$(lsb_release -cs).list'
wget -q -O - https://username:password @apt.enterprisedb.com/edb-deb.gpg.key | apt-key add -
You can also use the apt list command to access a list of the packages that are currently available from your configured repository. Open a command line, assume superuser privileges, and enter:
The edb-as11-server-client package contains client programs and utilities that you can use to access and manage Advanced Server.
The edb-as11-server-core package includes the programs needed to create the core functionality behind the Advanced Server database.
The edb-as11-server-dev package contains the header files and libraries needed to compile C or C++ applications that directly interact with an Advanced Server server and the ecpg or ecpgPlus C preprocessor.
The edb-as11-server-docs package installs the readme file.
The edb-as11-server-plpython package installs the PL/Python procedural language for Advanced Server. Please note that the edb-as11-server-plpython package is dependent on the platform-supplied version of Python.
The edb-as11-pltcl package installs the PL/Tcl procedural language for Advanced Server. Please note that the edb-as11-pltcl package is dependent on the platform-supplied version of TCL.
The edb-edbplus package contains the files required to install the EDB*Plus command line client. EDB*Plus commands are compatible with Oracle's SQL*Plus.
The edb-jdbc package includes the .jar files needed for Java programs to access an Advanced Server database.
The edb-migrationtoolkit package installs Migration Toolkit, facilitating migration to an Advanced Server database from Oracle, PostgreSQL, MySQL, Sybase and SQL Server.
The PostgreSQL initdb command creates a database cluster. After installing Advanced Server, you must manually configure the service and invoke initdb to create your cluster. When invoking initdb, you can:
Include the service command on RHEL or CentOS 6.x, and use a service configuration file to configure the environment.
Include the systemd service manager on RHEL or CentOS 7.x use a service configuration file to configure the environment.
To review the initdb documentation, visit:
To create a database cluster in the PGDATA directory that listens on the port specified by the PGPORT environment variable specified in the service configuration file (described in Section 4.4.2), assume root privileges, and invoke the service script:
You can also assign a locale to the cluster when invoking initdb. By default, initdb will use the value specified by the $LANG operating system variable, but if you append a preferred locale when invoking the script, the cluster will use the alternate value. For example, to create a database cluster that uses simplified Chinese, invoke the command:
To invoke initdb on a RHEL or CentOS 7.x system, with the options specified in the service configuration file, assume the identity of the operating system superuser:
To initialize a cluster with the non-default values, you can use the PGSETUP_INITDB_OPTIONS environment variable by invoking the edb-as-11-setup cluster initialization script that resides under EPAS_Home/bin.
To invoke initdb export the PGSETUP_INITDB_OPTIONS environment variable with the following command:
After creating the cluster, use systemctl to start, stop, or restart the service:
Note: The data directory is created under /var/lib/edb-as/11/main2 and configuration directory is created under /etc/edb-as/11/main/.
On a CentOS or RedHat version 6.x host, the RPM installer creates a service configuration file named edb-as-11.sysconfig in /etc/sysconfig/edb/as11 (see Figure 4.1). Please note that options specified in the service configuration file are only enforced if initdb is invoked via the service command; if you manually invoke initdb (at the command line), you must specify the other options (such as the location of the data directory and installation mode) on the command line.
C:\Users\susan\Desktop\one.png
PGENGINE specifies the location of the engine and utility executable files.
PGPORT specifies the listener port for the database server.
PGDATA specifies the path to the data directory.
PGLOG specifies the location of the log file to which the server writes startup information.
Use INITDBOPTS to specify any initdb option or options that you wish to apply to the new cluster. For more information, see Section 4.4.2.1.
You can modify the edb-as-11.sysconfig file before using the service command to invoke the startup script to change the listener port, data directory location, startup log location or installation mode. If you plan to create more than one instance on the same system, you may wish to copy the edb-as-11.sysconfig file (and the associated edb-as-11 startup script) and modify the file contents for each additional instance that resides on the same host.
You can use the INITDBOPTS variable to specify your cluster configuration preferences. By default, the INITDBOPTS variable is commented out in the service configuration file; unless modified, when you run the service startup script, the new cluster will be created in a mode compatible with Oracle databases. Clusters created in this mode will contain a database named edb, and have a database superuser named enterprisedb.
To create a new cluster in PostgreSQL mode, remove the pound sign (#) in front of the INITDBOPTS variable, enabling the "--no-redwood-compat" option. Clusters created in PostgreSQL mode will contain a database named postgres, and have a database superuser named postgres.
You may also specify multiple initdb options. For example, the following statement:
Creates a database cluster (without compatibility features for Oracle) that contains a database named postgres that is owned by a user named alice; the cluster uses UTF-8 encoding.
Include the --no-redwood-compat keywords to instruct the server to create the cluster in PostgreSQL mode. When the cluster is created in PostgreSQL mode, the name of the database superuser will be postgres, the name of the default database will be postgres, and Advanced Server’s features compatible with Oracle databases will not be available to the cluster.
Include the --redwood-like keywords to instruct the server to use an escape character (an empty string ('')) following the LIKE (or PostgreSQL-compatible ILIKE) operator in a SQL statement that is compatible with Oracle syntax.
Include the --icu-short-form keywords to create a cluster that uses a default ICU (International Components for Unicode) collation for all databases in the cluster. For more information about Unicode collations, please refer to the EDB Postgres Advanced Server Guide available at:
For more information about using initdb, and the available cluster configuration options, see the PostgreSQL Core Documentation available at:
You can also view online help for initdb by assuming superuser privileges and entering:
/path_to_initdb_installation_directory/initdb --help
Where path_to_initdb_installation_directory specifies the location of the initdb binary file.
On a CentOS or RedHat version 7.x host, the unit file is named edb-as-11.service and resides in /usr/lib/systemd/system. The unit file contains references to the location of the Advanced Server data directory. You should avoid making any modifications directly to the unit file because it may be overwritten during package upgrades.
By default, data files reside under /var/lib/edb/as11/data directory. To use a data directory that resides in a non-default location, create a copy of the unit file under the /etc directory:
After copying the unit file to the new location, modify the service file (/etc/systemd/system/edb-as-11.service) with your editor of choice, correcting any required paths.
Then, use the following command to reload systemd, updating the modified service scripts:
The edb-as11-server-core RPM contains a script that starts the Advanced Server instance. The script can be copied, allowing you to run multiple services, with unique data directories and that monitor different ports. You must have root access to invoke or modify the script.
1.
Create a hard link in /etc/rc.d/init.d (or equivalent location) to the edb-as-11 service (named secondary-edb-as-11):
2.
Create a file in /etc/sysconfig/edb/as11/ named secondary-edb-as-11. This file is where you would typically define PGDATA and PGOPTS. Since $PGDATA/postgresql.conf will override many of these settings (except PGDATA) you might notice unexpected results on startup.
3.
Create the target PGDATA directory.
4.
Assume the identity of the Advanced Server database superuser (enterprisedb) and invoke initdb on the target PGDATA. For information about using initdb, please see the PostgreSQL Core Documentation available at:
5.
Edit the postgresql.conf file to specify the port, address, TCP/IP settings, etc. for the secondary instance.
The edb-as11-server-core RPM for version 7.x contains a unit file that starts the Advanced Server instance. The file allows you to start multiple services, with unique data directories and that monitor different ports. You must have root access to invoke or modify the script.
1.
2.
Edit the file, changing PGDATA to point to the new data directory that you will create the cluster against.
3.
Create the target PGDATA with user enterprisedb.
4.
Run initdb, specifying the setup script:
5.
Edit the postgresql.conf file for the new instance, specifying the port, the IP address, TCP/IP settings, etc.
1.
Use yum to install the epel-release, yum-utils, and createrepo packages:
5.
Install your preferred webserver on the host that will act as your local repository, and ensure that the repository directory is accessible to the other servers on your network.
[edbas11]
name=EnterpriseDB Advanced Server 11
baseurl=https://yum.
your_domain.com/edbas11
enabled=1
gpgcheck=0
If you encounter difficulty displaying Java-based server features (controls or text not being displayed correctly, or blank windows), upgrading to the latest libxcb-xlib libraries should correct the problem on most distributions. Please visit the following link for other possible work-arounds:
If you encounter a similar message, you should confirm that the data directory is empty; the presence of files (including the system-generated lost+found folder) will prevent the installation from completing. Either remove the files from the data directory, or specify a different location for the data directory before re-invoking the installer to complete the installation.
If your installation of Advanced Server resides on version 7.x of RHEL and CentOS, you must use the systemctl command to control the Advanced Server service and supporting components.
The systemctl command must be in your search path and must be invoked with superuser privileges. To use the command, open a command line, and enter:
systemctl action service_name
action specifies the action taken by the service command. Specify:
start to start the service.
stop to stop the service.
restart to stop and then start the service.
status to discover the current status of the service.
service_name specifies the name of the service.
On version 6.x of RHEL or CentOS Linux, you can control a service at the command line with the service command. The service command can be used to manage an Advanced Server cluster, as well as the services of component software installed with Advanced Server.
Using the service command to change the status of a service allows the Linux service controller to keep track of the server status (the pg_ctl command does not alert the service controller to changes in the status of a server). The command must be in your search path and must be invoked with superuser privileges. Open a command line, and issue the command:
service service_name action
The Linux service command invokes a script (with the same name as the service) that resides in /etc/init.d. If your Linux distribution does not support the service command, you can call the script directly by entering:
/etc/init.d/service_name action
service_name specifies the name of the service.
action specifies the action taken by the service command. Specify:
start to start the service.
stop to stop the service.
condstop to stop the service without displaying a notice if the server is already stopped.
restart to stop and then start the service.
condrestart to restart the service without displaying a notice if the server is already stopped.
try-restart to restart the service without displaying a notice if the server is already stopped.
status to discover the current status of the service.
To know more about modifying the pg_hba.conf file, see Section 6.3.
You can use the pg_ctl utility to control an Advanced Server service from the command line on any platform. pg_ctl allows you to start, stop, or restart the Advanced Server database server, reload the configuration parameters, or display the status of a running server. To invoke the utility, assume the identity of the cluster owner, navigate into the home directory of Advanced Server, and issue the command:
./bin/pg_ctl -D data_directory action
data_directory is the location of the data controlled by the Advanced Server cluster.
action specifies the action taken by the pg_ctl utility. Specify:
start to start the service.
stop to stop the service.
restart to stop and then start the service.
reload sends the server a SIGHUP signal, reloading configuration parameters
status to discover the current status of the service.
For more information about using the pg_ctl utility, or the command line options available, please see the official PostgreSQL Core Documentation available at:
You can use the pg_ctl utility to manage the status of an Advanced Server cluster, but it is important to note that pg_ctl does not alert the operating system service controller to changes in the status of a server, so it is beneficial to use the service command whenever possible.
/sbin/chkconfig service_name on
Where service_name specifies the name of the service.
Configuration parameters in the postgresql.conf file specify server behavior with regards to auditing, authentication, encryption, and other behaviors. The postgresql.conf file resides in the data directory under your Advanced Server installation.
Parameters that are preceded by a pound sign (#) are set to their default value (as shown in the parameter setting). To change a parameter value, remove the pound sign and enter a new value. After setting or changing a parameter, you must either reload or restart the server for the new parameter value to take effect.
Within the postgresql.conf file, some parameters contain comments that indicate change requires restart (see Figure 6.1). To view a list of the parameters that require a server restart, execute the following query at the psql command line:
Appropriate authentication methods provide protection and security. Entries in the pg_hba.conf file specify the authentication method or methods that the server will use when authenticating connecting clients. Before connecting to the server, you may be required to modify the authentication properties specified in the pg_hba.conf file.
When you invoke the initdb utility to create a cluster, initdb creates a pg_hba.conf file for that cluster that specifies the type of authentication required from connecting clients.
To modify the pg_hba.conf file, open the file with your choice of editor. After modifying the authentication settings in the pg_hba.conf file, use the Linux command line to restart the server and apply the changes.
For more information about authentication, and modifying the pg_hba.conf file, see the PostgreSQL Core Documentation at:
psql is a command line client application that allows you to execute SQL commands and view the results. To open the psql client, the client must be in your search path. The executable resides in the bin directory, under your Advanced Server installation.
-d specifies the database to which psql will connect;
-U specifies the identity of the database user that will be used for the session.
Include the -e option when invoking the rpm command to remove an installed package; the command syntax is:
Where package_name is the name of the package that you would like to remove.
You can use the yum remove command to remove a package installed by yum. To remove a package, open a terminal window, assume superuser privileges, and enter the command:
Where package_name is the name of the package that you would like to remove.
Note: yum and RPM will not remove a package that is required by another package. If you attempt to remove a package that satisfies a package dependency, yum or RPM will provide a warning.
Please note: the configuration files and data directory remains intact.