Wednesday, March 21, 2012
Find the table name corresponding to a page
This is the query executed.
select * from master..sysprocesses where cpu > 2000
and this is the result.
14:1:3068040 [WAITRESOURCE]
[select * from sysindexes where id = 3068040 does not return any data]
TIA
Manoj Kumar
try select db_name(14) for the database
and select object_name(3068040) for the table.
Hilary Cotter
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com
"Manoj Kumar" <ManojKumar@.discussions.microsoft.com> wrote in message
news:0A0E5BE7-1969-436B-A116-D91E39D9305F@.microsoft.com...
>I am trying to find the table name associated with page#.
> This is the query executed.
> select * from master..sysprocesses where cpu > 2000
> and this is the result.
> 14:1:3068040 [WAITRESOURCE]
> [select * from sysindexes where id = 3068040 does not return any data]
> TIA
> --
> Manoj Kumar
|||Manoj, a combination of sp_who2 and sp_lock will give you the locked
resource (or the corresponding current activity screens in EM).
Cheers,
Paul Ibison SQL Server MVP, www.replicationanswers.com .
|||Manoj, you can use DBCC PAGE to show information on page # 3068040.
In the DBCC page output - you will see an object_id that you can tie up to
sysobjects...
"Manoj Kumar" wrote:
> I am trying to find the table name associated with page#.
> This is the query executed.
> select * from master..sysprocesses where cpu > 2000
> and this is the result.
> 14:1:3068040 [WAITRESOURCE]
> [select * from sysindexes where id = 3068040 does not return any data]
> TIA
> --
> Manoj Kumar
Sunday, February 26, 2012
Find an associated user
that is on Windows 2003. Is there a way to export a list of server
login names? I am having problems with one I am trying to create where
on the old server using Teratrax I can see that it is an associated
user Name, but I don't know which user it is associated with. Is there
a command that can tell me which user the account is associated with?
It definitely isn't a domain user and isn't a local account. It says
that the user is a SQl user but I can't seem to find where the
association is.
hi Mark,
"Mark Constant" <constants@.mix-net.net> ha scritto nel messaggio
news:ce43fdea.0412011310.6ac9ef82@.posting.google.c om
> I am trying to copy a database that is on a Windows 2000 box to one
> that is on Windows 2003. Is there a way to export a list of server
> login names? I am having problems with one I am trying to create where
> on the old server using Teratrax I can see that it is an associated
> user Name, but I don't know which user it is associated with. Is there
> a command that can tell me which user the account is associated with?
> It definitely isn't a domain user and isn't a local account. It says
> that the user is a SQl user but I can't seem to find where the
> association is.
SET NOCOUNT ON
USE TEMPDB
PRINT 'adding SQL Server Login [x] to [' + DB_NAME() + '] as [x_user] in the
[db_datareader] database role'
EXEC sp_adduser 'x', 'x_user', 'db_datareader'
PRINT 'grandting [x_user] in [' + DB_NAME() + '] database [db_datawriter]
database role membership'
EXEC sp_addrolemember @.rolename = 'db_datawriter' , @.membername = 'x_user'
PRINT 'listing all [' + DB_NAME() + '] database users'
EXEC sp_helpuser
PRINT 'listing [' + DB_NAME() + '] database [x_user] user''s database role
membership'
EXEC sp_helpuser 'x_user'
PRINT 'Dropping [x_user] user from [' + DB_NAME() + '] database'
EXEC sp_dropuser 'x_user'
which results to
adding SQL Server Login [x] to [tempdb] as [x_user] in the [db_datareader]
database role
Granted database access to 'x'.
'x_user' added to role 'db_datareader'.
grandting [x_user] in [tempdb] database [db_datawriter] database role
membership
'x_user' added to role 'db_datawriter'.
listing all [tempdb] database users
UserName GroupName LoginName DefDBName UserID SID
-- -- -- -- -- --
----
dbo db_owner sa master 1 0x01
x_user db_datareader x a 5
0x67F945E170B2574AA8DCB909B68D46A9
x_user db_datawriter x a 5
0x67F945E170B2574AA8DCB909B68D46A9
listing [tempdb] database [x_user] user's database role membership
UserName GroupName LoginName DefDBName UserID SID
-- -- -- -- -- --
----
x_user db_datareader x a 5
0x67F945E170B2574AA8DCB909B68D46A9
x_user db_datawriter x a 5
0x67F945E170B2574AA8DCB909B68D46A9
Dropping [x_user] user from [tempdb] database
User has been dropped from current database.
as you can see you can inspect the result of sp_helpuser system store
precedure
(http://msdn.microsoft.com/library/de...-us/tsqlref/ts
_sp_help_45o2.asp) that reports, as long as the user name, the corresponding
Login..
Andrea Montanari (Microsoft MVP - SQL Server)
http://www.asql.biz/DbaMgr.shtmhttp://italy.mvps.org
DbaMgr2k ver 0.9.1 - DbaMgr ver 0.55.1
(my vb6+sql-dmo little try to provide MS MSDE 1.0 and MSDE 2000 a visual
interface)
-- remove DMO to reply
Sunday, February 19, 2012
Filtering Records Out in DSV. Performance Benefit?
For example, there are records in our Products dimension that have no facts associated with them and I'm thinking of doing the following for the Products table in the cube's DSV:
select *
from products (nolock)
where product_key not in (
select distinct product_key from [sales fact] (nolock)
) or product_key not in (
select distinct product_key from [forecast fact] (nolock)
)
Doing this would filter out around 15,000 rows.This isn't a performance question - this is a functionality question. Do you want your dimensions to have members, which (currently) don't have any data associated with them ? If yes - then you need to do this filtering in DSV. If no - then not. As far as performance goes, I imagine that by doing this filtering you will make performance worse, since during processing of dimension it will have to do join with two fact tables.|||
Mosha Pasumansky wrote:
This isn't a performance question - this is a functionality question. Do you want your dimensions to have members, which (currently) don't have any data associated with them ? If yes - then you need to do this filtering in DSV. If no - then not. As far as performance goes, I imagine that by doing this filtering you will make performance worse, since during processing of dimension it will have to do join with two fact tables.
I'm not too concerned with the performance hit during the processing of the cube since we do it night.
So there's really no performance benefit to filtering out the "unnecessary" data?|||Again, if it is OK for you to have less dimension members in the dimension - you may see some performance benefits during qurying. Whether or not you will see this benefit depends greatly on the queries you are sending, on the calculations inside cube etc.|||
Hi,
I did this for AS2000 and do this for AS2005. It help me. I have only about 2 Millions dimension members instead of 5. I make a sence.
But take a look at you query
select *
from products (nolock)
where product_key not in (
select distinct product_key from [sales fact] (nolock)
) or product_key not in (
select distinct product_key from [forecast fact] (nolock)
)
You should rewrite it without "distinct" but should have an index on the product_key field.