Method steps for Oracle database to modify instance name Sid

Source: Internet
Author: User
Tags oracle database sqlplus

Modify Oracle Instance name

System Environment: CentOS 6.5
Oracle Version: 10.2

1, check the original database instance name
$ echo $ORACLE _sid
Orcl

$ sqlplus/as SYSDBA
> select instance from V$thread;
INSTANCE
--------------------------------------------------------------------------------
Orcl


2. Close the database
> Shutdown Immediate;
> exit;


3, modify the Oracle user's ORACLE_SID environment variables, such as modified by ORCL to LINUXIDC
$ vi/home/oracle/.bash_profile
Export ORACLE_SID=LINUXIDC
$ source/home/oracle/.bash_profile


4. Modify the/etc/oratab file to change the SID name from ORCL to LINUXIDC
$ vi/etc/oratab
Linuxidc:/u01/app/oracle/11.2/db_1:y


5, into the $oracle_home/dbs directory
The modification of all file names containing the original SID to the corresponding new SID.
$ cd $ORACLE _home/dbs
$ mv Hc_zf.dat Hc_linuxidc.dat
$ mv Lkzf LKLINUXIDC
$ mv Orapwzf ORAPWLINUXIDC
$ mv Spfilezf.ora Spfilelinuxidc.ora


6. Rebuild Password file
Because the password file cannot be used in a new instance after renaming it, the rebuild
$ orapwd file= $ORACLE _home/dbs/orapw$oracle_sid password=123456 entries=5 force=y


7, start the database

$ sqlplus/as SYSDBA
> Startup

8, check the database instance name

Check the database instance name with the following statement, discovering that the instance name has been changed from ORCL to LINUXIDC
> select instance from V$thread;
INSTANCE
--------------------------------------------------------------------------------
Linuxidc

This time, although the instance name has been changed to LINUXIDC, but the database name (dbname) is still ORCL, so the client still cannot connect, if you need to connect, you need to modify dbname

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.