Steps for modifying Instance name SID in Oracle Database

Source: Internet
Author: User

Steps for modifying Instance name SID in Oracle Database

Sometimes we need to modify the instance SID of the Oracle database. The following is an instance tutorial for modifying the Instance name of ORACLE10.2 in Centos 6.5. If you are interested in learning, you can check it out.

  Modify the 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. Shut down the database

> Shutdown immediate;

> Exit;

  3. Modify the oracle ORACLE_SID environment variable, for example, from orcl to linuxidc

$ Vi/home/oracle/. bash_profile

Export ORACLE_SID = linuxidc

$ Source/home/oracle/. bash_profile

  4. Modify the/etc/oratab file and change the sid Name from orcl to linuxidc.

$ Vi/etc/oratab

Linuxidc:/u01/app/oracle/11.2/db_1: Y

  5. Go to the $ ORACLE_HOME/dbs directory.

Modify all files whose names contain 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 the password file

Because the password file cannot be used in the new instance after it is renamed

$ 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 using the following statement and find that the Instance name has changed from orcl to linuxidc

> Select instance from v $ thread;

INSTANCE

--------------------------------------------------------------------------------

Linuxidc

At this time, although the Instance name has been changed to linuxidc, the Database Name (dbname) is still orcl, so the connection still cannot be established on the client. to connect, You need to modify the dbname

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.