Thursday 11 March 2010

SQLServer : Object sizes Report

USE DEALHUB_ARCH1

select 'Database Name: ', db_name()
set nocount on
if exists(select name from tempdb..sysobjects where name='##tmp')
drop table ##tmp
create table ##tmp(nam varchar(50), rows int, res varchar(15),data varchar(15),ind_sze varchar(15),unsed varchar(15))
go

declare @tblname varchar(50)
declare tblname CURSOR for select name from sysobjects where xtype='U'
open tblname
Fetch next from tblname into @tblname
WHILE @@FETCH_STATUS = 0
BEGIN
insert into ##tmp

exec sp_spaceused @tblname
  FETCH NEXT FROM tblname INTO @tblname

END
CLOSE tblname

deallocate tblname
go

select nam Table_Name,rows Total_Rows,res Total_Table_Size,data Data_size,ind_sze Index_Size,unsed Unused_Space from ##tmp
drop table ##tmp



Monday 8 March 2010

Audacity : Recording from a sound card in Vista

  • Download and install Virtual Audio Cable (not freeware) - confirm when prompted
  • Taskbar -> Go to the playback devices (right-click the speaker icon) - Select the 'Playback' tab.
  • There will be a new option named 'Line 1' or 'VAC 1' etc
  • Make that 'Line 1' Default (button)
  • Close all programs (specially programs that have sound - itunes, realplayer, windows media player)
  • Then, run the program Audio Repeater (Included in the VAC install use start->all programs)
  • Set 'Wave in' to 'Line 1'
  • Set 'Wave out' to "SPEAKER" (or your computer's original default selection)
  • After this, click 'Start' tab below.
  • Then, turn on any music on the computer you should hear the sound from your speaker.
  • Right-click the speaker icon on your taskbar-> recording devices -> 'Recording' tab -> make 'Line 1' Default
  • Run Audacity -> Edit -> Preferences -> Audio I/O tab -> See 'Recording' and make 'device' into 'Line 1'


Friday 5 March 2010

Oracle Dataguard : dgmgrl - various commands

<b>Start dgmgrl
</b>
  • export ORACLE_SID=dbdg; . oraenv; dgmgrl
  • sys/<password>
<b>Check the configuration status<br /></b>
  • SHOW CONFIGURATION;
  • SHOW DATABASE VERBOSE 'North_Sales'
  • SHOW DATABASE 'North_Sales';
  • SHOW DATABASE 'North_Sales' 'StatusReport';
  • SHOW DATABASE 'North_Sales' 'InconsistentProperties';
  • SHOW DATABASE 'North_Sales' 'InconsistentLogXptProps';
Change properties
  • EDIT DATABASE 'DR_Sales' SET PROPERTY 'LogArchiveFormat'='log_%t_%s_%r_%d.arc';
  • EDIT DATABASE 'DR_Sales' SET STATE='READ-ONLY';
<b>Create/enable configuration<br /></b>
  • CREATE CONFIGURATION 'DRSolution' AS PRIMARY DATABASE IS 'North_Sales' CONNECT IDENTIFIER IS North_Sales.foo.com;
  • ADD DATABASE 'DR_Sales' AS CONNECT IDENTIFIER IS DR_Sales.foo.com MAINTAINED AS PHYSICAL;
  • SHOW CONFIGURATION;
  • ENABLE CONFIGURATION;
<b>Stop transmit of dbs from primary <br /></b>
  • EDIT DATABASE North_Sales SET STATE=LOG-TRANSPORT-OFF
<b>Temporarily stop broker managing and monitoring a standby database.<br /></b>
Switchover
  • SWITCHOVER TO DR_Sales;
  • SHOW CONFIGURATION;
<b>Manual Failover<br /></b>
  • FAILOVER TO "DR_Sales";
  • SHOW CONFIGURATION;