Skip to main content

Posts

Showing posts from December, 2012

sharepoint site size

the following query list the size of sharepoint sites. select fullurl , sum ( datalength ( content ))/ 1024 / 1024 from alldocstreams a , webs b where a . siteid = b . siteid group by fullurl order by 2 desc sharepoint table info can be found in the url below. http://www.sharepointkings.com/2008/06/sql-queries-for-sharepoint-content.html   Features Table that holds information about all the activated features for each site collection or site. Sites Table that holds information about all the site collections for this content database. Webs Table that holds information about all the specific sites (webs) in each site collection. UserInfo Table that holds information about all the users for each site collection. Groups Table that holds information about all the SharePoint groups in each site collection. Roles Table that holds information about all the SharePoint roles (permission levels) for each site. AllLists Table that holds information about lists

re-create control file missing datafiles?

# we have a script to re-create controlfile when the mount point of datafiles changed, however, the number of datafiles are increasing but the script is not catching up, so when the re-create controlfile is executed, it sometime missing the new added datafiles and leaving some MISSING000XXX files in dba_data_files dictionary. #this script check if re-create controlfile script is missing any datafiles in it, if it does, the filenames will be displayed to the standard output. 1. unix shell script for myfile in /redo_prod/PROD/* /orasys_prod/PROD/* /data_prod/PROD/* /index_prod/PROD/* do grep  -q $myfile $HOME/dba/control_prod.sql status=$? if test $status -eq 1 then         echo $myfile "is missing in the re-create controlfile script"         fi done 2. re-create controlfile script control_prod.sql CREATE CONTROLFILE REUSE DATABASE "PRODUCTION" NORESETLOGS  ARCHIVELOG --  SET STANDBY TO MAXIMIZE PERFORMANCE     MAXLOGFILES 5     MAXLOGMEMBERS 3     MAXDATAFIL

shell script to count active oracle process

From unix: ps aux|grep oraclePROD|awk '{if ($3 == 0.0) i=i+1; else j=j+1;} END {print "number of oracle process use 0 cpu is: " i; print "number of oracle process use more than 0 cpu is :" j;}'   the results are shown below: number of oracle process use 0 cpu is: 143 number of oracle process use more than 0 cpu is :48   from database: 10:32:50 PROD> select status,count(*) from v$session group by status; STATUS        COUNT(*) ---------- ---------- INACTIVE           178 ACTIVE              46