Skip to main content

Questions tagged [automation]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
1 answer
51 views

how can I add the date and time on the autogrowth query below?

while trying to prevent autogrowth from happening, I got this nice script here. however, if it does happen, I need to know how to find it out. that I can do using this very nice script by Max Vernon. ...
Marcello Miorelli's user avatar
1 vote
2 answers
104 views

error when re-applying the permissions script into the original database - sql server

when I run the following script: -- ——— SCRIPT GRANTS for Object Privileges————— IF OBJECT_ID('[sys].[sysrowsets]') IS NOT NULL GRANT CONTROL on [sys].[sysrowsets] to [db_myrole_BA] I get this ...
Marcello Miorelli's user avatar
2 votes
1 answer
69 views

how to set in-transit encryption sql server?

today I had to check if in-transit Encryption was up and running in a particular server (sql server) and if not then set it up. the way it is done is: In SQL Server Configuration Manager, expand SQL ...
Marcello Miorelli's user avatar
0 votes
1 answer
35 views

Postgres: automatic action (increment count of foreign key) after update

How to automate an update in a table, after a change in another table ? Say (please see below) I have a table countries, and a table cities. How to make that, when adding a city in table cities, the ...
ymudyruc's user avatar
0 votes
1 answer
29 views

How to auto-shutdown postgresql with timeout?

I have here a simple PostgreSQL instance, generated by a build script. The goal is to make it automatically safe shutdown, if it has no new connection request for a while (like 5 min or so). What is ...
peterh's user avatar
  • 2,109
0 votes
0 answers
43 views

Can my database LDF and MDF files go into this directory?

Is there a way to determine, given a drive and a directory, if a CREATE DATABASE command would succeed? There are basically two questions here. 1. How do you determine if a simple command like this ...
Null Pointers etc.'s user avatar
2 votes
0 answers
23 views

Is there an algorithmic way to identify potential primary key foreign key relationships in postgres

I have a lots of tables in postgres with a lots of columns per each table. I need to write a program in such a way that it can identify the columns that can be a potential primary and foreign key pair....
Ashwin Prasad's user avatar
0 votes
0 answers
62 views

Using dbatools powershell module with azure automation hybird worker groups

We want to use dbatools powershell module with azure automation . We already have dbatools module on hybird worker group machines . We tested the code we want to run by directly logging into the ...
yegnasew's user avatar
  • 487
0 votes
1 answer
479 views

Error with dbatools

Trying to export SQL Objects via DBAtools in Powershell. Get-DbaAgentJob -SqlInstance 'TestServer01' -Job 'mydatabase-daily-backup' | Export-DbaScript -FilePath C:\temp\mydatabase-daily-backup.sql ...
Prakash's user avatar
0 votes
0 answers
29 views

Managing database Users when restoring backups across environments

I have numerous Azure SQL Server Databases that teammates backup and restore. The issue we're running into is regarding the Users on these databases. We have Azure AD Groups that contain the ...
mt programmer's user avatar
1 vote
1 answer
62 views

How to list the permissions needed for a role / user to run a query / view successfully (in an automated manner)?

Suppose I have queries / views like this: select internal.companies._cid, internal.companies.name, src1.employees.year, src1.employees.count from internal.companies join src1....
m01010011's user avatar
  • 111
0 votes
1 answer
151 views

Create a schema for each user in a group

I'm trying to find a way to create a schema within a database, for each user in a group... The goal is to automatize the creation process for a structure in a school. Say, each class is a database, ...
Sagan Goodenough's user avatar
0 votes
1 answer
254 views

How to daily download and merge a csv file and update on Google sheets?

Disclaimer: I’m not sure if this question goes on here. I’ve trying to solve this issue for quite a while and I don’t think there is another way other than using a python script. I need to solve this ...
Heleno Paiva's user avatar
0 votes
1 answer
150 views

Setting up reporting and alerting in SQL Server through TSQL and Powershell

I am trying to automate monitoring on SQL Server through PowerShell and TSQL, to get alerts through mail whenever some issue is there. I have gone through many articles over the internet and tried the ...
Kartikey Tripathi's user avatar
1 vote
0 answers
102 views

Can you synchronize user accounts with specific DB permissions with records found in a table?

Background / Current Setup I have a database in a SQL server that uses row level security to determine what records a user has access to. Users will have two methods to interact with the database. ...
Mandelbrotter's user avatar
0 votes
0 answers
129 views

What is the intended method for automatically/streamlinedly updating minor/patch PostgreSQL versions on Windows?

I currently run PostgreSQL 12.4 on Windows 10. Since the "BigSQL" distribution is no longer around, the only choice is to use the EnterpriseDB installer for the initial installation: https://...
user16508174's user avatar
1 vote
1 answer
2k views

MySQL dump to MariaDB issue with collation

I have a django app running on a staging server (windows server 2012) with a MariaDB database. I have a git hook running mysqldump locally when I push to the staging branch. On the server I have a ...
Samoht's user avatar
  • 13
