Вы находитесь на странице: 1из 6

cassandra

For testing:

First we have to login the SIT fur, ( (for testing))

bash-4.1$ ssh dsafur@10.88.26.181


dsafur@10.88.26.181's password: Jan@2018

export CASSANDRA_HOME=/opt/dsa/fur/cassadsa-3.10
export PYTHON_HOME=/opt/dsa/fur/packages/Python27
export JAVA_HOME=/opt/dsa/fur/packages/jdk1.8.0_112

export PATH=$JAVA_HOME/bin:$CASSANDRA_HOME/bin:$PYTHON_HOME/bin:$PATH
command to connect cassendra DB :
cqlsh -u cassandra -p cassandra

use cassadsa;
cassandra@cqlsh>describe tables;
cassandra@cqlsh>describe keyspaces;
cassandra@cqlsh>describe table cassadsa;
cassandra@cqlsh>help use;
..............................
For Production:

ssh dsatm@10.88.24.28
[dsatm@inmumcld1dsa11 ~]$ cqlsh -u evolms -p 3voLm3
Connected to DSA at 127.0.0.1:9042.
[cqlsh 5.0.1 | Cassandra 3.10 | CQL spec 3.4.4 | Native protocol v4]
Use HELP for help.
evolms@cqlsh> use cassadsa;
evolms@cqlsh:cassadsa> desc tables
sims imsit_recycle release_imsi sim_map

evolms@cqlsh> select
iccid,imsi_t,imsi_d,imsi_circle_id,state,processtype,requesttype from
cassadsa.sim_map where last_updated_timestamp>= '2018-01-17' allow filtering;

To get day -1 report

success So's:----
SQL> select count(*), SOTYPE from dsatm.sorecord where soid in ( select soid from
dsatm.sotransaction where slestate!='SUCCESS') and
to_char(RECEIPTTIMESTAMP+5.5/24,'YYYYMMDD')=to_char(sysdate,'YYYYMMDD') and SOTYPE!
='getCircleID' group by SOTYPE;

SQL> select count(*), SOTYPE from dsatm.sorecord where soid in ( select soid from
dsatm.sotransaction where slestate='SUCCESS') and
to_char(RECEIPTTIMESTAMP+5.5/24,'YYYYMMDD')=to_char(sysdate,'YYYYMMDD') and SOTYPE!
='getCircleID' group by SOTYPE;

iccid | imsi_t | imsi_d | imsi_circle_id | state


| processtype | requesttype
----------------------+-----------------+-----------------+----------------
+----------------+-------------+-------------
89910271001001765928 | 404469010076592 | 404844252000697 | 5 |
IMSI_SWAPPED | PREPAID | SIMEX
89910271001001765977 | 404469010076597 | 404152102015361 | 20 |
IMSI_SWAPPED | PREPAID | SIMEX
89910271001001765902 | 404469010076590 | 404152102013204 | 20 |
PROV_COMPLETED | PREPAID | SIMEX
89910271001001765985 | 404469010076598 | 404152102013201 | 20 |
IMSI_SWAPPED | PREPAID | SIMEX
89910271001001878911 | 404469010087891 | 404844252000703 | 5 |
PROV_COMPLETED | PREPAID | SIMEX
89910271001002810723 | 404469010181072 | 404014680001084 | 18 |
IMSI_SWAPPED | POSTPAID | SIMEX
89910271001001828080 | 404469010082808 | 404152102013228 | 20 |
PROV_COMPLETED | PREPAID | SIMEX
89910271001001765993 | 404469010076599 | 404152102013222 | 20 |
PROV_COMPLETED | PREPAID | SIMEX
89910271001001879554 | 404469010087955 | 404277282054022 | 9 |
PROV_COMPLETED | PREPAID | SIMEX
89910271001001766009 | 404469010076600 | 404152102013206 | 20 |
PROV_COMPLETED | PREPAID | SIMEX
89910271001001879547 | 404469010087954 | 404277282054018 | 9 |
PROV_COMPLETED | PREPAID | SIMEX
89910271001001878838 | 404469010087883 | 405672362025494 | 7 |
PROV_COMPLETED | PREPAID | SIMEX
89910271001001766215 | 404469010076621 | 404152102013215 | 20 |
IMSI_SWAPPED | PREPAID | SIMEX
89910271001001260987 | 404469010026098 | 404604720011997 | 8 |
IMSI_ALLOCATED | POSTPAID | PreToPost
89910271001001885346 | 404469010088534 | 404205900000269 | 1 |
PROV_COMPLETED | POSTPAID | SIMEX
89910271001001766017 | 404469010076601 | 404152102013217 | 20 |
PROV_COMPLETED | PREPAID | SIMEX

(16 rows)

.........................................................

Date wise IMSI_SWAPPED:-


evolms@cqlsh> select count(*) from cassadsa.sim_map where last_updated_timestamp >=
'2017-12-12' and state ='IMSI_SWAPPED' allow filtering;

Date wise IMSI_ALLOCATED:-


evolms@cqlsh> select count(*) from cassadsa.sim_map where last_updated_timestamp >=
'2017-12-22' and state ='IMSI_ALLOCATED' allow filtering;

Today Total Transaction count :


evolms@cqlsh> select count(*) from cassadsa.sim_map where last_updated_timestamp>=
'2017-12-22' allow filtering;

Today total transactional details:


select iccid,imsi_t,imsi_d,imsi_circle_id,state,processtype,requesttype from
cassadsa.sim_map where last_updated_timestamp>= '2017-12-22' allow filtering;

''''''''''''''''''''''''''''''''''''''''''''''''''''
Month wise: we have to give date month starting date:

evolms@cqlsh> select count(*) from cassadsa.sim_map where last_updated_timestamp >=


'2017-12-22' and state ='IMSI_SWAPPED' allow filtering;

evolms@cqlsh> select count(*) from cassadsa.sim_map where last_updated_timestamp >=


'2017-12-22' and state ='IMSI_ALLOCATED' allow filtering;
evolms@cqlsh> select count(*) from cassadsa.sim_map where last_updated_timestamp>=
'2017-12-22' allow filtering; (total count)

.........................................................
using iccid
evolms@cqlsh:cassadsa> select
iccid,imsi_t,imsi_d,imsi_circle_id,state,processtype,requesttype from
cassadsa.sim_map where iccid='89910271001001878911' allow filtering;

iccid | imsi_t | imsi_d | imsi_circle_id | state


| processtype | requesttype
----------------------+-----------------+-----------------+----------------
+----------------+-------------+-------------
89910271001001878911 | 404469010087891 | 404844252000703 | 5 |
PROV_COMPLETED | PREPAID | SIMEX

(1 rows)

..................................................
Transaction status report:-

evolms@cqlsh:cassadsa> select
iccid,imsi_circle_id,state,processtype,requesttype,last_updated_timestamp,creation_
timestamp from cassadsa.sim_map where last_updated_timestamp>'2017-12-26' and
processtype='POSTPAID' and requesttype='MNP' allow filtering;
select
iccid,imsi_circle_id,state,processtype,requesttype,last_updated_timestamp,creation_
timestamp from cassadsa.sim_map where last_updated_timestamp>'2017-12-26' and
processtype='PREPAID' and requesttype='MNP' allow filtering;

evolms@cqlsh:cassadsa> select
iccid,imsi_circle_id,state,processtype,requesttype,last_updated_timestamp,creation_
timestamp from cassadsa.sim_map where last_updated_timestamp>='2017-12-30' and
processtype='POSTPAID' and requesttype='SIMEX' allow filtering;

evolms@cqlsh:cassadsa> select
iccid,imsi_circle_id,state,processtype,requesttype,last_updated_timestamp,creation_
timestamp from cassadsa.sim_map where last_updated_timestamp>='2017-12-26' and
processtype='PREPAID' and requesttype='SIMEX' allow filtering;

evolms@cqlsh:cassadsa> select
iccid,imsi_circle_id,state,processtype,requesttype,last_updated_timestamp,creation_
timestamp from cassadsa.sim_map where last_updated_timestamp>='2017-12-26' and
requesttype='PreToPost' allow filtering;

evolms@cqlsh> select
iccid,imsi_t,imsi_circle_id,state,processtype,requesttype,last_updated_timestamp,cr
eation_timestamp from cassadsa.sim_map where last_updated_timestamp>='2018-01-01'
and state='IMSI_ALLOCATED' allow filtering;

evolms@cqlsh> select iccid,imsi_t,imsi_circle_id,state,processtype,requesttype from


cassadsa.sim_map where last_updated_timestamp>='2018-01-01' and
state='PROV_COMPLETED' allow filtering;
select iccid,imsi_t,imsi_d,imsi_circle_id,state,processtype,requesttype from
cassadsa.sim_map where last_updated_timestamp>= '2018-01-02' and
state='PROV_COMPLETED' allow filtering;

89910271001002214298 | 404469010121429 | 404466083001520 | 11 |


PROV_COMPLETED | PREPAID | SIMEX
89910271001002580755 | 404469010158075 | 404152102016534 | 20 |
PROV_COMPLETED | PREPAID | SIMEX
89910271001002581423 | 404469010158142 | 404844252000719 | 5 |
PROV_COMPLETED | PREPAID | SIMEX
89910271001002588246 | 404469010158824 | 404014682004723 | 18 |
PROV_COMPLETED | PREPAID | SIMEX
89910271001001802879 | 404469010080287 | 404152102016542 | 20 |
PROV_COMPLETED | PREPAID | SIMEX
89910271001002583452 | 404469010158345 | 404051830105480 | 2 |
PROV_COMPLETED | PREPAID | SIMEX
89910271001002582272 | 404469010158227 | 405756742005384 | 15 |
PROV_COMPLETED | PREPAID | SIMEX
89910271001002579344 | 404469010157934 | 405672362025486 | 7 |
PROV_COMPLETED | PREPAID | SIMEX
89910271001002573685 | 404469010157368 | 404152102016543 | 20 |
PROV_COMPLETED | PREPAID | SIMEX
89910271001002328080 | 404469010132808 | 404132082012683 | 3 |
PROV_COMPLETED | PREPAID | SIMEX
89910271001002590747 | 404469010159074 | 404152102016572 | 20 |
PROV_COMPLETED | PREPAID | SIMEX
89910271001002573156 | 404469010157315 | 404844252000715 | 5 |
PROV_COMPLETED | PREPAID | SIMEX
89910271001002562860 | 404469010156286 | 404152102016535 | 20 |
PROV_COMPLETED | PREPAID | SIMEX
89910271001003232166 | 404469010223216 | 404300272001177 | 6 |
PROV_COMPLETED | PREPAID | SIMEX
89910271001001880214 | 404469010088021 | 404152102016533 | 20 |
PROV_COMPLETED | PREPAID | SIMEX
89910271001002662645 | 404469010166264 | 404051830105491 | 2 |
PROV_COMPLETED | PREPAID | SIMEX
89910271001002588857 | 404469010158885 | 404205900000275 | 1 |
PROV_COMPLETED | POSTPAID | SIMEX
89910271001003230053 | 404469010223005 | 404152102016569 | 20 |
PROV_COMPLETED | PREPAID | SIMEX

('89910271001002165581','89910271001002590184','89910271001002876211','899102710010
02573131','89910271001002202749','
89910271001003211301','89910271001002590242','89910271001003229949','89910271001003
230004','89910271001002172728','
','
'89910271001002819724','89910271001002327462','89910271001002820326','8991027100100
1814460','89910271001002581449','
89910271001001803612','89910271001001764921','89910271001002588873','89910271001002
202269','89910271001002570095','
89910271001002820060','89910271001001876295','89910271001002177214','89910271001002
328239','
89910271001002819757','89910271001002819799','89910271001002819955','89910271001002
561029','
89910271001002327611','89910271001002188625','89910271001002820359','89910271001002
202194','
89910271001002819922','89910271001002571291','89910271001002820052','89910271001002
820011','
89910271001002564809','89910271001002819948','89910271001002819971','89910271001002
820243','
89910271001003237686','89910271001002571283','89910271001002820144','89910271001002
571267','
89910271001002328163','89910271001002820177','89910271001002820201','89910271001002
820250','
89910271001002820078','89910271001001862238','89910271001002819997','89910271001002
202236','
89910271001003216359','89910271001002564015','89910271001002328221','89910271001002
328338','
89910271001001762727','89910271001002689952','89910271001002820268','89910271001002
328189','
89910271001002591513','89910271001002819765','89910271001003223405','89910271001002
327868','
89910271001002328262','89910271001002819963','89910271001002328353','89910271001002
328205','
89910271001001867906','89910271001002562597','89910271001002820029','89910271001002
173536','
89910271001003212564','89910271001003110552','89910271001003234048','89910271001002
662678','
89910271001001878259','89910271001002819807','89910271001002580748','89910271001001
762586','
89910271001002327645','89910271001002328379','89910271001002819989','89910271001001
762719','
89910271001003243098','89910271001002661712','89910271001002176794','89910271001001
880339','
89910271001002820136','89910271001002876278','89910271001002819773','89910271001002
819781','
89910271001001878895','89910271001002820045','89910271001002820037','89910271001002
819930','
89910271001002573099','89910271001002820128','89910271001002820367','89910271001001
861461','
89910271001003234030','89910271001001861941','89910271001002570905','89910271001001
871098','
89910271001002587560','89910271001002591539','89910271001002590754','89910271001002
820342','
89910271001002574311','89910271001002568198','89910271001002566556','89910271001002
565889','
89910271001002565772','89910271001002820334','89910271001001764749','89910271001002
586067','
89910271001002820003','89910271001002581720','89910271001002819740','89910271001002
820235'

'89910271001002831935','89910271001002110603','89910271001002819872','8991027100100
1880669','
89910271001002591547','89910271001002832222','89910271001002820193','89910271001002
820219','
89910271001002316960','89910271001002819716','89910271001002573735','89910271001001
862196','
89910271001001764897','89910271001002961773','89910271001002583643','89910271001002
202491','
89910271001002820110','89910271001002820318','89910271001002576795','89910271001001
861453','
89910271001002673741','89910271001001867047','89910271001002820227','89910271001001
876832','
89910271001001564909','89910271001001564917','89910271001001802523','89910271001001
802986','
89910271001001803570','89910271001001880685','89910271001002165581','89910271001002
202376','
89910271001002202699','89910271001002202715','89910271001002217309','89910271001002
570103','
89910271001002570806','89910271001002572034','89910271001002574287','89910271001002
575078','
89910271001002579765','89910271001002580722','89910271001002583650','89910271001002
584229','
89910271001002590184','89910271001002592552','89910271001002876211','89910271001002
967846','
89910271001003211301','89910271001003216714','89910271001003223306','89910271001003
229949','
89910271001003229964','89910271001003230004','89910271001001250608','89910271001002
214322','
89910271001002214298','89910271001002580755','89910271001002581423','89910271001002
588246','
89910271001001802879','89910271001002583452','89910271001002582272','89910271001002
579344','
89910271001002573685','89910271001002328080','89910271001002590747','89910271001002
573156','
89910271001002562860','89910271001003232166','89910271001001880214','89910271001002
662645','
89910271001002588857','89910271001003230053'

Вам также может понравиться