Home >Database >Oracle >How to modify oracle sid

How to modify oracle sid

WBOY
WBOYOriginal
2022-02-28 11:04:348223browse

Method: 1. Use the "shutdown immdiate" command to close the database; 2. Modify the "initSID.ora" file and change the "instance_name" content to the new sid; 3. Modify the "listener.ora" file of "SID_NAME".

How to modify oracle sid

The operating environment of this tutorial: linux7.3 system, Oracle 11g version, Dell G3 computer.

How to modify the sid of oracle

1. Log in to the database to view the SID

select instance_name,status from v$instance;

2. Close the database

shutdown immdiate;

3. Modify the /etc/oratab file

4. Modify the .bash_profile under the Oracle user, and source .bash_profile to take effect

Check whether it takes effect

env|grep ORACLE

5.Modify the file name in the dbs directory

How to modify oracle sid

6. Regenerate the password file

orapwd file=$ORACLE_HOME/dbs/oraw$ORACLE_SID password=sys entries=5 force=y

7. Modify the initSID.ora file and modify instance_name to the new SID

Find your initialization parameter file, which There are the following parameters.

db_name = "testdb" 
instance_name = testdbl 
service_names = testdb

is changed to

db_name = "testdb" 
instance_name = oral 
service_names = oral

Note, do not change db_name, because our database is still called testdb, but its service is sid, change it to oral, otherwise it will Report an error. After modification, save the file

8. Modify the SID_NAME in listener.ora

SID_LIST_LISTENER = 
(SID_LIST = 
(SID_DESC = 
(SID_NAME = PLSExtProc) 
(ORACLE_HOME = E:\oracle\ora81) 
(PROGRAM = extproc) 
) 
(SID_DESC = 
(GLOBAL_DBNAME = testdb) 
(ORACLE_HOME = E:\oracle\ora81) 
(SID_NAME = oral) 
) 
)

Change the SID_NAME inside to oral, as shown in the above example.

Recommended tutorial: "Oracle Video Tutorial"

The above is the detailed content of How to modify oracle sid. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn