I am getting following error while running xp_cmdshell under non system admin rights.An error occurred during the execution of xp_cmdshell. A call to 'CreateProcessAsUser' failed with error code: '1314'.any help will be appreciated..
↧
Running xp_cmdshell under non system admin
↧
Login failed for user 'abc\mssqlsrv'. Reason: Failed to open the explicitly specified database
Hi,We have sql server 2008 x64 instance with SP1. When ever SQL Serve instance got restarted, I'm seeing the below error in log:[quote]Error: 18456, Severity: 14, State: 38.2011-07-04 17:38:57.95 Logon Login failed for user 'abc\mssqlsrv'. Reason: Failed to open the explicitly specified database. [CLIENT: <local machine>][/quote]Could you please adviceThanks
↧
↧
xp_logoninfo #nt invalid object error code 0x6ba
Good morning, I'm running xp_logoninfo to retrieve group members exec master..xp_logininfo @acctname='dddd\gggggg',@option=members;or exec master..xp_logininfo 'dddd\gggggg',members;On our 2008/2012 servers it fails for groups, on our old 2003 with SQL2005 it works fine. The error is :-Msg 15404, Level 16, State 4, Procedure xp_logininfo, Line 43Could not obtain information about Windows NT group/user 'dddd\ggggg', error code 0x6ba.Having run a profile trace its saying #nt is an invalid object and looking at the SP it creates this to load the members into. I can copy the create #nt statement and run it and it works for me. We have tried changing the SQLServer user to the same as the server that works, it still fails. I have a gut feeling its the hardening the use here, but I've looked through the code and can't see anything that would appear to cause it. anyone seen anything similar? Or understand the permissions requiredMany thanks
↧
Automating SQL Server Locking/DeadLock Error.
Team,In your existing engagement, have your’l ever automated a SQL Server Locking/DeadLock situation via Email. I know that from SQL Server 2008 onwards the best option to accomplish this would be Extended Events but since I have this situation on a SQL Server 2005 version, I was hoping that somebody might have come across such a scenario.Anyhelp would be Greatly appreciated.With Thanks,Satnam
↧
Unable to Connect in Single User Mode
I added -m; at the beginning of the startup parameters to start the server in single user mode. I then restarted the server. When i tried to connect to the server, I'm getting the below message "Login failed for user '[i]DomainName\Admin[/i]'. Reason: Server is in single user mode. Only one administrator can connect at this time. (.Net SqlClient Data Provider)"I tried connecting using sqlcmd. But the same meesage came up.I stopped all the services[text search, analysis, integration, reporting].No applications are using this server.Any idea would be appreciated....
↧
↧
How to calculate future growth of a new database?
I've came up with the idea about how is database sizing done.I've read the information provided by Microsoft on its website (https://msdn.microsoft.com/es-es/library/ms189124(v=sql.120).aspx) about how to make estimations about sizing, but the information on this article supposes that the number of rows that will be present in the tables is already known.What about if I don't know what will be the exact number of rows that will hold the table?Event though I coulde use a simple estimate ,this could take to some errors about a minor or bigger estimation.So I ask you guys, how could I handle this approach for an estimation?What about running databases, how can estimate future growth?Thank you.
↧
Openrowset returns an error when run from my WS
Hi all,I am stuck since yesterday morning with a stupid problem on which I hope you can help me.I can't run the following query from my workstation:[quote]SELECT * FROM OPENROWSET ( 'Microsoft.Jet.OLEDB.4.0', 'Excel 5.0; Database=\\server\Data\test\file.xls;HDR=Yes', 'Select * from [Sheet1$]' )[/quote]The error message says:[quote]Msg 7399, Level 16, State 1, Line 1The OLE DB provider "Microsoft.Jet.OLEDB.4.0" for linked server "(null)" reported an error. The provider did not give any information about the error.Msg 7303, Level 16, State 1, Line 1Cannot initialize the data source object of OLE DB provider "Microsoft.Jet.OLEDB.4.0" for linked server "(null)".[/quote]Running following query on my workstation works fine:[quote]SELECT * FROM OPENROWSET ( 'Microsoft.Jet.OLEDB.4.0', 'Excel 5.0; Database=c:\test\file.xls;HDR=Yes', 'Select * from [Sheet1$]' )[/quote]Please note that the file is located here elsewhere.If I run both queries with a remote access to the sql server, everything runs just fine.I am administrator from the domain, the user running the SQL Server service is Administrator of the machine and has full access on the database. Allow Inprocess is checked for the Provider Microsoft.Jet.OLEDB.4.0.The only difference is that once it is run from my workstation via SSMS and the other time it is run from my workstation through remote access on the Sql server via SSMS as well.Any idea where the problem could hide?Many thanks for your help ...
↧
how to partition a table on multiple columns
Hi,I have a table workcachedetail with 40 million rows which has 8 columns.We decided to partition the table.Most of the queries in our environment uses 4 columns in the where clause or joins.If I partition the table with 4 columns then I may get better performance.Can we partition the table on multiple columns(like partitioning on id,deptid,designation)?Thanks,Vamsy
↧
sysJobActivity showing jobs from years ago that never ended
I've noticed that sysJobActivity shows a number of jobs where the stop_execution_date is NULL, but the run_requested_date is up to 3 years ago, so it looks like the job started 3 years ago and has not yet finished. If I look at these jobs in Redgate SQL Backup or in SQLSoft SQLjobvis then it looks like the jobs are just starting and ending on their usual schedules.I have 24 jobs in total like this, and it looks like the run_requested_date on them is in batches of around the same date/time per batch, so at first I though it might be something to do with the server being restarted and leaving jobs hanging, but the more recent ones were only 2 months ago and the server hasn't been restarted in over a year (it's a live/production server that is used 24/7).So my questions are: (1) What might have caused this? (2) Is it safe to just do an UPDATE on these records and change the stop_execution_date to something like '1900-01-01' (3) Are there any better ways to tidy this up?[b]EDIT:[/b] Source code to quickly see what I mean:[code="sql"]SELECT job.Name, job.job_ID, job.Originating_Server, activity.run_requested_Date, DATEDIFF(mi, activity.run_requested_Date, GETDATE()) as ElapsedFROM msdb.dbo.sysjobs_view job JOIN msdb.dbo.sysjobactivity activity ON job.job_id = activity.job_idWHERE activity.run_requested_date IS NOT NULL AND activity.stop_execution_date IS NULL --AND run_Requested_date >= '2013-01-01'ORDER BY 4[/code]
↧
↧
How to give permission to a user in a read only database ?
hi all,i have a question can we give a user permission read permission on a read only database.
↧
Operation manager DB space free % alert
Hello All, Hope everyone is doing well we are getting this below alert. I see I have sufficient space on the drives and also set the DB to autogrowth.Operations Manager operational database percent free space is 3%. Ops DB Server Name:xxxxxxxName: OperationsManagerObserved below points.1.database is in simple recovery model2.auto-growth enabled and Restricted mode upto 50GB(its 1000MB). Right now free space available on both the drives 26%(MDF) and 27%(NDF) respectively.and log file in different drive and its just 500MB only.3.we do not have any maintenance on this database.Please let us know should we demand for extra space and im in confusion what needs to be checked and address this issue further.Please suggest the same.Please help me on this issue.Thanks & Regards,DBA
↧
Extracting tables from SPs
Hi,I have a lot of stored procedures which use several tables.Is there a way to extract the information of which tables used by which stored procedures?I mean, suppose I have a stored procedure that has 20 tables inside (Joins , inserts, etc...)How can I know which are those tables without having to see one by one?Thank you
↧
See the size of tables using t-sql
Hi,I have a list of tables (several tables) and I would like to know their size.Is there a way to know that using t-sql?It will be easyer then having to select each one from the diagram or having to look at the reports, one by one...Thank you
↧
↧
Can DBCC FREEPROCCACHE not work properly at certain times?
Had an issue yesterday which caused a backlog of queries, very high CPU, application slowdown - all from the start of the business day at about 6.30am. This was fixed almost immediately by running a job which creates+drops a snapshot as this was known to clear the cache (a hunch by someone that this was the issue).What I can't understand is WHY this occurred at the time it did, since just prior to it at 6am there is a job which changes 'degree of parallelism' and also has an explicit step to (after a wait of 2 mins') run DBCC FREEPROCCACHE.It is almost like the freeproccache didn't do its job at the time specified, and had to be run via the snapshot job a bit later - is this a bug with SQL 2005 SP4 that the command doesn't do what is required??Incidentally, the wait of 2 mins and explicit running of DBCC FREEPROCCACHE was introduced because during load testing in the pre-production environment a similar patter was found. The first run of the day had CPU issues etc, and after some deduction it was found that the command needed to be specified, despite there being other jobs (snapshots and the like) which should have cleared the cache automatically themselves. This 'fix' has kept things sweet in both pre and production up until yesterday.One further bit of info is that between 4am and 5:30am there was an update stats job using the 'UPDATE STATISTICS' command. But surely the 6am FREEPROCCACHE should have taken care of any out of date stats in query plans?Also, here are the relevant things recorded by SQL:[b]Snapahot created and MAXDOP changed:[/b][size="2"]2016-01-18 00:00:01.130 spid109 Configuration option 'show advanced options' changed from 0 to 1. Run the RECONFIGURE statement to install.2016-01-18 00:00:01.130 spid109 Configuration option 'max degree of parallelism' changed from 1 to 4. Run the RECONFIGURE statement to install.2016-01-18 00:00:01.230 spid109 SQL Server has encountered 1 occurrence(s) of cachestore flush for the 'Object Plans' cachestore (part of plan cache) due to 'DBCC FREEPROCCACHE' or 'DBCC FREESYSTEMCACHE' operations.2016-01-18 00:00:01.230 spid109 SQL Server has encountered 1 occurrence(s) of cachestore flush for the 'Object Plans' cachestore (part of plan cache) due to some database maintenance or reconfigure operations.2016-01-18 00:00:08.050 spid109 SQL Server has encountered 1 occurrence(s) of cachestore flush for the 'SQL Plans' cachestore (part of plan cache) due to 'DBCC FREEPROCCACHE' or 'DBCC FREESYSTEMCACHE' operations.2016-01-18 00:00:08.050 spid109 SQL Server has encountered 1 occurrence(s) of cachestore flush for the 'SQL Plans' cachestore (part of plan cache) due to some database maintenance or reconfigure operations.2016-01-18 00:00:08.050 spid109 SQL Server has encountered 1 occurrence(s) of cachestore flush for the 'Bound Trees' cachestore (part of plan cache) due to 'DBCC FREEPROCCACHE' or 'DBCC FREESYSTEMCACHE' operations.2016-01-18 00:00:08.050 spid109 SQL Server has encountered 1 occurrence(s) of cachestore flush for the 'Bound Trees' cachestore (part of plan cache) due to some database maintenance or reconfigure operations.2016-01-18 00:00:08.080 spid109 Configuration option 'show advanced options' changed from 1 to 0. Run the RECONFIGURE statement to install.[/size][b]Snapshot dropped after use:[/b][size="2"]2016-01-18 02:36:03.520 spid70 SQL Server has encountered 1 occurrence(s) of cachestore flush for the 'Object Plans' cachestore (part of plan cache) due to some database maintenance or reconfigure operations.2016-01-18 02:36:05.840 spid70 SQL Server has encountered 1 occurrence(s) of cachestore flush for the 'SQL Plans' cachestore (part of plan cache) due to some database maintenance or reconfigure operations.2016-01-18 02:36:05.840 spid70 SQL Server has encountered 1 occurrence(s) of cachestore flush for the 'Bound Trees' cachestore (part of plan cache) due to some database maintenance or reconfigure operations.[/size][b]MAXDOP changed, 2 minute wait and then DBCC FREEPROCCACHE command run:[/b][size="2"]2016-01-18 06:00:00.150 spid62 Configuration option 'show advanced options' changed from 0 to 1. Run the RECONFIGURE statement to install.2016-01-18 06:00:00.160 spid62 Configuration option 'max degree of parallelism' changed from 4 to 1. Run the RECONFIGURE statement to install.2016-01-18 06:00:00.230 spid62 SQL Server has encountered 2 occurrence(s) of cachestore flush for the 'Object Plans' cachestore (part of plan cache) due to some database maintenance or reconfigure operations.2016-01-18 06:00:00.480 spid62 SQL Server has encountered 2 occurrence(s) of cachestore flush for the 'SQL Plans' cachestore (part of plan cache) due to some database maintenance or reconfigure operations.2016-01-18 06:00:00.490 spid62 SQL Server has encountered 2 occurrence(s) of cachestore flush for the 'Bound Trees' cachestore (part of plan cache) due to some database maintenance or reconfigure operations.2016-01-18 06:00:00.510 spid62 Configuration option 'show advanced options' changed from 1 to 0. Run the RECONFIGURE statement to install.[/size][b]Manual running of the earlier snapshot creation and drop jobs to try and fix the performance issue:[/b][size="2"]2016-01-18 10:51:35.070 spid549 SQL Server has encountered 1 occurrence(s) of cachestore flush for the 'Object Plans' cachestore (part of plan cache) due to 'DBCC FREEPROCCACHE' or 'DBCC FREESYSTEMCACHE' operations.2016-01-18 10:51:35.160 spid549 SQL Server has encountered 1 occurrence(s) of cachestore flush for the 'Object Plans' cachestore (part of plan cache) due to some database maintenance or reconfigure operations.2016-01-18 10:52:17.740 spid549 SQL Server has encountered 1 occurrence(s) of cachestore flush for the 'SQL Plans' cachestore (part of plan cache) due to 'DBCC FREEPROCCACHE' or 'DBCC FREESYSTEMCACHE' operations.2016-01-18 10:52:17.830 spid549 SQL Server has encountered 1 occurrence(s) of cachestore flush for the 'SQL Plans' cachestore (part of plan cache) due to some database maintenance or reconfigure operations.2016-01-18 10:52:18.010 spid549 SQL Server has encountered 1 occurrence(s) of cachestore flush for the 'Bound Trees' cachestore (part of plan cache) due to 'DBCC FREEPROCCACHE' or 'DBCC FREESYSTEMCACHE' operations.2016-01-18 10:52:18.100 spid549 SQL Server has encountered 1 occurrence(s) of cachestore flush for the 'Bound Trees' cachestore (part of plan cache) due to some database maintenance or reconfigure operations.2016-01-18 10:56:50.200 spid549 SQL Server has encountered 1 occurrence(s) of cachestore flush for the 'Object Plans' cachestore (part of plan cache) due to some database maintenance or reconfigure operations.[/size]
↧
Installing multiple instances of reporting services on the same server
Hey all,Been doing a little reading this morning:[url=http://bloggingabout.net/blogs/mglaser/archive/2006/12/18/multiple-reporting-services-instances-on-one-machine.aspx]http://bloggingabout.net/blogs/mglaser/archive/2006/12/18/multiple-reporting-services-instances-on-one-machine.aspx[/url][url=http://bloggingabout.net/blogs/mglaser/archive/2006/12/18/multiple-reporting-services-instances-on-one-machine.aspx]http://bloggingabout.net/blogs/mglaser/archive/2006/12/18/multiple-reporting-services-instances-on-one-machine.aspx[/url][url=http://msdn.microsoft.com/en-us/library/ms159114(SQL.90).aspx]http://msdn.microsoft.com/en-us/library/ms159114(SQL.90).aspx[/url]and I could use some help. Basically I have a server which is running three instances of SQL, one purely for reporting services. My plan is to install two new instances of reporting services, each one using one of the two instances of SQL and then tearing down the old reporting services instance as well as the third instance of SQL.I'm a bit confused by what I've been reading. Do I actually need to setup multiple IP addresses? All I'm really looking to do is have two different instance of reporting services, both resolving to the same host name, simply separated by virtual directory ... http://servername/reports1 + http://servername/reports2.Before I get underway with this and mess things up, can anyone help shed some light on this? Am I taking the correct approach in by assuming:- Install reporting services - point to instance1- Install reporting services - point to instance2- Uninstall old reporting services instance- Uninstall old SQL server instance- Setup and configure both instances of reporting services- Reports will resolve to http://servername/reports1 + http://servername/reports2- Reports will be published to http://servername/reportserver$1 + http://servername/reportserver2?Thanks
↧
Remove a Filegroup
I want to remove a filegroup like this:"ALTER DATABASE MyDBNameREMOVE FILEGROUP MyFileGroupName"and before i do that T-SQL, I have removed all the files in the filegroup that planed to remove.But when remove that filegroup,It says:Server: Msg 5042, Level 16, State 7, Line 1The filegroup 'MyFileGroupName' cannot be removed because it is not empty.Question: How can I tell what is on this filegroup. I'm having trouble in finding it ...;)
↧
LDAP query using domain name co.id
hi all i have a little question about query ldap using SQL 2008 R2, LDAP server using windows server 2012domain was created using testing.co.idim tried with query below and always show errorSELECT * FROM OpenQuery (ADSI2,'SELECT *FROM ''LDAP://testing.co.id:389/dc=testing,dc=co,dc=id''') AS tblADSIError Message :Msg 7321, Level 16, State 2, Line 25An error occurred while preparing the query "SELECT *FROM 'LDAP://testing.co.id:389/dc=testing,dc=co,dc=id'" for execution against OLE DB provider "ADSDSOObject" for linked server "ADSI2". any suggestion?thanks for help
↧
↧
QUERY: GET SPACE USED/FREE in All Databases
Hello again,I need to get the following information:- Space Allocated from each database, - Space Used and from each database and - Space Free from each database in one instance and Total Space Used on that instance.Can you send me one Query/Stored Procedure that give me all this output.I need to make one report with all this information.I know that with sp_spaceused i get this information but i need to get this information for all databases in one cursor or somethin like this.Thanks and regards,JMSM ;)
↧
File growth during log shipping
Hi all,I have a database which is 86Gb in size and every 10 minutes we log ship to our DR environment which is in a remote location 50 miles away. The transaction logs on the database at the DR environment have grown to 43Gb and I am now out of disk space on that particular partition.I firstly attempted to shrink the log file but received the error that I cannot do this when a database is recovering. Then, thought I would move the log file to another drive which has more space using the usual detach > move > reattach commands. I detatched OK, copied OK, but can't now reattach because of a "Cannot attach a database that was being restored". Dammit.Firstly, should the log file in the destination database be growing like it has been? It doesn't make sense to me for the log file in the destination DB to be set to 'Full Recovery' - the log file in the source database is only 112Mb.Secondly, am I now forced to reinitialize the TxLog shipping by copying another 86Gb database to our DR location or is there a way out of this mess?Thanks in advance,Martin
↧
Disk space
Hi, Our test server is running out of space in the G (Log files) and F drive(Data files and backups drive ) .We have roughly 8 user SQL databases installed on it .DB A = 15.8 GBDB B = 18 GBDB C = 6.38 MBDB D = 5 MBDB E = 17 GBDB F = 88 MBDB G = 13.6 GBDB H = 30.2 GBWhat is the recommended disk size needed so that we do not run into such issues very frequently?Thanks,PSB
↧