Quantcast
Channel: SQL Server Database Engine forum
Viewing all 6624 articles
Browse latest View live

Memory utalization of each database

$
0
0

Hi All,

Is there any way to record memory utilization for each database in one Instance. I have around 7 databases and want to know which one is utilizing more at current time.


Shamas Saeed (if Post helpful please mark as Answer) http://shamas-saeed.blogspot.com


First Row Record is not inserted from CSV file while bulk insert in sql server

$
0
0

Hi Everyone,

I have a csv file that needs to be inserted in sql server. The csv file will be format will be like below.

1,Mr,"x,y",4

2,Mr,"a,b",5

3,Ms,"v,b",6

While Bulk insert it coniders the 2nd column as two values (comma separte) and makes two entries .So i used filelterminator.xml.  

Now, the fields are entered into the column correctly. But now the problem is, the first row of the csv file is not reading in sql server. when i removed the  terminator,  i can get the all records. But i must use the above code terminator. If am using means, am not getting the first row record.

Please suggests me some solution.

Thanks,

Selvam




Wait Type

$
0
0

Hi Friends,

the wait type result like below for our production server. how can I interpret this to solve the performance problem, or following are optimal values.

Wait TypeWait Time (s)Wait Time (%)
BROKER_RECEIVE_WAITFOR2549353.8222.35
DISPATCHER_QUEUE_SEMAPHORE1081972.369.49
BROKER_TASK_STOP1037387.869.1
BROKER_TRANSMITTER765339.26.71
SP_SERVER_DIAGNOSTICS_SLEEP764852.796.71
CLR_AUTO_EVENT728384.486.39
CXPACKET427208.313.75
HADR_FILESTREAM_IOMGR_IOCOMPLETION382679.553.36
XE_DISPATCHER_WAIT382672.073.36
DIRTY_PAGE_POLL382670.253.36
XE_TIMER_EVENT382645.223.36
SQLTRACE_INCREMENTAL_FLUSH_SLEEP382483.613.35
BROKER_EVENTHANDLER382278.613.35
ONDEMAND_TASK_QUEUE382061.873.35
REQUEST_FOR_DEADLOCK_SEARCH381842.053.35
FT_IFTS_SCHEDULER_IDLE_WAIT379504.583.33

thank you.

regards,

asad


asad

suser_sname() returns sid string when proc set to exec as

$
0
0

is a proc w/execute as 'someuser' suppose to return the SID string instead of the users name? The user context I have my proc running under is a user who has no login...eg: 'create user foobar without login'.

thoughts?


mike t.

so what I mean is that within body of proc I am returning: 'select suser_sname();'

this is returning a SID value instead of the users name???


How to drop the tables (articles) in subscription database MERGE replication.

$
0
0

We have configured the merge replication from publication server to subscription server,

Here I mistakenly selecting few tables (articles) in publication,

Now I need to remove those mistakenly selected tables in subscription server database . 

Note: I am trying to below way but unable to remove those tables in subscription server.

1<sup>st</sup> I unselected those tables (articles) in publication, but not working.

 

Could please tell me the how to remove those tables in subscription database.

view cluster index affecting performance

$
0
0

Hi All,

We have a simple delete and insert script for a table, but the table has a dependency to 2 view cluster index, So whenever am going to insert and update the parent table it is going to update the view cluster index, But while updating the view cluster index it runs the view cluster index again (like executing the view) hence it affect the performance.

Please advise Is there any way to skip the view execution? because this view is already a heavy operation with many logial reads..

Also advise view cluster index in simple terms because when i google I can not get a concrete answers. Since it's a index can we rebuild or reorg? forgive if my question is stupid... :)


Best Regards Moug

Error occurred while attempting to drop allocation unit ID

$
0
0

Anyone have any experience with this?  I'm on  64 bit Sql 2005 Standard SP3. 

These errors are showing up in my sql server logs and roughly correspond with periods of poor

db performance.

 

03/05/2011 16:02:18,spid431,Unknown,Error [36<c/> 17<c/> 145] occurred while attempting to drop allocation unit ID 438356380090368 belonging to worktable with partition ID 438356380090368.

03/07/2011 14:42:18,spid333,Unknown,Error [36<c/> 17<c/> 145] occurred while attempting to drop allocation unit ID 438859152752640 belonging to worktable with partition ID 438859152752640.

What is this Memory Grants Outstanding are 8 ?

$
0
0

Hello Everyone,

In our organisation sql server 2008 r2 enterprise edition having 32 GB of RAM, 64 bit of OS(Windows Server 2008 r2).

We assigned a RAM to sql server is more than 80% and PLE is more than 300 ms.

Then what is this Memory Grants Outstanding  are 8 and  what are the possible steps to reduce it ?

Thank you in advance!!!


Linked Server Slow performance SQL Server 2014 to SQL Server 2000

$
0
0

Hi Masters,

I am using Microsoft SQL Server 2014 and trying to connect to Microsoft SQL Server 2000 to get some data. I have performance problem when querying a query using linked server that i create.

For a simple query like :

select * from [LSERVER].[SparePart].[dbo].[STOCK]

When i create linked server in Microsoft SQL Server 2014 it took 2.5 Minutes to querying around 140k record.

Then i tried to create the same linked server in Microsoft SQL Server 2008 R2 and query the same. The result query only took 35 sec to querying the same values as before.

Can someone share an experiences about this condition?

Thanks!

Change the index_name after creation of the table..

$
0
0

Hi Friend,

I have small requirement.

When I am created the table default index_name created on the primary key.

index_name like this

[PK__hemer__3214EC07AE2E7369]

I want to the change default  name to some generic name like this PK__hemer.

How we can do that..

Pls let me know

SQL 2005 to 2012 Upgrade - huge sql code base

$
0
0

Hi Experts,

I have a database that has thousand stored procedures, with hundred of thousands lines of code if not millions. Processing lots of data.

We are migrating from SQL 2005 to 2012. The current box is expertly maintained by DBA so I think most tuning a DBA expert should know are in place currently.

My concern is.. would such a big jump in SQL engine cause adverse behaviors with impact in performance, even if we refresh all statistics etc.

Has that been seen 'out there'?

You would think that the expert DBA read all BOL and watched out for breaking changes but with a immense code base it's very difficult to analyze everything. Stress test has been done which is proving inconclusive at the moment, thus my concern.

Thanks

Significant part of sql server process memory ahs been paged out on SQL2008R2 build 4321

$
0
0

We have a 64 bit SQL2008R2 server running SP2 build 4321 that has the account running SQL having lock pages in memory set. This setting is supposed to stop the OS from pulling the memory out of SQL but it didn't. The server has 32Gb with SQL set to 24Gb min and max. 

Any ideas?

Thanks

Chris

Grant a user the select permission on a view that references external objects

$
0
0

Hi all,

SQL Server 2012 Enterprise Edition SP2.

