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

Remove certificate from Win 2008 R2 used for SQL 2012 encrypted connections

$
0
0

I need to remove self signed certificates from a 2 node cluster that was used for testing SQL Server 2012 encrypted connections.  I did a similar test on my desktop and SQL Server would not restart after removing the self signed cert there, complaining about not being able to find the certificate.  I set Force Encryption to no with the SSConfig Manager and dropped the cert with MMC.

The cluster is going to turn into a QA SQL installation and I can't afford to have SQL not restartable.

Thanks,  joe


new dbms which supports user defined dml

$
0
0

Hi

So is there any architectural possibility of making a DBMS with user defined DML capabilities?i.e., Other than SQL server.

Thank you


meNeethu

Feasibility of programmatically checking password history

$
0
0
I am tasked with updating the security options of our software. Our software lets a user login to SQL server with the SQL username/password rather than NT Security. So regarding the SQL Security, when the account needs a password change we pop up a dialog that lets the user change the password. However, we've not been able to figure out how to check against the list of past passwords. So if my last password was "c0mPlex1", and I am forced to change it, I can "change" it back to "c0mPlex1" and not throw any issues. For the record, we are using ALTER LOGIN to change the passwords. SQL server is 2012, on a variety of platforms, and dev environment is VB2012.

Strange results from sys.partitions system view

$
0
0

There is a strange problem on some of new upgraded sql server 2012 servers,for example:

use testDB
go
select partition_id,object_id,index_id,partition_number,rows 
from sys.partitions 
where object_id = object_id ('testtable')
order by index_id 
select partition_id,object_id,index_id,partition_number,row_count
from sys.dm_db_partition_stats 
where object_id = object_id ('testtable')
order by index_id 
-- query results as below

partition_id         object_id   index_id    partition_number rows
-------------------- ----------- ----------- ---------------- --------------------
72057599707119616    158727718   1           1                3957149
72057599732875264    158727718   2           1                3957149
72057599738642432    158727718   2           1                3950892
72057599389859840    158727718   4           1                3957149
72057599714852864    158727718   11          1                3957149
72057599738707968    158727718   11          1                3950892
72057599736283136    158727718   11          1                3945037
72057599728025600    158727718   31          1                3957149
72057599678808064    158727718   48          1                3957149

partition_id         object_id   index_id    partition_number row_count
-------------------- ----------- ----------- ---------------- --------------------
72057599707119616    158727718   1           1                3957149
72057599732875264    158727718   2           1                3957149
72057599389859840    158727718   4           1                3957149
72057599714852864    158727718   11          1                3957149
72057599728025600    158727718   31          1                3957149
72057599678808064    158727718   48          1                3957149

Index 2 and index 11 index columns are:

indexid 22: Hotel(int), onlineDisplay(char(1)), CloseFlag(char(1))
indexid 11: onlineDisplay(char(1)), CloseFlag(char(1)), Room(int), Hotel(int), Currency(char(3)), PrepayReserveType(varchar(5))

So the question are:

1st: Why the two queries got different results?

2nd: Why the two indexes (indexid =2 and indexid=11) have multiple rows from sys.partitions

3rd: And the two indexes (indexid =2 and indexid=11) have different rows?

Many thanks.

SQL Database Hierarchy Structures for WinRT

$
0
0

I've done a lot of reading over the past about SQL and database structures. One of the most helpful being:
http://stackoverflow.com/questions/4048151/what-are-the-options-for-storing-hierarchical-data-in-a-relational-database
which does an overview on many types with links to more information. However, after reading it has brought up several questions. Currently, I'm looking to build a database, and am trying to choose the best structure for an extremely large number of sets. It will be leaf heavy, but also a moderate number of middle nodes. It will initially have several inserts, but few inserts, and removes after insertion. However, there would be frequent updates to information within all of the nodes, hence navigating to specific items through their lineage is important. Lets use a business employee model to represent my case which has 4 tables. They link as follows:

  Region     Manager
         \       /         
          Store
             |  
      Employees

Now I've seen the examples on msdn which reference a join statement to link tables, but I assumed that when one uses join that it linearly goes through all elements in a table binding and checking whether the condition (if where is used) is satisfied. Is my assumption correct? This is what I understand to be a type of adjacency set and to me would be way too slow for my application and I would need to use something with fast queries for a large dataset.

The following methods as I understand it don't partition into separate tables and instead contain all information in one table.

Nested sets is another option, but I dislike how intensity of the insert/move/delete procedures. I also read that recursive procedures can incur major costs, but since I'm using SQLite is that still true?

I saw materialized path/lineage column which sounds pretty great, but requires string analysis. Plus, I don't have a single lineage. I figured I could fix the initial issue by referencing positive or negative values of lineage (region would have a negative id while manager would have a positive).

The last method described was multiple column lineage which has a maximum number of nests, but in my case this is of no issue since I have a finite number.

