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

Extract data from AS400 with SSIS

$
0
0
Hello,

We try to extract data from AS400 to integer them in our SQL Server database with SSIS. We don't know how to do it because we don't know how to create a connection to AS400.

For information we work on our personal computer and we deploy our devlopments on a distant server. The distant server is a windows server, and on it,  SQL SERVER Standard edition is installed.

My question is: what we need to do to be able to extract data from AS400 with SSIS ?

Best regard's

Mohamed



Connect to Oracle, error 7302

$
0
0

Dear friends,

I have the following error when I want to test my linked server:
Cannot create an instance of OLE DB provider "OraOLEDB.Oracle" for linked server (Error Number: 7302).

I followed the instructions posted on this URL:
https://www.mssqltips.com/sqlservertip/4396/creating-a-sql-server-2014-linked-server-for-an-oracle-11g-database/

My situation
2 W2012R2 servers, 1 with SQL2016dev and 1 with Ora11g as mentioned on the URL.
On the SQL server I installed as well the ODAC122010 x64. So the provider OraOLEDB.Oracle came available.
Both servers are not part of any domain, they both live in the WORKGROUP.

After creating the linked server I get the mentioned error.
I just want to connect via SSMS.
I searched for a solution, but did not find one.
So I was wondering if somebody can help me?

Thanks in advance
Marco


SQLServerAgent could not be started (reason: Unable to connect to server ''; SQLServerAgent cannot start)

$
0
0

Unable to start SQL Agent SQL Server 2008 R2 RTM OS: Windows 2008 R2

Agent Log

2012-04-17 22:17:22 - ! [298] SQLServer Error: 27, Registry information is corrupt or missing. Make sure the provider installed and registered correctly. [SQLSTATE 08001]
2012-04-17 22:17:22 - ! [298] SQLServer Error: 27, Client unable to establish connection [SQLSTATE 08001]
2012-04-17 22:17:22 - ! [165] ODBC Error: 0, A network-related or instance-specific error has occurred while establishing a connection to SQL Server. Server is not found or not accessible. Check if instance name is correct and if SQL Server is configured to allow remote connections. For more information see SQL Server Books Online. [SQLSTATE 08001]
2012-04-17 22:17:22 - ! [000] Unable to connect to server '(local)'; SQLServerAgent cannot start
2012-04-17 22:17:22 - ! [298] SQLServer Error: 27, Registry information is corrupt or missing. Make sure the provider installed and registered correctly. [SQLSTATE 08001]
2012-04-17 22:17:22 - ! [298] SQLServer Error: 27, Client unable to establish connection [SQLSTATE 08001]
2012-04-17 22:17:22 - ! [165] ODBC Error: 0, A network-related or instance-specific error has occurred while establishing a connection to SQL Server. Server is not found or not accessible. Check if instance name is correct and if SQL Server is configured to allow remote connections. For more information see SQL Server Books Online. [SQLSTATE 08001]
2012-04-17 22:17:22 - ! [382] Logon to server '(local)' failed (DisableAgentXPs)
2012-04-17 22:17:23 - ? [098] SQLServerAgent terminated (normally)

EventLog:

SQLServerAgent could not be started (reason: Unable to connect to server '<ServerNAme>'; SQLServerAgent cannot start).

TITLE: Microsoft SQL Server Management Studio
------------------------------

Unable to start service SQLSERVERAGENT on server <Server Name>. (mscorlib)

------------------------------
ADDITIONAL INFORMATION:

The SQLSERVERAGENT service on <Server Name> started and then stopped. (ObjectExplorer)

------------------------------
BUTTONS:

OK
------------------------------

Uninstalled couple of times and Reinstall still getting the same Error and also tried below workarounds:

sp_configure 'show advanced options', 1;  
GO  
RECONFIGURE;  
GO  
sp_configure 'Agent XPs', 1;  
GO  
RECONFIGURE  
GO


[HKLM\SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\SQLServerAgent] PATH is Correct

Can you please share with you if have any fix for this issue.

Note: Services are running under service account [Domain Account] and also has SA privilage.

Thanks

Nag


Nag Pal MCTS/MCITP (SQL Server 2005/2008) :: Please Mark Answer/vote if it is helpful ::

observing High cpu

$
0
0
Hi Experts,

Seeking for inputs on High cpu scenario.
App team has started running workload at that time and they back saying DB is slow.  Seeing 100% CPU on one of our production env.  Checked if any jobs are running on the server. Found Full backup started at 12:00 AM PST and it is running over 2 hours.  Next, tried to query sp_whoisactive to see what active processes running on the servers? they were like 20 spids which started just before 2 mins but all are in RUNNABLE state.  Next, tried to query if there are any sleeping spids using sp_whoisactive, and found there are almost 570 spids which are in sleeping state for more than 4 days and open_txn = 1.

What does this indicate? is this is a worker thread starvation scenario? how to prove it or how can I troubleshoot this issue? Do we need to monitor any user connections over here? or any batch requests herer? What are things we need to check when we bump up into such scenario?

Eventually, we had to KILL those sleeping spids with consultation with app team which are running over 2 days. Once it is done, the current processes which are in runnable state started their execution. Also, slowly the cpu utilization has come down to 50%.

Env : SQL 2012 EE

Regards,
Sam

Packed Decimal datatype in DB2

$
0
0

Hi,

We are trying to get the value from DB2 database table via Linked Server in SQL server 2016. The DB2 table has one column with the data type of "Packed Decimal in the Length of 11 & Precision of 5".  when I query this column in SQL server, I'm getting only the decimal value and not getting any precision value. For eg. In DB2 the actual value is "5.67234" where as in SQL Server giving the column value as "5.0".

How do I get the actual value (via linked servers)which is exactly available in DB2 from SQL Server 2016?


hostname and program name showing blanks in sys.sysprocesses

$
0
0

Hi All,

For some of spids, I am seeing hostname and program_name as blanks. But, I am seeing sql text, login name etc...
Why is it so? any thoughts why sql server is not showing hostname and program names?


--sleeping spids with hostname and program name is showing blank
select s.spid,s.[status],s.blocked,db_name(s.dbid) as dbname,s.open_tran,s.hostname,s.[program_name],s.cmd,s.loginame,s.nt_domain,s.nt_username,s.login_time,
LEFT([sql].[text], 1000) as [text]
 from sys.sysprocesses s
OUTER APPLY sys.dm_exec_sql_text (s.sql_handle) as [sql]
where s.[status] = 'sleeping'
and (s.hostname='' and s.[program_name]='')


Thanks,
Sam

Microsoft.ACE.OLEDB.16.0 provider is not registered on the local machine. (System.data)

$
0
0

Trying to import data from Excel is giving this message.

Office365 64-bit

Here's what I tried:

1) I installed the 64-bit Access database engine 2016

2) I tried the 2010 & 2007 versions as well

3) I reinstalled Office365

I'm out of ideas. What else could be going on here?

install SQLserver.smoExtended 2008 assemblies on SQL2016 server, any concern?

$
0
0

hello, I am wondering if there is any issues to download and install the SQLserver smoExtended version 10 (2008) assembly by installing the sql native client 2008 or from feature pack on a sql2016 server?

my vendor has an application requires the 2008 smo assembly.



Blocking issue - sql 2016

$
0
0

how to segregate this blocking, 

is  sp_getapplock & sp_releaseapplock  helps? 

SPID  106 blocks 107
SPID  106 blocks 196
SPID  107 blocks 196

< SPID  -- 107


update i set 
last_posted_price = t.price,
last_posted_map = t.map,
last_posted_price_feedid = t.feed,
last_posted_price_ts = getdate()
from marketplace_items i join #tmp t on t.id = i.id
--?>

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

< SPID -- 196
update marketplace_items set item_verification_status = @status,item_verification_status_reason = @status_reason
where id = @recordid
--?>

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

< SPID  --  106
with e as (
select *,row_number()over(partition by sku order by sku) row from #tmp
), f as (
select * from e where row = 1
)
merge into marketplace_items as target
using f as source on source.sku =target.sku and target.marketplace_id =6 
when matched then
update set 
confirmed=getdate(),
confirmed_price=case when isnumeric(source.price)= 1 and source.price not like '%[a-z]%' then source.price end,
confirmed_status=left(source.[PUBLISH STATUS],500),
confirmed_status_reason =left(source.[STATUS CHANGE REASON],1000),
confirmed_category = left(source.[PRODUCT CATEGORY],500),


