Quantcast
Channel: SQL Server Manageability forum
Viewing all 1563 articles
Browse latest View live

[SQLSTATE 22001] (Error 8152)Unable to open Step output file.

$
0
0

Hi,

I have configured the backups from our SQL Server instance to tape directly with out storing in the local drive, so that the disk space allocated for storing the backups in the local drive is saved. 

but i end up with the below error.

Executed as user: CORP\devsqlservice. select       DATABASE_NAME   = db_name(sd.database_id)      from       sys.databases sd      where         -- ONLINE      sd.state = 0        and sd.is_read_only = 0      group by sd.database_id      order by 1 [SQLSTATE 01000] (Message 0)  String or binary data would be truncated. [SQLSTATE 22001] (Error 8152)Unable to open Step output file.  The step failed.

I am clueless , why i face this error, Do any one of you face such problems in backup (scheduled backups) job. 


hemadri


Powershell sql agent jobs

$
0
0

Hi, I am trying to check status of sql agent jobs on various servers using powershell howerver I successfully list all the servers but cant seem to be able toWrite-Output$job.namefor any of the servers including the monitoring server that I am absolutely sure I have all required permissions. I get no errors which makes troubleshooting that much more difficult. Any ideas? Thank you

...

 foreach($sqlserverin$sqlservers)

