Questions tagged [alter-database]
26 questions
18
votes
5 answers
Move multiple databases from C: to D: at once
I have SQL Server 2008 R2 with 323 databases consuming some 14 GB on my C: drive, a fast SSD.
Because I want to reclaim some space on my C: drive, I would like to move them to my D: drive.
I have found this MSDN article, but that seems to be the…
BioGeek
- 281
- 1
- 2
- 5
12
votes
2 answers
Unable to mirror a database SQL Server 2012
When trying to mirror a database using the following command
ALTER AVAILABILITY GROUP SQLAlwaysonGroup ADD DATABASE test0916aj8CJ
I get the following error
Msg 1475, Level 16, State 105, Line 1
Database "test0916aj8CJ" might contain bulk logged…
Bill
- 273
- 2
- 4
- 7
6
votes
2 answers
Best approach for moving tempdb .ndf files
During a SQL Server installation, I "thought" I specified location of tempdb on 'F:' and not 'C:', but I can see that although tempdb.mdf and templog.ldf are on 'F:', the 3 .ndf secondary data files are on 'C:'.
I'm thinking of moving the .ndf…
BRW
- 93
- 1
- 1
- 4
6
votes
2 answers
Are cursors/While loops the only way to make administrative changes to multiple databases?
I specifically want a programmable way to change the recovery model of all the databases on a server, and i know this solution can be applied to all 'Alter Database' commands. While I know SMO in PowerShell can solve this problem very…
Luke Pafford
- 311
- 1
- 11
5
votes
2 answers
User cannot create schema in PostgresSQL database
I'm trying to setup a "deployment" user which can create and alter tables on an existing database in addition to selecting, updating, inserting and deleting records.
Here is what I've tried so far:
-- Create deployment user
CREATE ROLE deploy_user…
Sergei
- 151
- 1
- 1
- 4
3
votes
1 answer
Could 'Maximum Server Memory' be too low for large batched delete with captured output?
I'm trying to improve the performance of a SQL server database backup program that will create a new database to hold one years worth of report records, delete report records out of the main database, and capture the delete output and use it to…
Zack
- 133
- 5
2
votes
0 answers
Trouble renaming a PostgreSQL database
Trying to rename a postgres database:
$ psql -d some_other_database
some_other_database=# ALTER DATABASE myapp_development RENAME TO myapp_development_old
some_other_database-# \l
Name | Owner | Encoding | Collate …
Meltemi
- 777
- 3
- 9
- 14
2
votes
2 answers
Is it possible through only T-SQL to physically move the data and log files of a database from one drive to another drive (on the same server)?
I know you can alter the database to update their data and log file paths in the database properties, but is there also a way to script out the actual physical move of the files themselves?...maybe through a database command?
J.D.
- 40,776
- 12
- 62
- 141
1
vote
1 answer
Tablespace resize in Oracle 10g
I'm trying to resize a couple of tablespaces but the following query is only valid in Oracle 11g.
alter tablespace 2 DATAFILE '/appli2/oracle/xxx/oradata02/xxx_undo_01.dbf' resize 3g;
In oracle v10g i try with this query, picked from oracle…
Jorge Vega Sánchez
- 993
- 3
- 15
- 22
1
vote
1 answer
How Restore backup as overwrite on a database in use in SQL Server?
I Want to restore a backup with overwriting on a database in use
for this problem I want to create a query base on these steps :
1- Remove All Connections [MyDB]
2- Create a backup from [MyDB]
3- Restore a Backup as an Overwrite on [MyDB] from…
Mojtabah
- 33
- 6
1
vote
2 answers
Where are my files?
The DBA run a file relocation script to move the physical Database file from where it was running to I:.
ALTER DATABASE [cro01] MODIFY FILE ( name=cro01,filename=N'i:\SQLData\cro01.MDF')
He take the Database offline ad copy the file.
But for some…
Sergio Branda
- 11
- 1
1
vote
2 answers
Moving DataFile to Another Location ORACLE
I'm having some problems moving DATAFILE from one location to another due to the shortage of storage space. I've managed to change the path file of control file via command(linux). Now I would like to change the path file of the datafile and logs to…
user154546
- 19
- 2
1
vote
1 answer
ALTER DATABASE ARITHABORT configuration minimum privilege needed
What is the minimum privilege needed to execute ALTER DATABASE {db_name} SET ARITHABORT ON?
I found that the privilege ALTER ANY DATABASE would suffice this, but I wonder if there isn't any other "smaller" privilege that does the same thing, because…
Iúri dos Anjos
- 123
- 7
1
vote
2 answers
Can't change _log database physical location in SQL Server
I just installed Microsoft ServiceBus and it created 5 databases. Now I want to move them to some specific location so I can join them to SQL Server AlwaysOn Availability group.
I stopped service bus farm and tried to execute the following queries…
Andrew
- 153
- 6
1
vote
2 answers
Issues with setting a global setting in PostgreSQL 9.5/PostGIS2.2
I am trying to set a global setting/GUC variable postgis.gdal_enabled_drivers from the PostGIS extension for a while. I am a non-admin user but can ask admin to change settings if needed. But I tried several different methods following the…
tinlyx
- 3,810
- 14
- 50
- 79