Active IQ Unified Manager Discussions

Domain User View in OnCommand

israelmmi
6,712 Views

Hi Adai,

I had a question I wondered maybe you knew the answer to. I read through TR-3690, as you posted above. I ran a Sybase DB command to query the server for all tables, and received a list. As you may notice in the Crystal Reports screen shot in that document above, there are two DB owners on tables - some are owned by 'DFM' and some by 'DFMGROUP'. I would like to query the tables owned by 'DFM' by running the command :"dfm database query run" but I get an error message:

dfm database query run "select * from domains"

Error preparing select * from domains: (-141) [Sybase][ODBC Driver][SQL Anywhere]Table 'domains' not found

Error: Error preparing select * from domains: -141: [Sybase][ODBC Driver][SQL Anywhere]Table 'domains' not found

How can I query the 'DFM' owned tables?

Thanks,

Reuvy

12 REPLIES 12

amirm
6,691 Views

Hi Reuvy,

Could you please check for the user with which you are trying to run the query has DB access enabled?

If not please run this command to enable the DB access for this user from DFM CLI:

dfm database access enable -u <user-name-or-id>

Regards,

-Amir

israelmmi
6,691 Views

Hi Amir,

I figured I was using a user who add access since the other tables work just fine for me. When you run the command "dfm database user list", you have a user listed there called "Administrator"?

Reuvy

amirm
6,691 Views

Hi Reuvy,

Yes I am logged in as user "Administrator" and running the query. However I found that this user need not be listed under "dfm database user list".

In your case you might have to create a DB user using "dfm database user create" and give access to this user using "dfm database access enable" cli.

Regards,

-Amir

israelmmi
6,691 Views

Genius Watson!

So I tried it with our Domain 'Administrator' account and it worked. Just my own username isn't loved. How do I tackle that?

-R

amirm
6,691 Views

Cool! To be able to use the non-admin account, as I said in last post, create a DB user and enable DB access for that user using DFM CLIs.

Regards,

-Amir

adaikkap
6,690 Views

Hi Reuvy,

     We dont have a view for domains. The list of database view that are exposed are documented along with their schema under the following location.

http://<dfm server name/id>:8080/help/dfm.htm#%3E%3Ecmd=1%3E%3Epan=2

Database schema

Database schema for DataFabric Manager non-historic data

Database schema for DataFabric Manager historic data

Relationship among fields of various database views

Regards

adai

israelmmi
6,690 Views

Hi Adai,

Amir was right. Although you don't have a view, I just needed to create a new user (didn't matter the name or whatever) and I was able to query the database directly, regardless of whether it was a view or not. What I still did not understand was what good did the user creation do, if my username and the username I created were totally different. It was not like in between running the same command I entered in a username or something. And also, why when I used the Administrator account that worked even without creating a new username.

Reuvy

adaikkap
6,690 Views

Hi Reuvy,

     You used a unsupported cli to query the db directly which is not supposed to be used. The user creation was to access the readonly views exposed, where as you accessed the db directly which can be done by any user who belong to the local administrator group of that windows box as by virtue of being an user of admin group they get DFM global full control capability.

Pls refrain from using the cli as customers are not supposed to query the db directly except when asked by netapp support.

Hope this helps.

Regards

adai

israelmmi
6,690 Views

Hey Adai,


Here is where I disagree -

  • Both accounts that I am using are members of the Local Administrators group on the DFM server
  • Even without running the command "dfm database user create" command I can access all of the views listed
  • The only difference that the above command made was that it allowed me to access the monitors table (amongst others)
  • I opened up a support case about this, and both I and the engineer realized that when we create any account it gives us access, although neither of us really understood why.

Ultimately, I want to access OSSV Backup Job data which none of your views (sadly) provide. The reporting for OSSV is horrific (or really non-existant) so I am looking to export the data and generate reports myself on the data. Essentially, all I want is to just export the data, a seemingly harmless task. I already previously turned to PS for help with this and they provided me with the above document to connect to the Sybase DB and query the data directly. The problem is that unless you have Sybase in house, none of the query tools I tested were able to connect to the DB. So creating an ODBC connection as the document referenced above shows doesn't help. Besides, if the native "dfm..." commands give me the same info just fine, why bother with ODBC.

If you are up to taking feature requests, maybe you can add a request to add views for OSSV tables as well.

Cheers,

Reuvy

adaikkap
5,163 Views

Hi Reuvy,

     I tried the same and logged into the DFM box( running on windows as Administrator)

C:\>dfm database user list

There are no database users or the specified database user does not exist.

C:\>dfm database query run "SELECT * FROM objectView"

Error: Database access denied.

Enable the database access to one of the database users

using 'dfm database access enable' CLI.

C:\>dfm database user create -u db_user -p dbuser123

Created database user 'db_user'.

C:\>dfm database access enable -u db_user

Enabled database access for user 'db_user'

C:\>

C:\>dfm database query run "SELECT * FROM objectView" | more

"objId","objName","objFullName","objDescription","objType","objStatus","objPerfStatus"

"1","vmwin186-206","vmwin186-206","","Mgmt Station","Error","Unknown"

"2","GlobalRead","GlobalRead","View information in DataFabric Manager","Role","Unknown","Unknown"

"3","GlobalQuota","GlobalQuota","View user quota reports and events","Role","Unknown","Unknown"

"4","GlobalWrite","GlobalWrite","View and modify information in DataFabric Manager","Role","Unknown","Unknown"

"5","GlobalDelete","GlobalDelete","View, modify and delete information in DataFabric Manager","Role","Unknown","Unknown"

"6","GlobalBackup","GlobalBackup","Create and manage backups","Role","Unknown","Unknown"

"7","GlobalRestore","GlobalRestore","Perform restore operations from backups","Role","Unknown","Unknown"

"8","GlobalMirror","GlobalMirror","Manage replication and failover policies","Role","Unknown","Unknown"

"9","GlobalSAN","GlobalSAN","Create, expand and destroy LUNs","Role","Unknown","Unknown"

"10","GlobalSRM","GlobalSRM","View SRM path walk information","Role","Unknown","Unknown"

As you can clearly see that untill I create a db user I and not able to access the views.

Regards

adai

israelmmi
5,163 Views

Hi Adai,

You are right, and after trying a few times, I am back to my original problem where I cannot access the domains table again.

This is what I did:

C:\>dfm database user create -u dfmuser -p password
Created database user 'dfmuser'.

C:\>dfm database access enable -u dfmuser
Enabled database access for user 'dfmuser'

C:\>dfm database user list
User Id  User Name            Database Access Status
-------- -------------------- -------------------------
105      dfmuser              Enabled

C:\>dfm database query run "select * from lunview" | more
"lunId","lunHostId","lunSize","lunDescription"
"5531","5410","408039690240"," "
"5939","72","4836464640"," "

C:\>dfm database query run "select * from domains"
Error preparing select * from domains: (-141) [Sybase][ODBC Driver][SQL Anywhere]Table 'domains' not found
Error: Error preparing select * from domains: -141: [Sybase][ODBC Driver][SQL Anywhere]Table 'domains' not found

Now how do I regain access to the domains table?

adaikkap
5,163 Views

Hi Reuvy,

     As I said earlier, only those documented under the following link in you dfm server has view and we dont have a view exposed for domains.

http://<dfm server name/id>:8080/help/dfm.htm#%3E%3Ecmd=1%3E%3Epan=2

Database schema

Database schema for DataFabric Manager non-historic data

Database schema for DataFabric Manager historic data

Relationship among fields of various database views

Regards

adai

Public