oracle怎么改sid,Oracle怎么改字段名

oracle數(shù)據(jù)庫中SID到底什么意思?怎么用?

SID的意思是oracle數(shù)據(jù)庫的唯一標識符是你在建立一個數(shù)據(jù)庫時系統(tǒng)自動賦予的一個初始ID。

創(chuàng)新互聯(lián)公司堅持“要么做到,要么別承諾”的工作理念,服務(wù)領(lǐng)域包括:成都做網(wǎng)站、網(wǎng)站建設(shè)、企業(yè)官網(wǎng)、英文網(wǎng)站、手機端網(wǎng)站、網(wǎng)站推廣等服務(wù),滿足客戶于互聯(lián)網(wǎng)時代的懷遠網(wǎng)站設(shè)計、移動媒體設(shè)計的需求,幫助企業(yè)找到有效的互聯(lián)網(wǎng)解決方案。努力成為您成熟可靠的網(wǎng)絡(luò)建設(shè)合作伙伴!

SID主要用于在一些DBA操作以及與操作系統(tǒng)交互,從操作系統(tǒng)的角度訪問實例名,必須通過ORACLE SID,且它在注冊表中也是存在的。

擴展資料

如何查詢當前用戶的SID:

1、按【W(wǎng)in + R】快捷鍵,在彈出的運行對話框中輸入【cmd】后按回車鍵

2、在命令提示符窗口中輸入"whoami ? /user",按回車鍵

3、然后就查出我當前的用戶名和對應(yīng)的SID

如何更改Oracle數(shù)據(jù)庫的SID

SQL show parameter instance

DB_NAME: 數(shù)據(jù)庫名。可以用DBNEWID (nid)命令更改DB_NAME.

SQL show parameter db_name

DBID: 數(shù)據(jù)庫建立時創(chuàng)建的內(nèi)部數(shù)字,用于區(qū)分不同數(shù)據(jù)庫。RMAN會用該數(shù)字來區(qū)分數(shù)據(jù)庫。當數(shù)據(jù)庫都是正常創(chuàng)建時,DBID是不一樣的。如果用復(fù)制的方法復(fù)制數(shù)據(jù)庫,它們的DBID就會一樣??梢杂肈BNEWID (nid)命令更改DBID.

SQL select dbid from v$database;

下面開始更改SID.本例中,原SID名為oldsid,更改為newsid

1. 關(guān)閉數(shù)據(jù)庫

SQL create pfile from spfile; 生成initoldsid.ora 文件,后續(xù)操作需要用到

SQL shutdown immediate;

2. 編輯環(huán)境變量

# vi /home/oracle/.bash_profile

將其中的

export ORACLE_SID=oldsid 更改為

export ORACLE_SID=newsid

為使環(huán)境變量生效,以oracle用戶重新登錄。

3. 重命名參數(shù)文件

# cd $ORACLE_HOME/dbs

# mv initoldsid.ora initnewsid.ora

參數(shù)文件內(nèi)容無需更改。如果本數(shù)據(jù)庫是從另一臺oracle服務(wù)器復(fù)制過來的,那需要將參數(shù)文件中的路徑和內(nèi)存等配置進行修改,這不屬于本次任務(wù)。

4. 創(chuàng)建口令文件

orapwd file=$ORACLE_HOME/dbs/orapwnewsid password=oracle

至此,SID已經(jīng)更改完成,數(shù)據(jù)庫可以正常啟動。以下操作是額外部分:

5. 更改其他相關(guān)配置

更改listener.ora:

vi $ORACLE_HOME/network/admin/listener.ora,若其中配置了SID_NAME=OLDSID,則需要更改為NEWSID.然后重啟監(jiān)聽:# lsnctl restart.

更改tnsnames.ora:

所有需要連接到本數(shù)據(jù)庫的其他主機,都需要更改tnsnames.ora.將SERVICE_NAME = OLDSID更改為SERVICE_NAME = NEWSID.這樣才能連接到本數(shù)據(jù)庫。

求助,如何修改ORACLE默認SID

比如將sid=orcl 更改為sid=db01

1.shutdown immediate

2.[oracle@oracle ~]$ vi .bash_profile

export ORACLE_SID=bd01

[oracle@oracle ~]$ source .bash_profile(使其生效)

3.修改 /etc/oratab 文件 ; 在文件的最后一行 將 orcl 改為db01

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

4. 接下來就應(yīng)該修改 oracle 目錄里邊的文件 cd

/$ORACLE_HOME/dbs 把所有包含 orcl 的文件名 ,修改為 包含 db01 的文件名

mv

hc_orcl.dat hc_db01.dat

mv lkORCL lkDB01

mv spfileorcl.ora

spfildb01.ora

mv orapworcl

orapwdb01

5.重建口令文件 我的用戶名密碼

為:oracle@oracle

[oracle@oracle dbs]$ orapwd

file=$ORACLE_HOME/dbs/orapw$ORACLE_SID password=oracle

6 啟動數(shù)據(jù)庫,更改sid成功

