Oracle9i OLAP Services Developer's Guide to the OLAP DML Release 1 (9.0.1) Part Number A86720-01 |
|
Defining and Working with Analytic Workspaces, 12 of 12
The DBDESCRIBE program displays a complete description of your analytic workspace, including:
Because the output from DBDESCRIBE is frequently very long, you can direct it to a file with the OUTFILE command.
outfile 'filename' dbdescribe outfile eof
The DATABASE function returns various kinds of information about attached analytic workspaces. For example, you can use the DATABASE function to learn your read or write access rights to an analytic workspace or to determine if an attached analytic workspace has been changed by a user with read/write access.
For the complete syntax for the DATABASE function, see the OLAP DML Reference. The simplified syntax of the DATABASE function is shown below.
DATABASE(choice [database-name])
The keyword you specify for choice determines the type of information that is returned by the DATABASE function. Examples of keywords are: ATTACHED, CHANGED, FILESIZE, NAME, RO, and RW.
For example, the following commands check which analytic workspace is active so the program can choose the appropriate data to report.
if DATABASE(NAME) eq 'MYSALES' then report sales.m else report gensales
You can retrieve a list of the objects in an analytic workspace by using the LISTNAMES program. This program lists all the objects in the analytic workspace, grouped by object type and alphabetized within object type. LISTNAMES shows the total number of each type of object (dimension, variable, and so on).
If the demo
analytic workspace is attached, issuing the command listnames
produces the following output.
To display the definitions of one or more objects, use the DESCRIBE command. For example, you can issue the following command for the demo
analytic workspace.
describe price
It produces the following output.
DEFINE PRICE VARIABLE DECIMAL <MONTH PRODUCT> LD Wholesale Unit Selling Price
If you execute the DESCRIBE command without any object names, all the objects in the current status list of the NAME dimension are described.
Use the LISTBY command to retrieve a list of all objects that are dimensioned by, or related to, a given dimension.
For example, to find out which objects in the demo
analytic workspace are dimensioned by, or related to, MONTH, you can use the following command.
listby month
The following list is displayed.
14 objects dimensioned by or related to MONTH in database DEMO -------------------------------------------------------------- ACTUAL ADVERTISING BUDGET EXPENSE FCST NATIONAL.SALES PRICE PRODUCT.MEMO SALES SALES.FORECAST SALES.PLAN SHARE UNITS UNITS.M
To obtain information about OLAP DML objects, you can use the OBJ function.
The following command obtains the number of dimensions for the variable UNITS in the demo
analytic workspace. The output is shown below the command.
show obj(numdims 'units') 3
The following command obtains the data type of the UNITS variable. The output is shown below the command.
show obj(data 'units') INTEGER
You often use the OBJ function in conjunction with the LIMIT command and the NAME dimension in order to obtain information about groups of objects. The LIMIT command sets the status of a dimension. This means that it restricts the accessibility of dimension values, which sets a corresponding restriction on any variables or relations that are dimensioned by them. The NAME dimension contains the names of all the objects that are defined in the analytic workspace.
You can use the LIMIT command together with the OBJ function to identify a group of objects with a particular characteristic. Then, you can list the objects in the group using the STATUS command.
The following commands lists the objects that are dimensioned by both MONTH and PRODUCT.
limit name to obj(isby 'month') and obj(isby 'product') status name
The output of these commands is shown below.
The current status of NAME is: ADVERTISING, EXPENSE, NATIONAL.SALES, PRICE, PRODUCT.MEMO, SALES, SALES.FORECAST, SALES.PLAN, SHARE, UNITS, UNITS.M
For more information, see the following table.
|
Copyright © 1996-2001, Oracle Corporation. All Rights Reserved. |
|