{

#***THIS WORKS***

write-host$sqlserver.instancename

$srv=New-Object ('Microsoft.SqlServer.Management.Smo.Server')$sqlserver;

foreach ($jobin$srv.Jobserver.Jobs)

{

$jobName=$job.Name;

$jobEnabled=$job.IsEnabled;

...

#***THIS DOESN'T WORK***

write-host $jobName 

write-host $job.Name 

...


Paula


SQL 2012 Log and Back up Files.

$
0
0

Hi, 

I am installing SharePoint 2013 on a server farm and SQL 2012 was already installed but I have been reading up on the SQL side and it is advise to create different partitions for the database logs, backup and data. At the moment, the Database default Locations are set as follows: 

Default Database Location 

New Location preference: 

Partitions were created to handle the logs, backups and Data as shown on the screenshot. Please advise whether the following paths will be suitable and if I were to change them to the following if it would be okay. Another question - Is it okay to have the Logs and Backup in the same partitions and If I were to change the paths how will this affect the current installation of SharePoint? 

Much Thanks,

 

Data 

New Path: E:\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\DATA

Logs

New Path - F:\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\LOGS 

Back up

New Path: F:\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\Backup



how to shrink logs and database om Always on 2012 setup

$
0
0

i got 2 servers in an always on setup sql 2012

I need to shrink the logs file and database

the logs is over 80gb and the db is only 2-3 gb

I also tried to change the db from full recovery to simple but it wont let me do it since its doing replication

any idea?

Invoke-PolicyEvaluation TargetObject Issue

$
0
0

Hello everyone.

I am really stumped here and was hoping that I can get some help as I haven't been able to find anything on my own.  

I am working with Policy Based Management (PBM) to start auditing our environment for things like backups, etc.  I need to run this across a few hundred servers, and really don't want to loop through each of the servers.  I see in the Invoke-PolicyEvaluation cmdlet, that it has the option of -TargetObject.  In reading the notes on Invoke-PolicyEvaluation, I see this statement:

  • -TargetObjects takes an object or array of objects that represent the SQL Server objects in the target set. For example, you could create an array of Database class objects to pass in to -TargetObjects.

However, when I pull a list of database objects from CMS, it won't work.  Below is a code sample of what I am trying to do.  

How can I get this process multi-threaded for a large number of databases, rather than having to loop through each server?

## params
[string]$EvalMode="Check"
[string]$CentralManagementServer = "TS001-EQLT586\dev_sql2012"
[string]$HistoryDatabase = "DBASupport"
[string]$ConfigurationGroup="ProductionCluster"
[string]$PolicyCategoryFilter="ProductionBackups"

#Get server list
$CMSGroupFolders = Get-ChildItem -Recurse -Path "SQLSERVER:\SQLRegistration\Central Management Server Group\$CentralManagementServer" | ? {$_.Mode -ieq "d"}
$ServerList = $CMSGroupFolders | ? {$_.Name -ieq $ConfigurationGroup} | Get-ChildItem -recurse | ?{$_.Mode -ieq "-"}

#Get policy list
$PolicyList = Get-ChildItem -Path SQLSERVER:\SQLPolicy\$CentralManagementServer\Policies | ? {$_.Name -ilike "*Full*"}

FOREACH ($Policy in $PolicyList)
{
    Invoke-PolicyEvaluation -Policy $Policy -TargetObjects $ServerList -AdHocPolicyEvaluationMode $EvalMode -OutputXML > C:\OUTPUT.XML
}

Thank you all for you help in advance.  

Sincerely,

Nathan

Transactions per hour and other useful metrics?

$
0
0

Hi,  

The boss has asked me to find out:

  • Number of Databases and their sizes
  • Number of SQL Transactions per hour
  • Anything else we need to purport 

How should I go about getting the number of transactions on the server?

What other metrics are useful from a business/IT Manager perspective? How can I access/colate them?

Which forum should this question be in?

Cheers

Lucas


LucasF

SQL Server Database backup

$
0
0

Hi Team ,

I have SQL Cluster 2012 server running with Couple of Critical data base instance . Each instance installed in different drive.

One of my application database is having mdf of size 1 Gb and ldf is 250 GB . Database is set to full recovery model.

Now I want to change recovery model to simple and want to shrink the los also. before than I want to take database backup.

I have 50 GB space left in drive .

i want to take full database backup on same drive .please let me know how much space i need on that drive to take full backup.

thanks


Ravi

BLOB Backups

$
0
0

We are looking at implementing Remote Blob Storage for our Sharepoint server to allow us to do more regular backups for financial documents attached to our Dynamics AX implementation. We want a 1 hour RPO so we are looking to do hourly backups of the content.

We are using the FileStream provider from SQL 2012 Feature pack.

What's the best way to do this to minimize the backup size?



SQL Conectivity error (1418) on SQL Mirroring in SQL Server_2014 Enterprises

$
0
0

I perform this subjected task/activity in DOMAIN environment with Multiple VPN.

No matter what I try, I constantly run into a 1418 error, I've check all my tcp/ip configs both in sql, and the server 2012 os, on both vms/physical machine.  I’ve enabled tcp/ip filtering and allowed all connections, rulessets in firewall, I’ve used telnet to connect up.  Nothing seems to work.  Each server can ping the other, they can telnet into 5022, & 5023 as well. I don’t know where to proceed from here.  Is there some config somewhere or issues with vms that I am not seeing?  All the machines in the mirroring array are server 2012 with same SQL 2014 Ent edition. Now please guide as what can we do to go at next Step....!

Regards,

Zeeshan

How to reduce Database LOG file size ?

$
0
0

Hi,

I have database file with 50 GB and its log file is 150 GB.

First, I need to how the log file is triple the size of the database itself ? 

Second, I need to know How to reduce the size of the Log file ? losing log data is not an issue for me, unless it will affect the performance.

Thanks,

Check 'Enable Mail Profile' on SQL Agent

$
0
0

Hi All,

Is there a programmatic way to check if 'Enable Mail Profile' is enabled for SQL Server Agent for an instance? Rather than going to right-click 'Properties' --> SQL Server Agent, etc on my 100s of SQL instances, I was hoping it was something I could check using a Central Management Server via a T-SQL query...or even better by using a policy and PBM in conjunction with my CMS.

I have seen one article that recommends to use xp_regread to read registry values to get the value but I would prefer not to query the registry directly for these type of administrative checks..

Thanks in advance,

changing from full recovery model to simple in sql 2012 always on

$
0
0

how do I change from a full recovery model to simple in an always on sql 2012 setup? When I try to change it it gave this error



log file contents

$
0
0
I want to ask that when a person enters internet, a log file is created...
the question is that what is the information which is stored in a log file, alternatively what are log file contents?

Backup SQL Database

$
0
0

Hi SQL Server Expert,

Our company is using the SQL Server 2012 for the Navision Database. I am new to the ERP and CRM. thus, it would be very appreciate if you could guide me on how to perform the backup and restore on the SQL database.

Thanks so much.

Regards,

Henry

Drop Trigger back

$
0
0

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

I manage
SQL SERVER 2000, it has a Trigger that I DROP it,  (DROP TRIGGER xxxx)<o:p></o:p>

After few hours it back,  <o:p></o:p>

From where? and how can I drop it permanently ?<o:p></o:p>

<o:p> </o:p>

Thank you
hery much,<o:p></o:p>

Yakov<o:p></o:p>



Rebalancing Data Across Files

$
0
0

I have a situation where a DB has a single file, but for performance reasons we want to evenly distribute the data among four files. I ran across this SQL magazine article which states:

If you’d like to rebalance over a certain number of files, the easiest method is to create a new filegroup with the desired number of files, then rebuild indexes using CREATE INDEX … WITH (DROP_EXISTING=ON) plus specifying the new filegroup, and then drop the old filegroup. That unfortunately means you need to provision even more space (easier said than done) but it will do the trick. Note that this method won’t work if you have any LOB data, as that cannot be moved without creating a new table and exporting the data into it.

I'm not a T-SQL expert, so what I need are the complete list of T-SQL commands that will do the trick.

Thanks!

Article: http://sqlmag.com/blog/rebalancing-data-across-files-filegroup


Blog: www.derekseaman.com, VMware vExpert 2012/2013


Powershell fails when scheduled as a job

$
0
0

This works through powershell. 
I have other jobs that use powershell script that also connect to the same servers using the same powershell proxy account that work fine.

Error:

Executed as user: domain\proxy_account. A job step received an error at line 23 in a PowerShell script. The corresponding line is '        foreach ($job in $srv.Jobserver.Jobs)  '. Correct the script and reschedule the job. The error information returned by PowerShell is: 'The following exception occurred while trying to enumerate the collection: "An exception occurred while executing a Transact-SQL statement or batch.".  '. Process Exit Code -1.  The step failed.

Script excerpt:
[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SqlServer.SMO") | out-null;
$params = @{'server'='sql_server_name';
       'Database'='database_name'}
$sqlservers = invoke-sqlcmd @params -Query "SELECT InstanceName from SQLInstances_TEST"
foreach($sqlserver in $sqlservers)
{
        foreach ($job in $srv.Jobserver.Jobs)
        {
...

Thank you, any clues much appreciated.


Paula

SSMS 2012 crashes when opening new query on instance with Failover Clustering installed (not 2012 R2)

$
0
0

Hi,

I'm trying to start a new query in SSMS, but every time I click the "New Query" button on the tool bar or open a new query window by Object Explorer -> right-click -> Script as -> New Query Editor Window, SSMS hangs with (Not Responding) and has to be restarted.

I'm running SSMS 2012 (v11.0.3381.0) on Server 2012 6.2.9200. I'm connecting to the primary node of an AlwaysOn Availability Group, and SSMS is located on the primary node itself.

I'm aware of KB2908806, which describes the same symptoms, but this only applies to Windows 6.3.x. Is there an equivalent fix for 6.2.x, or another workaround?

EDIT: To confirm behaviour: "New Query" works intermittantly, Script as ... to -> New Query Editor Window always crashes.

Backup SQL databese using DPM error VSS SQL server Writer

$
0
0

Hello,

DPM 2012 R2 update rollup 4 stop backup SCCM 2012 R2 site database after November updates. Before November updates DPM backup SCCM site database normály without problem.

I found error in application log on SCCM server:

EventID 12366 VSS

An unhandled exception was encountered while processing a VSS writer event callback method. The VSS writer infrastructure is in an unstable state. Restart the service or application that hosts the writer.
 
 Writer name:            SqlServerWriter
 Writer id:              {a65faa63-5ea8-4ebc-9dbd-a0c4db26912a}
 Writer instance:        {f07262ae-d9d2-41e5-94ac-9e7bc54f653f}
 Process command line:   "C:\Program Files\Microsoft SQL Server\90\Shared\sqlwriter.exe"
 Process ID:             1096
 Writer operation:       1014
 Writer state:           1
 Exception code:         0xe06d7363
 Exception location:     02

Volume Shadow Copy Service error: Writer SqlServerWriter did not respond to a GatherWriterStatus call.

Operation:

   Gather writers' status

   Executing Asynchronous Operation

Context:

   Current State: GatherWriterStatus

SqlServerWriter missing in vssadmin list writers.

Restart SQL Server VSS Writer service not help.

What was happend? Does anybody help me?

Thanks,

Regards,

Jakub

Powershell sql agent

$
0
0

Are there assemblies that need to be loaded when scheduling a sql agent job that runs a powershell step?! I don't get it how both sqlps and the os use the same version and when scheduled as a job it fails.

I test the powershell script using powershell_ise works great then schedule on sql 2014 sql agent to run the powershell and it fails.

ERROR

The corresponding line is '$DatabaseBackup.SqlBackup($ServerSMO)  '. Correct the script and reschedule the job. The error information returned by PowerShell is: 'Exception calling "SqlBackup" with "1" argument(s): "Backup failed for Server 'serverA'. "  '.  Process Exit Code -1.  The step failed.

CODE (NOT MINE)
$ServerName = "server"
$BackupDirectory = "\\path\"
$BackupDate = get-date -format yyyyMMdd_HHmmss

[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SqlServer.SMO") | out-null
$ServerSMO = new-object ("Microsoft.SqlServer.Management.Smo.Server") $ServerName
$DatabaseList = $ServerSMO.Databases


foreach ($Database in $DatabaseList)
{
if($Database.Name -ne "tempdb")
{
$DatabaseName = $Database.Name

$DatabaseBackup = new-object ("Microsoft.SqlServer.Management.Smo.Backup")
$DatabaseBackup.Action = "Database"
$DatabaseBackup.Database = $DatabaseName
$DatabaseBackup.Devices.AddDevice($BackupDirectory + "\" + $DatabaseName + "_FULL_" + $BackupDate + ".BAK", "File")
$DatabaseBackup.SqlBackup($ServerSMO)
}
}

 


Paula


Viewing all 1563 articles
Browse latest View live


Latest Images

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