I needed to change the SID of an Oracle XE database (not the Service Name) to match a production database.
When I tried searching online, most of the pages were describing changing or adding a service name through tnsnames.ora; that's not what I needed to do.
You can change the value of ORACLE_SID by completing the following steps: 1. Invoke SQL*Plus and connect as a user with SYSDBA privileges.
Oracle SID is the unique name that uniquely identifies your instance/database, whereas the Service name is the TNS alias that you give when you remotely connect to your database, and this Service name is recorded in tnsnames.
In version 11g, all of the previous solution didn't work... I always get the following error when trying to do the sqlplus / as sysdba :
ERROR: ORA-12560: TNS:protocol adapter error
Luckily I found a script to do what I wanted to do under [XE_HOME]\config\scripts. The script is named XE.bat and it will instantiate a new database from scratch asking you for the sysPassword along the process. So what I did was :
oradim -delete -sid XE
Edit the copy of the script as follows :
Execute the script... It will prompt you for the SYSTEM password a few times saying
Enter value for 1:
or
Enter value for 2:
That's it, the new database with your NEW_SID_NAME is up and running!!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With