confirmed_qty=case when isnumeric(source.[INVENTORY COUNT]) =1 then source.[INVENTORY COUNT] end,
confirmed_ref_code=left(source.WPID,500),
confirmed_ref_number=source.[ITEM ID],
confirmed_upc=source.UPC,
confirmed_shelf=left(source.[SHELF NAME],500),
confirmed_shelf_path=left(source.[PRIMARY CAT PATH],500),
confirmed_reviews=case when isnumeric(source.[REVIEWS COUNT]) =1 then source.[REVIEWS COUNT]  end,
confirmed_rating=case when isnumeric(source.[AVERAGE RATING]) =1 then cast(source.[AVERAGE RATING] as money) end,
confirmed_searchable=left(source.[SEARCHABLE?],500),

status= left(source.[LIFECYCLE STATUS],500),
response_message=left(source.[STATUS CHANGE REASON],500);
--?>

Strange Issues with memory on SQL2016

$
0
0

We have started seeing an issue over the last two weeks where our CPU jumps and causes us to clear the cache for one of our databases on a HA cluster. The server this is occurring on is a read-only node and see a lot of activity (2k batches/sec). Some of our procedures are called 8k - 10k times per minute.

 

About 10 minutes before the CPU spikes and causes an automated system to kick in that will free the cache in one of the databases, we start seeing two weird things:

1 - Our stored procedures start falling out of the cache when looking at sys.dm_exec_procedure_stats.

2 - We start seeing RESOURCE_MEMPHYSICAL_HIGH IndicatorsSystem = 1 when looking at sys.dm_os_ring_buffers. RESOURCE_MEM_STEAD also have an IndicatorsSystem = 1.

 

For the dm_os_ring_buffer, we will see results such as this:

 

EventTimeType IndicatorsProcess IndicatorsSystem Avail Phys Mem, KbAvail VAS, Kb

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

2019-11-29 14:48:24.440 RESOURCE_MEM_STEADY 0 1 31085396 136037463680

2019-11-29 14:48:24.440 RESOURCE_MEMPHYSICAL_LOW 0  0 31085396 136037463680

2019-11-29 14:48:24.440 RESOURCE_MEMPHYSICAL_HIGH 0 1 31085396 136037463680

2019-11-29 14:48:24.440 RESOURCE_MEM_STEADY 0 0 31085396 136037463680

2019-11-29 14:48:24.440 RESOURCE_MEMPHYSICAL_LOW 0  0 31085396 136037463680

2019-11-29 14:48:23.440 RESOURCE_MEM_STEADY 0 1 31085148 136037463680

2019-11-29 14:48:23.440 RESOURCE_MEMPHYSICAL_HIGH 0 1 31085148 136037463680

2019-11-29 14:48:23.440 RESOURCE_MEM_STEADY 0 0 31085148 136037463680

 

SQL Server Enterprise - 2016 SP2 CU10

524GB RAM

Min Memory 65,436, Max Memory 471,772

Pages Locked in Memory is set.

 

Has anyone seen anything like this before?


Ed Mlynar

DBCC skipping one database during integrity check

$
0
0

Hi,

we are running DBCC Integrity command using for user databases and sometime it's skipping one database.

No error message.

last few days, user databases we have 6 DB and DBCC when running every night, one DB not running DBCC integrity check but other databases running so couldn't understand why one DB not checked by DBCC command.

There are no information or any error message in log.

This kind of behavior happens on another server also randomly during nightly backup, one or two DBs getting skipped sometimes and it's not happening everyday but sometimes. 

DBCC Throwing PFS Corruption after upgrade from sql 2012 to sql 2017

$
0
0

Hi Experts,

We are in dilemma how is it possible - 

On Source Server sql 2012, we ran DBCC CHECKDB successfully, without any issue it came clean.

We took backup and migrated to sql server 2017 and restored successfully.

In error log , it printed message

DBCC Checkdb executed successfully on 29-Nov-2019 without any error. no action required.

We started DBCC Checkdb, it failed with PFS Corruption issue and Repair_Allow_data_loss the recommended step.