SQL startup

select instance_name from v$instance;

INSTANCE

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

db01

linux oracle中的sid怎么修改

1、檢查原來的數(shù)據(jù)庫實例名

$ echo $ORACLE_SID

orcl

$ sqlplus / as sysdba

select instance from v$thread;

INSTANCE

orcl

2、關(guān)閉數(shù)據(jù)庫

shutdown immediate;

exit;

3、修改oracle用戶的ORACLE_SID環(huán)境變量,如由orcl修改為exoaidc

$ vi /home/oracle/.bash_profile

export ORACLE_SID=exoaidc

$ source /home/oracle/.bash_profile

4、修改/etc/oratab文件,將sid名由orcl修改為linux

$ vi /etc/oratab

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

5、進入到$ORACLE_HOME/dbs目錄

將所有文件名中包含原來的sid的修改為對應(yīng)的新sid的

$ cd $ORACLE_HOME/dbs

$ mv hc_zf.dat hc_exoa.dat

$ mv lkZF lkexoa

$ mv orapwzf orapwexoa

$ mv spfilezf.ora spfileexoa.ora

6、重建口令文件

因為口令文件改名后不能在新實例中使用,所以重建

$ orapwd file=$ORACLE_HOME/dbs/orapw$ORACLE_SID password=123456 entries=5 force=y

7、啟動數(shù)據(jù)庫

$ sqlplus / as sysdba

startup

8、檢查數(shù)據(jù)庫實例名

通過如下語句檢查數(shù)據(jù)庫實例名,發(fā)現(xiàn)實例名已經(jīng)由orcl變成exoa

select instance from v$thread;

INSTANCE

exoa

接下來要修改監(jiān)聽器,因為修改了sid,但是監(jiān)聽器此時還是配置原來的orcl的sid

修改$ORACLE_HOME\network\admin\listener.ora文件

SID_LIST_LISTENER =

(SID_LIST =

(SID_DESC =

(SID_NAME = PLSExtProc)

(ORACLE_HOME = /u01/app/oracle/product/11.2.0/dbhome_1)

(PROGRAM = extproc)

)

(SID_DESC =

(GLOBAL_DBNAME = orcl)

(ORACLE_HOME = /u01/app/oracle/product/11.2.0/dbhome_1)

(SID_NAME = ORCL)

)

)

把ORCL改成exoa即可

如何在Oracle更改SID名稱

1、先查詢oracle當前的db_name和sid; SYS@test select instance_name from v$instance;INSTANCE_NAME----------------testSYS@test select name from v$database;NAME---------TEST關(guān)閉數(shù)據(jù)庫; SYS@test shutdown immediate;啟動到mou

如何更改oracle的sid

Modifying a database to run under a new ORACLE_SID:

1. Shutdown the instance

2. Backup all control, redo, and data files.

3. Go through the .profile, .cshrc, .login, oratab, tnsnames.ora, (for SQL*Net version

2), and redefine the ORACLE_SID environment variable to a new value.

For example, search through disks and do a grep ORACLE_SID *

4. Change locations to the "dbs" directory

% cd $ORACLE_HOME/dbs

and rename the following files:

o initsid.ora (or use pfile to point to the init file.)

o control file(s). This is optional if you do not rename any

of the controlfiles, and the control_files parameter is used.

The "control_files" parameter is set in the "initSID.ora" file or in a file it

references with the ifile parameter. Make sure that the control_files parameter does

not point to old file names, if you have renamed them.

o "crdbsid.sql" "crdb2sid.sql", This is optional. These are only used at

database creation.

5. Change locations to the "rdbms/admin" directory

% cd $ORACLE_HOME/rdbms/admin

and rename the file:

o startupsid.sql. This is optional. On some platforms, this file may be in the

"$ORACLE_HOME/rdbms/install" directory. Make sure that the contents of this file do not

reference old initSID.ora files that have been renamed. This file simplifies the

"startup exclusive" process to start your database.

6. To rename the database files and redo log files, you would follow the instructions

in Note:9560.1.

7. Change the ORACLE_SID environment variable to the new value.

8. Check in the "$ORACLE_HOME/dbs" directory to see if the password file has been

enabled. If enabled, the file "orapwOLD_SID" will exist and a new password file for

the new SID must be created (renaming the old file will not work). If "orapwOLD_SID"

does not exist, skip to step 9. To create a new password file, issue the following

command as oracle owner:

orapwd file=orapwNEWSID password=?? entries=number of users to be granted

permission to start the database instance

9. Start up the database and verify that it works. Once you have done this, shutdown

the database and take a final backup of all control, redo, and data files.

10. When the instance is started, the control file is updated with the current

ORACLE_SID.

文章題目:oracle怎么改sid,Oracle怎么改字段名
URL鏈接:http://muchs.cn/article42/hcpiec.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供建站公司、網(wǎng)站維護、定制網(wǎng)站靜態(tài)網(wǎng)站、網(wǎng)站設(shè)計公司電子商務(wù)

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)

成都app開發(fā)公司