Spacewalk 1.7 With PostgreSQL

前端之家收集整理的这篇文章主要介绍了Spacewalk 1.7 With PostgreSQL前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

This article will show you how to integrate spacewalk 1.7 with postgresql.Before you do,you must configure yum repository.Append following lines to your file:

 
 
  1. [Satellite]@H_403_7@@H_403_7@
  2. name@H_403_7@=@H_403_7@Spacewalk@H_403_7@Satellite@H_403_7@@H_403_7@
  3. baseurl@H_403_7@=@H_403_7@http@H_403_7@://spacewalk.redhat.com/yum/1.7/RHEL/6/x86_64/@H_403_7@@H_403_7@
  4. enabled@H_403_7@=@H_403_7@1@H_403_7@@H_403_7@@H_403_7@
  5. gpgcheck@H_403_7@=@H_403_7@1@H_403_7@@H_403_7@@H_403_7@
  6. gpgkey@H_403_7@=@H_403_7@http@H_403_7@://spacewalk.redhat.com/yum/RPM-GPG-KEY-spacewalk-2012@H_403_7@@H_403_7@
  7. @H_403_7@
  8. [Satellite-Client]@H_403_7@
  9. name@H_403_7@=@H_403_7@Spacewalk@H_403_7@Satellite@H_403_7@@H_403_7@
  10. baseurl@H_403_7@=@H_403_7@http@H_403_7@://spacewalk.redhat.com/yum/1.7-client/RHEL/6/x86_64/@H_403_7@@H_403_7@
  11. enabled@H_403_7@=@H_403_7@1@H_403_7@@H_403_7@@H_403_7@
  12. gpgcheck@H_403_7@=@H_403_7@1@H_403_7@@H_403_7@@H_403_7@
  13. gpgkey@H_403_7@=@H_403_7@http@H_403_7@://spacewalk.redhat.com/yum/RPM-GPG-KEY-spacewalk-2012@H_403_7@@H_403_7@
  14. @H_403_7@
  15. [epel]@H_403_7@
  16. name@H_403_7@=@H_403_7@Red@H_403_7@HatEnterpriseLinux$releasever-$basearch-Debug@H_403_7@@H_403_7@
  17. baseurl@H_403_7@=@H_403_7@http@H_403_7@://dl.fedoraproject.org/pub/epel/6/x86_64/@H_403_7@@H_403_7@
  18. enabled@H_403_7@=@H_403_7@1@H_403_7@@H_403_7@@H_403_7@
  19. gpgcheck@H_403_7@=@H_403_7@1@H_403_7@@H_403_7@@H_403_7@
  20. gpgkey@H_403_7@=@H_403_7@http@H_403_7@://dl.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-6@H_403_7@@H_403_7@
  21. @H_403_7@
  22. [Centos]@H_403_7@
  23. name@H_403_7@=@H_403_7@Centos@H_403_7@@H_403_7@@H_403_7@
  24. baseurl@H_403_7@=@H_403_7@http@H_403_7@://mirrors.163.com/centos/6.2/os/x86_64/@H_403_7@@H_403_7@
  25. enabled@H_403_7@=@H_403_7@1@H_403_7@@H_403_7@@H_403_7@
  26. gpgcheck@H_403_7@=@H_403_7@1@H_403_7@@H_403_7@@H_403_7@
  27. gpgkey@H_403_7@=@H_403_7@http@H_403_7@://mirrors.163.com/centos/6.2/os/x86_64/RPM-GPG-KEY-CentOS-6@H_403_7@@H_403_7@
  28. @H_403_7@
  29. [Centos-Update]@H_403_7@
  30. name@H_403_7@=@H_403_7@Centos@H_403_7@@H_403_7@@H_403_7@
  31. baseurl@H_403_7@=@H_403_7@http@H_403_7@://mirrors.163.com/centos/6.2/updates/x86_64/@H_403_7@@H_403_7@
  32. enabled@H_403_7@=@H_403_7@1@H_403_7@@H_403_7@@H_403_7@
  33. gpgcheck@H_403_7@=@H_403_7@1@H_403_7@@H_403_7@@H_403_7@
  34. gpgkey@H_403_7@=@H_403_7@http@H_403_7@://mirrors.163.com/centos/6.2/os/x86_64/RPM-GPG-KEY-CentOS-6@H_403_7@@H_403_7@
  35. @H_403_7@
  36. [Jpackes]@H_403_7@
  37. name@H_403_7@=@H_403_7@jpackage@H_403_7@@H_403_7@@H_403_7@
  38. baseurl@H_403_7@=@H_403_7@http@H_403_7@://mirrors.dotsrc.org/jpackage/5.0/generic/free/@H_403_7@@H_403_7@
  39. enabled@H_403_7@=@H_403_7@1@H_403_7@@H_403_7@@H_403_7@
  40. gpgcheck@H_403_7@=@H_403_7@1@H_403_7@@H_403_7@@H_403_7@

