Skip to main content
OverflowAI is here! AI power for your Stack Overflow for Teams knowledge community. Learn more

Questions tagged [alter-database]

The tag has no usage guidance.

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

Run TSQL alter db set trustworthy on multiple times

We have a few SQL Server databases that needs to have trustworthy option set to 'ON' to allow for external assemblies to load, but every time there's any security patch, the option sets to off and the ...
Affy's user avatar
  • 3
0 votes
1 answer
851 views

How to change from "Read-Only" mode to "Standby / Read-Only" mode?

I changed the database (foo) mode from "Standby / Read-Only" to Active by using the following statement: restore database foo with recovery After that, I changed the mode back to Active by ...
Java's user avatar
  • 233
0 votes
1 answer
1k views

Alter database from Read-Only to Regular mode? A warm-standby database is read-only (Error 5063)

I am trying to change the mode of database from "Standby / Read-Only" to "Normal" mode so that I could use mdf file to attach to other SQL Server. One instruction that I got was go ...
Java's user avatar
  • 233
0 votes
1 answer
958 views

How to alter column to make it primary key when one already exists mysql8?

id | bigint unsigned | NO | PRI | NULL | auto_increment | | title | varchar(255) | NO | | NULL | | | category | varchar(255) | NO | | NULL |...
analogbeing's user avatar
1 vote
1 answer
1k views

How Restore backup as overwrite on a database in use in SQL Server? [closed]

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- ...
Mojtabah's user avatar
2 votes
2 answers
401 views

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 ...
J.D.'s user avatar
  • 37.8k
6 votes
2 answers
11k views

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 ...
BRW's user avatar
  • 93
0 votes
1 answer
36 views

Altering Tables using Tablenames from other Table

I have a database with several tables and i have a table which contains all tablenames which I want to alter. I want to perform a query like this: ALTER TABLE (SELECT "TABLE_NAME" FROM "...
DataLordDev's user avatar
1 vote
2 answers
333 views

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 ...
Sergio Branda's user avatar
1 vote
2 answers
1k views

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 ...
user154546's user avatar
1 vote
1 answer
282 views

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 "...
Iúri dos Anjos's user avatar
0 votes
2 answers
281 views

Is using the rename database feature in PHPMyAdmin safe?

I know the rename database functionality has been taken out of MySQL. My question is, does renaming it in PHPMyAdmin work and is safe? I know they have written functionality to deal with a number of ...
StackOverflowed's user avatar
0 votes
2 answers
10k views

How do I add multiple users to a role in one statement?

I simply want to add multiple users that I have created to a created role then grant all privileges on said role. This is what I have thus far: CREATE USER Bob FROM LOGIN Bob; CREATE USER ...
CrashFive's user avatar
6 votes
2 answers
1k views

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 ...
Luke Pafford's user avatar
1 vote
2 answers
426 views

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 ...
Andrew's user avatar
  • 153
1 vote
2 answers
1k views

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 ...
tinlyx's user avatar
  • 3,580
5 votes
2 answers
18k views

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: -...
Sergei's user avatar
  • 151
12 votes
2 answers
5k views

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 ...
Bill's user avatar
  • 273
0 votes
2 answers
2k views

Drop datafile without dropping a tablespace in Oracle 11g

I was trying to take backup of database in Oracle 11g by using RMAN $ rman target / Recovery Manager: Release 11.2.0.1.0 - Production on Fri Sep 11 10:14:37 2015 Copyright (c) 1982, ...
Paresh's user avatar
  • 81
0 votes
1 answer
222 views

database not opening

While altering a DB to open getting the below error. SQL> alter database open; alter database open * ERROR at line 1: ORA-00600: internal error code, arguments: [kcratr_nab_less_than_odr], [1], [...
Capricon's user avatar
0 votes
1 answer
2k views

Does the scope for 'Alter Any Database' operate similar to 'Create Any Database'?

Does the scope for 'Alter Any Database' operate similar to 'Create Any Database', as in, only those databases created by Login-A under the 'Create Any Database' umbrella can be altered, and not the ...
Jake's user avatar
  • 19
2 votes
0 answers
36 views

Trouble renaming a PostgreSQL database [duplicate]

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 ...
Meltemi's user avatar
  • 777
0 votes
2 answers
120 views

Can I update only the needed changes in a database?

First of all, I apologize if you can't understand very well what I am saying and it can be edit for better understanding of my post. The next example is for better understanding of databases with ...
ernestoglez22's user avatar
3 votes
1 answer
587 views

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, ...
Zack's user avatar
  • 133
1 vote
1 answer
9k views

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 ...
Jorge Vega Sánchez's user avatar
18 votes
5 answers
13k views

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 ...
BioGeek's user avatar
  • 281