Msg 8948, level 16 state 6 line 1

Database error: Page (1:1204771) is marked with wrong type in PFS Page(1:1197024). PFS Status 0x40, expected 0x60

There were 20 or more errors which we corrected with repair_allow_data_loss.

To check whether there are more error in database or not, we ran dbcc checkdb again

Again it failed with many below errors

msg 8906, Level 16,state 1 line 1

Page(1:1156305) in database id 9 is allocated in SGAM (1:1022465) and PFS(1:1148496) but was not allocated in any IAM . PFS Flags ';Mixed_EXT_Allocated 0_PCT_Full'

msg 8906, Level 16,state 1 line 1

Page(1:1156306) in database id 9 is allocated in SGAM (1:1022465) and PFS(1:1148496) but was not allocated in any IAM . PFS Flags ';Mixed_EXT_Allocated 0_PCT_Full'

msg 8906, Level 16,state 1 line 1

Page(1:1156307) in database id 9 is allocated in SGAM (1:1022465) and PFS(1:1148496) but was not allocated in any IAM . PFS Flags ';Mixed_EXT_Allocated 0_PCT_Full'

msg 8906, Level 16,state 1 line 1

Page(1:1156308) in database id 9 is allocated in SGAM (1:1022465) and PFS(1:1148496) but was not allocated in any IAM . PFS Flags ';Mixed_EXT_Allocated 0_PCT_Full'

Now after running repair_allow_data_loss , it got successful.

Please let me know is this the BUG.

Please If not, how can I recover all data without any loss. Thank you very much

 



Manish

Do you want to be acknowledged as SQL Server Database Engine Guru? Submit your work to December 2019 competition!

$
0
0


What is TechNet Guru Competition?

Each month the TechNet Wiki council organizes a contest of the best articles posted that month. This is your chance to be announced as MICROSOFT TECHNOLOGY GURU OF THE MONTH!

One winner in each category will be selected each month for glory and adoration by the MSDN/TechNet Ninjas and community as a whole. Winners will be announced in dedicated blog post that will be published in Microsoft Wiki Ninjas blog, a tweet from the Wiki Ninjas Twitter account, links will be published at Microsoft TNWiki group on Facebook, and other acknowledgement from the community will follow.

Some of our biggest community voices and many MVPs have passed through these halls on their way to fame and fortune.

If you have already made a contribution in the forums or gallery or you published a nice blog, then you can simply convert it into a shared wiki article, reference the original post, and register the article for the TechNet Guru Competition. The articles must be written in December 2019 and must be in English. However, the original blog or forum content can be from beforeDecember 2019.

Come and see who is making waves in all your favorite technologies. Maybe it will be you!


Who can join the Competition?

Anyone who has basic knowledge and the desire to share the knowledge is welcome. Articles can appeal to beginners or discusse advanced topics. All you have to do is to add your article to TechNet Wiki from your own specialty category.


