phpPgAdmin is a web based administration tool for managing PostgreSQL database, it is very similar in look of phpMyAdmin. If you have a work experience on phpMyAdmin, you wont take much time in finding the way to work with. This guide will help you to setup phpPgAdmin on CentOS 7 / RHEL 7. Installing phpPgAdmin: Before installing, take a look at how to install PostgreSQL on CentOS 7. If you have followed PostgrqSQL install, you do not need to steup EPEL. Here is the link to setup EPEL repository on CentOS 7.
yum -y install phpPgAdmin php-pgsql httpd php
Configuring phpPgAdmin: Edit /etc/phpPgAdmin/config.inc.php file, we have to modify the admin file to enable the browser access. vi /etc/phpPgAdmin/config.inc.php
Add the localhost in the following server parameter.
$conf['servers'][0]['host'] = 'localhost';
If extra login security is true, then logins via phpPgAdmin with no password or certain usernames (pgsql, postgres, root, administrator) will be denied. To enable the postgres login, change it to false.
$conf['extra_login_security'] = false;
To simply hide other databases in the list make following condition to true – this does not in any way prevent your users from seeing other database by other means.
$conf['owned_only'] = true;
Configuring PostgreSQL: Modify config file to accept the authentication from the remote networks. vi /var/lib/pgsql/9.3/data/pg_hba.conf Please enter the value as per your requirements inIPv4 and Ipv6 connections and make sure it accepts md5 passwords.
# IPv4 local connections:
host all all 127.0.0.1/32 md5
host all all 192.168.2.0/24 md5
# IPv6 local connections:
host all all ::1/128 md5
Configuring Apche: By-default phpPgAdmin places the web config file in /etc/httpd/conf.d directory; it has the rules and access permission for the web access. In CentOS 7, web access is managed by mod_authz_core.c module; so normal allow or deny rules wont work even if you modify. vi /etc/httpd/conf.d/phpPgAdmin.conf Default config will look like below.
Alias /phpPgAdmin /usr/share/phpPgAdmin
<Location /phpPgAdmin>
<IfModule mod_authz_core.c>
# Apache 2.4
Require local
#Require host example.com
</IfModule>
<IfModule !mod_authz_core.c>
# Apache 2.2
Order deny,allow
Deny from all
Allow from 127.0.0.1
Allow from ::1
# Allow from .example.com
</IfModule>
</Location>
Please comment Require local and add Require all granted just below to commented line, it will look like below.
Alias /phpPgAdmin /usr/share/phpPgAdmin
<Location /phpPgAdmin>
<IfModule mod_authz_core.c>
# Apache 2.4
# Require local
Require all granted
#Require host example.com
</IfModule>
<IfModule !mod_authz_core.c>
# Apache 2.2
Order deny,allow
Deny from all
Allow from 127.0.0.1
Allow from ::1
# Allow from .example.com
</IfModule>
</Location>
Method 1 You can check the mode of the server using "pg_controldata". [pgsql@test~]$ pg_controldata /usr/local/pgsql/data84/ Database cluster state: in archive recovery --> This is Standby Database Database cluster state: in production --> This is Production Database [Master] Method 2 You can use pg_is_in_recovery() which returns True if recovery is still in progress(so the server is running in standby mode or slave) postgres=# select pg_is_in_recovery(); pg_is_in_recovery ------------------- t (1 row) If Return false so the server is running in primary mode or master postgres=# select pg_is_in_recovery(); pg_is_in_recovery ------------------- f (1 row)
SQL> create pfile='/home/oracle/karan/admin/pfile/initclone.ora' from spfile; create pfile='/home/oracle/karan/admin/pfile/initclone.ora' from spfile * ERROR at line 1: ORA-01565: error in identifying file '?/dbs/spfile@.ora' ORA-27037: unable to obtain file status Linux Error: 2: No such file or directory Additional information: 3 SQL> show parameter spfile; NAME TYPE VALUE ------------------------------------ ----------- ------------------------------ spfile string SQL> create spfile= 2 SQL> create spfile='/home/oracle/karan/admin/pfile/initclone.ora' from pfile; create spfile='/home/oracle/karan/admin/pfile/initclone.ora' from pfile * ERROR at line 1: ORA-01078: failure in processing system parameters LRM-00109: could not open parameter file '/oraeng/app/oracle/product/11.2.0/dbs/initkiruba.ora' SQL> create spfile from pfile; create spfile from pfil
In this post, I am sharing few important function for finding the size of database, table and index in PostgreSQL. Finding object size in postgresql database is very important and common. Is it very useful to know the exact size occupied by the object at the tablespace. The object size in the following scripts is in GB. The scripts have been formatted to work very easily with PUTTY SQL Editor. 1. Checking table size excluding table dependency: SELECT pg_size_pretty(pg_relation_size('mhrordhu_shk.mut_kharedi_audit')); pg_size_pretty ---------------- 238 MB (1 row) 2. Checking table size including table dependency: SELECT pg_size_pretty(pg_total_relation_size('mhrordhu_shk.mut_kharedi_audit')); pg_size_pretty ---------------- 268 MB (1 row) 3. Finding individual postgresql database size SELECT pg_size_pretty(pg_database_size('db_name')); 4. Finding individual table size for postgresql database -including dependency index: SELECT pg_size_pretty(pg_total_rel
These are the lists of top paying url shortening websites that are similar to Adfoc.us or Shrink url Websites like Adfoc.us. The websites are similar in the sense that you can use the same pattern of registration and earnings for all them, but the only difference is the amount of money each pays to its members and also the percentage of earnings from their referral programs. 1. ADF.LY – Free Url Shortening similar to adfocus that will pay you $4 for 1000 clicks on your shorten url. You can Also refer your friends and earn 20% of their earnings for life. Their payment is quick and consistant. Paypal Or Alertpay. It’s legit and very popular. JOIN HERE It’s legit and very popular. JOIN HERE Payment Options Details :- Payout for 1000 Views: Upto $9 Minimum Payout: $5 Referral Commission: 20% Payment Options:Payoneer, Payza Payment Time : Daily and On Request You can Withdraw money Following Acc
While I start my database with my initialization parameter it fails with oracle error Solution :- su oracle run environment variable sqlplus / as sysdba SQL>create pfile from spfile; Then remove or comment below line in pfile db_recovery_file_dest Save and exit su oracle run environment variable sqlplus / as sysdba SQL>startup mount; ORACLE instance started. Total System Global Area 1068937216 bytes Fixed Size 2166536 bytes Variable Size 427819256 bytes Database Buffers 624951296 bytes Redo Buffers 14000128 bytes it should became the mount stage then open the DB as follows SQL>alter database open; Database altered.
Comments
Post a Comment