网创优客建站品牌官网
为成都网站建设公司企业提供高品质网站建设
热线:028-86922220
成都专业网站建设公司

定制建站费用3500元

符合中小企业对网站设计、功能常规化式的企业展示型网站建设

成都品牌网站建设

品牌网站建设费用6000元

本套餐主要针对企业品牌型网站、中高端设计、前端互动体验...

成都商城网站建设

商城网站建设费用8000元

商城网站建设因基本功能的需求不同费用上面也有很大的差别...

成都微信网站建设

手机微信网站建站3000元

手机微信网站开发、微信官网、微信商城网站...

建站知识

当前位置:首页 > 建站知识

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

oracle数据库中SID到底什么意思?怎么用?

SID的意思是oracle数据库的唯一标识符是你在建立一个数据库时系统自动赋予的一个初始ID。

创新互联公司坚持“要么做到,要么别承诺”的工作理念,服务领域包括:成都做网站、网站建设、企业官网、英文网站、手机端网站、网站推广等服务,满足客户于互联网时代的怀远网站设计、移动媒体设计的需求,帮助企业找到有效的互联网解决方案。努力成为您成熟可靠的网络建设合作伙伴!

SID主要用于在一些DBA操作以及与操作系统交互,从操作系统的角度访问实例名,必须通过ORACLE SID,且它在注册表中也是存在的。

扩展资料

如何查询当前用户的SID:

1、按【Win + R】快捷键,在弹出的运行对话框中输入【cmd】后按回车键

2、在命令提示符窗口中输入"whoami   /user",按回车键

3、然后就查出我当前的用户名和对应的SID

如何更改Oracle数据库的SID

SQL show parameter instance

DB_NAME: 数据库名。可以用DBNEWID (nid)命令更改DB_NAME.

SQL show parameter db_name

DBID: 数据库建立时创建的内部数字,用于区分不同数据库。RMAN会用该数字来区分数据库。当数据库都是正常创建时,DBID是不一样的。如果用复制的方法复制数据库,它们的DBID就会一样。可以用DBNEWID (nid)命令更改DBID.

SQL select dbid from v$database;

下面开始更改SID.本例中,原SID名为oldsid,更改为newsid

1. 关闭数据库

SQL create pfile from spfile; 生成initoldsid.ora 文件,后续操作需要用到

SQL shutdown immediate;

2. 编辑环境变量

# vi /home/oracle/.bash_profile

将其中的

export ORACLE_SID=oldsid 更改为

export ORACLE_SID=newsid

为使环境变量生效,以oracle用户重新登录。

3. 重命名参数文件

# cd $ORACLE_HOME/dbs

# mv initoldsid.ora initnewsid.ora

参数文件内容无需更改。如果本数据库是从另一台oracle服务器复制过来的,那需要将参数文件中的路径和内存等配置进行修改,这不属于本次任务。

4. 创建口令文件

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

至此,SID已经更改完成,数据库可以正常启动。以下操作是额外部分:

5. 更改其他相关配置

更改listener.ora:

vi $ORACLE_HOME/network/admin/listener.ora,若其中配置了SID_NAME=OLDSID,则需要更改为NEWSID.然后重启监听:# lsnctl restart.

更改tnsnames.ora:

所有需要连接到本数据库的其他主机,都需要更改tnsnames.ora.将SERVICE_NAME = OLDSID更改为SERVICE_NAME = NEWSID.这样才能连接到本数据库。

求助,如何修改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. 接下来就应该修改 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 启动数据库,更改sid成功

SQL startup

select instance_name from v$instance;

INSTANCE

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

db01

linux oracle中的sid怎么修改

1、检查原来的数据库实例名

$ echo $ORACLE_SID

orcl

$ sqlplus / as sysdba

select instance from v$thread;

INSTANCE

orcl

2、关闭数据库

shutdown immediate;

exit;

3、修改oracle用户的ORACLE_SID环境变量,如由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的修改为对应的新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、启动数据库

$ sqlplus / as sysdba

startup

8、检查数据库实例名

通过如下语句检查数据库实例名,发现实例名已经由orcl变成exoa

select instance from v$thread;

INSTANCE

exoa

接下来要修改监听器,因为修改了sid,但是监听器此时还是配置原来的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关闭数据库; 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怎么改字段名
文章链接:http://bjjierui.cn/article/hcpiec.html

其他资讯