Show Table of Contents
2.6. 기록 데이터베이스에 대한 읽기 전용 액세스 허용
편집을 허용하지 않고 기록 데이터베이스에 대한 액세스를 허용하려면
ovirt_engine_history 데이터베이스에 로그인하여 데이터를 읽을 수 있는 읽기 전용 PostgreSQL 사용자를 만들어야 합니다. 이 절차는 기록 데이터베이스가 설치된 시스템에서 실행해야 합니다.
절차 2.1. 기록 데이터베이스에 대한 읽기 전용 액세스 허용
- 기록 데이터베이스에 대한 읽기 전용 액세스를 부여할 사용자를 만듭니다.
# psql -U postgres -c "CREATE ROLE [user name] WITH LOGIN ENCRYPTED PASSWORD '[password]';" -d ovirt_engine_history
- 새로 만든 사용자에게 기록 데이터베이스에 연결할 수 있는 권한을 부여합니다.
# psql -U postgres -c "GRANT CONNECT ON DATABASE ovirt_engine_history TO [user name];"
- 새로 만든 사용자에게
public스키마 사용을 허용합니다.# psql -U postgres -c "GRANT USAGE ON SCHEMA public TO [user name];" ovirt_engine_history
- 새로 만든 사용자에게 부여할 나머지 권한을 생성하여 파일에 저장합니다.
# psql -U postgres -c "SELECT 'GRANT SELECT ON ' || relname || ' TO [user name];' FROM pg_class JOIN pg_namespace ON pg_namespace.oid = pg_class.relnamespace WHERE nspname = 'public' AND relkind IN ('r', 'v');" --pset=tuples_only=on ovirt_engine_history > grant.sql - 이전 단계에서 만든 파일을 사용하여 새로 만든 사용자에게 권한을 부여합니다.
# psql -U postgres -f grant.sql ovirt_engine_history
- 새로 만든 사용자에게 권한을 부여하는 데 사용한 파일을 제거합니다.
# rm grant.sql
이제 다음 명령을 사용하여 새로 만든 사용자로
ovirt_engine_history 데이터베이스에 액세스할 수 있습니다.
# psql -U [user name] ovirt_engine_history
ovirt_engine_history 데이터베이스의 테이블 및 보기에 대한 SELECT 문은 성공하지만 수정은 실패합니다.

Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.