Is it possible to rename an SQL Server 2005 instance - sql-server

I would like to change the name of my SQL Server instance. Is there a simple way of doing this or is a significant effort required? Note, this is a named instance - not the default instance.

The only way is a reinstall. See this similar thread for more info: SQL Server, convert a named instance to default instance?

Or you could try this method:
http://groups.google.com/group/microsoft.public.sqlserver.server/browse_thread/thread/544c4eaf43ddfaf3/f1bdcd1ec9cab158#f1bdcd1ec9cab158

I have seen a few makeshift ways of doing this, but I don't have confidence in any of them. I think I will simply install a new instance and transfer my information over.

Renaming does't work well on the registry. Install a new isntance.

Although there is no simple way of renaming a SQL Server instance, one can create SQL aliases.

Related

Create new instance in Oracle 11g

I installed Oracle 11g, with ad instance called orcl.
And I want to create another instance, called for example orcl1.
How could I do that? Do I nead to re-install another database like I did the first time?
You need either to use :
DBCA : recommended because easier. See example (this assumes that Oracle executables have already been installed).
or
CREATE DATABASE SQL statement with SQL*Plus: more complex.

How to get a list of all the MS SQL Server instances on the local machine?

This seems to be a fairly common question, but none of the answers I've seen have been particularly satisfactory. I want to get a list of the names of the MS SQL Server instances installed on the local machine, regardless of whether they're started or not. For the purposes of this discussion, I'm OK with just finding instances of SQL 2005 and newer; I can handle 2000 and earlier using "legacy" methods (i.e., look in the registry). What I do require is that it not be dependent on the SQL Server Browser service (it's disabled by default nowadays), and that 64-bit instances are returned even when the app is 32-bit.
Suggestions I've seen:
Dig through the registry: Supposedly Not recommended due to the registry entries being undocumented; MS may change them in the future. More importantly, as far as I can tell, 64-bit instances of MSSQL go in the 64-bit HKLM\SOFTWARE\Microsoft\Microsoft SQL Server InstalledInstances, and 32-bit instances go in the 32-bit one, so a 32-bit app won't see any 64-bit instances.
Use the SQL WMI Provider for Configuration Management mentioned in the previous blog post. This seems to be the closest, but despite the author's admonition to avoid using the registry because it might change, it turns out the WMI namespace changed between SQL 2005 and 2008: in 2005, it's root\Microsoft\SqlServer\ComputerManagement, but in 2008 it's root\Microsoft\SqlServer\ComputerManagement10. Will it change again in the future? That said, it's probably not a huge issue if I have to update my app for a future version of SQL.
The problem I have with the WMI method is that the SqlService class returns a list of the service names, whereas I want the instance names. E.g., instead of MSSQL$INSTANCE, I just want INSTANCE. Stripping off the "MSSQL$" is trivial, as is handling the special case of the default instance, but is it reliable? AFAIK, there's technically no reason why the service couldn't be renamed, while keeping the instance name the same. That said, unless someone has a better method, I think I'll go with that (get the service names and strip off the MSSQL$). The ServerSettings class returns the instance name, but it doesn't see a 64-bit instance of SQL 2008 R2 Express that I have installed on my machine.
Use SmoApplication.EnumAvailableSqlServers(true): this seems to depend on the SQL Server Browser service. It works great if the Browser service is started, but if it's not, I just get a single row with the computer name as the server name and a blank instance name.
Use System.Data.Sql.SqlDataSourceEnumerator.GetDataSources(): same problem that it depends on the SQL Server Browser.
So, are there some other methods that might work better?
I am able to see both 2005 and 2008 SQL Server instances on my laptop using Powershell:
Get-Service | Where-Object {$_.Name -like 'MSSQL$*'}
Other possibilities to explore include enumerating through the RegisteredServers namespace.
From a command prompt (cmd.exe):
sc query|findstr "DISPLAY_NAME"|findstr /C:"SQL Server (" > myfile.txt
FOR /F " tokens=2 delims=()" %i in (myfile.txt) do #echo %computername%\%i
I know this is an older post, but I did come to this post today looking for a way to find installed instances of SQL Server. Although the two answers given are helpful, I think they only pertain to installed and running instances of SQL Server. If SQL Server Configuration Manager is installed, all installed instances should be listed under the SQL Server Services node. Here you might find an instance that is installed, but not running. You can right click the instance and start it. I am sure there are other ways to do this; it is just a way that came in handy for me today and I thought I would share it.
The SQL Browser service (if active) speaks SSRP/MS-SQLR on UDP Port 1434.
It is the component which is used for remote discovery of instances (and also determining their port). It helps also discovery in a network.
It is however disabled by default (good thing for surface reduction).
This might be helpful , i have tried this in Sql Server 2008 :
select * from sys.servers

Is is possible to run multiple instances of SQL Server on the same machine

Is is possible to run multiple instances (installations) of SQL Server databases on the same machine (assuming the machine is not virtualized)
Yes, you can give the installations different names. I think you have to choose "advanced options" on installation to be able to set the name.
yep, they need to be named instances though. Run the setup but when you get to the instance name - add a new name for the instance.
Yes, we can use multiple instance of SQL Server of same machine/server.
All instances of the database engine other than the default instance are identified by an instance name specified during installation of the instance.

Change my local named SQL Instance from 'localhost\sql05' to just 'localhost'

I currently have a SQL Server 2005 instance installed on my local machine, and at the time of installation I named the instance 'localhost\sql05'
Can I easily change this to just 'localhost'
From what I can tell, the best option is to simply install the instance with the name you would like, move the DB's over, and then remove the instance you want to replace. While the link to CodeJournal seems promising, I don't believe it will yield positive results.
http://www.coderjournal.com/2008/02/how-to-change-instance-name-of-sql-server/
Also see this post (duplicate here on SO)...
https://stackoverflow.com/questions/907851/change-sql-server-instance-name
The only way to rename an instance is to uninstall it and re-install it under the correct instance name. Tricks that try to work around the name like creating an alias or making the named instance listen on the default port but they sometimes work sometimes don't, and they can fail in seemingly random manner, eg. due to the SPN (Service Principal Name) requested by the client during authentication.

Rename a sql server instance

Is it possible to change a sql server instance name? Or is it something that can only be set during installation?
To the best of my knowledge, they can only be changed at install time. You might be able to change the name with the installer package while keeping the current info. I would make backups of all of your databases and then try this.
On another note, changing instance names will just cause you so many headaches. Even if you can do it, I would strongly reccomend leaving well enough alone.
You can't rename the instance but you can rename a server (sql2000 only) - does that help at all?
Have a look at:
sp_dropserver 'oldname', 'droplogins'
and then;
sp_addserver 'newname', local
Be aware that if there are any jobs running on that server they'll need to be renamed too;
use msdb
go
update sysjobs set originating_server = 'newname'
You'll need to restart your SQL Server

Resources