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

Alert on Low disk space

$
0
0

Hi  All

I have created an alert of WMI event in sql server  which send mail if disk space on D drive is less than 10GB

Query :

-----------------------------------

SELECT * from __InstanceModificationEvent
WITHIN 60
WHERE
TargetInstance ISA 'CIM_LogicalDisk'
AND
TargetInstance.FreeSpace < 10000000000
AND
TargetInstance.DeviceID = 'D:'

----------------------------

when I enable this alert It sends alert for low disk space

but some time it does'nt send alerts. I am not sure when this __InstanceModificationEvent   occure

and is there any another way to alert low disk space in my mailbox


Suppress Powershell Warning in agent job "WARNING: Could not obtain SQL Server Service information"

$
0
0

Hi

I get this warning running through powershell_ise but through sql agent it just errors out.

The code does everything it is supposed to and I tried everything to completely resolve the warning to no avail.

How do I supress it so sql agent wont error out running powershell code?

Thanks!

WARNING: Could not obtain SQL Server Service information. An attempt to connect to WMI on 'server_name' failed with the following error: Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))

Warning only present when it connects to remote servers, it doesn't produce it for local server. And it does get all info from the remote servers.


Paula

The operating system returned error 170(The requested resource is in use)

$
0
0

Hello Experts,

We have a Sharepoint farm where we are receiving OS Error 170 for many days. It results in database shutdown/Start because required transaction file is not available.

The operating system returned error 170(The requested resource is in use.) to SQL Server during a write at offset 0x0000029495e000 in file 'F:\MSSQL10_50.INST1\MSSQL\DATA\****.***. Additional messages in the SQL Server error log and system event log may provide more detail. This is a severe system-level error condition that threatens database integrity and must be corrected immediately

Write error during log flush.
Error: 9001, Severity: 21, State: 4.
The log for database 'DBNAME' is not available

We have checked the Anti Virus but all data files are excluded. We have also disabled the anti virus for some time but still issue persist.

This is a Virtual Machine and no VM snapshot backup is running during the time window.

Please help!

Thanks in advance.

Regards,

Divesh Mathur

Run a SQL procedure with multi database querying from Excel

$
0
0

I'm using SQL Server 2008 Enterprise. I created a procedure in one database. The procedure is composed of several queries to different databases and the final combined result set is being displayed.

I try to execute it via Excel, so the results will appear automatically in Excel sheet, but I'm getting the error:

"The query did not run, or the database table could not be opened. Check the database server or contact your DBA. Make sure the external
 database is available and hasn't been moved or recognized, then try the operation again".

I created a simpler procedure that queries only one database, and the results displayed at the Excel sheet with no issues.

I suspect that, the original procedure failed due to the fact that I'm querying several databases in the procedure, when in the connection details of the "External Data Properties", only one database is mentioned.

My question is - can it be solved? Can I use multiple databases in the procedure and see it in the Excel?

Thanks, Roni


slow sql server machine

$
0
0

Hello,
We have a sql server machine with many databases.
These databases are big and a few of the tables have millions of records.
We also have mirroring setup so that the data gets mirrored into another location on another sql server machine too...
Everyday thousands of records are inserted, updated, etc...
I have started seeing extreme slow performance issue on these inserts or updates, etc...
After several checks, we believe the whole sql server machine is being hammered by users heavily using databases.
The machine has the max. memory available.
Note that sometimes the sql server machine hangs too, i.e. (can not click on the enterprise manager icon to open it)...

Questions:
1-
It seems the mirroring has encryption enabled by default. If this is disabled on the mirroring server which is on another location, then could it improve the performance on the local server?

2-
What can I use to investigate the workload on the server

Thank you

SQL Server 2008 R2 Migration to a New Hardware

$
0
0

Hello,

I've a question on migration of cluster to a new hardware. Our currently hardware is out of date and our customer wants to do AS-IS migration to new hardware. The new hardware will have same configuration in terms of number of CPUs, Memory and OS version will be still Windows 2008 R2. The only difference will be the difference in HP Blade type (current G5 to new G8).

What will be the fastest way to do this? Is any migration tool like Platespin capable of doing this?

Also if I evict the passive node and replace it with new hardware..will it be possible to add the new one to current cluster setup..can I have one node of G5 and one node of G8 running together with same rest of hardware configuration and OS.

Regards,

Divesh Mathur

Sql Sp Performance

$
0
0

hi,

i have a procedure it will featch 8500 records and it will take time 00:00:23 secs .

How to improve the performance to complete with in less duration.Please let me know.

money datatype is 19 bytes?

$
0
0

Hi all

books online states that money datatype is 8 bytes long, but I can't understand why, when I create an index I see 19 bytes al length of money colums:



sp_syscollector_event_onpackageend taking 100% CPU and timing out

$
0
0

Howdy group,

@@Version:

Microsoft SQL Server 2012 (SP1) - 11.0.3339.0 (X64) 
Jan 14 2013 19:02:10 
Copyright (c) Microsoft Corporation
Standard Edition (64-bit) on Windows NT 6.1 <X64> (Build 7601: Service Pack 1) (Hypervisor)

I've been using Data Collector on most my servers for a couple years, and never had any major issues until now.  For some reason, seemingly random (I just haven't found the pattern yet), collection_set_3_upload job, step 2 will use between 50 and 100% CPU then timeout after an hour.  There are no blocks when I look at running processes. I used Extended Events to check out the actual query and it is this WHILE loop playing over and over again.

