How do you find out the current size of an SQLDB instance in Bluemix - ibm-cloud

How do you know the current size of an SQLDB? Normally with DB2 I would check how much diskspace there is left to understand if the database is starting to get full. But as I don't have access to the file system I would like to know what the recommended alternative method is.
Best Regards
W

There is a built-in routine that might be able to help you:
CALL GET_DBSIZE_INFO(?, ?, ?, -1)
You can see more information about the routine on the IBM Knowledge Center. The routine above would return something like this, for example:
Value of output parameters
--------------------------
Parameter Name : SNAPSHOTTIMESTAMP
Parameter Value : 2004-02-29-18.31.55.178000
Parameter Name : DATABASESIZE
Parameter Value : 22302720
Parameter Name : DATABASECAPACITY
Parameter Value : 4684793856
Return Status = 0

You can find the SQLDB usage details by clicking the Profile Settings icon in the upper-right corner of the Bluemix user interface and selecting Account -> Usage Details. If you expand Service Charges, you should see your db instance listed with a $$ figure denoted. On the right, you can expand the twistie and you should be able to see your current usage in GBs.

Related

Section Access in OBIEE 12c

I'm trying to Implement Section Access in OBIEE 12c . I referred a Blog and followed the steps to Implement Section Access . But the End Result is not as Expected .
Blog Link : http://bisimplified.blogspot.com/2014/06/obiee-11g-datarow-level-security.html
First I created "User_1" and Assigned that user to "BI Consumer" Application Role.
I want to display only certain data to the "User_1".
Created Initialization Block .
This is the SQL Statement I used to define the Initialization Block ( Data Source ) :
select pc.category_name from dim_category ft , product_categories pc where ft.category_id=pc.category_id and lower(ft.username) = lower(':USER') .
(Screenshot of Initialization Block created )
I assigned 'default' (String) to Default Initializer and Check in the " Row-Wise Initialization" and "Use Caching" ( Initialization Block (Block we are working on ) -> Edit Variable Target -> New ( Variable )) .
(Screenshot of Session Variable created)
Else , an error prompted at the assigning the Section variable to the Application Role / User , if the Default Initializer is left empty .
(Screenshot of Error Message if the Default Initializer left empty and try to assign that Section variable to the Application Role / User ).
Is there anything to be done with Session Variable ?
After that I assign this Session Variable to the "BI Consumer " Application Role .
(Screenshot of Assigning Session Variable to "BI Consumer" Application Role )
I request to give suggestion on " Implementing Section Access " in OBIEE 12c or if there is anything you like to Add in the above steps please correct me.
Consolidated answer for general knowledge: "Section Access" is a misnomer. The intent is "row-level security".
The problem mentioned with the query above stems primarily from the usage of ':USER' which most likely is "weblogic" and who owns/has no data for that query.
The query must be validated using a user account which actually brings back data.
Secondly, since the query is set to row-wise initialization it must bring back value pairs representing the variable name and an actual value.
Section_Variable | CategoryA
Section_Variable | CategoryB
etc
So the SQL must pull
select
'Section_Variable',
ft.category_name
from
.....

How to read info on voltage/beam energy, imaging mode, acquisition date/timestamp, etc. from image meta-data? (Tags)

