Quantcast
Channel: Forum SQL Server Database Engine
Viewing all 15889 articles
Browse latest View live

Issues with reporting percent log space used, between DMV and DBCC

$
0
0
Using SQL Server 2012 SE 11.0.2100, I am getting two different sets of values when querying for log space between the DMV and the DBCC command. 

Querying using the DMV.

select instance_name as DBName, cntr_value as PercentLogUsed from sys.dm_os_performance_counters where counter_name = 'Percent Log Used' and instance_name <> '_Total' and instance_name <> 'mssqlsystemresource' and instance_name <> 'model' order by cntr_value desc

The results that I get from using this DMV are about 10% off from the results that I get when I use dbcc.

DBCC SQLPERF(logspace)

Why is this?





Handle with parameter

$
0
0
Hi,
I have unicode inside @area below.
                cmd = new SqlCommand("SELECT a.id,a.name FROM dbo.dist a,dbo.area b where area_name=b.name and case when isnull(local_name,'')='' then b.name else local_name end=@area order by 1", conn);
                ...


How to put anything like

N'...'

for @area above?

Many Thanks & Best Regards, Hua Min



SQL query timeout error

$
0
0

I am using vb6 application with Sql Server 2012. Very often I get timeout error.

I have 700+ tables in the database. Some tables i am using in query have 20K + rows (some have very few records also).

I use begin transaction and commit transaction.

I have several small small queries in the transaction. 

Just for example,

Suppose i am saving invoice created for customer, after i click SAVE button,

 first I go to 1 or 2 other forms to calculate totals and get accounts etc  etc. so load those forms and get the data.

Then checking dates and some other data in other tables.

Then i delete existing invoice first, then insert new invoice in say 4/5 tables.

I get timeout error [odbc sql server driver]timeout expired. I have give commandtimeout = 600 and connectiontimeout=600 already. I am using ADODB.Connection. My tables are not indexed.

How can i eliminate or atleast minimise this error.


h2007

Find unused databases

$
0
0

Hi Experts,

I know this is a question asked before. We need to figure out the databases in our servers that arenot being used. We could check from audit logs, profiler trace and some DMV's. But is there any useful tool or any easy method by which we could get it for all the databases (100s of them) for all servers. Please provide your suggestions ?


MM

SQL Server 2008 and Java application

$
0
0

Hi,

notice lately a problem with SQL Server 2008 that application for no reason hang and stop operating and this problem unsolvable till restart the application and all support team pointing to SQL Server because the application lose connection with SQL as they identify the problem (the problem behavior is very random) 

so I am looking for a way to monitor all connection hit the database connected to this application and see if this the problem

appreciate you support

  • how can I monitor and gather all connections state concerning this application with associated database from SQL Server
  • what type of error SQL Server can generate if this problem is true

Thanks In advance

 



about 10 INSERT statements issued and taking long

$
0
0

Hello dear Gurus,

I issued about 10 insert statements all at same time (selected all and executed) and the SQL Server is taking too long. Now, I want to know which of the 10 statements have completed and which are still running. Is there any way I can identify  the insert statements of the 10 that have completed?

ASAP please....

Help Much appreciated

ebro

 


ebro

WAITSTATS cause for concern or no?

$
0
0

Hi All,

Am diagnosing a 'slow' application and looking at the database server first. I ran Paul Randall's waitstats script and here is the output.

Couple questions as i'm going through this:

1) Even though CXPACKET is the most waited on (in terms of %), the avgwait_s is 0.006 which is very small, meaning it shouldn't be a cause for concern. We have MAXDOP=8 on a 12 CPU server.

2) The waits with the highest avgwait_s are LCK_M_IX and LCK_M_S so i *think* these would be the obvious place to start an investigation. If so, i've read these could be indicative of blocking (or not), but what other areas can i look at to further dive into these waits?

Thanks in advance.

Fastest way to read a 600MB table (in memory)

$
0
0

 I cannot get more than 15-19mb/s is there any limitation that I need to know about?

The query is a simple select not doing sorting and the database is read-only : "select * from tablename"

Tried local and remote and still get the same throughput therefore is not a network problem.

Launching multiple queries in parallel bring the total time down almost linearly as I increase the number of parallel connections (which bring different sections of the data).

Finally the table fits entirely in memory therefore no DiskIO is involved either.

If someone has any insight, please chime in.

noel


Kill Kpid

$
0
0

Hi All

It's possible to kill a kpid from TSQL ??

Replication information

$
0
0

Hi ,

we configurations the  Replication, after we can run the update statistics on the publication database, this update statistics reflect into subscriber database or not ?

 


Reg:Uploading Excel File is not working

$
0
0

HI Friends,

After Uploading a file i will show data in Gridview.Then i will Import in a Sql Table.

Another machine i have published Its working fine.But After i have Publish in New Server its not Uploading a file.I had changed IIS Pool Settings 64 bit to 32 it and i have given full rights on the folder.Still its not working.

SQL Remote connection without specify PORT Number between different locations

$
0
0

Hello,

We need to connect SQL Server from one machine to another machine.

We have installed SQL server with instance name as SQLExpress.

We can able to connect remote connection with client machines in the same location without specifying port number.

But if i try to coonect sql server from different city or different country not able to connect without specifying Port number.

Could you please hep me to connect Sql server without specify PORT number from all locations.

Note :

1.Enabled Protocols.

2.Firewall exception created.

3.Allow remote connections enabled.

4.Authentication Mode changed to SQL Authentication.

Thanks and Regards,

Karthik.K

Client statistics showing zero's

$
0
0
When I click on the show client statistics it shows all zeros. See screenshot.

Alan

Problem with unicode

$
0
0
Hi,
when doing the insert using these
                    cmd = new SqlCommand("insert into dbo.ite_tab (...,area,...) values (...,@area,...)", conn);
                    ...
                    cmd.Parameters.Add("@area", SqlDbType.NVarChar).Value = area_ddl.SelectedItem.ToString();

I am getting this in the table column in the DB,
中?

while the relevant Dropdownlist is having

中国

inside. why?

Many Thanks & Best Regards, Hua Min

Active directory

$
0
0

Hi Everyone,

How the data in active directory gets stored?

Are the data getting stored in SQL Server?

I have googled is, but didnt found any articels.

 

Thanks,

Karthi K


backup status

$
0
0

Hi,

I want to check if there are any backups running in SQL Server 2012. We are shutting down the servers and I have to make sure no backups are running.

Please help

Regards

Unable to open physical file - Operating system error 5: 5(error not found) Microsoft SQL Server: Error 5120

$
0
0

I am trying to attach a database to SQL 2005. This database has not previously been attached. I have only just installed SQL.

 

I get the following message: Unable to open physical file "C:\ArrowSQL\Arr@Data\Arrow_data.mdf" Operating system error 5: "5(error not found)" (Microsoft SQL Server: Error 5120)".

 

I have loaded SQL and the database fiel and directory with the same user acccount which is a local adminstrator ont hsi machine. I have checked that I have read/write access to the file.

 

The machine runs Windows Vista Business. SQL has SP 2 loaded.

 

What causes this?

CDC Oracle source SQL Server destination

$
0
0

Hi can anyone recommend CDC software for moving data from oracle to sql server.

We have looked at attunity, before we can make a decision we need to look at competitors.

SQL Server 2008 R2, Error: 701, Severity: 17, State: 123, There is insufficient system memory in resource pool 'internal' to run this query.

$
0
0
In the error log, I get:

2013-06-02 00:00:37.78 spid22s     This instance of SQL Server has been using a process ID of 1268 since 5/15/2013 4:12:15 AM (local) 5/15/2013 8:12:15 AM (UTC). This is an informational message only; no user action is required.
2013-06-02 00:03:21.45 spid71      Error: 701, Severity: 17, State: 123.
2013-06-02 00:03:21.45 spid71      There is insufficient system memory in resource pool 'internal' to run this query.
2013-06-02 00:12:23.20 spid53      Error: 701, Severity: 17, State: 123.
2013-06-02 00:12:23.20 spid53      There is insufficient system memory in resource pool 'internal' to run this query.
2013-06-02 00:12:23.25 spid59      Error: 701, Severity: 17, State: 123.
2013-06-02 00:12:23.25 spid59      There is insufficient system memory in resource pool 'internal' to run this query.
2013-06-02 00:12:23.26 spid58      Error: 701, Severity: 17, State: 123.
2013-06-02 00:12:23.26 spid58      There is insufficient system memory in resource pool 'internal' to run this query.
2013-06-02 00:12:23.31 spid53      Error: 701, Severity: 17, State: 131.
2013-06-02 00:12:23.31 spid53      There is insufficient system memory in resource pool 'internal' to run this query.
2013-06-02 00:30:10.12 spid75      1 transactions rolled forward in database 'AppFabricMonitoringStoreDb' (9). This is an informational message only. No user action is required.
2013-06-02 00:30:14.12 spid75      0 transactions rolled back in database 'AppFabricMonitoringStoreDb' (9). This is an informational message only. No user action is required.
2013-06-02 00:30:20.78 spid75      Recovery completed for database AppFabricMonitoringStoreDb (database ID 9) in 13 second(s) (analysis 51 ms, redo 2264 ms, undo 2347 ms.) This is an informational message only. No user action is required.
2013-06-02 00:32:23.88 spid75      DBCC CHECKDB (AppFabricMonitoringStoreDb) WITH all_errormsgs, no_infomsgs, data_purity executed by NT AUTHORITY\NETWORK SERVICE found 0 errors and repaired 0 errors. Elapsed time: 0 hours 2 minutes 20 seconds.  Internal database snapshot has split point LSN = 0000e67d:00000593:0097 and first LSN = 0000e67d:00000591:0001.  This is an informational message only. No user action is required.
2013-06-02 00:32:30.27 spid75      DBCC CHECKDB (AppFabricPersistenceStoreDb) WITH all_errormsgs, no_infomsgs, data_purity executed by NT AUTHORITY\NETWORK SERVICE found 0 errors and repaired 0 errors. Elapsed time: 0 hours 0 minutes 0 seconds.  Internal database snapshot has split point LSN = 0000111b:000000b7:0001 and first LSN = 0000111b:000000b6:0001.  This is an informational message only. No user action is required.
2013-06-02 00:32:31.40 spid75      DBCC CHECKDB (ReportServer$SQL2008) WITH all_errormsgs, no_infomsgs, data_purity executed by NT AUTHORITY\NETWORK SERVICE found 0 errors and repaired 0 errors. Elapsed time: 0 hours 0 minutes 0 seconds.  Internal database snapshot has split point LSN = 00000066:0000013f:0001 and first LSN = 00000066:0000013e:0001.  This is an informational message only. No user action is required.
2013-06-02 00:32:31.91 spid75      DBCC CHECKDB (ReportServer$SQL2008TempDB) WITH all_errormsgs, no_infomsgs, data_purity executed by NT AUTHORITY\NETWORK SERVICE found 0 errors and repaired 0 errors. Elapsed time: 0 hours 0 minutes 0 seconds.  Internal database snapshot has split point LSN = 00000017:00000262:0001 and first LSN = 00000017:00000261:0001.  This is an informational message only. No user action is required.

At the time of the error, the system is running a Job Agent Job created by Microsoft AppFabric called Microsoft_ApplicationServer_Monitoring_ImportWfEvents_AppFabricMonitoringStoreDb. It has succeeded in every other invocation except this one at 5:06:30 AM. At the same time, the system runs another job named Microsoft_ApplicationServer_Monitoring_ImportWcfEvents_AppFabricMonitoringStoreDb. Both jobs are scheduled to run every 10 seconds. This job has never failed. This is what I see when viewing the Job Agent History Log:

Date        6/3/2013 5:06:30 AM
Log        Job History (Microsoft_ApplicationServer_Monitoring_ImportWfEvents_AppFabricMonitoringStoreDb)

