Hot answers tagged

4

The only way to find out what process caused the autogrowth is to use Extended events esp. EVENT --> sqlserver.database_file_size_change & sqlserver.databases_log_file_size_changed and ACTION --> sqlserver.sql_text. Looks like @DBA_ANDY already did the hard work of writing an XEvent -- Original Author : @DBA_ANDY http://nebraskasql.blogspot.com/2016/06/...


2

How to migrate windows login in from one sql server to another sql server on another domain So whatever logins the database has in DMN1 cannot be used in DMN2 anymore. it would take a lot of time to sort out a lot of windows logins in DMN1, get their equivalent login in DMN2 and map them to the right databases. What would be an easier way of doing ...


2

Consider enforcing this combination of columns as a unique constraint at the database level. That won't be possible until the existing duplicates are cleaned out. But it will help prevent this problem from creeping back into the data. You should define the 4 columns as a non-unique index now since this process will involving lots of comparisons using them. ...


2

You could set the owner of model database as [DEVELOPMENT\d-testuser] and then any new databases that are created will automatically be owned by [DEVELOPMENT\d-testuser]. I normally tend to set the database owner to sa. Our applications are not using (should never use) sa :-) so there is no harm in setting the db owner to sa.


2

You won't get a much better answer than here. Basically, the part of this document that you want is here: Restoring your MySQL Database Above we backup the Tutorials database into tut_backup.sql file. To re-create the Tutorials database you should follow two steps: Create an appropriately named database on the target machine If, ...


2

A method that I find useful is to implement the cleanup code in my main programming framework (so Django, I guess, in your case) and expose that function via a URL. Then in my crontab I use wget or curl to invoke the cleanup URL. That way the cron file is only responsible for the scheduling part, while the code that does the cleanup is kept together with ...


2

You can use CASE for what you're using the replace for. Also, I've modified the WHERE to be more streamlined; SELECT CASE WHEN column = '1' THEN 'ABC' WHEN column = '2' THEN 'DEF' WHEN column = '3' THEN 'GHI' WHEN column = '4' THEN 'JKL' END AS column FROM table WHERE column IN ('1','2','3','4') As a note, if column is an int then you don'...


2

There is no easy way to suppress specific events (with the exception of log backups using TF3226 or using the -n startup parameter which suppresses all events as ably described here). What you should probably be doing is addressing the root cause of the issue. If you have decided not to do that, you can simply suppress the ids when you report on your event ...


2

Yes simple way to temporarily stop Logshipping is to disable all the jobs related to Logshipping, since LS is basically backup of transaction logs and restore you have control over it. You need to disable Backup, copy and restore jobs. Please also make sure you disable LS_Alert jobs because they would fire and unnecessarily give you false alerts. Caution: ...


1

Assuming the procedure lives on the remote server: have you tried using the EXECUTE AT command? DECLARE @RunStoredProcSQL VARCHAR(1000); SET @RunStoredProcSQL = 'EXEC [Database].[dbo].[StoredProcName]'; --SELECT @RunStoredProcSQL --Debug EXEC (@RunStoredProcSQL) AT [LinkedServerName]; Print 'Procedure Executed'; That's what I have used successfully in the ...


1

The hosts file on a server is typically located at: C:\Windows\System32\drivers\etc. In this location you will see several files, one of which is the Hosts file. Edit with caution.


1

Oracle 'takes care' of the conversion between different NLS settings. As long as both NLS settings can store the same characters the there should be no problem. It is the same as the difference between the database and a client. If for example the database of the customer is in UTF-8 and you create a database in ISO8859-P1 then you will loose (some) ...


1

This is one of the ways SELECT CASE WHEN `amount`='type 1' then `amount` end as `amount1`, CASE WHEN `amount`='type 2' then `amount` end as `amount2`, CASE WHEN `amount`='type 3' then `amount` end as `amount3` FROM db.tablename; Ex: SELECT CASE WHEN amount=1000 then amount end as amount1, CASE WHEN amount=2000 then amount end as amount2, CASE ...


1

You don’t need to delete the already missing database.The user is configured to use a none existing or deleted database as a default database for the application. First, use trace and check for which application the user is failed to login, then on the application, change the default database to one of the existing databases. Sadequl’s post might help you ...


1

You can right click on the job in SSMS, go to properties, then to the 'schedule' option. From the schedule add your daily schedule to the 4h schedule. Default behavior of SQL Server jobs are that if a job is already running and the same job comes up again, it'll wait for the prior execution to finish before starting a new one. What you're describing is ...


1

If the column never has an underscore other than the one you want to remove, you can use SUBSTRING_INDEX(). update yourtable set yourcolumn = substring_index(yourcolumn,'_',1);


1

Back in 2013 a similar question was asked (How to run recurring tasks on a Postgresql database without a cron-like tool?). The crontab or pgAgent were the only way to go. For version 9.3 there is already the Background Worker Processes. But even in the version 9.5.2 documentation there is a warning about using it. I think that the cron solution is a good ...


1

Are the 37 indexes you have on the table global indexes? Option 1: Where you truncate and then rebuild This method is most appropriate if the partition that you are truncating has at least 10% of the total data in the table. But rebuilding these 37 indexes is going to take time. Option 2: Where you delete and truncate the partition The delete statement ...


1

This is what I do to start the mysql daemon manually. I've also included my own my.cnf. By specifying the correct corresponding paths in your system, you should be able to do the same thing. I would also point out that this is a source install, but again, it should apply generally. Start the daemon like this: ./bin/mysqld --defaults-file=./my.cnf ...



Only top voted, non community-wiki answers of a minimum length are eligible