System for automating admin creation for any database - sql-server

For example I have a database, and want to have good automaticly generated admin for it. Is there software for this?

Not sure what your question is. What kind of admin tasks are you trying to automate?
The SQL Server Agent service can handle a lot of the scheduled aspect, as well as alerts for certain conditions. Policy Based Management can log and restrict certain database params across a single instance or multiple ones.
What more are you looking for? SSMS is the gui that sits on top of SQL Server for an easy implementation.

Related

Mirroring Azure SQL Database to an on-premise SQL Server

I have a database deployed on Azure SQL. Due to various requirements, my company would like to make a continuous mirror of this database to an on-premise SQL Server database. We have explored several ways to implement this, so far to no avail.
The way recommended online, using the Azure Sync tool, didn't work for us -- and seeing as this tool is currently in CTP, it is not currently supported by Microsoft, so we want to implement this ourselves.
The requirements for this mirroring solution aren't extremely high - we only want to make backups every half an hour or so, so continuous synchronization isn't an issue. What would be the best way to approach this without resorting to commercial solutions that seem to be an overkill for us?
Hummm... it depends what you call an overkill. One way to do this is to wrap up your own BCP commands out of SQL Azure, and BCP into a database on premises. But depending on your database complexity, this may very quickly get out of hands, unless you can identify the top 2 or 3 tables that you really want to export/import to minimize your work. In fact you might event want to consider using SSIS; you will need to manage your own retry logic regardless of the approach you take.
We ended up choosing a complete backup-restore from the Azure account to the on-premise VM, since implementing custom retry & incremental query generation sounded way too complicated for this case.
Azure SQL Database support Import Export Database Service including Automated Exports to Azure Storage account.
Using Automated Exports you can define the export interval per day and bacpac files will be created in your Azure storage account which can be imported into your on-premise server.
You can find more detail about Configuring Automated Exports

Disable Access To SQL Server Database Via SQL Server Management Studio

Apologies in advance for the long post, I am trying to be as clear as possible. Is there a way to disable a user / Windows AD group accessing a database via SQL Server Management Studio (SSMS)?
I have an desktop application that uses a SQL Server 2005 database. The application runs as the user logged onto the machine (unfortunately we can't change that otherwise this would be simple). The database is permissioned with groups (but it would apply to users as well) to give access to the appropriate schemas and objects that the user requires. The users have (and need) the ability to select, insert, update and delete data to complete their process.
The application carries out a series of validation and auditing steps on the user input to ensure they are entering decent data (and for some additional business processing). A user could open SSMS and make these changes through the query editor avoiding the application completely which is what we are trying to avoid. What I am looking for is a way to stop the users updating the database through any tool other than the application provided.
I have found a couple of similar posts (including How to disable SQL Server Management Studio for a user) but these don't quite cover this issue as they work on restricting user access or using different logins.
The only solution I can think of at the moment is to have a set of tables where the user data goes initially and then another process picks this up, runs the application processes on and then puts the data into the master / source tables. Then I could restrict user access to the master tables.
This appears to be a good scenario for an application role.

Best way of logging in SSIS

There are 5 different types of logging in SSIS
Event Log
Text File
XML File
SQL Server
SQL Server Profiler
I am in a production environment where developers do not have access to production systems.
Which logging method should be my poison of choice, and why?
If you're not going to have access to the production server, then SQL Server logging is your best bet by far. You'll have plenty of ways of viewing the logged information, for example via custom SSRS reports or web pages, or direct access to the tables if your DBA allows it. Also, the logs will be easier to search and filter when in a table.
Personally I prefer logging to SQL Server.
I think this is because it puts the data in a form which I can immediately access and process. For example, I can then slice and dice the data, export it to another server, setup agent jobs to monitor the logs and email alerts etc.
Have you looked at BI xPress from Pragmaticworks. They have serious auditing feature for SSIS
SSIS Logging And Auditing, Notification, Deployment using BI xPress

Updating database on website from another data store

I have a client who owns a business with a handful of employees. He has a product website that has several hundred static product pages that are updated periodically via FTP.
We want to change this to a data-driven website, but the database (which will be hosted at an ISP) will have to be updated from data on my client's servers.
How best to do this on a shoestring? Can the database be hot-swapped via FTP, or do we need to build a web service we can push changes to?
Ask the ISP about the options. Some ISPs allow you to ftp upload the .mdf (database file).
Some will allow you to connect with SQL management studio.
some will allow both.
you gotta ask the ISP.
Last time I did this we created XML documents that were ftp'd to the website. We had an admin page that would clear out the old data by running some stored procs to truncate tables then import the xml docs to the sql tables.
Since we didn't have the whole server to ourselves, there was no access to SQL Server DTS to schedule this stuff.
There is a Database Publishing Wizard from MS which will take all your data and create a SQL file that can then be run on the ISP. It will also, though I've never tried it, go directly to an ISP database. There is an option button on one of the wizard screens that does it.
it does require the user to have a little training and it's still a manual process so mabe not what you're after but i think it will do the job.
Long-term, building a service to upload the data is probably the cleanest solution as the app can now control it's import procedures. You could go grossly simple with this and just have the local copy dump some sort of XML that the app could read, making it not much harder than uploading the file while still in the automatable category. Having this import procedure would also help with development as you now have an automated and repeatable way to sync data.
This is what I usually do:
You could use a tool like Red-Gate's SQL Data Compere to do this. The tool compares data between two catalogs (on same or different servers) and generates a script for syncing them.

Generic Database Monitoring Tool

It seems like something like this should exist, but I have never heard of it and would find such a utility to be incredibly useful. Many times, I develop applications that have a database backed - SQL Server or Oracle. During development, end users of the app are encouraged to test the site - I can verify this by looking for entries in the database...if there are entries, they have been testing...if not, they haven't.
What I would like is a tool/utility that would do this checking for me. I would specify the Database and connection parameters and the tool would pool the database periodically (based on values that I specify) and alert me if there was any new activity in the database (perhaps it would pop up a notification in the system tray). I could also specify multiple database scenarios to monitor in the tool. If such an app existed, I wouldn't have to manually run queries against databases for new activity. I'm aware of SQL Profiler, but when I reviewed it, it seemed like overkill for what I wanted to do (and it also wouldn't do the Oracle DB monitoring). Also, to use SQL Profiler, you have to be an admin of the database. I would need to monitor databases where I only have a read-only account.
Does someone know if such a tool exists?
Sounds like something really easy to write yourself. Just query the database schema, then do a select count(*) or select max(lastUpdateTime) query on each table and save the result. If something is different send yourself an email. JDBC in Java gives you access to the schema information in a cross-database manner. Don't know about ADO.

Resources