I like the last method the best, however I'd rather just store everything in 4 different tables and have a parent/child id like we have for adjacency lists. However, I don't want to linearly search each table as that would be expensive if queried on the employee table. Is it possible to linearly search regions (there would be a lot less of them) and find its children (potentially multiple) in store and find all the employees of store without linearly searching each subsequent table for matches? Or is it silly to not just use a join/where query to get the information?

I guess I'm still quite lost when it comes to building/querying my database. If I could just get some more information regarding how these techniques iterate through the tables and suggestions of how to setup/query for this table setup I would be greatly appreciative! Thanks for taking the time to read this!

Bests,

Jeremy



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

Best Practices for Install on VMware / SQL Server 2012 / Sharepoint Server 2013 / BI

$
0
0

Hello, I searching for information about best practices to implement or parameters to configure before or during the installation under VMware / ESX environment / vSphere and SQL Server 2012 and Sharepoint 2013 (including a tabular SSAS server, a data warehouse and ETL SSIIS server, server, SSRS to generate reports, a Sharepoint Server for broadcast of PowerPivot reporting and PowerView)

Can you help me please.

Thanks for advance.

LSN - is it a global indication all across the instance or per DB value

$
0
0

I need to restore many DBs to the same point.

I know I can restore them with stopAt time, but I'm afraid I could lose some transaction that would happen in that exact time.

I think using the  STOPATMARK = 'lsn:xxx' is more reliable.

My question is if I can use on LSN for all DBs, meaning, the LSN is global to instance and not per DB. right?

if I restore all the DBs to the same LSN, this means that I get all the transaction that occurred all over the instance in all DBs before this transaction, right?


Database table wrongly update

$
0
0


Hi team,

I have one big production database; under this production database one very important table is there.

Here I am updated the table wrongly, but I have table backup before updating  the table.

Here how we can restore the backup table into old backup table.

invalid column name 'xml_index_type'

$
0
0

Hi, 

I'm not sure when this started happening but today, none of us using SSMS 2012 connected to SQL server 2012 SP1 were able to script any objects.  we are presented with the message

Failed to retrieve data for this request. (microsoft.sqlserver.management.sdk.sfc)
Invalide column name 'xml_index_type'.

see screenshot.

wondering if any ran into this before and have a fix?

Thanks

per day cumulative stock

$
0
0

Hi Everyone,

here I'm trying to findout the per day stock on the basis of below code but the code is not running its giving the error 

please anyone help me to correct this code is it right way or not which is I'm trying.

        

 create table Stock

   (
    [Item No_] int,
    [Location Code] nvarchar(155),
    Stock decimal(30),
    [Posting Date] DATE
    );

    SELECT * FROM Stock

    DECLARE  @date1 DATETIME;
    set @date1 = '2013-12-01'
    while @date1 <= '2013-12-31'
    (
     insert into Stock 
     select  [Item No_],[Location Code],sum([Quantity])as Stock, @date1 as [Posting Date]
     from [bckup].[dbo].[ItemLedgerEntry]
     where [Posting Date]<= @date1
     set @date1 = dateadd(day,1,@date1)
     )

Regarding Backup Schedules

$
0
0

Hi all,

1) I scheduled full backup on Sunday.

2) Differential Backup every day twice for every 12 hours.

3) And Log backup every hour.

But ,  i will be taking a full backup of necessary database (to place from application server to test server )in between as per the request from the teams.

Does taking a full backups in between affects a scheduled plans .

Please , do me needful. And the scheduled plans what i implemented is good or not (if it is not good please suggest me )

Thanks All....

Executing same sproc on 2 different machines (Development & Staging), same execution plan, but CPU times are different

$
0
0

Hello,

I have SQL Server 2012 instance installed on 2 different machines, one is my local machine (Development) and other on a Staging environment. The server version's and editions are all same.

When I execute a stored procedure, the Staging server takes 3 times (takes 3 seconds) as much as my local machine (takes 1 sec). The databases are same, as I backed up the DB from Stage to my local machine. The execution plans are same, the reads and writes are same. Running profiler, the only thing I am seeing different is the CPU time. The CPU time is also 3 times on stage vs on development. 

My local machine has a Intel i7 processor 3.4GHz, where as the stage server has Intel i5 2.7GHz. Also the stage server is a Virtual server having Windows Server 2012. My local machine is Windows 7. Could processor make such a difference? (3 times execution time).

Indexes are same, I rebuilt them on both machines. I tried DBCC freeproccache on both before running them. The recordsets are same. Could processor could really make such a difference on Sproc execution time?

Greatly appreciate any/all comments/thoughts.


Simulated buffer.

$
0
0
In SQL sever 2012, there is a new concept Name "Simulated buffer" , is there anyone know what's it?


Please click the Mark as Answer button if a post solves your problem!

how to select the column with respect to language in sql server

$
0
0

USE Master
SELECT * FROM SysMessages

GO

when i execute the above query, in description column am getting English and Chinese , here if i want to select only English .

how can i select only English language by using WHERE condition.

And why am getting data in Description column in Chinese also any reason behind it.

If there is any reason please suggest me.


Snap file is created automatically on my SharePoint database ?

$
0
0

