How to find out content-views association using postgres database queries in the Red Hat Satellite?
Environment
- Red Hat Satellite 6.x
Issue
- How to find out content-views association in satellite using postgres database queries.
- How to find out where the content views is being used ?
Resolution
Note: Following database queries are sensitive, hence use it carefully. Put proper content view ID/Name and other details in the following queries.
- To Login into the
database.
# su - postgres -c "psql foreman"
- To find out all details of the
content-view. Such as ID, Organization id, Created and updated time with the date.
foreman=# SELECT * FROM katello_content_views WHERE name = 'ContentViewToDelete';
- To find out the hosts which are using this
content-view.
foreman=# SELECT * FROM katello_systems WHERE content_view_id = <ID>;
- To find out the
activation keyswhich are using thiscontent-view.
foreman=# SELECT * FROM katello_activation_keys WHERE content_view_id = <ID>;
- To find out all associations of the
content-view.
foreman=# SELECT * FROM katello_content_facets WHERE content_view_id= <ID>;
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