After,use following command to install spacewalk:

 
 
  1. yum-yinstallspacewalk-postgresql@H_403_7@@H_403_7@

Configure postgresql database

You will need to becomethe operating system user under which Postgresql was installed (usually postgres@H_403_7@) to create the firstuser account. It could also be that you were assigned a Postgresql user name that is different from youroperating system user name.By default,postgresql has already created a user postgres@H_403_7@.

 
 
  1. [root@sate~]#id-apostgres@H_403_7@@H_403_7@
  2. uid@H_403_7@=@H_403_7@26@H_403_7@(postgres)@H_403_7@gid@H_403_7@=@H_403_7@26@H_403_7@(postgres)@H_403_7@groups@H_403_7@=@H_403_7@26@H_403_7@(postgres)@H_403_7@@H_403_7@

1.Create database and user:

Before you do,you mustinitialize postgrsql and start it by following command@H_403_7@.

 
 
  1. [root@sate~]#servicepostgresqlinitdb@H_403_7@@H_403_7@
  2. Initializingdatabase:[OK]@H_403_7@
  3. [root@sate~]#servicepostgresqlstart@H_403_7@
  4. Startingpostgresqlservice:[OK]@H_403_7@
 
 
  1. [root@sate~]#su-postgres@H_403_7@@H_403_7@
  2. -bash-4.1$PGPASSWORD@H_403_7@=@H_403_7@redhat@H_403_7@ //Set the spaceuser's password@H_403_7@@H_403_7@
  3. -bash-4.1$createdbspacewalk //Create database@H_403_7@
  4. -bash-4.1$createlangplpgsqlspacewalk@H_403_7@
  5. -bash-4.1$createuser-P-sDRspaceuser //Create user@H_403_7@
  6. Enterpasswordfornewrole:@H_403_7@
  7. Enteritagain:@H_403_7@

2.Append following contents to /var/lib/pgsql/data/pg_hba.conf:

 
 
  1. hostallall172.16.255.0/24trust@H_403_7@@H_403_7@

3.Append following lines to /var/lib/pgsql/data/psotgresql.conf:

 
 
  1. listen_addresses@H_403_7@=@H_403_7@'*'@H_403_7@@H_403_7@@H_403_7@

4.Restart postgresql service:

 
 
  1. [root@sate~]#servicepostgresqlrestart@H_403_7@@H_403_7@
  2. Stoppingpostgresqlservice:[OK]@H_403_7@
  3. Startingpostgresqlservice:[OK]@H_403_7@

5.Connect to spacewalk database:

 
 
  1. [root@sate~]#su-postgres@H_403_7@@H_403_7@
  2. postgres@H_403_7@=#\cspacewalk@H_403_7@@H_403_7@
  3. psql(8.4.9)@H_403_7@
  4. Youarenowconnectedtodatabase"spacewalk".@H_403_7@
  5. spacewalk@H_403_7@=#@H_403_7@@H_403_7@
  6. spacewalk@H_403_7@=#\db@H_403_7@@H_403_7@
  7. Listoftablespaces@H_403_7@
  8. Name|Owner|Location@H_403_7@
  9. ------------+----------+----------@H_403_7@
  10. pg_default|postgres|@H_403_7@
  11. pg_global|postgres|@H_403_7@
  12. (2rows)@H_403_7@

