nid修改oracle11gR2数据库名
2012-02-07 15:13 java环境变量 阅读(219) 评论(0) 编辑 收藏 举报
1.查看数据库信息
show parameter instance_name
show parameter db_name
show parameter service_name
select dbid from v$database;
2.正常关闭数据库
sqlplus / as sysdba
SQL>shutdown immediate
3.启动数据库到mount模式
SQL>startup mount
4.确认LISTENER是启动的
lsnrctl status
5.修改数据库名
host nid target=sys/password dbname=ocp setname=y
# Change database ID and database name ORATEST to TEST? (Y/[N]) => y
6.修改参数文件
shutdown immediate
startup nomount;
create pfile='E:\app\Administrator\admin\test\pfile\initocp.ora' from spfile;
将参数文件:
E:\app\Administrator\admin\test\pfile\initocp.ora中:
db_domain=""
db_name=ocp
shutdown immediate
7.重设密码文件
host orapwd file=E:\app\Administrator\product\11.2.0\dbhome_1\database\PWDocp.ora password=password entries=5
-----windows平台需要8.9两步-----
8.重新创建服务
更改instance_name
net stop OracleServiceTEST
oradim -delete -sid test
oradim -new -sid ocp -STARTMODE auto -SRVCSTART system
9.修改注册表SID
HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE\KEY_OraDb11g_home1\ORACLE_SID
值修改为ocp
10.启动数据库
sqlplus / as ysdba
startup pfile='E:\app\Administrator\admin\test\pfile\initocp.ora'
select dbid,name from v$database;
11.新建spfile
create spfile from pfile='E:\app\Administrator\admin\test\pfile\initocp.ora';
12.重新加载监听文件
lsnrctl reload