How can you win?

  1. Please copy/Write over your Microsoft technical solutions and revelations to TechNetWiki.
  2. Add a link to your new article on THIS WIKI COMPETITION PAGE (so we know you've contributed)
  3. (Optional but recommended) Add a link to your article at the TechNetWiki group on Facebook. The group is very active and people love to help, you can get feedback and even direct improvements in the article before the contest starts.

Do you have any question or want more information?

Feel free to ask any questions below, or Join us at the official MicrosoftTechNet Wiki groups on facebook. Read More about TechNet Guru Awards.

If you win, people will sing your praises online and your name will be raised as Guru of the Month.


PS: Above top banner came from Vimal Kalathil.

create unique key on Partition table

$
0
0

Need to create unique key on ref_number column in [purchase_order] table,

while use below 

CREATE UNIQUE NONCLUSTERED INDEX [idx_unique_PO] ON [dbo].[purchase_order]
(
[ref_number] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF,
 ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [psPurchase_order]([id])

getting error,

Column 'id' is partitioning column of the index 'idx_unique_PO'. Partition columns for a unique index must be a subset of the index key.

So i created Partion-key index,    this one created but this still allow duplicate


CREATE UNIQUE NONCLUSTERED INDEX [IX_Unique_purchase_order_partic] ON [purchase_order] 
(
    [ref_number] ASC,
    id
) ON [psPurchase_order](id)

Maintenance jobs failed with Integration Services evaluation period has expired ?

$
0
0

Hi All,

in this server , SSIS not at all installed and it's SQL server 2016 sp2 CU10 cluster enterprise edition and no old versions are running in this server but maintenance jobs are failing with below error....

Error Details:
Source: Full_Backup      Description: Integration Services evaluation period has expired.  End Error  Error: 2019-12-04 00:00:01.01     Code: 0xC0000033     Source: Full_Backup     Description: Integration Services evaluation period has expired.  End Error  Could not execute package because of error 0xC0000033.  Started:  12:00:00 AM  Finished: 12:00:01 AM  Elapsed:  0.516 seconds. The command line parameters are invalid.  The step failed.

Please provide the resolution steps for this issue....  

 

RAM



How to bring Database back ONLINE when in SUSPECT MODE in SQL SERVER 2000?

$
0
0

Dear All.

I am using SQL SERVER 2000 for my Databases. Recently, I faced a great crash of Server Hard Drive. Due to which I ran into a big horrible situation. Well Alas i got recovered data back. Now SQL SERVER 200 Says all databases in (SUSPECT MODE). I have put the Hard Drive back on its location. Now what i do to recover or bring back the DATABASES ONLINE. I am using SQL SERVER 2000. Pleas help. 

Thanks in ADV.

Log Shipping in SQLServer2019 error

$
0
0

Hi all,

I am trying to configure log shipping and getting following error in agent job history.(SQL Server 2019)

There was no problem with sql server 2017 and 2016 in same configuration.

The backup file was created normally but error message is logged.

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

2019-12-04 11:16:50.90 Starting transaction log backup. ID: '26c94b60-7380-4ddd-8dc7-ae2ae70630c7'

2019-12-04 11:16:50.90 *** ERROR: Unable to log history / error messages.(Microsoft.SqlServer.Management.LogShipping) ***

2019-12-04 11:16:50.90 *** error: Failed to convert parameter value fromSqlGuid to String.(System.Data) ***

2019-12-04 11:16:50.90 *** error: The object must implement IConvertible.(mscorlib) ***

2019-12-04 11:16:50.90 Retrieving backup settings ID: '26c94b60-7380-4ddd-8dc7-ae2ae70630c7'

2019-12-04 11:16:50.91 *** ERROR: Unable to log history / error messages.(Microsoft.SqlServer.Management.LogShipping) ***

2019-12-04 11:16:50.91 *** error: Failed to convert parameter value fromSqlGuid to String.(System.Data) ***

2019-12-04 11:16:50.91 *** error: The object must implement IConvertible.(mscorlib) ***

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

Can anyone tell me what is the problem in this?

n addition, I found the following phenomena:

Column [last_backup_file], [last_backup_date] of msdb.dbo.log_shipping_primary_databases and msdb.dbo.log_shipping_monitor_primary table is not updated. It's NULL.

It seems to be related to the error message noted above.



SQL Server Coallation Issue

$
0
0

Hi,

My SQL Server instance (SQL Server 2016) collation is  Japanese_BIN but i need to move an database from instance (SQL Server 2008) whose collation is Japanese_CI_AS and database itself collation is  SQL_Latin1_General_CP1_CI_AS. can you please let me knof is there any issue in doing it.

Regards,

Deepak

sys.index_columns.key_ordinal versus index_column_id

$
0
0

http://msdn.microsoft.com/en-us/library/ms175105.aspx

What is the difference between key_ordinal and index_column_id?

One one table where there is no PK indicated by there is a clustered unique index with four fields, the key_ordinal values reflect the order of the fields in the index, the index_column_id has 3-4 reversed.

So I mainly wonder what the purpose of index_column_id is?

Thanks.

Josh

ps - SQL 2008 64-bit enterprise.


Question on sys.dm_exec_query_plan

$
0
0

Hello,

Can anybody tell me why do the queries like these not return the database id?

I just don't know how to interpret such outputs: I do see there are plans in the cache but can't figure out which database the corresponding statements were compilied in?

Thank you in advance,
Michael

Viewing all 12963 articles
Browse latest View live


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