Sample Header Ad - 728x90

Database Administrators

Q&A for database professionals who wish to improve their database skills

Latest Questions

1 votes
0 answers
159 views
dbatools, DbcCheck Does not use Saved credential
Last week I deployed **dbccheck** on the production environment. I found strange thing and have no idea what the problem is. We have 40 db vm's which are not domain joined. Each of db vm's have same windows login credential and DB with sql server authentication having sysadmin privilege and are conf...
Last week I deployed **dbccheck** on the production environment. I found strange thing and have no idea what the problem is. We have 40 db vm's which are not domain joined. Each of db vm's have same windows login credential and DB with sql server authentication having sysadmin privilege and are configured as below. Set-DbcConfig -Name policy.storage.backuppath -Value \\backup\userfull Set-DbcConfig -Name app.sqlinstance -Value 10.1.1.1 Set-DbcConfig -Name app.computername -Value DB-22 Set-DbcConfig -Name app.sqlcredential (Get-Credential Username) `Set-DbcConfig -Name policy.ola.userfullretention -value 47 ` Whenever I run the below command with manually passed credentials, it works fine but if I remove the (-SqlCredential (Get-Credential username)) and run. it fails. `Invoke-DbcCheck backuppathaccess, UserFull,FailedJob, olainstalled, Storage -SqlCredential (Get-Credential username) -Show Summary -PassThru | Update-DbcPowerBiDataSource -Environment Production Start-DbcPowerBi` Running Invoke-DbcCheck   backuppathaccess, UserFull,FailedJob, olainstalled, Storage I need to run without providing credential manually. It looks like the dbachecks module is up to date: Dbachecks Version
kedar (23 rep)
Feb 3, 2023, 04:09 PM • Last activity: Feb 3, 2023, 07:55 PM
-1 votes
1 answers
91 views
How to send dbachecks output to a file on disk?
How do you send the dbachecks output to a file on disk? I tried the following but it resulted with the output on screen and a 0 kb file on disk. ```ps Invoke-DbcCheck -Check Database -SqlInstance myserver -ExcludeCheck TestLastBackup, TestLastBackupVerifyOnly | Out-File c:\myserver.txt ```
How do you send the dbachecks output to a file on disk? I tried the following but it resulted with the output on screen and a 0 kb file on disk.
Invoke-DbcCheck -Check Database -SqlInstance myserver -ExcludeCheck TestLastBackup, TestLastBackupVerifyOnly | Out-File c:\myserver.txt
user2368632 (1133 rep)
Sep 10, 2022, 02:55 AM • Last activity: Sep 11, 2022, 10:27 AM
2 votes
1 answers
2129 views
DBCC CHECKDB getting terminated abnormally
We have a SQL Server 2014 set up on Always on AG with one primary node and 2 secondary nodes. On the primary node, DBCC CHECKDB for one of the databases is scheduled on SQL agent job. This job was running fine till last month and now its getting failed and the job logs read "DBCC CHECKDB terminated...
We have a SQL Server 2014 set up on Always on AG with one primary node and 2 secondary nodes. On the primary node, DBCC CHECKDB for one of the databases is scheduled on SQL agent job. This job was running fine till last month and now its getting failed and the job logs read "DBCC CHECKDB terminated abnormally due to error state 6." when running the DBCC CHECKDB command manually, getting the same result. During the job/Command runtime , there is a spike in I/O , Memory and CPU utilization is full. Storage team had also checked and reported that there are no storage related errors On the Secondary nodes, the job runs fine without any issues. I did try to restore the DB on a test instance and the DBCC CHECKDB runs fine. Could anyone help me to find the cause of this.
GopiMth (31 rep)
May 26, 2022, 02:40 AM • Last activity: May 26, 2022, 08:07 AM
0 votes
3 answers
1502 views
How to perform bulk delete and release free space?
Good Afternoon, We have a database that wasn't been an archive anytime. The database has grown tremendously and we are running short of space. Hence there is a need to do a bulk delete and free space. Based on my research, in order to free up space, I have 2 options: shrink DB or shrink files. The s...
Good Afternoon, We have a database that wasn't been an archive anytime. The database has grown tremendously and we are running short of space. Hence there is a need to do a bulk delete and free space. Based on my research, in order to free up space, I have 2 options: shrink DB or shrink files. The shrink DB is a bad option because it ruins the fragmentation. Can anyone guide me on how to perform a bulk delete and free space? Also, we are planning to implement this process on a monthly schedule job. Based on the discussion, I want to clarify 3 things: 1. Bulk Delete Without Locking The Table 2. Reclaim Free Space 3. Schedule Monthly Job Looking forward to expert opinion.
rushabh138 (13 rep)
Mar 8, 2021, 08:31 PM • Last activity: Mar 9, 2021, 04:26 PM
1 votes
0 answers
288 views
Unable to execute dbachecks command
i installed dbachecks module in a server. but when i am trying to execute get-dbccheck, it is throwing the below error Populating RepositorySourceLocation property for module Pester. VERBOSE: Loading module from path 'C:\Program Files\WindowsPowerShell\Modules\Pester\5.0.4\Pester.psm1'. [18:59:41][d...
i installed dbachecks module in a server. but when i am trying to execute get-dbccheck, it is throwing the below error Populating RepositorySourceLocation property for module Pester. VERBOSE: Loading module from path 'C:\Program Files\WindowsPowerShell\Modules\Pester\5.0.4\Pester.psm1'. [18:59:41][dbachecks.psm1] Failed to import suitable version - Do you have Version 4* installed ? Get-DbcCheck : The 'Get-DbcCheck' command was found in the module 'dbachecks', but the module could not be loaded. For more information, run 'Import-Module dbachecks'. At line:1 char:1 + Get-DbcCheck + ~~~~~~~~~~~~ + CategoryInfo : ObjectNotFound: (Get-DbcCheck:String) [], CommandNotFoundException + FullyQualifiedErrorId : CouldNotAutoloadMatchingModule I have updated the pester and psframework modules to the latest, still i am unable to execute the commands. Can someone help me in this.?
Saravana Kumar (13 rep)
Oct 4, 2020, 12:15 AM
0 votes
1 answers
4413 views
Encrypt connection when using sqlcmd
Trying to connect database with an encrypted connection, tried below sql queries: ``` sqlcmd -N -E -S tcp:SQLSERVER,1234 -U username -P password -d Database -Q "INSERT INTO table1 VALUES(1,2,2)``` > ERROR: Sqlcmd: The -E and the -U/-P options are mutually exclusive. ```sqlcmd -N -S tcp:SQLSERVER,123...
Trying to connect database with an encrypted connection, tried below sql queries:
sqlcmd -N -E -S tcp:SQLSERVER,1234  -U username -P password -d Database -Q "INSERT INTO table1 VALUES(1,2,2)
> ERROR: Sqlcmd: The -E and the -U/-P options are mutually exclusive.
-N -S tcp:SQLSERVER,1234  -U username -P password -d Database -Q "INSERT INTO table1 VALUES(1,2,2)
> ERROR Sqlcmd: Error: Microsoft ODBC Driver 13 for SQL Server : SSL Provider: The target principal name is incorrect. Sqlcmd: Error: > Microsoft ODBC Driver 13 for SQL Server : Client unable to establish > connection
-S tcp:SQLSERVER,1234  -U username -P password -d Database -Q -E -N "INSERT INTO table1 VALUES(1,2,2)
> Sqlcmd: '-Q': Missing argument. Enter '-?' for help. Am I missing something here?
chris (103 rep)
Feb 28, 2020, 11:12 PM • Last activity: Mar 2, 2020, 01:41 AM
1 votes
1 answers
293 views
How to monitor Mongo databases and Cloud servers?
We have mongo databases installed in AWS and Azure based servers. We need to monitor the Mongo databases and Cloud servers on daily basis. Is there any way to healthcheck the databases and servers ? Thanks,
We have mongo databases installed in AWS and Azure based servers. We need to monitor the Mongo databases and Cloud servers on daily basis. Is there any way to healthcheck the databases and servers ? Thanks,
Mr Surya (11 rep)
Mar 18, 2019, 09:49 AM • Last activity: Oct 9, 2019, 06:02 PM
1 votes
2 answers
325 views
dbatools, DbcCheck LastBackup
Last week I started testing `dbccheck` on my test system. I found one strange thing, and I have no idea what is the problem, last fullbackup is few hours old, but dbccheck print an error. Following you can see my steps: **installation dba checks** * based on the blog from chrissy lemaire (thank you...
Last week I started testing dbccheck on my test system. I found one strange thing, and I have no idea what is the problem, last fullbackup is few hours old, but dbccheck print an error. Following you can see my steps: **installation dba checks** * based on the blog from chrissy lemaire (thank you chrissy,for that great job) **change configuration** Set-DbcConfig -Name policy.backup.fullmaxdays 3 Set-DbcConfig -Name policy.backup.logmaxminutes 720 **first check** $server = "ALET21" Invoke-DbcCheck -SqlInstance $server -Check LastBackup here the result: result DbcCheck The dbccheck print an error I did the same test with PS Command, following you can see the results: result PS command any idea what is the problem? AdminDB DB is not new, creation date was on 23.11.2016. I also updated the policy.backup.newdbgraceperiod to 1, but I have the same problem, as you can see below: same problem It looks like the dbacheck module is up to date: Version
KW_1970 (11 rep)
Mar 26, 2018, 12:56 PM • Last activity: Mar 27, 2018, 06:47 AM
Showing page 1 of 8 total questions