Change sid and dbnameoracle11g database name at Oracle11g

Source: Internet
Author: User
Windows XP + VM7.1.3 + redhatlinuxenterprenterprise5.5 + Oracle11g2 changed oracle11g2 to sidorcl by default and ORCL by default.

Windows XP + VM 7.1.3 + Red hat linux enterprise 5.5 + Oracle 11g2 installed oracle 11g2 changed the default sid orcl and default database name ORCL in two ways

Environment:

Windows XP + VM 7.1.3 + Red Hat linux enterprise 5.5 + Oracle 11g2

Change the default sid orcl and default database name ORCL for the installed oracle 11g2

It is described in two stages. sid is changed in the first stage, and dbname is changed in the second stage.

The detailed steps are as follows:

Phase 1: sid change

1. log on to the database to view the previous sid. There are three steps in total. You can understand it and don't know how to ask questions.

2. Shut down the database

3. Edit the/etc/oratab file and replace all orcl with nihao. In most cases, it is actually one.

  • [Oracle @ localhost ~] $ Vim/etc/oratab
  • 4. Change the. bash_profile file of an oracle user

  • [Oracle @ localhost ~] $ Vim. bash_profile
  • 5. Make the modified. bash_profile file take effect

  • [Oracle @ localhost ~] $. Bash_profile
  • 7. View System Environment Variables

    The effect is always effective.

    8. Go to $ ORACLE_HOME/dbs to view the directories with orcl.

    9. Change the file name orcr =, nihao, ORCL =, and NIHAO. The command is as follows:

    10. Generate and view the password file again.

    11. log on to the database and view the Instance name. The result shows that the sid has changed from orcl to nihao.

    You do not need to log out. Start the second part and change the database name dbname.

    2.1 backup control file

    2.2 close and exit the database

    2.3 The Backup Directory of the control file of orcale 11.2g is
    /U01/app/oracle/diag/rdbms/nihao/trace

  • You can find the contolfile backup trc in alter_nihao.log,Sid _Ora_nnnn.trc is the latest one.
  • Alter_nihao.log contains such a line to tell you which one controls the backup file

  • 2.5 copy

  • [Oracle @ localhost trace] $ cp nihao_ora_5419.trc nihao. SQL
  • 2.6 edit nihao. SQL, that is, the copy of nihao_ora_5419.trc.

    1) Find the startup nomount statement and delete all the rows above this line.
    2) Search for all rows starting with -- and delete these rows.
    3) change all orcl to nihao and all ORCL to NIHAO.
    4) Find the create controlfile reuse database... statement and change the REUSE to SET.
    5) locate the recover database using backup controlfile statement and comment out the statement with the double horizontal line (--).

    The result is as follows:

    2.7 generate a configuration file

    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.