Query Database

Click here for aggregate storage version

Get advanced information about the current state of the database.

Minimum permission required: Read. This statement requires the database to be started.


query database sample.basic get member_calculation 'Profit per Ounce';

query database sample.basic list lro before '09_16_2003';


You can query for database information in the following ways using query database.

Key Phrase Explanation
get active alias_table Display the active alias table for the user issuing the statement.
get attribute_info Get attribute member, dimension, and name information for the specified attribute member.
get attribute_spec Display the current attribute specifications for the database. These specifications include attribute member name format, Attribute Calculation dimension member names, Boolean and date member names, and numeric range specifications. These settings are defined in Outline Editor.
get currency_rate Display the currency rate for every currency partition.
get dbstats dimension Get information about dimensions.
get dbstats data_block Get information about data blocks.
get default calculation View the contents of the calculation designated as default for the database. The default calculation refers to either the relations defined in the database outline (CALC ALL) or to the set of calc strings defined as the default database calculation.
get member_info <MEMBER-NAME> Get information on a specific member.
get member_calculation <MEMBER-NAME> View the formula associated with the selected member.
get estimated size Display an estimate of the number of blocks a database will create after full calculation (CALC ALL), based on the number of blocks that exist before calculation. The database can have all data loaded, or it can have a random sampling of data loaded. Outlines that contain sparse formulas of any type or topdown formulas are not supported. Results of the estimation on such databases may be invalid.
performance statistics ... table Display one of several choices of performance statistics tables. Before you can use this statement, you must enable performance statistics gathering, using alter database <dbs-name> set performance statistics enabled.
list alias_table Get a list of alias tables that are defined for the database.
list alias_names in alias_table List the alias names defined in an alias table. Alias tables contain sets of aliases for member names and are stored in the database outline. Use this grammar to see a list of alias names defined in the specified table.
list lro Get information about linked objects, including the object type, name, and description, based on criteria you specify. If you specify both a user name and modification date, objects matching both criteria are listed. If you specify no user name or date, a list of all linked objects in the database is displayed.
list ... file information Get accurate index and data file information. Provides index and data file names, counts, sizes, and totals, and indicates whether or not each file is presently opened by Analytic Services. The file size information is accurate. Note that the file size information provided by the Windows NT operating system for index and data files that reside on NTFS volumes may not be accurate.
score miner ... Scoring a model is similar to applying a model to the data in a database. However, scoring is executed synchronously and the results are not written back into the database; rather, they are returned in XML for Analysis format. To load a model in preparation for scoring, see create mining result. To score a model, use this statement. To unload the model after scoring, use alter system (stop mining session).

Output Columns

For get dbstats dimension, the index_type field values are numeric, and translate as follows:

0               Dense
1               Sparse
3               None (database is aggregate storage)

For get dbstats data_block, the type field values are numeric, and translate as follows:

0               Array
1               AVL (or "B+ Tree")

For get member_info, the unary_type field values are numeric, and translate as follows:

0               Add
1               Subtract
2               Multiply
3               Divide
4               Percent
5               NoRollUp

For get member_info, the member_tag_type field values translate as follows:

0               SkipNone
16384           SkipMissing
32768           SkipZero
49152           SkipBoth
1               BalFirst
2               BalLast
4               TwoPass
8               Average
64              Expense

Variations are possible. The field value consists of one of the first four "skip" values plus any/all/none of the last five values. Some examples:

0               SkipNone
77              SkipNone, BalFirst, TwoPass, Average, Expense
16385           SkipMissing and BalFirst

The first four "skip" values are base values, and added to them are combinations of 1, 2, 4, 8, and 64.

For get member_info, the status field values are hexadecimal, and translate as follows:

0               Normal
1               Never Share
2               Label
4               Refer Share
8               Refer Share (with different name)
16              Implicit share
32              Virtual Member (stored)
64              Virtual Member (not stored)
2048            Attribute
32768           Referred