Hi,

On My SharePoint Database a snap file is created which consumes lots of space and the performance of server is degraded.

The snap file is created automatically and its also removed automatically after 1 day.

I am new to SQL and won't find any scheduled task for snap file under SQL .

I had checked on technet and won't find an appropriate solution, why snapshot file is created.

The SQL server version is 2008 R2 and SharePoint version is 2013.
Also due to snap file sometime I am unable to take backup of database with DPM (Data Protection Manager).

Thanks,

Nadeem A

Database backup

$
0
0

Hello

I've came to situation where I can not find who is backing up the server. :)

At a specific time database get backed up with two tools. One is known, another is the one that needs to be tracked.
Windows logs show these backups as a regular SQL backups, nothing special about these.
SQL trace shows that backups as a backup with following info

BACKUP DATABASE [DBNAME] TO VIRTUAL_DEVICE='{GUID comes here}' WITH SNAPSHOT,BUFFERCOUNT=1,BLOCKSIZE=1024,COPY_ONLY

SQL Trace shows that backups are done with LocalSystem account and hostname is server name.

I can not find any jobs that might start such backups. Also Backup admins say that they have one tool configured for backups (the known one). And Sharepoint Admins say that database backup is not enabled it the settings (I've checked in SP 2013 you can configure Content DB backup from Sharepoint administration).

Maybe someone can advice how to track down that application, which is doing backups?

Thanks.
Olegas



SQL Server 2008 Error occurring when trying to attach database

$
0
0

Hi.

I'm trying to attach a database in Management Studio but am recieving an the following error. What can I do to resolve this? I'm using an Administrator account also.

===================================

Attach database failed for Server 'RW113L'.  (Microsoft.SqlServer.Smo)

------------------------------
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=10.0.1600.22+((SQL_PreRelease).080709-1414+)&EvtSrc=Microsoft.SqlServer.Management.Smo.ExceptionTemplates.FailedOperationExceptionText&EvtID=Attach+database+Server&LinkId=20476

------------------------------
Program Location:

   at Microsoft.SqlServer.Management.Smo.Server.AttachDatabase(String name, StringCollection files)
   at Microsoft.SqlServer.Management.SqlManagerUI.AttachDatabaseData.PrimaryFile.Attach()
   at Microsoft.SqlServer.Management.SqlManagerUI.AttachDatabase.SendDataToServer()

===================================

An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)

------------------------------
Program Location:

   at Microsoft.SqlServer.Management.Common.ServerConnection.ExecuteNonQuery(String sqlCommand, ExecutionTypes executionType)
   at Microsoft.SqlServer.Management.Common.ServerConnection.ExecuteNonQuery(StringCollection sqlCommands, ExecutionTypes executionType)
   at Microsoft.SqlServer.Management.Smo.ExecutionManager.ExecuteNonQuery(StringCollection queries)
   at Microsoft.SqlServer.Management.Smo.Server.AttachDatabaseWorker(String name, StringCollection files, String owner, AttachOptions attachOptions)
   at Microsoft.SqlServer.Management.Smo.Server.AttachDatabase(String name, StringCollection files)

===================================

Unable to open the physical file "C:\Murach\SQL Server 2008\Databases\AP.mdf". Operating system error 5: "5(failed to retrieve text for this error. Reason: 15105)". (.Net SqlClient Data Provider)

------------------------------
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=10.00.1600&EvtSrc=MSSQLServer&EvtID=5120&LinkId=20476

------------------------------
Server Name: RW113L
Error Number: 5120
Severity: 16
State: 101
Line Number: 1


------------------------------
Program Location:

   at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)
   at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)
   at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)
   at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
   at System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean async)
   at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe)
   at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
   at Microsoft.SqlServer.Management.Common.ServerConnection.ExecuteNonQuery(String sqlCommand, ExecutionTypes executionType)


QUERY window problem

$
0
0

hi team ,

i am able to connecting sql server , but click the new query window getting below error.

Provider to link to Oracle server

$
0
0

I have a question relating to compatability, and the Microsoft documentation seems unclear. Here are the system specs:

Windows Server 2008 R2 (64 bit) Standard

SQL Server 2008 R2 (64 bit) Standard

The desire is to link to an Oracle server. It appears I can possibly use:

Oracle Provider for OLE DB: http://technet.microsoft.com/en-us/library/ms190618(v=sql.105).aspx

or

Microsoft OLE DB Provider for Oracle: http://msdn.microsoft.com/en-us/library/windows/desktop/ms675851(v=vs.85).aspx

We've had issues trying the first one. When I looked closer (and found above link) its suggested that the Oracle provider is not compatable with our system? 32 bit Oracle driver does not work with 64 bit SQL server:http://support.microsoft.com/kb/2555855/en-us and it appears 64 bit driver is simply "None" for support.

Can anyone confirm Which driver(s) I can use given my setup? It looks like the Microsoft driver may be the only compatible driver for our setup. The message regarding it being a discontinued feature concerns me.

Viewing all 15889 articles
Browse latest View live


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