DM scripting beginner here, almost no programming skills.
I would like to know the commands to access all the metadata of DM images/spectra.
I realized that all my STEM images at 80 kV taken between 2 dates (let's say 02.11.2017-05.04.2019) have the scale calibration wrong by the same factor (scale of all such images needs to be multiplied by 1.21).
I would like to write a script which multiplies the scale value by a factor only for images in scanning mode at 80 kV taken during a period for all images in a folder with subfolders or for all images opened in DM and save the new scale value.
I checked this website http://digitalmicrograph-scripting.tavernmaker.de/other%20resources/Old-DMHelp/AllFunctions.html but only found how to call the scale value (ImageGetDimensionCalibration). I have a general idea how to write the script based on other scripts if I find out how to call the metadata.
If anyone can write the whole script for me I would greatly appreciate your effort.
All general meta-data is organized in the image tag-structure
You can see this, if you open the Image Display Info of an image. (Via the menu, or by pressing CTRL + D) and then browse to the "Tags" section:
All info on the right are image tags and they are organized in a hierarchical tree.
How this tree looks like, and what information is written where, is totally open and will depend on what GMS version you are using, how the hardware is configured etc. Also custom scripts might alter this information.
So for a scripting start, open the data you want to modify and have a look in this tree.
Hint: The following min-script can be useful. It opens a tag-browsing window for the front-most image but as a modeless dialog (i.e. you can keep it open and interact with other parts):
GetFrontImage().ImageGetTagGroup().TagGroupOpenBrowserWindow(0)
The information you need to check against is most probably found in the Microscope Info sub-tree. Here, usually all information gathered from the microscope during acquisition is stored. What is there, will depend on your system and how it is set up.
The information of the STEM image acquisition - as far as the scanning engine and detector is concerned - is most probably in the DigiScan sub-tree.
The Data Bar sub-tree usually contains date and time of creation etc.
Calibration values are not stored in the image tag-structure
What you will not find in this tag-structure is the image calibration, i.e. the values actually used by DM to display calibrated values. These values are "one level up" so to speak here:
This is important to know in the following for your script, because you will need different commands for both the "meta-data" from the tags, and the "calibration" you want to change.
Accessing meta-data by script
The script-commands you need to read from the tags are all described in the F1 help documentation here:
Essentially, you need a command to get the "root" TagGroup of an image, which is ImageGetTagGroup() and then you traverse within this tree.
This might seem confusing - because there are a lot of slightly different commands for the different types of stored tags - but the essential bits are easy:
All "Paths" through the tree are just the individual names (typed exactly)
For each "branch" you have to use a single colon :
The commands to set/get a tag-value all require as input the "root" tagGroup object and the "path" as a string. The get commands require a variable of matching type to store the value in, the set commands need the value which should be written.
= The get commands themeselves return true or false depending on whether or not a tag-path could be found and the value could be read.
So the following script would read the "Imaging Mode" from the tags of the image shown as example above:
string mode
GetFrontImage().ImageGetTagGroup().TagGroupGetTagAsString( "Microscope Info:Imaging Mode", mode )
OKDialog( "Mode: " + mode )
and in a little more verbose form:
string mode // variable to hold the value
image img // variable for the image
string path // variable/constant to specify the where
TagGroup tg // variable to hold the "tagGroup" object
img := GetFrontImage() // Use the selected image
tg = img.ImageGetTagGroup() // From the image get the tags (root)
path = "Microscope Info:Imaging Mode" // specify the path
if ( tg.TagGroupGetTagAsString( path, mode ) )
OKDialog( "Mode: " + mode )
else
Throw( "Tag not found" )
If the tag is not a string but a value, you will need the according commands, i.e.
TagGroupGetTagAsNumber().

how to disable 2nd parameter we select 1st parameter in crystal reports

Please guide how to do this requirement.
I Have a report having 2 command level parameters a and b.
If they select any of the one parameter then other one should be disabled/should not ask any value to enter /should not take any value .
Please suggest how to do
Command don't support optional parameters. Moreover, you can't disable or hide a parameter based on another parameter's value.
Your best option is to create a parameter that has a default value that will be 'ignored' by the query.
For example, given this Access command:
SELECT *
FROM customer
WHERE region='{?Region}'
with this parameter:
you will note that the parameter's Optional Prompt setting is false (and not editable):
Instead, you will need to a default, something like 'ALL' (or -1, in the case of a numeric value):
Modify the command accordingly:
SELECT *
FROM customer
WHERE ( '{?Region}'='ALL' OR region='{?Region}' )
This should be a feature of the user interface. You can implement it if you write your own software. The only viewer , which MIGHT be able to do this is R-Tag (www.r-tag.com). But even it will need to do some workaround ( if can do it at all). This behavior is very unique. Why would you need to have it ?

Get statuscode text in C#

I'm using a plugin and want to perform an action based on the records statuscode value. I've seen online that you can use entity.FormattedValues["statuscode"] to get values from option sets but when try it I get an error saying "The given key was not present in the dictionary".
I know this can happen when the plugin cant find the change for the field you're looking for, but i've already checked that this does exist using entity.Contains("statuscode") and it passes by that fine but still hits this error.
Can anyone help me figure out why its failing?
Thanks
I've not seen the entity.FormattedValues before.
I usually use the entity.Attributes, e.g. entity.Attributes["statuscode"].
MSDN
Edit
Crm wraps many of the values in objects which hold additional information, in this case statuscode uses the OptionSetValue, so to get the value you need to:
((OptionSetValue)entity.Attributes["statuscode"]).Value
This will return a number, as this is the underlying value in Crm.
If you open up the customisation options in Crm, you will usually (some system fields are locked down) be able to see the label and value for each option.
If you need the label, you could either do some hardcoding based on the information in Crm.
Or you could retrieve it from the metadata services as described here.
To avoid your error, you need to check the collection you wish to use (rather than the Attributes collection):
if (entity.FormattedValues.Contains("statuscode")){
var myStatusCode = entity.FormattedValues["statuscode"];
}
However although the SDK fails to confirm this, I suspect that FormattedValues are only ever present for numeric or currency attributes. (Part-speculation on my part though).
entity.FormattedValues work only for string display value.
For example you have an optionset with display names as 1, 2, 3,
The above statement do not recognize these values because those are integers. If You have seen the exact defintion of formatted values in the below link
http://msdn.microsoft.com/en-in/library/microsoft.xrm.sdk.formattedvaluecollection.aspx
you will find this statement is valid for only string display values. If you try to use this statement with Integer values it will throw key not found in dictionary exception.
So try to avoid this statement for retrieving integer display name optionset in your code.
Try this
string Title = (bool)entity.Attributes.Contains("title") ? entity.FormattedValues["title"].ToString() : "";
When you are talking about Option set, you have value and label. What this will give you is the label. '?' will make sure that the null value is never passed.

How do I create a manual link on a tree in Oracle APEX when Session State Protection is turned on?

Friends,
I'm facing another challenge in APEX and I hope you can help.
I have created a tree using the method described in John & Scott's superb book, "Pro Application Express" whereby the page link is stored in a table. Below is an example:
go to a page passing some parameters
f?p=&APP_ID.:3:&SESSION.::::P3_IDENTIFIER,P3_FAMILY_NAME:&P2_IDENTIFIER.,&P2_FAMILY_NAME.
When the page is run this works as expected. I can expand the tree and navigate to the page passing parameters if required.
However when I turned on session state protection these "hand crafted" links stopped working. Which I expected because the link contains no checksum.
After some investigation I see I have to use APEX_UTIL.PREPARE_URL to generate the URL with a checksum. Unfortunately this is where I run into problems. I can't seem to be able to pass the parameters values to the calling page.
The original tree query was:
select "IDENTIFIER" id,
"PARENT_IDENTIFIER" pid,
"TITLE" name,
"LINK" link,
null a1,
null a2
from <some table>
I then changed this to use APEX_UTIL.PREPARE_URL:
....
APEX_UTIL.PREPARE_URL('f?p='||:APP_ID||':3:'||:APP_SESSION||'::::P3_IDENTIFIER,P3_FAMILY_NAME:&P2_IDENTIFIER.,&P2_FAMILY_NAME.') link,
...
and this works, the page is called and I can see the values of the parameters passed. But I can't use this method as it is restricted to the one page!
Finally I tried storing the page number, parameters and parameter values in different columns of the table that the tree is based on and then bring them together:
...
APEX_UTIL.PREPARE_URL('f?p='||:APP_ID||':'||navigate_to_page||':'||:APP_SESSION||'::::'||parameters||':'||parameter_values) link,
...
Where:
navigate to page has the value of: 3
parameters has the value of: P3_IDENTIFIER,P3_FAMILY_NAME
parameter_values has the values of: &P2_IDENTIFIER.,&P2_FAMILY_NAME.
This now calls the page, but the parameter values have become literals. so where I'm expecting an identifier I see &P2_IDENTIFIER and ditto for family name.
What am I doing wrong? How can I pass values to my called page using apex_util_prepare_url?
In case of need, my environment details are: Apex 3.2.1, Oracle Application Server 10.1.2.3. Oracle Database 10.2.0.3
Thanks in advance for any help you may be able to provide.
I think you'll need to resolve those variables, using the v() function:
APEX_UTIL.PREPARE_URL('f?p='||:APP_ID
||':'||navigate_to_page
||':'||:APP_SESSION
||'::::'||parameters
||':'||v('P2_IDENTIFIER')||','||v('P2_FAMILY_NAME')) link,
On a side note, you might need to be careful about P2_FAMILY_NAME since it's being used in the url; it sounds like a plain text field which contains user-entered data?