oracle 修改SID

來源:互聯網
上載者:User

標籤:product   oracle   export   使用者   

問題描述:我以前預設的 ORACLE_SID 是orcl ,現在我想做資料同步, 必須的有不同的 ORACLE_SID ,以便區分開來。

    

     現在僅需要簡單的幾個步驟就可以修改好ORACLE_SID;

 

    1.首先shutdown immediate (注意不要shutdown abort)

 

    2.修改oracle使用者的環境變數 : ~/.bash_prfile

    [[email protected] ~]$ vi .bash_profile

    把 export ORACLE_SID=orcl 這一行的 orcl 改為 你想改的名稱;我該為  export ORACLE_SID=morcl

    然後儲存並退出;

 

    3.修改 /etc/oratab 檔案 ; 在檔案的最後一行 將   orcl  改為 morcl

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

 

    4. 接下來就應該修改 oracle 目錄裡邊的檔案 cd /$ORACLE_HOME/dbs   把所有包含 orcl 的檔案名稱 ,修改為  包含 morcl 的檔案名稱

     mv hc_orcl.dat hc_morcl.dat

     mv lkORCL lkMORCL 

     mv spfileorcl.ora  spfilemorcl.ora

     mv orapworcl orapwmorcl

  

    5.重建口令檔案     我的使用者名稱密碼 為:[email protected]

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

   5. 檢查ORACLE_SID 是否生效 echo $ORACLE_SID 如果為生效, 則可以重啟 機子 ,讓 ORACLE_SID生效

  [[email protected] dbs]$ echo $ORACLE_SID

  morcl

  [[email protected] dbs]$

 

  6.確認oracle_sid 修改好了就可啟動資料庫了,然我們拭目以待吧::.....

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.確認oracle database 內部已經SID 已經修改

SQL>

SQL> select instance from V$thread;

INSTANCE

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

morcl

SQL>


本文出自 “常用文檔” 部落格,請務必保留此出處http://yujianglei.blog.51cto.com/7215578/1561614

oracle 修改SID

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.