Configure Spacewalk by spacewalk-setup command

 
 
  1. [root@sate~]#spacewalk-setup--disconnected@H_403_7@@H_403_7@
  2. **Database:SettingupdatabaseconnectionforPostgresqlbackend.@H_403_7@
  3. Hostname(leaveemptyforlocal)?sate.xzxj.edu.cn@H_403_7@
  4. Port[5432]?@H_403_7@
  5. Database?spacewalk@H_403_7@
  6. Username?spaceuser@H_403_7@
  7. Password?@H_403_7@
  8. ***Progress:##################################@H_403_7@
  9. *Settingupusersandgroups.@H_403_7@
  10. **GPG:InitializingGPGandimportingkey.@H_403_7@
  11. Youmustenteranemailaddress.@H_403_7@
  12. AdminEmailAddress?root@localhost@H_403_7@
  13. *Performinginitialconfiguration.@H_403_7@
  14. *ActivatingSpacewalk.@H_403_7@
  15. **LoadingSpacewalkCertificate.@H_403_7@
  16. **Verifyingcertificatelocally.@H_403_7@
  17. **ActivatingSpacewalk.@H_403_7@
  18. *EnablingMonitoring.@H_403_7@
  19. *ConfiguringapacheSSLvirtualhost.@H_403_7@
  20. Shouldsetupconfigureapache'sdefaultsslserverforyou(savesoriginalssl.conf)[Y]?@H_403_7@
  21. *Configuringtomcat.@H_403_7@
  22. **/etc/tomcat6/server.xmlhasbeenbackeduptoserver.xml-swsave@H_403_7@
  23. Reversed(orprevIoUslyapplied)patchdetected!Skippingpatch.@H_403_7@
  24. 1outof1hunkignored--savingrejectstofileweb.xml.rej@H_403_7@
  25. *Configuringjabberd.@H_403_7@
  26. *CreatingSSLcertificates.@H_403_7@
  27. CAcertificatepassword?@H_403_7@
  28. Re-enterCAcertificatepassword?@H_403_7@
  29. Organization?xzxj@H_403_7@
  30. OrganizationUnit[sate.xzxj.edu.cn]?@H_403_7@
  31. EmailAddress[root@localhost]?@H_403_7@
  32. City?ShangHai@H_403_7@
  33. State?ShangHai@H_403_7@
  34. Countrycode(Examples:"US","JP","IN",ortype"?"toseealist)?CN@H_403_7@
  35. **SSL:GeneratingCAcertificate.@H_403_7@
  36. **SSL:DeployingCAcertificate.@H_403_7@
  37. **SSL:Generatingservercertificate.@H_403_7@
  38. **SSL:StoringSSLcertificates.@H_403_7@
  39. *Deployingconfigurationfiles.@H_403_7@
  40. *Updateconfigurationindatabase.@H_403_7@
  41. *SettingupCobbler..@H_403_7@
  42. cobblerddoesnotappeartoberunning/accessible@H_403_7@
  43. CobblerrequirestftpandxinetdservicesbeturnedonforPXEprovisioningfunctionality.Enabletheseservices[Y]?@H_403_7@
  44. cobblerddoesnotappeartoberunning/accessible@H_403_7@
  45. *Restartingservices.@H_403_7@
  46. Installationcomplete.@H_403_7@
  47. Visithttps://sate.xzxj.edu.cntocreatetheSpacewalkadministratoraccount.@H_403_7@

Check Spacewalk service

 
 
  1. [root@sate~]#spacewalk-servicestatus@H_403_7@@H_403_7@
  2. router(pid16795)isrunning...@H_403_7@
  3. sm(pid16802)isrunning...@H_403_7@
  4. c2s(pid16809)isrunning...@H_403_7@
  5. s2s(pid16816)isrunning...@H_403_7@
  6. osa-dispatcher(pid16832)isrunning...@H_403_7@
  7. tomcat6(pid16901)isrunning...[OK]@H_403_7@
  8. httpd(pid17126)isrunning...@H_403_7@
  9. 2012-03-0918:41:43Monitoring:-----------InstallSoftwareConfigSTATUS---------------@H_403_7@
  10. 2012-03-0918:41:44Monitoring:-----------NotifEscalatorSTATUS---------------@H_403_7@
  11. 2012-03-0918:41:46Monitoring:-----------GenerateNotifConfigSTATUS---------------@H_403_7@
  12. 2012-03-0918:41:47Monitoring:-----------NotifLauncherSTATUS---------------@H_403_7@
  13. 2012-03-0918:41:49Monitoring:-----------NotifierSTATUS---------------@H_403_7@
  14. 2012-03-0918:41:54Monitoring:-----------AckProcessorSTATUS---------------@H_403_7@
  15. 2012-03-0918:41:55Monitoring:-----------TSDBLocalQueueSTATUS---------------@H_403_7@
  16. 2012-03-0918:42:02MonitoringScout:-----------InstallSoftwareConfigSTATUS---------------@H_403_7@
  17. rhn-searchisrunning(17338).@H_403_7@
  18. cobblerd(pid17393)isrunning...@H_403_7@
  19. RHNTaskomaticisrunning(17451).@H_403_7@