Step ID        1
Server        1049AS_SQL\SQL2008
Job Name        Microsoft_ApplicationServer_Monitoring_ImportWfEvents_AppFabricMonitoringStoreDb
Step Name        ASImportWfEvents
Duration        00:00:01
Sql Severity        17
Sql Message ID        701
Operator Emailed        
Operator Net sent        
Operator Paged        
Retries Attempted        0

Message
Executed as user: AS_MonitoringDbJobsAdmin. There is insufficient system memory in resource pool 'internal' to run this query. [SQLSTATE 42000] (Error 701).  The step failed.

The Windows Event Log shows no entries around this time the System log, and only these SQL events in the Application log around this time.

Configuration details:

Server: Microsoft Windows NT 6.1 (7601), Windows Server 2008 R2 Standard SP1
    Installed RAM: 4.00 GB
    This is a VMware VM.

Microsoft SQL Server Standard Edition (64-bit)
10.50.1600.1
SQL_Latin1_General_CP1_CI_AS
Min Memory: 0
Max Memory: 2000 MB

This instance is on the same server as a SQL Server 2005 instance (Min Memory:0, Max Memory: 2000 MB). The 2005 instance was quiet at the time of the error in the 2008 R2 instance. Neither IIS nor any other significant services is running on this server.

This 2008 R2 instance is running SSRS and contains the databases for an AppFabric instance that is running on a different server. The only databases in this instance are the two SSRS databases and the two AppFabric databases, all of which are in simple mode.

The AppFabricMonitoringStoreDb.mdf (E:) is 1.5 GB and its log (F:) is 470 MB. tempdb.mdf (C:) is 250 MB and templog (C:) is 25 MB. All are set to allow unlimited growth. All drives have at least 5 GB free.

I had a similar problem last weekend, when the Max Memory for the 2008 R2 instance was set to 1500 MB. I increased it to 2000 MB as an experiment, but that doesn't seem to have helped. Given that the VM is only allocated 4 GB, the two SQL instances can't each take 2 GB and leave the OS with nothing, so maybe I just need to allocate more RAM to this VM, but I have 4 other VMs exactly like it (same pair of SQL instances, same jobs) that haven't had any such memory issues and they are more heavily used than this one.

I would appreciate any ideas as to how to track this down and fix the source of this issue.

Thanks,
Mark

SET options used in SQL Server 2008

$
0
0

We are using the following SET options in Oracle. I need to convert the same Oracle script to SQL server script which have the following SET options.

SET ECHO OFF     /*to suppress SQL queries in the output file*/

SET VERIFY OFF  /* will show before and after substitution variables*/

SET TRIMSPOOL ON   /* will remove trailing spaces from spooled output*/

SET TRIMOUT ON   /* will remove trailing spaces from output*/

SET LINESIZE 9999 /* width of page (80 is typical)  */

SET LONG 9999  /* Sets maximum width (in bytes) for displaying LONG, CLOB, NCLOB and XML Type values; and for copying LONG values.*/

SET LONGCHUNKSIZE 9999    /* Sets the size (in bytes) of the increments in which SQL*Plus retrieves a LONG, CLOB, NCLOB or XML Type value.*/

SET PAGESIZE 0   /* Sets the number of lines in each page*/

SET FEEDBACK OFF   /* It won’t displays the number of records returned by a script when a script selects at least n records. It also turns off the statement confirmation messages such as 'Table created' and 'PL/SQL procedure successfully completed' that are displayed after successful SQL or PL/SQL statements.*/

SET TIMING OFF    /* Controls the display of timing statistics.*/

SET TIME OFF    /* Controls the display of the current time.*/

SET COLSEP   /* In iSQL*Plus, SET COLSEP determines the column separator character to be printed between column output that is rendered inside <PRE> tags. Sets the text to be printed between selected columns */

   Can you please tell me, what are the options used for the above SET options in SQL Server?

Thank in Advance.

Viewing all 15889 articles
Browse latest View live