°Ô½Ã¹° 2°Ç
 
[DB] PostgreSQL ¼³Ä¡Çϱâ (Æ®·¯ºí ½´Æà Ãß°¡)
±Û¾´ÀÌ : ÃÖÀå¼· ³¯Â¥ : 2014-11-11 (È­) 10:31 Á¶È¸ : 4523
  1. PostgreSQL ¼³Ä¡ Çϱâ (¹öÀü postgresql-9.3.5.tar.gz )
    1. ¼³Ä¡ ÆÐÅ°Áö
      RHEL 6.5 Desktop ÆÐÅ°Áö¸¸ ¼³Ä¡ ÇÔ

    2. PostgreSQL ±¸¼º¿¡ ÇÊ¿äÇÑ ÆÐÅ°Áö
      readline: ÇÁ·ÒÇÁÆ® »ó¿¡¼­ ÁÙ ÆíÁý ¹× ÀÔ·Â ±â·Ï ÀúÀåµîÀÇ ¿ªÇÒÀ» ÇÏ´Â ¶óÀ̺귯¸®
      readline-devel
      ncurses : ÅؽºÆ® »ç¿ëÀÚ ÀÎÅÍÆäÀ̽º¸¦ Å͹̳Πµ¶¸³¹æ½ÄÀ¸·Î ±â·ÏÇÒ ¼ö ÀÖµµ·Ï API¸¦ Á¦°øÇÏ´Â ÇÁ·Î±×·¡¹Ö ¶óÀ̺귯¸®
      ncurses-devel
      zlib : µ¥ÀÌÅÍ ¾ÐÃà ¶óÀ̺귯¸®
      zlib-devel
      gcc : ÄÄÆÄÀÏ·¯

  2. ¼³Ä¡ ¼Ò½º Build Çϱâ
    #./configure –prefix=/usr/local/pgsql && make && make install

  3. °èÁ¤ »ý¼º ¹× µð·ºÅ丮 ±ÇÇÑ º¯°æ
    1. useradd pgsql -d /home/pgsq
    2. chown -R pgsql.pgsql /usr/local/pgsql
    3. pgsql °èÁ¤¿¡ º¯¼ö Ãß°¡Çϱâ
      vim /home/pgsql/.bash_profile
      export PATH=$PATH:/usr/local/pgsql/bin
      export PGDATA=/usr/local/pgsql/data
      #initdb -D /usr/local/pgsql/data

  4. Postgresql ½ÃÀÛÇϱâ
    1. DB ÃʱâÈ­¸¦ À§ÇÏ¿© postgres °èÁ¤À¸·Î ·Î±×ÀÎ ÇÑ ÈÄ DB¸¦ ÃʱâÈ­ ¹× DB »ý¼º
      #su - pgsql
      #cd /usr/local/pgsql/bin
      #./initdb -D (½ºÅ丮Áö °æ·Î ¿¹: /DATA/)
      The files belonging to this database system will be owned by user "pgsql".
      .
      .
      .
      Success. You can now start the database server using:
          ./postgres -D /usr/local/pgsql/data/ 
       or
          ./pg_ctl -D /usr/local/pgsql/data/ -l logfile start

  5. DB¸¦ ½ÇÇà ½ÃÄÑÁØ´Ù.
    #./postgres -D (½ºÅ丮Áö °æ·Î ¿¹: /DATA) &

  6. DB °¡ Á¤»óÀûÀ¸·Î ¿Ã¶ó¿Ô´ÂÁö ·Î±×ÀÎ ¹× È®ÀÎ
    [pgsql@200-VM bin]$ ./psql template1
    psql (9.3.5)
    Type "help" for help.
    template1=# \l (¼Ò¹®ÀÚ L)
                                  List of databases
    Name    | Owner | Encoding |   Collate   |    Ctype    | Access privileges
    -----------+-------+----------+-------------+-------------+-------------------
    postgres  | pgsql | UTF8     | en_US.UTF-8 | en_US.UTF-8 |
    template0 | pgsql | UTF8     | en_US.UTF-8 | en_US.UTF-8 | =c/pgsql         +
               |       |          |             |             | pgsql=CTc/pgsql
     template1 | pgsql | UTF8     | en_US.UTF-8 | en_US.UTF-8 | =c/pgsql         +
               |       |          |             |             | pgsql=CTc/pgsql
     (3 rows)
     template1=#


  7. PostgreSQL ½ÇÇà Á¾·á°¡ µÇÁö ¾ÊÀ» °æ¿ì ¾Æ·¡¿Í °°ÀÌ Á¶Ä¡ÇÑ´Ù.
    ¸Þ¼¼Áö> pg_ctl: server does not shut down

    Attempt Normal Stop: bash-3.1$pg_ctl stop
    Attempt Smart Stop: bash-3.1$pg_ctl stop -m s
    Attempt Fast Stop: bash-3.1$pg_ctl stop -m f
    Attempt Immediate Stop: bash-3.1$pg_ctl stop -m i

 


À̸§ Æнº¿öµå
ºñ¹Ð±Û (üũÇÏ¸é ±Û¾´À̸¸ ³»¿ëÀ» È®ÀÎÇÒ ¼ö ÀÖ½À´Ï´Ù.)
¿ÞÂÊÀÇ ±ÛÀÚ¸¦ ÀÔ·ÂÇϼ¼¿ä.
 

miwit.com sir.co.kr DNS Powered by DNSEver.com DNS Powered by DNSEver.com