0 votes
1 answer
666 views

what databases are already set up in the log-shipping, and which ones are not?

I am setting up log-shipping from server1 to server2. there are many databases on server1 and I want to automate the process. I have already done a few databases manually, while I am working on the ...
Marcello Miorelli's user avatar
0 votes
1 answer
47 views

Looking for a tool for managing complex powershell automation processes with multiple scripts [closed]

Sysadmin here, I'm wondering what tools you all use to manage large scale automation tasks with powershell. I currently have several powershell scripts that are regularly used, but do not interact or ...
Austin's user avatar
  • 93
0 votes
1 answer
49 views

Does mongo *really* need a dedicated volume, if I need to back it up?

TLDR; What's the easiest way to automate a mongodb backup of a 20-gig DB? We run mongo on the same KVM (VPS) as the web app; the server runs Debian. We/I don't need/want to backup the entire fs on a ...
harry young's user avatar
0 votes
2 answers
4k views

How do I find out whenever a value changes in a certain column?

Need help if anyone can offer! I currently have my select statement returning the TOP 1000 * results from a table. They are CC numbers that are currently active. I'd like to see how I can go about ...
Chase Sarhan's user avatar
1 vote
2 answers
569 views

How to script server level objects in sql server?

I regularly do sql server installations (mainly sql server 2016), in virtual machines or otherwise, and I have a bunch of things like permissions, and linked servers and endpoints that I have mostly ...
Marcello Miorelli's user avatar
1 vote
1 answer
110 views

Is it possible to run a stored procedure automatically on a new database when it is attached?

Replication is causing issues on our daily snapshots. What we would like to do is remove replication automatically on a database when it is attached to the SQL server. Is this possible?
Fire Starter's user avatar
0 votes
0 answers
186 views

Auto running SQL script with Azure database server

I am trying to automate a report that is generated from the database on Azure database server. I am using below script in the batch file but I get the error. Script: osql -U firstname.lastname@company....
rk02's user avatar
  • 11
0 votes
1 answer
424 views

Auto running SQL script

I am using the below command in my batch file and running it via task scheduler. osql -S myserver\sqlexpress -E -i "c:\test.sql" -o "c:\output.txt" I get the error stating that: ...
rk02's user avatar
  • 11
1 vote
0 answers
260 views

Oracle Scheduler Job - Exporting of CSV File every 16:01

I have already executed the code for scheduler. However, I have a problem whenever I execute my scheduler. Can someone help me with this? I'll appreciate all your response. My procedure code: create ...
stummyhurts's user avatar
1 vote
3 answers
8k views

Postgresql Backup all databases separate files

I need to create an automatic backup of all databases from PostgreSQL (running on a Windows machine). I need to know if it is possible to get a backup of all databases but in separate files. Using ...
Anisa Ibro's user avatar
1 vote
1 answer
676 views

SQL Server Configuration File and InstanceName parameter

We have a configuration file at E:\SQL_Server_2016_Install\MyConfigFile.ini that looks like below: [OPTIONS] ACTION = "Install" FEATURES = SQLENGINE INSTANCENAME = MSSQLSERVER AGTSVCACCOUNT =...
Aleksey Vitsko's user avatar
0 votes
1 answer
158 views

is there a DDL generator out there where you can start with CSV/TSV to create DDL for Cassandra

Is there a DDL generator out there where you can start with CSV/TSV (or maybe even JSON) to create DDL for Cassandra?
Gary Sharpe's user avatar
0 votes
1 answer
208 views

Is there a way to optimize the process of uninstalling and installing SSMS?

in terms of patching sql server 2016 to the latest cumulative patches, I found out that stopping the services helps avoiding lots of inconveniences, specially if there is log shipping and replication ...
Marcello Miorelli's user avatar
1 vote
1 answer
2k views

Unable to replicate schema changes in transactional replication

I have implemented a transactional replication on one of my dbs. In the documents provided by Microsoftsql (here and here), I should be able to change the schema and that these changes will be ...
tsu90280's user avatar
  • 175
1 vote
2 answers
1k views

How can I script administrator permissions on a SSAS server?