WHILE @parent_log_id IS NOT NULL
        BEGIN
            -- get the next parent
            SET @log_id = @parent_log_id
            SELECT @parent_log_id = parent_log_id FROM dbo.syscollector_execution_log_internal WHERE log_id = @log_id;
        END

56 mins in, it already had 1292279865 READS.  The COUNT(*) of my MSDB.dbo.syscollector_execution_log_internal table is only 28,036.  Again, there are no waits, it seems it can't find a @parent_log_id and just keeps on going till the 3600 sec timeout.

I've searched for sometime without luck hoping to find a solution. This is only happening on one server.  Has anyone else seen this situation?  My next step is to try to debug this stored procedure to figure out what is going on.  

Thanks!

-John V

i have sa rights but cannot create a login on my local

$
0
0

Hi.  We run 2012 enterprise.  I'm looking at instance level rights and see my windows login having sa role. 

But when i try to issue this command i get an error saying its either an invalid id or i do not have permission:

CREATE USER [xxxxxxx_xxx] FOR LOGIN [xxxxxxx_xxx] WITH password = 'xxxxxxx_xxx', DEFAULT_SCHEMA=[dbo]

...can someone explain?

how to put music on a device

$
0
0
I would like to know how i would go about transfering music and or movies from my computer to a ipod or a audio device 

Database Offline

$
0
0

Hello:

I have weird problem where around morning 1:35AM majority of my databases went OFFLINE in Windows Cluster 2008.

I only see this message in SQL error log "Setting database option OFFLINE to ON for database xxxxxxx event id 5084". beside that no other infos or error.

I checked cluster logs and see no errors or warning.

There was no failover or restart of SQL Server Services.

I checked default trace, error logs, event view logs etc  no luck.

there is no trace of user that might have took database offline nor I see any trigger that will take offline.

Any help or pointer is greatly appreciated.

Thanking in advance.

Thanks

Data issue with SQL 2012 Parallelism (Something unusual)

$
0
0

Hi,

Recently we have migrated our database from SQL 2008 R2 to 20012. One of our stored procedure is calling another stored procedure and it executes many update statements, out of which 2 update statements which were working fine in SQL 2008R2 Standard edition (Prod) as well as developer edition (Dev and QA) are not working as expected in Prod environment (SQL 2012 standard edition). It works fine in SQL 2012 developer edition (DEV and QA).

Only two differences we have between SQL 2012 QA and Prod are:

1) SQL Edition is different.

2) Number of processors are different. Prod has 8 processors, while QA has 2 processors.

What I have found so far is, if I run 2 update statements without setting up Maxdop, I am not getting out put as expected. But if I apply maxdop 1 or maxdop 2 settings at query level than I am getting data as expected. It does not work with Maxdop 3 or 4 etc.

This is strange behavior. Any one encounter similar issue with SQL 2012 parallelism?

Find out idle query...

$
0
0

Hi,<o:p></o:p>

i am using  sql server 2005 <o:p></o:p>

I have some  Stored procedures deployed in sql agent.<o:p></o:p>

i need  check following things.<o:p></o:p>

1) if any  statement in SP taking more than normal time.<o:p></o:p>

i need  check that any  command running or not in back ground . if command running need to
wait some tome else kill that job and restart the job.<o:p></o:p>

here how can i find out the query is  in running or idle mode.<o:p></o:p>


thanks in advance

Restoring single data file to multiple data file

$
0
0

Hi,

   I have to restore a single data file to 2 data file. Any options are there?


SQL Server 2005 Hierarchical Data concatenation

$
0
0

Hi Folks,
Please help me on the following data concatenation using hierarchical
 Query

Table Data:

Level Id     ParentTbl     PatCol    ChildTbl    ChildCol   
1                  A                 a           B            b
1                  A                  a           C            c
2                  C                  c           D            d
3                  D                  d           E            e        


Excepted Result:
Level Id     ParentTbl     PatCol    ChildTbl    ChildCol         SQLString
1                  A                 a           B            b            A.a =B.b
1                  A                  a           C            c            A.a = C.c
2                  C                  c           D            d           A.a = C.c =D.d
3                  D                  d           E            e           A.a = C.c = D.d =E.e  


Thanks
Narendran 



Narendran



The process is suspended with a full text index search in sqlserver 2012

$
0
0

The wait resource:


The process infomation is:

How to end the process? I try to kill it but failed.

for default sql server insatance dynamic port allocation

$
0
0

Hello Everyone,

is this right thing to change the default sql server instance port number 1433 to another number.

and another thing is how to assign dynamic port to sql server default instance is it possible? 

Backup and restore a DB on the slaved side

$
0
0

I have 3 sites, Primary site where I have backups and I have no question about it.

I have another 2 site which are synchronized with the above site, one is synchronizing using Always on AG and the other one is synchronizing using log shipping.

The other sites are far from the main site (few hours of flight) and moving the backup files from the main site to the other sites is almost very expensive.

I need to design solution for how we recover if any of the secondary sites breaks.

AFAIK I can't backup \ restore a DB that is in a "Recovering.." state (like the ones in the log shipping site). So how will I restore the DBs if the machine breaks (or if the machine needs to be recreated)

And for the DB which is in the Always-on synchronization method, I wonder if I can use the ability to full backup the secondary DB and restore it with no recovery , and then apply TRN backups which were taken on the primary site.

DBCC shrinkfile for Data file while DB is online

$
0
0
Is there any risk in running DBCC shrink file on the MDF file many times, decreasing the size of the DB every time in 1 MB, while the DB is highly active? the size of the DB is greater than 500 GB and I'd like to free up about 100 GB of disk space.
Viewing all 12554 articles
Browse latest View live


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