Get the App
SLTechnology News&Howtos  ›  Database  › 

Oracle modifies SID

Shulou Source: shulou.com Published: 2022-06-01 15:21:24 11月08日 Update

Problem description: my default ORACLE_SID was orcl, but now I want to do data synchronization. I have to have a different ORACLE_SID to distinguish it from each other.

Now it only takes a few simple steps to modify the ORACLE_SID

1. First shutdown immediate (be careful not to shutdown abort)

two。 Modify the environment variable of oracle user: ~ / .bash_prfile

[oracle@oracle ~] $vi .bash _ profile

Change the orcl of the export ORACLE_SID=orcl line to the name you want to change; I should be export ORACLE_SID=morcl

Then save and exit

3. Modify the / etc/oratab file; change orcl to morcl on the last line of the file

Morcl:/u01/app/oracle/product/10.2.0:N

4. Next, you should modify the file cd / $ORACLE_HOME/dbs in the oracle directory to change all the file names that contain orcl to those that contain morcl

Mv hc_orcl.dat hc_morcl.dat

Mv lkORCL lkMORCL

Mv spfileorcl.ora spfilemorcl.ora

Mv orapworcl orapwmorcl

5. Rebuild the password file my username and password is: oracle@oracle

[oracle@oracle dbs] $orapwd file=$ORACLE_HOME/dbs/orapw$ORACLE_SID password=oracle entries=5 force=y

5. Check whether ORACLE_SID is effective echo $ORACLE_SID if it is, you can restart the machine and let ORACLE_SID take effect

[oracle@oracle dbs] $echo $ORACLE_SID

Morcl

[oracle@oracle dbs] $

6. Confirm that the oracle_sid has been modified and the database can be started, but let's wait and see.

SQL >

SQL > startup

ORACLE instance started.

Total System Global Area 167772160 bytes

Fixed Size 1218316 bytes

Variable Size 62916852 bytes

Database Buffers 100663296 bytes

Redo Buffers 2973696 bytes

Database mounted.

Database opened.

SQL >

SQL >

SQL >

7. Confirm that the oracle database internal SID has been modified

SQL >

SQL > select instance from V$thread

INSTANCE

Morcl

SQL >

Tags: File line data file name user different wait and see next variable password name password database machine step environment user name directory problem synchronization Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno MariaDB OPPO Reno Docker Apple Shulou Technology