Create the Spacewalk administrator account

image

After created,use administrator account to access:

image

image

View Database information

1.List tables:

 
 
  1. [root@sate~]#su-postgres@H_403_7@@H_403_7@
  2. -bash-4.1$psqlspacewalk@H_403_7@
  3. psql(8.4.9)@H_403_7@
  4. Type"help"@H_403_7@@H_403_7@for@H_403_7@help.@H_403_7@@H_403_7@
  5. spacewalk=#\dt@H_403_7@
  6. Listof@H_403_7@relations@H_403_7@@H_403_7@
  7. Schema@H_403_7@|@H_403_7@Name@H_403_7@|Type|Owner@H_403_7@@H_403_7@
  8. --------+--------------------------------+-------+-----------@H_403_7@@H_403_7@@H_403_7@
  9. public@H_403_7@|dual|@H_403_7@table@H_403_7@|spaceuser@H_403_7@@H_403_7@
  10. public@H_403_7@|pxtsessions|@H_403_7@table@H_403_7@|spaceuser@H_403_7@@H_403_7@
  11. public@H_403_7@|qrtz_blob_triggers|@H_403_7@table@H_403_7@|spaceuser@H_403_7@@H_403_7@
  12. public@H_403_7@|qrtz_calendars|@H_403_7@table@H_403_7@|spaceuser@H_403_7@@H_403_7@
  13. public@H_403_7@|qrtz_cron_triggers|@H_403_7@table@H_403_7@|spaceuser@H_403_7@@H_403_7@
  14. public@H_403_7@|qrtz_fired_triggers|@H_403_7@table@H_403_7@|spaceuser@H_403_7@@H_403_7@
  15. public@H_403_7@|qrtz_job_details|@H_403_7@table@H_403_7@|spaceuser@H_403_7@@H_403_7@
  16. public@H_403_7@|qrtz_job_listeners|@H_403_7@table@H_403_7@|spaceuser@H_403_7@@H_403_7@
  17. public@H_403_7@|qrtz_locks|@H_403_7@table@H_403_7@|spaceuser@H_403_7@@H_403_7@
  18. public@H_403_7@|qrtz_paused_trigger_grps|@H_403_7@table@H_403_7@|spaceuser@H_403_7@@H_403_7@
  19. public@H_403_7@|qrtz_scheduler_state|@H_403_7@table@H_403_7@|spaceuser@H_403_7@@H_403_7@
  20. public@H_403_7@|qrtz_simple_triggers|@H_403_7@table@H_403_7@|spaceuser@H_403_7@@H_403_7@
  21. public@H_403_7@|qrtz_trigger_listeners|@H_403_7@table@H_403_7@|spaceuser@H_403_7@@H_403_7@
  22. public@H_403_7@|qrtz_triggers|@H_403_7@table@H_403_7@|spaceuser@H_403_7@@H_403_7@
  23. public@H_403_7@|rhn_check_probe|@H_403_7@table@H_403_7@|spaceuser@H_403_7@@H_403_7@
  24. public@H_403_7@|rhn_check_suite_probe|@H_403_7@table@H_403_7@|spaceuser@H_403_7@@H_403_7@
  25. public@H_403_7@|rhn_check_suites|@H_403_7@table@H_403_7@|spaceuser@H_403_7@@H_403_7@
  26. public@H_403_7@|rhn_command|@H_403_7@table@H_403_7@|spaceuser@H_403_7@@H_403_7@
  27. public@H_403_7@|rhn_command_class|@H_403_7@table@H_403_7@|spaceuser@H_403_7@@H_403_7@
  28. public@H_403_7@|rhn_command_groups|@H_403_7@table@H_403_7@|spaceuser@H_403_7@@H_403_7@
  29. public@H_403_7@|rhn_command_param_threshold|@H_403_7@table@H_403_7@|spaceuser@H_403_7@@H_403_7@
  30. public@H_403_7@|rhn_command_parameter|@H_403_7@table@H_403_7@|spaceuser@H_403_7@@H_403_7@
  31. public@H_403_7@|rhn_command_queue_commands|@H_403_7@table@H_403_7@|spaceuser@H_403_7@@H_403_7@
  32. public@H_403_7@|rhn_command_queue_execs|@H_403_7@table@H_403_7@|spaceuser@H_403_7@@H_403_7@
  33. public@H_403_7@|rhn_command_queue_instances|@H_403_7@table@H_403_7@|spaceuser@H_403_7@@H_403_7@
  34. public@H_403_7@|rhn_command_queue_params|@H_403_7@table@H_403_7@|spaceuser@H_403_7@@H_403_7@
  35. public@H_403_7@|rhn_command_queue_sessions|@H_403_7@table@H_403_7@|spaceuser@H_403_7@@H_403_7@
  36. public@H_403_7@|rhn_command_requirements|@H_403_7@table@H_403_7@|spaceuser@H_403_7@@H_403_7@
  37. public@H_403_7@|rhn_command_target|@H_403_7@table@H_403_7@|spaceuser@H_403_7@@H_403_7@
  38. public@H_403_7@|rhn_config_group|@H_403_7@table@H_403_7@|spaceuser@H_403_7@@H_403_7@
  39. public@H_403_7@|rhn_config_macro|@H_403_7@table@H_403_7@|spaceuser@H_403_7@@H_403_7@
  40. public@H_403_7@|rhn_config_parameter|@H_403_7@table@H_403_7@|spaceuser@H_403_7@@H_403_7@
  41. public@H_403_7@|rhn_config_security_type|@H_403_7@table@H_403_7@|spaceuser@H_403_7@@H_403_7@
  42. public@H_403_7@|rhn_contact_group_members|@H_403_7@table@H_403_7@|spaceuser@H_403_7@@H_403_7@
  43. public@H_403_7@|rhn_contact_groups|@H_403_7@table@H_403_7@|spaceuser@H_403_7@@H_403_7@
  44. public@H_403_7@|rhn_contact_methods|@H_403_7@table@H_403_7@|spaceuser@H_403_7@@H_403_7@
  45. public@H_403_7@|rhn_current_state_summaries|@H_403_7@table@H_403_7@|spaceuser@H_403_7@@H_403_7@
  46. public@H_403_7@|rhn_deployed_probe|@H_403_7@table@H_403_7@|spaceuser@H_403_7@@H_403_7@
  47. public@H_403_7@|rhn_host_probe|@H_403_7@table@H_403_7@|spaceuser@H_403_7@@H_403_7@
  48. public@H_403_7@|rhn_ll_netsaint|@H_403_7@table@H_403_7@|spaceuser@H_403_7@@H_403_7@
  49. public@H_403_7@|rhn_method_types|@H_403_7@table@H_403_7@|spaceuser@H_403_7@@H_403_7@
  50. public@H_403_7@|rhn_metrics|@H_403_7@table@H_403_7@|spaceuser@H_403_7@@H_403_7@
  51. public@H_403_7@|rhn_multi_scout_threshold|@H_403_7@table@H_403_7@|spaceuser@H_403_7@@H_403_7@
  52. public@H_403_7@|rhn_notification_formats|@H_403_7@table@H_403_7@|spaceuser@H_403_7@@H_403_7@
  53. ............
  54. (383rows@H_403_7@)@H_403_7@@H_403_7@

2.List views:

 
 
  1. spacewalk=#\dv@H_403_7@@H_403_7@
  2. Listof@H_403_7@relations@H_403_7@@H_403_7@
  3. Schema@H_403_7@|@H_403_7@Name@H_403_7@|Type|Owner@H_403_7@@H_403_7@
  4. --------+--------------------------------+------+-----------@H_403_7@@H_403_7@@H_403_7@
  5. public@H_403_7@|all_primary_keys|@H_403_7@view@H_403_7@|spaceuser@H_403_7@@H_403_7@
  6. public@H_403_7@|all_tab_columns|@H_403_7@view@H_403_7@|spaceuser@H_403_7@@H_403_7@
  7. public@H_403_7@|rhn_contact_monitoring|@H_403_7@view@H_403_7@|spaceuser@H_403_7@@H_403_7@
  8. public@H_403_7@|rhn_customer_monitoring|@H_403_7@view@H_403_7@|spaceuser@H_403_7@@H_403_7@
  9. public@H_403_7@|rhn_host_monitoring|@H_403_7@view@H_403_7@|spaceuser@H_403_7@@H_403_7@
  10. public@H_403_7@|rhnactionoverview|@H_403_7@view@H_403_7@|spaceuser@H_403_7@@H_403_7@
  11. public@H_403_7@|rhnavailablechannels|@H_403_7@view@H_403_7@|spaceuser@H_403_7@@H_403_7@
  12. public@H_403_7@|rhncddevice|@H_403_7@view@H_403_7@|spaceuser@H_403_7@@H_403_7@
  13. public@H_403_7@|rhnchannelfamilyoverview|@H_403_7@view@H_403_7@|spaceuser@H_403_7@@H_403_7@
  14. public@H_403_7@|rhnchannelfamilypermissions|@H_403_7@view@H_403_7@|spaceuser@H_403_7@@H_403_7@
  15. public@H_403_7@|rhnchannelfamilyserverfve|@H_403_7@view@H_403_7@|spaceuser@H_403_7@@H_403_7@
  16. public@H_403_7@|rhnchannelfamilyserverphysical|@H_403_7@view@H_403_7@|spaceuser@H_403_7@@H_403_7@
  17. public@H_403_7@|rhnchannelfamilyservers|@H_403_7@view@H_403_7@|spaceuser@H_403_7@@H_403_7@
  18. public@H_403_7@|rhnchannelfamilyservervirtual|@H_403_7@view@H_403_7@|spaceuser@H_403_7@@H_403_7@
  19. public@H_403_7@|rhnchannelnewestpackageview|@H_403_7@view@H_403_7@|spaceuser@H_403_7@@H_403_7@
  20. public@H_403_7@|rhnchannelpermissions|@H_403_7@view@H_403_7@|spaceuser@H_403_7@@H_403_7@
  21. public@H_403_7@|rhnchanneltreeview|@H_403_7@view@H_403_7@|spaceuser@H_403_7@@H_403_7@
  22. public@H_403_7@|rhnchecksumview|@H_403_7@view@H_403_7@|spaceuser@H_403_7@@H_403_7@
  23. public@H_403_7@|rhnentitledservers|@H_403_7@view@H_403_7@|spaceuser@H_403_7@@H_403_7@
  24. public@H_403_7@|rhnhwdevice|@H_403_7@view@H_403_7@|spaceuser@H_403_7@@H_403_7@
  25. public@H_403_7@|rhnorgchannelfamilypermissions|@H_403_7@view@H_403_7@|spaceuser@H_403_7@@H_403_7@
  26. public@H_403_7@|rhnorgchanneltreeview|@H_403_7@view@H_403_7@|spaceuser@H_403_7@@H_403_7@
  27. public@H_403_7@|rhnorgerrata|@H_403_7@view@H_403_7@|spaceuser@H_403_7@@H_403_7@
  28. public@H_403_7@|rhnpackagechangelog|@H_403_7@view@H_403_7@|spaceuser@H_403_7@@H_403_7@
  29. public@H_403_7@|rhnserverentitlementphysical|@H_403_7@view@H_403_7@|spaceuser@H_403_7@@H_403_7@
  30. public@H_403_7@|rhnserverentitlementview|@H_403_7@view@H_403_7@|spaceuser@H_403_7@@H_403_7@
  31. public@H_403_7@|rhnserverentitlementvirtual|@H_403_7@view@H_403_7@|spaceuser@H_403_7@@H_403_7@
  32. public@H_403_7@|rhnservererratatypeview|@H_403_7@view@H_403_7@|spaceuser@H_403_7@@H_403_7@
  33. public@H_403_7@|rhnserverfeaturesview|@H_403_7@view@H_403_7@|spaceuser@H_403_7@@H_403_7@
  34. public@H_403_7@|rhnserverfvecapable|@H_403_7@view@H_403_7@|spaceuser@H_403_7@@H_403_7@
  35. public@H_403_7@|rhnservergroupmembership|@H_403_7@view@H_403_7@|spaceuser@H_403_7@@H_403_7@
  36. public@H_403_7@|rhnservergroupoverview|@H_403_7@view@H_403_7@|spaceuser@H_403_7@@H_403_7@
  37. public@H_403_7@|rhnservergroupovlitehelper|@H_403_7@view@H_403_7@|spaceuser@H_403_7@@H_403_7@
  38. public@H_403_7@|rhnserverneedederratacache|@H_403_7@view@H_403_7@|spaceuser@H_403_7@@H_403_7@
  39. public@H_403_7@|rhnserverneededpackagecache|@H_403_7@view@H_403_7@|spaceuser@H_403_7@@H_403_7@
  40. public@H_403_7@|rhnserverneededview|@H_403_7@view@H_403_7@|spaceuser@H_403_7@@H_403_7@
  41. ..........
  42. (58rows@H_403_7@)@H_403_7@@H_403_7@

