Oracle数据库修改DBID和DBNAME

1.受影响文件统计

文件 关联参数 NID是否处理
Password File DBNAME
Parameter File DBNAME
Data File DBNAME,DBID
Online Redo Log DBID
Archived Redo Log DBID
Backup Set DBID
Control File DBID,DBNAME
Oracle NET File(Listener,tnsnames) DBNAME
DBConsole DBID,DBNAME

2.查看数据库信息

select dbid,name from v$database;
archive log list;
-- 生成最新的pfile
create pfile from spfile;

3.关闭数据库

shutdown immediate;
startup mount;

4.修改

nid -help
nid target=/ dbname=sailydb

5.修改参数文件

startup nomount;
alter system set db_name='sailydb' scope=spfile;
shutdown immediate;
cd $ORACLE_HOME/dbs
mv spfilemonkeydb.ora spfilesailydb.ora

6.生成密码文件

cd $ORACLE_HOME/dbs
orapwd file=orapwsailydb password=monkey

7.修改环境变量

vi .bash_profile
ORACLE_SID=sailydb
source .bash_profile

8.修改监听

cd $ORACLE_HOME/network/admin
vi listener.ora

9.开启数据库

startup mount;
alter database open resetlogs;
lsnrctl stop
lsnrctl start

10.生成EM

posted @ 2021-11-26 11:10  monkey6  阅读(279)  评论(0编辑  收藏  举报