Ask Your Question
0

Viewing all db tables in cinder [closed]

asked 2015-03-01 08:45:57 -0600

Pradip gravatar image

Hello,

Is there a way through which I can view what all db tables are defined for a particular service, say Cinder. Then I want to browse through the tables to see the content.

Thanks, Pradip

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by Pradip
close date 2015-03-01 22:19:55.357411

1 answer

Sort by ยป oldest newest most voted
2

answered 2015-03-01 15:20:04 -0600

Login to your DB server and view the tables.

For mysql:

select the DB you want to view. mysql> use cinder;

Show all tables in that DB.

mysql> show tables;
+--------------------------+
| Tables_in_cinder         |
+--------------------------+
| backups                  |
| encryption               |
| iscsi_targets            |
| migrate_version          |
| quality_of_service_specs |
| quota_classes            |
| quota_usages             |
| quotas                   |
| reservations             |
| services                 |
| snapshot_metadata        |
| snapshots                |
| transfers                |
| volume_admin_metadata    |
| volume_glance_metadata   |
| volume_metadata          |
| volume_type_extra_specs  |
| volume_types             |
| volumes                  |
+--------------------------+
19 rows in set (0.01 sec)

Show tables definitions.

mysql> describe volumes;
+---------------------+--------------+------+-----+---------+-------+
| Field               | Type         | Null | Key | Default | Extra |
+---------------------+--------------+------+-----+---------+-------+
| created_at          | datetime     | YES  |     | NULL    |       |
| updated_at          | datetime     | YES  |     | NULL    |       |
| deleted_at          | datetime     | YES  |     | NULL    |       |
| deleted             | tinyint(1)   | YES  |     | NULL    |       |
| id                  | varchar(36)  | NO   | PRI | NULL    |       |
| ec2_id              | varchar(255) | YES  |     | NULL    |       |
| user_id             | varchar(255) | YES  |     | NULL    |       |
| project_id          | varchar(255) | YES  |     | NULL    |       |
| host                | varchar(255) | YES  |     | NULL    |       |
| size                | int(11)      | YES  |     | NULL    |       |
| availability_zone   | varchar(255) | YES  |     | NULL    |       |
| instance_uuid       | varchar(36)  | YES  |     | NULL    |       |
| mountpoint          | varchar(255) | YES  |     | NULL    |       |
| attach_time         | varchar(255) | YES  |     | NULL    |       |
| status              | varchar(255) | YES  |     | NULL    |       |
| attach_status       | varchar(255) | YES  |     | NULL    |       |
| scheduled_at        | datetime     | YES  |     | NULL    |       |
| launched_at         | datetime     | YES  |     | NULL    |       |
| terminated_at       | datetime     | YES  |     | NULL    |       |
| display_name        | varchar(255) | YES  |     | NULL    |       |
| display_description | varchar(255) | YES  |     | NULL    |       |
| provider_location   | varchar(256) | YES  |     | NULL    |       |
| provider_auth       | varchar(256) | YES  |     | NULL    |       |
| snapshot_id         | varchar(36)  | YES  |     | NULL    |       |
| volume_type_id      | varchar(36)  | YES  |     | NULL    |       |
| source_volid        | varchar(36)  | YES  |     | NULL    |       |
| bootable            | tinyint(1)   | YES  |     | NULL    |       |
| attached_host       | varchar(255) | YES  |     | NULL    |       |
| provider_geometry   | varchar(255) | YES  |     | NULL    |       |
| _name_id            | varchar(36)  | YES  |     | NULL    |       |
| encryption_key_id   | varchar(36)  | YES  |     | NULL    |       |
| migration_status    | varchar(255) | YES  |     | NULL    |       |
+---------------------+--------------+------+-----+---------+-------+
32 rows in set (0.05 sec)

Getting some information from the tables.

mysql> select id, display_name,status from volumes;
+--------------------------------------+---------------------+-----------+
| id                                   | display_name        | status    |
+--------------------------------------+---------------------+-----------+
| 4c4cc1c3-f4da-414e-aece-f1ac38a9de82 | test-vol            | in-use    |
| 68b44c28-155d-484e-836d-b7fec5ca851e | webserverImported_1 | deleted   |
| cf1184f7-ecde-4af9-9a95-77f2a014d8d3 | db-data             | available |
+--------------------------------------+---------------------+-----------+
3 rows in set (0.05 sec)
edit flag offensive delete link more

Comments

Thanks a lot for such a detailed explanation.

Pradip gravatar imagePradip ( 2015-03-01 22:19:16 -0600 )edit

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower

Stats

Asked: 2015-03-01 08:45:57 -0600

Seen: 473 times

Last updated: Mar 01 '15