Many times we try to shrink Tempdb due to space issue, but even after more than 90% space free it doesn't shrink
Script to shrink
CREATE TABLE freefilespace
(
fileid INT,
filegroup INT,
totalextents INT,
usedextents INT,
dbname VARCHAR(256),
filename VARCHAR(2000)
)
(
fileid INT,
filegroup INT,
totalextents INT,
usedextents INT,
dbname VARCHAR(256),
filename VARCHAR(2000)
)
Data Compression Results
SQL 2008 is supporting data compression.
Its a new feature in SQL 2008 which is not available in previous versions
Its a new feature in SQL 2008 which is not available in previous versions
Rank Function (For same value)
As we all are aware of rank function. It gives incremental rank for selected set.
I am going to discuss a silent feature of rank which many are not aware since now.
I am going to discuss a silent feature of rank which many are not aware since now.
Rank with partitioning - MDX
Rank on grouping
Recently I got a problem of ranking based on a group.
Lets try to solve the same problem using Adventure Works cube.
Recently I got a problem of ranking based on a group.
Lets try to solve the same problem using Adventure Works cube.
Having function in SSAS
Having function
This is undocumented function in SSAS. Those who have worked with SQL Server knows that having is used to filter aggregate data. Same use here. In general we can get same result using filter function but having is more easy to understand and might be giving better result.
This is undocumented function in SSAS. Those who have worked with SQL Server knows that having is used to filter aggregate data. Same use here. In general we can get same result using filter function but having is more easy to understand and might be giving better result.
Detach DB in SSAS
Detach and attach DB in Analysis Service
Now in Analysis Service 2008 its possible to detach and attach database.
Its make easy to move database to different location which was not so easy in past
Now in Analysis Service 2008 its possible to detach and attach database.
Its make easy to move database to different location which was not so easy in past
Expected Annual Sales (MDX- Analysis Service)
Recently I got a query on to show annual sales.
For example in Adventure works for year 2004 there is sales upto July 31st.
For example in Adventure works for year 2004 there is sales upto July 31st.
How to backup multiple database using XMLA in one batch
Recently I got a question on how to backup multiple database using XMLA in one batch.
&sp;Lets see the problem
Here are two XMLA scripts for backup databases
<Backup xmlns="http://schemas.microsoft.com/analysisservices/2003/engine">
<Object>
<DatabaseID>Adventure Works DW 2008</DatabaseID>
</Object>
<File>adv1.abf</File>
<AllowOverwrite>true</AllowOverwrite>
</Backup>
<Backup xmlns="http://schemas.microsoft.com/analysisservices/2003/engine">
<Object>
<DatabaseID>Mining Test</DatabaseID>
</Object>
<File>mine1.abf</File>
<AllowOverwrite>true</AllowOverwrite>
</Backup>
Here when you run this query in XMLA query window it will give error
Executing the query ...
The 'Backup' element at line 15, column 76 ('http://schemas.microsoft.com/analysisservices/2003/engine' namespace) appears more than once under Envelope/Body/Execute/Command.
Execution complete
so we need to run it in batch. In batch we can run multiple XMLA query. But since this is backup we can not run it in transaction. So we have to specify transaction as false in the query
So the new query will be
<Batch xmlns="http://schemas.microsoft.com/analysisservices/2003/engine" Transaction="false" >
<Backup xmlns="http://schemas.microsoft.com/analysisservices/2003/engine">
<Object>
<DatabaseID>Adventure Works DW 2008</DatabaseID>
</Object>
<File>adv1.abf</File>
<AllowOverwrite>true</AllowOverwrite>
</Backup>
<Backup xmlns="http://schemas.microsoft.com/analysisservices/2003/engine">
<Object>
<DatabaseID>Mining Test</DatabaseID>
</Object>
<File>mine1.abf</File>
<AllowOverwrite>true</AllowOverwrite>
</Backup>
</Batch>
Cheers
Amish Shah
&sp;Lets see the problem
Here are two XMLA scripts for backup databases
<Backup xmlns="http://schemas.microsoft.com/analysisservices/2003/engine">
<Object>
<DatabaseID>Adventure Works DW 2008</DatabaseID>
</Object>
<File>adv1.abf</File>
<AllowOverwrite>true</AllowOverwrite>
</Backup>
<Backup xmlns="http://schemas.microsoft.com/analysisservices/2003/engine">
<Object>
<DatabaseID>Mining Test</DatabaseID>
</Object>
<File>mine1.abf</File>
<AllowOverwrite>true</AllowOverwrite>
</Backup>
Here when you run this query in XMLA query window it will give error
Executing the query ...
The 'Backup' element at line 15, column 76 ('http://schemas.microsoft.com/analysisservices/2003/engine' namespace) appears more than once under Envelope/Body/Execute/Command.
Execution complete
so we need to run it in batch. In batch we can run multiple XMLA query. But since this is backup we can not run it in transaction. So we have to specify transaction as false in the query
So the new query will be
<Batch xmlns="http://schemas.microsoft.com/analysisservices/2003/engine" Transaction="false" >
<Backup xmlns="http://schemas.microsoft.com/analysisservices/2003/engine">
<Object>
<DatabaseID>Adventure Works DW 2008</DatabaseID>
</Object>
<File>adv1.abf</File>
<AllowOverwrite>true</AllowOverwrite>
</Backup>
<Backup xmlns="http://schemas.microsoft.com/analysisservices/2003/engine">
<Object>
<DatabaseID>Mining Test</DatabaseID>
</Object>
<File>mine1.abf</File>
<AllowOverwrite>true</AllowOverwrite>
</Backup>
</Batch>
Cheers
Amish Shah
Subscribe to:
Posts (Atom)
Popular Posts
-
sp_addlinkedsrvlogin To modify or add new login for linked server
-
Recently we had hardware and performance issues on SQL Server,with our client , so while monitoring the system we also looked at error ...
-
Recently I got a problem where Builtin\Administrators Account was deleted . How can we recreate it? Here is a solution for this Run th...
-
As we all are aware with the variables in SSIS, which is used for holding custom values and assign to various properties of objects at run...
-
Recently I got a mail for following problem While the client tries to open registered server window in Mbanagement Studio he gets follow...
-
Various way to calculate running total from All period to currentmember As MDX is a very vast and dynamic language we can write same quer...
-
Many time we need to do runing sum of value. In SQL 2oo5 we can do it with use of CTE
-
sp_purge_jobhistory We can use this procedure to delete old history for jobs.
-
For every Developer and DBA index maintenance is very important task. Since the changing ...
-
Index are very important part for any database. We need to regularly monitor index and maintain index for better performance of the system...