http://iotn.co.kr 연락처: gilho.kr@gmail.com [ The Japanese government should apologize to Japanese Military Sexual Slavery victim. / 日本政府は日本軍の性的奴隷?牲者に謝罪すべき. ]

사용자

ID:
PW:

INDEX
01.게시판
게시판 [71]
02.File Book
File 자료실 [95]
Site Link [17]
개인폴더 [201]
03.Field Book
Altibase [19]
Tibero [30]
MS-SQL [25]
MySQL [43]
DB2 [79]
ORACLE [3003]
PSQL [134]
기타정보 [155]
운영체제 [603]
04.Q/A Book
Q/A [53]
05.방명록
방명록 [54]
레벨업 [37]
구인/구직 [2]

기념일
Search
LINK
+ 가족 Hompy
+ DNSEver
IOTN :: Field Book :: PostgreSQL

 회원가입

/usr/bin/initdb -D /var/lib/pgsql/test [ Instance 추가 ]
최길호 [LIST]   2021-11-05 10:14:46, 조회 : 128

-bash-4.1$ echo $PGDATA
/var/lib/pgsql/data
-bash-4.1$ ps -ef | grep $PGDATA
postgres 23534     1  0 Nov04 ?        00:00:01 /usr/bin/postmaster -p 5432 -D /var/lib/pgsql/data


DB 운영중 instance 추가 / port, DB 위치 다르면 가능


-bash-4.1$ rm -rf /var/lib/pgsql/test
-bash-4.1$ /usr/bin/initdb -D /var/lib/pgsql/test
The files belonging to this database system will be owned by user "postgres".
This user must also own the server process.

The database cluster will be initialized with locale en_US.UTF-8.
The default database encoding has accordingly been set to UTF8.
The default text search configuration will be set to "english".

creating directory /var/lib/pgsql/test ... ok
creating subdirectories ... ok
selecting default max_connections ... 100
selecting default shared_buffers ... 32MB
creating configuration files ... ok
creating template1 database in /var/lib/pgsql/test/base/1 ... ok
initializing pg_authid ... ok
initializing dependencies ... ok
creating system views ... ok
loading system objects' descriptions ... ok
creating conversions ... ok
creating dictionaries ... ok
setting privileges on built-in objects ... ok
creating information schema ... ok
vacuuming database template1 ... ok
copying template1 to template0 ... ok
copying template1 to postgres ... ok

WARNING: enabling "trust" authentication for local connections
You can change this by editing pg_hba.conf or using the -A option the
next time you run initdb.

Success. You can now start the database server using:

    /usr/bin/postgres -D /var/lib/pgsql/test
or
    /usr/bin/pg_ctl -D /var/lib/pgsql/test -l logfile start

-bash-4.1$ vi /var/lib/pgsql/test/postgresql.conf
listen_addresses = '*'
port = 5433

-bash-4.1$ /usr/bin/pg_ctl -D /var/lib/pgsql/test -l logfile start
server starting
-bash-4.1$ psql -h localhost -p 5433
psql (8.4.20)
Type "help" for help.

postgres=# \l
                                  List of databases
   Name    |  Owner   | Encoding |  Collation  |    Ctype    |   Access privileges  
-----------+----------+----------+-------------+-------------+-----------------------
postgres  | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 |
template0 | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 | =c/postgres
                                                             : postgres=CTc/postgres
template1 | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 | =c/postgres
                                                             : postgres=CTc/postgres
(3 rows)

postgres=# \du
            List of roles
Role name | Attributes  | Member of
-----------+-------------+-----------
postgres  | Superuser   | {}
           : Create role  
           : Create DB    

postgres=# \q

-bash-4.1$ pg_ctl stop -D /var/lib/pgsql/test
waiting for server to shut down.... done
server stopped

3.235.60.197


  LIST

제목 작성자 작성일 조회
Admin  psql 10.7 oracle dblink [ oracle_fdw db link ]    최길호 2023/07/25 20
Admin  HA 복구 test    최길호 2023/03/03 31
Admin  log: COPY public.xxxx (xxx, xxx, xxx) TO stdout; / pg_dump 백업시 발생    최길호 2023/03/03 14
Admin  requested timeline x is not a child of this server's history    최길호 2023/03/02 16
Admin  recovery_target_action / archive log 받아서 계속 복구    최길호 2023/02/28 25
Admin  recovery_target_action = 'pause' / select pg_wal_replay_pause(); / select pg_get_wal_replay_pause_state();    최길호 2023/02/27 6
Admin  memory buffer cache    최길호 2023/02/06 14
Admin  active session, pid, lock sql , kill pid / pg_terminate_backend    최길호 2023/02/06 60
Admin  psql HA    최길호 2023/02/05 46
Admin  pg_ctl start -D . | postmaster.pid | /tmp/.s.PGSQL.5432 |    최길호 2023/02/03 31
Admin  pg_waldump    최길호 2023/02/03 9
Troubleshoot  $PGDATA/pg_wal/00000002.history 없는경우 [ ERROR: could not open file "pg_wal/00000002.history": ENOENT ]    최길호 2023/02/02 24
Admin  pg_basebackup 복구 test lv:9   최길호 2023/02/02 23
Admin  shmem_exit(0): 0 before_shmem_exit callbacks to make [ 로그 기록용 ]    최길호 2023/02/01 46
Troubleshoot  LOG: invalid resource manager ID in primary checkpoint record    최길호 2023/02/01 24
Admin  pg_restore [ 다른 계정, 다른 DB, sql 파일로 저장 ]    최길호 2023/01/30 16
Admin  pg_basebackup pg_dump pg_dumpall backup script    최길호 2023/01/30 79
Admin  session 정보    최길호 2023/01/27 21

    목록보기   다음페이지 1 [2][3][4][5][6][7]
       

Copyright 1999-2023 Zeroboard / skin by 최길호(gilho.kr@gmail.com)
최근 댓글
최근 게시물
12/01
[ORACLE]
dgmgrl 운영, db11st h/w 교체 시나리....
by 최길호
12/01
[ORACLE]
DGMGRL> show configuration;....
by 최길호
11/23
[운영체제]
arch filesystem 100% full 예방 /....
by 최길호