亚美亚AEP运维之PostgreSQL数据库相关

  

,,由于AEP EPM所有相关的报表数据(应用运行日志,呼叫清单,会话清单),配置信息等都存在本地PostgreSQL上,了解PostgreSQL的相关基本使用方法,有助于日常运维能力的提升。本篇主要总结如何开启本地登陆,开启远端登陆,基本命令,数据备份和清理。

<李>

,如何开启本地和远端登陆

在EPM安装的过程中,会把PostgreSQL也一并安装掉,过程中会提示输入用户名postgres的密码,以及创建一个报表用户。当时当你本地使用PostgreSQL去登陆数据库时,始终登陆不上,通过PostgreSQL客户端也始终登陆不上,需要进行如下操作来开启本地和远端登陆。

[root@vp142  VP-Tools] #, su 作用;postgres   bash - 4.1 $ ls   9.0,,data , pgstartup.log  SQLscripts   bash - 4.1美元,cd 数据/bash - 4.1美元,vi  pg_hba.conf ,//找到如下部分,修改第一条记录(运行本地登陆)以及新增一条记录(运行远端登陆,记得先备份该配置文件)

亚美亚AEP运维之PostgreSQL数据库相关

改完后:wq保存,然后重启PostgreSQL服务。

bash - 4.1美元,退出   注销   [root@vp142  VP-Tools] #, service  postgresql 启动


<李>

本地和远端登陆验证

[root@vp142  VP-Tools] #, psql  -h  127.0.0.1  -U  postgres  -d  VoicePortal   Password  for  user  postgres:,   psql  (9.0.15)   Type “帮助”,for 帮助。      VoicePortal=#,//本地登陆成功

,远端登陆:下载PostgreSQL客户端,配置

亚美亚AEP运维之PostgreSQL数据库相关

登陆成功:

亚美亚AEP运维之PostgreSQL数据库相关

<李>

PostgreSQL常用命令

VoicePortal - #, \ l ,,,//输出所有数据库   ,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,List  of 数据库   ,,,Name ,,,, |,, Owner ,, |, Encoding  |,, Collation , |,,,, Ctype ,,, |,, Access  privil   eges ,,   - - - - - - - - - - - - - - - - - - - - - - - - + + - - - - - - - - - - - - - - - - - - - - - - - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -   -------   |,VoicePortal  postgres  |, UTF8 ,,,, |, en_US.UTF-8  |, en_US.UTF-8  |,   ,postgres ,, |, postgres  |, UTF8 ,,,, |, en_US.UTF-8  |, en_US.UTF-8  |,   ,template0 , |, postgres  |, UTF8 ,,,, |, en_US.UTF-8  |, en_US.UTF-8  |,=c/postgres ,,,   ,VoicePortal - # \ c  postgres ,//切换到postgres库   你断开连接;你connected 用database “postgres”又是;   postgres - #,   VoicePortal - #, \ d ,,//显示当前库有哪些表   ,,,,,,,,,,,,,,,,,,,,,List  of 关系   ,Schema  |,,,,,,,,,,,,, Name ,,,,,,,,,,,,, |,,, Type ,, |,, Owner ,,   - - - - - - - - - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - - - - - - - - - - - - - - - - - - - -   |,public  alarmcode ,,,,,,,,,,,,,,,,,,,, |, table ,,, | postgres   |,public  alarmcodelistenerlink ,,,,,,,, |, table ,,, | postgres   |,public  alarmcodelistenerlinkdefault , |, table ,,, | postgres   |,public  alarmhistory ,,,,,,,,,,,,,,,,, |, table ,,, | postgres   |,public  alarmlistener ,,,,,,,,,,,,,,,, |, table ,,, | postgres   |,public  alarmnotify ,,,,,,,,,,,,,,,,,, |, table ,,, | postgres   ,……   ,VoicePortal - # \ d  cdr ,,//查看cdr表的结构   ,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,Table “public.cdr”   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null

亚美亚AEP运维之PostgreSQL数据库相关