The following query should give you the summary of users and the number of sessions held by them.
SQL> select schemaname, session_count from
(select distinct schemaname, count(sid) as session_count from v$session group by schemaname)
order by session_count desc;
-- To know the total number of sessions in progress...
SQL> select count(*) from v$session;
Capturing quick hacks, scripts and handy info working as a database generalist
Tuesday, February 2, 2010
Tuesday, January 19, 2010
CouchDB - More Updates ...
I was lucky to attend a session by my colleague who invested a lot of time in getting a prototype of couchDB to work. Some of my observations...
- Dont map it to features of relational db
- Doesnt enforce user security/isolation levels
- It is document-based database
- Stores JSON format documents
- For better read speeds, we need VIEWS to be pre-created
- Event consistent model
- Follows Brewer's CAP theorem
- Equivalent of WHERE clause is Map-Reduce way of selecting & aggregating contents.
- Definitely not an enterprise class database
- Excellent for applications that can model and consume document databases (eg. LDAP structure, Orkut like sites, user profiles, patient profiles, employee details database etc)
Monday, December 21, 2009
BULK UPDATE using FORALL in Oracle PLSQL - Awesome experience..
In one of the projects I work, there arose a need to conditionally update a few column values of a table. How many rows did we need to update ? Roughly 5 million rows out of 252 million total rows.
Experimented many approaches to get this done. Some of them ....
1. Use a single UPDATE statement (Worst thing to ever do for huge data updates)
2. Update in lots of 50K - using plain update statement (Kind of OK, though it handled shorter commits, I wasnt happy with performance)
3. Fantastic result : When I used PLSQL(bulk update using FORALL), I realized I had been under utilizing PLSQL for my day to day jobs. No doubt... Oracle PLSQL rocks.
Subscribe to:
Posts (Atom)