Presentation is loading. Please wait.

Presentation is loading. Please wait.

SPACI Consortium, CMCC & University of Salento, LECCE

Similar presentations


Presentation on theme: "SPACI Consortium, CMCC & University of Salento, LECCE"— Presentation transcript:

1 SPACI Consortium, CMCC & University of Salento, LECCE
Tutorial on GRelC DAS client command interfaces Ph.D. Sandro Fiore SPACI Consortium, CMCC & University of Salento, LECCE

2 What we will see during the tutorial
Authorization Select Queries Query Memory Query DIME Query Online Query HTML BDII Query: grid-info-search GRelC DAS Tutorial link:

3 Authorization Framework
Before starting be sure you have a valid proxy with the correct GRelC DAS Role. To create a valid proxy, run the following command: > voms-proxy-init --voms gilda:/gilda/grelc/das/grelc02.unile.it/sakila/Role=grelc-db-select With this proxy you will be able to access to the sakila database on grelc02.unile.it (only select statement)

4 Select query To carry out SELECT query you can use the following commands: query-das-memory query-das-dime query-das-online query-das-html The first two kinds of query were designed to address high performance The third should be used to submit DML Statements (Delete, Insert and Update) The last one stores result on the server as HTML pages that can be seen through a HTTP browser

5 Query Memory 1. Display help > grelc-das-query-memory -h
USAGE: query-das-memory [options] -s, --server VAL Sets GRelC DAS IP or hostname (default: localhost) -p, --port NUM Sets GRelC DAS port (default: 18500) -D, --database VAL Sets grid database name -Q, --query VAL Sets query value -c, --chunk NUM Sets chunk dimension (default:0 no chunk) -t, --table Prints result in table format (default) -x, --xml Prints result in xml format -H, --html Prints result in html format -h, --help Shows usage EXAMPLES: query submission without chunking grelc-das-query-memory -s hostname -p D database -Q 'select * from table' query submission with chunking grelc-das-query-memory -s hostname -p D database -Q 'select * from table' -c 50

6 Query Memory 2. Submits a query and displays its result in tabular format. The result is transferred one-shot. > grelc-das-query-memory -s grelc02.unile.it -p D sakila -Q "select * from actor" -t 3. Submits a query and displays its result in XML format. The result is transferred one-shot. > grelc-das-query-memory -s grelc02.unile.it -p D sakila -Q "select * from actor" -x 4. Submits a query and displays its result in XML format. The result is transferred in chunks of 50 tuples. The result shown is exactly the same of example no. 3 > grelc-das-query-memory -s grelc02.unile.it -p D sakila -Q "select * from actor" -x -c 50

7 Query Dime 5. Display help > grelc-das-query-dime -h
USAGE: query-das-dime [options] -s, --server VAL Sets GRelC DAS IP or hostname (default: localhost) -p, --port NUM Sets GRelC DAS port (default: 18500) -D, --database VAL Sets grid database name -Q, --query VAL Sets query value -c, --chunk NUM Sets chunk dimension (default: 0 no chunk) -z, --gzip Compresses result file -t, --table Prints result in table format (default) -x, --xml Prints result in xml format -H, --html Prints result in html format -h, --help Shows usage EXAMPLES: query submission with compression grelc-das-query-dime -s hostname -p D database -Q 'select * from table' -z query submission with chunking grelc-das-query-dime -s hostname -p D database -Q 'select * from table' -c 50 query submission with chunking and compression grelc-das-query-dime -s hostname -p D database -Q 'select * from table' -c 50 -z

8 Query Dime 6. Submits a query and displays its result in tabular format. The result is transferred one-shot. > grelc-das-query-dime -s grelc02.unile.it -p D sakila -t -Q "select * from actor" 7. Submits a query and displays its result in XML format. The result is transferred one-shot. > grelc-das-query-dime -s grelc02.unile.it -p D sakila -x -Q "select * from actor" 8. Submits a query and displays its result in XML format. The result is transferred in chunks of 50 tuples. > grelc-das-query-dime -s grelc02.unile.it -p D sakila -x -Q "select * from actor" -c 50 9. Now, let's look at the files in your current folder. Each file is a resultset stored client-side. > ls -lrta

9 Query Dime 10. Let's see what's inside one of the resultsets stored client-side. > more .grelc02.unile.it_18500_171-singlequery.xml 11. Submits a query and displays its result in XML format. The result is compressed (using -z option) and transferred in chunks of 50 tuples. > grelc-das-query-dime -s grelc02.unile.it -p D sakila -x -Q "select * from actor" 12. Now, let's look at the files in your current folder again. You can find a compressed and an uncompressed file for each resultset stored client-side. > ls -lrta

10 Query On line 13. Display help > grelc-das-query-online -h
USAGE: grelc-das-query-online [options] -s, --server VAL Sets GRelC DAS IP or hostname (default: localhost) -p, --port NUM Sets GRelC DAS port (default: 18500) -D, --database VAL Sets grid database name -Q, --query VAL Sets query value -t, --table Prints result in table format (default) -x, --xml Prints result in xml format -H, --html Prints result in html format -h, --help Show usage EXAMPLES: grelc-das-query-online -s hostname -p D database -Q 'select * from table'

11 Query On line 14. Submits a query and displays its result in tabular format. > grelc-das-query-online -s grelc02.unile.it -p D sakila -t -Q "select * from actor" 15. Submits a query and displays its result in XML format. > grelc-das-query-online -s grelc02.unile.it -p D sakila -x -Q "select * from actor"

12 Query HTML 16. Display help > grelc-das-query-html -h
USAGE:grelc-das-query-html [options] -s, --server VAL Sets GRelC DAS IP (default: localhost) -p, --port NUM Sets GRelC DAS port (default: 18500) -D, --database VAL Sets grid database name -Q, --query VAL Sets query value -c, --chunk NUM Sets chunk dimension (default: 0 no pagination) -x, --xml Prints result in xml format -t, --table Prints result in table format -h, --help Shows usage EXAMPLES: query submission grelc-das-query-html -s hostname -p D database -Q 'select * from table' query submission with html pagination grelc-das-query-html -s hostname -p D database -Q 'select * from table' -c 50

13 Query HTML 17. Submits a query.
> grelc-das-query-html -s grelc02.unile.it -p D sakila -Q "select * from actor" 18. Submits a query and stores the resultset in XML format. > grelc-das-query-html -s grelc02.unile.it -p D sakila -Q "select * from actor" -x 19. Submits a query and stores the resultset in XML and tabular format. > grelc-das-query-html -s grelc02.unile.it -p D sakila -Q "select * from actor" -x -t 20. Submits a query and stores the resultset in XML and tabular format. The resultset is stored splitted of 50 tuples/page > grelc-das-query-html -s grelc02.unile.it -p D sakila -Q "select * from actor" -x -t -c 50

14 BDII Query 21. You can try to obtain information about the sakila database by querying the BDII on grid009.ct.infn.it (our grelc02.unile.it registers its information on grid009.ct.infn.it) > grid-info-search -x -p b "mds-vo-name=OMII-CATANIA,o=grid" -h grid009.ct.infn.it


Download ppt "SPACI Consortium, CMCC & University of Salento, LECCE"

Similar presentations


Ads by Google