I've a database (let's say SRC_DB) that contains a series of views, some of these views refercenses tables or other views in other databases (let's say EXT_DB). I'm searching the best way to grant a user permission to SELECT from that view without granting permission to every single obejct in external databases referenced by the view.

Locking issue

$
0
0

Hi,

I have a strange locking issue and need your help to understand what is going on. 

Using a query, I join few tables (EventTransaction, Contact, Event and Outbound) in Prod_DW database and save the result into a table in CustomDataExtract database.

The query is something like this :

SELECT Col1, Col2, .... INTO CustomDataExtract..A1345_Contact_15022503

FROM Prod_DW..EventTransaction with (nolock) join ....

All of the tables in Prod_DW used in the query have with (nolock) option but still I see other connections being blocked on Prod_DW tables when I run the above query. My expectation is that since I query using with (nolock), during the query run, it shouldn't any blocking lock on the prod_DW tables. Can you please shed some light on this and tell me why still I see other connections being blocked.

Here is the Lock XML during the query run:

<Database name="CustomDataExtract">
  <Locks>
    <Lock request_mode="S" request_status="GRANT" request_count="1" />
  </Locks>
  <Objects>
    <Object name="(null)">
      <Locks>
        <Lock resource_type="DATABASE.BULKOP_BACKUP_DB" request_mode="NULL" request_status="GRANT" request_count="1" />
        <Lock resource_type="DATABASE.BULKOP_BACKUP_LOG" request_mode="NULL" request_status="GRANT" request_count="1" />
        <Lock resource_type="DATABASE.ENCRYPTION_SCAN" request_mode="S" request_status="GRANT" request_count="1" />
        <Lock resource_type="PAGE" page_type="*" request_mode="X" request_status="GRANT" request_count="1" />
      </Locks>
    </Object>
    <Object name="A1345_Contact_15022503" schema_name="dbo">
      <Locks>
        <Lock resource_type="ALLOCATION_UNIT.BULK_OPERATION_PAGE" request_mode="S" request_status="GRANT" request_count="1" />
        <Lock resource_type="HOBT.BULK_OPERATION" request_mode="IX" request_status="GRANT" request_count="1" />
        <Lock resource_type="METADATA.INDEXSTATS" request_mode="Sch-S" request_status="GRANT" request_count="1" />
        <Lock resource_type="OBJECT" request_mode="BU" request_status="GRANT" request_count="1" />
        <Lock resource_type="OBJECT" request_mode="X" request_status="GRANT" request_count="1" />
      </Locks>
    </Object>
  </Objects>
</Database>
<Database name="Prod_DW">
  <Locks>
    <Lock request_mode="S" request_status="GRANT" request_count="1" />
  </Locks>
  <Objects>
    <Object name="Contact" schema_name="dbo">
      <Locks>
        <Lock resource_type="OBJECT" request_mode="Sch-S" request_status="GRANT" request_count="9" />
      </Locks>
    </Object>
    <Object name="Event" schema_name="dbo">
      <Locks>
        <Lock resource_type="OBJECT" request_mode="Sch-S" request_status="GRANT" request_count="1" />
      </Locks>
    </Object>
    <Object name="EventTransaction" schema_name="dbo">
      <Locks>
        <Lock resource_type="OBJECT" request_mode="IS" request_status="GRANT" request_count="2" />
        <Lock resource_type="OBJECT" request_mode="Sch-S" request_status="GRANT" request_count="8" />
        <Lock resource_type="PAGE" page_type="*" index_name="ndx_EventTransaction" request_mode="S" request_status="GRANT" request_count="1" />
      </Locks>
    </Object>
    <Object name="Outbound" schema_name="dbo">
      <Locks>
        <Lock resource_type="OBJECT" request_mode="Sch-S" request_status="GRANT" request_count="1" />
      </Locks>
    </Object>
  </Objects>
</Database>

Moving Sql traffic to a new IP Address

$
0
0

We recently separated web and sql server machines and traffic runs across the public network.

We have now installed a direct link between the 2 machines and I need to redirect the traffic to this link.

How do I achieve this.

My knowledge of networking is average, so I would need a good deal of tutoring


How to update the user database physical file location in master database

$
0
0
I had to relocate the database log file and I issued an Alter database command but by mistake I put a space in the file name as below. The space is at the beginning file name. Now I am unable get the database loaded to SQL Server. The database has 2 replications configured, so deleting and re-attaching the database means the replication needs to be re-configured. Is there an alternative way to issue a command to update the database FILENAME ? Not sure if this can be edited in master database (sys files).

ALTER DATABASE [User_DB] 
MODIFY FILE (NAME = User_DB_log, FILENAME = 'I:\SQLLogs\ User_DB_log.ldf')
GO

SQL Server Agent Job Failing on Job Step

$
0
0

Hi,

Firstly, apologies if this post has been made in the wrong group.  Running SQL Server 2012.  I'm attempting to add a SQL Server Agent Job which calls a stored procedure that sends a Database Mail message.  The SQL Server and SQL Server Agent both run under the NT AUTHORITY\NETWORK SERVICE account.  The Database Mail service has been enabled, and a public profile created.  When running the stored procedure manually, I receive no errors - everything runs as expected and I do receive an email containing the expected information.

I've created the job, job step, job schedule, attached the schedule to the job, and assigned the job to server, all using T-SQL without error.  I've also enabled the mail profile on the SQL Server Agent, and I know that part is working because when the job fails, I get an email notification of the failure.

I've checked the command text in the job step and parsed it within the SQL Job Step Edit window to confirm, it shows as parsing correctly.  However, when I manually run the job itself, I get the following:

Execution of job failed.  See the history log for details.

I check the history log and it shows:

[474] Unable to refresh Database Mail profile Database Mail Profile. (reason: ) (Not a typo, the history log shows no reason)

[260] Unable to start mail session.

[396] An idle CPU condition has not been defined - OnIdle job schedules will have no effect

The command text on the failing job step is as follows:

DECLARE @date [varchar](10)

SET @date = CAST(GETDATE() AS [varchar](10))

EXEC [dbo].[GetExceptions]
    @company = 'MyCompany',
    @checkDate = @date

With regard to the date value being passed as varchar: This stored procedure is used to check for exceptions against multiple databases on this server (hence the company parameter) via dynamic SQL.  I'd much prefer to use proper data typing but this is the only way I could get it to work.

Does anyone have any suggestions on anything else I could check, or insights into why this is failing?  Any help is greatly appreciated!

Best Regards

Brad

How to find the SQL Server Instances running across the given activer directory domain?

$
0
0

How to find the SQL Server Instances running across the given activer directory domain?

I have though of OSQL -L , Microsoft Assessment and Planning ( MAP ) tool and SQLPing3 (SQLSecurity) might help me.

I would appreciate if there any other way of finding the SQL Servers / Instances running across the given active directory domain.

 


Sivaprasad Shttp://sivasql.blogspot.com Please click the Mark as Answer button if a post solves your problem!

"available_commit_limit_kb" : available to be committed by the process

$
0
0

Hi Experts,

Could you please help me to understand the dmv  "sys.dm_os_process_memory", there is a column "available_commit_limit_kb" that describes 'memory available to be committed by the process'... what it means?

Please help...


--------------------------------- Devender Bijania

Differencial backup, Log backup and restore

$
0
0

Hi Team,

A scenario: If I have backups as below.

FullBackup1

LogBackup1

LogBackup2

DiffBackup1

LogBackup3

LogBackup4

If our database crash after logBackup4, Is it really required the DiffBackup1 to recover the db? or will it be possible to recover using the first Full backup and all the 4 log backups? Here I did not considered tail of log.

Thanks,

Ashru

 


MCTS, http://asharafaliptb.wordpress.com

Viewing all 6624 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>