#########原来的##################
SQL> select dbid from v$database;
DBID
----------
1490502756
SQL> select name from v$database;
NAME
---------
ORCL
推荐在nid修改数据库name和DBID之前进行全库备份,最好是冷备
修改过程:
1. 数据库重启到mount
2. 指定参数
[oracle@dongsc2 ~]$ nid -help
DBNEWID: Release 11.2.0.4.0 - Production on Thu Dec 14 15:07:12 2017
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
Keyword Description (Default)
----------------------------------------------------
TARGET Username/Password (NONE)
DBNAME New database name (NONE)
LOGFILE Output Log (NONE)
REVERT Revert failed change NO
SETNAME Set a new database name only NO
APPEND Append to output log NO
HELP Displays these messages NO
3. 修改
[oracle@dongsc2 ~]$ nid TARGET=sys/oracle DBNAME=dongsc LOGFILE=nid_1214.log
4. 看输出
提示所有的redo已经不能用了
提示需要修改参数文件,创建新的密码文件
SQL> select dbid,name from v$database;
DBID NAME
---------- ---------
3893510668 DONGSC
5. 修改参数文件,创建密码文件
*.audit_file_dest='/u01/app/oracle/admin/orcl/adump'
*.audit_trail='db'
*.compatible='11.2.0.4.0'
*.control_files='/u01/app/oracle/oradata/ORCL/controlfile/o1_mf_f347m4sd_.ctl'
*.db_block_size=8192
*.db_create_file_dest='/u01/app/oracle/oradata'
*.db_domain=''
*.db_name='
dongsc'
*.diagnostic_dest='/u01/app/oracle'
*.dispatchers='(PROTOCOL=TCP) (SERVICE=orclXDB)'
*.instance_name='
dongsc'
*.log_archive_dest_1='LOCATION=/archivelog'
*.log_archive_format='%t_%s_%r.dbf'
*.open_cursors=300
*.pga_aggregate_target=102760448
*.processes=100
*.remote_login_passwordfile='EXCLUSIVE'
*.sessions=115
*.sga_target=308281344
*.undo_tablespace='UNDOTBS1'
注意修改环境变量的sid,和修改spfiledongsc.ora ,否则重启之后,smon依旧是orcl
生成orapwd
[oracle@dongsc2 dbs]$ orapwd file=orapwdongsc password=oracle
使用PLSQL DEV测试能够正常登陆.