3.List roles:

 
 
  1. spacewalk=#\dg@H_403_7@@H_403_7@
  2. Listof@H_403_7@roles@H_403_7@@H_403_7@
  3. Rolename@H_403_7@|Attributes|Member@H_403_7@of@H_403_7@@H_403_7@@H_403_7@
  4. -----------+-------------+-----------@H_403_7@@H_403_7@@H_403_7@
  5. postgres|Superuser|{}@H_403_7@
  6. :Create@H_403_7@role@H_403_7@@H_403_7@
  7. :Create@H_403_7@DB@H_403_7@@H_403_7@
  8. spaceuser|Superuser|{}@H_403_7@
  9. :Create@H_403_7@role@H_403_7@@H_403_7@
  10. :Create@H_403_7@DB@H_403_7@@H_403_7@

4.Display table info:

 
 
  1. spacewalk-#\drhnpackage@H_403_7@@H_403_7@
  2. Table"public.rhnpackage"@H_403_7@
  3. Column|Type|Modifiers@H_403_7@
  4. -----------------+-----------------------------+------------------------@H_403_7@
  5. id|numeric|notnull@H_403_7@
  6. org_id|numeric|@H_403_7@
  7. name_id|numeric|notnull@H_403_7@
  8. evr_id|numeric|notnull@H_403_7@
  9. package_arch_id|numeric|notnull@H_403_7@
  10. package_group|numeric|@H_403_7@
  11. rpm_version|charactervarying(16)|@H_403_7@
  12. description|charactervarying(4000)|@H_403_7@
  13. summary|charactervarying(4000)|@H_403_7@
  14. package_size|numeric|notnull@H_403_7@
  15. payload_size|numeric|@H_403_7@
  16. build_host|charactervarying(256)|@H_403_7@
  17. build_time|timestampwithouttimezone|@H_403_7@
  18. source_rpm_id|numeric|@H_403_7@
  19. checksum_id|numeric|notnull@H_403_7@
  20. vendor|charactervarying(64)|notnull@H_403_7@
  21. payload_format|charactervarying(32)|@H_403_7@
  22. compat|smallint|default0@H_403_7@
  23. path|charactervarying(1000)|@H_403_7@
  24. header_sig|charactervarying(64)|@H_403_7@
  25. copyright|charactervarying(128)|@H_403_7@
  26. cookie|charactervarying(128)|@H_403_7@
  27. last_modified|timestampwithtimezone|notnulldefaultnow()@H_403_7@
  28. created|timestampwithtimezone|notnulldefaultnow()@H_403_7@
  29. modified|timestampwithtimezone|notnulldefaultnow()@H_403_7@
  30. header_start|numeric|notnulldefault(-1)@H_403_7@
  31. header_end|numeric|notnulldefault(-1)@H_403_7@
  32. ................
  33. spacewalk-#@H_403_7@

5.Query table:

 
 
  1. spacewalk=#@H_403_7@select@H_403_7@@H_403_7@count@H_403_7@(*)@H_403_7@from@H_403_7@rhnpackage;@H_403_7@@H_403_7@
  2. count@H_403_7@@H_403_7@@H_403_7@
  3. -------@H_403_7@@H_403_7@@H_403_7@
  4. 4812@H_403_7@
  5. (1row)@H_403_7@
  6. spacewalk=#select@H_403_7@*@H_403_7@from@H_403_7@rhn_os;@H_403_7@@H_403_7@
  7. recid|os_name@H_403_7@
  8. -------+--------------@H_403_7@@H_403_7@@H_403_7@
  9. 4|LinuxSystem@H_403_7@
  10. 14|Satellite@H_403_7@
  11. (2rows@H_403_7@)@H_403_7@@H_403_7@

For more infomation about postgresql from following links:

1.PostgreSQL 8.4.11 Documentation

2.PostgreSQL examples

猜你在找的Postgre SQL相关文章