I am an administrator for a bunch of SSAS Instances. Sometimes I need to install or migrate SSAS instances to different machines or even different AD domains (we have a couple of different AD domains ...
Marcello Miorelli's user avatar
9 votes
3 answers
23k views

How can I install the SQL Server PowerShell module on an offline machine?

I have some SQL Server machines that cannot connect to any external sites. I have been using PowerShell more and more when managing databases, so I definitely need this module to be installed so ...
Marcello Miorelli's user avatar
2 votes
1 answer
785 views

Trying to use SSRS rsconfig.exe in silent mode to create the ReportServer and ReportServerTemp databases on a local instance

I have installed a brand new SQL 2017 Enterprise instance on a Windows 2019 Datacentre VM. I have then installed SQL Server Reporting Services via the command line (/quiet, /norestart, etc) and all ...
zapcon's user avatar
  • 73
5 votes
2 answers
25k views

how to list all features installed in a sql server instance?

There are other Installation related questions with similar details here and here. I could not find anything related to listing the installed features in sql server 2016 though. I can do it manually ...
Marcello Miorelli's user avatar
0 votes
1 answer
91 views

Automating database restoration of SQL Server transaction log files on standby mode

I am wondering if I get help from this house on the following issue. I have a standby database that should be restored with the set of transaction log files I get from the vendor's(eClincalWorks) ...
Lilly's user avatar
  • 41
1 vote
1 answer
377 views

Mongodb automatic Replica Set creation with JS driver

The MongoDB docs state that one can use the mongo client console to initialize replica sets by running rs.initiate([config]). However, I don't want to have to manually use the command line for this. ...
douira's user avatar
  • 113
0 votes
1 answer
1k views

Automating SQL scripts in Toad for Oracle (13.1)

I'm not a DBA, so bear with me. I've scheduled tasks through Toad's automation designer, but this uses Windows task scheduler. It's using Oracle 12c. All I'm doing is updating (creating/dropping) ...
hootsauce's user avatar
1 vote
2 answers
1k views

how to find out how long the last DBCC checkdb took to complete?

In most of my servers I have dbcc checkdb scheduled to run. I can get the last known good DBCC Checkdb through DBCC DBINFO(). I can read the tracks left on the sql server log and I get something ...
Marcello Miorelli's user avatar
0 votes
2 answers
186 views

Help error message inside dynamic T-SQL

I have a requirement to come up with reporting for indexes for our whole production environment: I found the below script online and modified it according to my requirement and trying to execute it ...
Ali's user avatar
  • 305
2 votes
2 answers
3k views

StorageEngineUsed set to TabularMetadata. For databases in this mode, you must use Tabular APIs to administer the database

I am an administrator in SSAS. I have many data warehouse servers. In some servers I have SQL Server and SSAS on the same machine. I successfully backup the SSAS databases and even check if the ...
Marcello Miorelli's user avatar
0 votes
1 answer
237 views

MariaDB Master / Slave failover / failback automation

Good day all, I'm hoping someone might be able to point me in the right direction. I'm working on a new dual data center project, and I'm trying to come up with a plan for failover (for patching and ...
Jimmy's user avatar
  • 1
0 votes
0 answers
15 views

Possible to automate updating development database on a VM?

Using MySQL 5.6 and VM Workstation Pro 12.1.1. At my job, the way things are set up is that my development environment is a locally hosted Virtual Machine. Every day the first thing I need to do is ...
bjk116's user avatar
  • 225
0 votes
1 answer
77 views

Application/MS SQL Server Express Installer

We're developing a small(ish) application that collects and stores data. It's low-throughput, low-volume, but needs to be able to archive and retrieve data from (almost) arbitrarily earlier times, ...
doppelfish's user avatar
4 votes
2 answers
5k views

how to script out the user defined table types?

I can Get name and definition of all table types using either of the following scripts: SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED IF OBJECT_ID('TEMPDB..#RADHE') IS NOT NULL DROP TABLE #...
Marcello Miorelli's user avatar
2 votes
1 answer
101 views

How to use grouping sets in this query that shows database sizes - adding the last time it was updated

I have the following query that shows me the database sizes, including log dna data files. SELECT [Database Name] = DB_NAME(s.database_id), [Type] = CASE WHEN s.Type_Desc = 'ROWS' THEN 'Data ...
Marcello Miorelli's user avatar
0 votes
1 answer
367 views

how to script server side permissions - specifically EXECUTE ON SYS.XP_PROP_OLEDB_PROVIDER?

I could not script the following server side permissions: GRANT VIEW DEFINITION ON LOGIN::[site_helpdesk] TO [Radhe] but thanks to the question below I found a solution to that: How to script out ...
Marcello Miorelli's user avatar
2 votes
1 answer
2k views

How to automate the changes of parameters in ssis package run by a job?

I have a job that runs a package with specific parameters as you can see on the picture below: I want to set up those parameters (the 2 dates in yellow) to 1900-01-01 instead of 2019-02-27. I need ...
Marcello Miorelli's user avatar
1 vote
1 answer
890 views

How to automate basic ddl scripts execution and management [closed]

Looking for suggestions (A Script, third party tool, software etc.) which can help automate some of the administration tasks around execution of DDL scripts across environments. Database is usually ...
Nik's user avatar
  • 123
0 votes
2 answers
175 views

Delete old records based on its identifier

For example, I have a table similar to this: deviceid | servertime 1 2019-05-13 12:00:00 1 2019-05-14 12:00:00 2 2019-05-13 13:00:00 2 2019-05-12 13:00:00 2 ...
xtl's user avatar
  • 5