Change Oracle Database Name and DBID with NID utility
--close database with immediate
SHUTDOWN IMMEDIATE
STARTUP MOUNT
--run "nid" command. end process of nid command database will be shutdown.
nid target=sys/oracle@RADB dbname=TSH2
--change db_name to new name in pfile
db_name =TSH2
--create a password file for new ORACLE_SID
orapwd file=D:\oracle\product\11.1.0\db_1\database\pwdTSH2.ora password=oracle entries=10
--if os windows delete old service.
oradim -delete -SID RADB
--if os windows add service for new ORACLE_SID
oradim -new -SID TSH2
-- listener reload
lsnrctl reload
--open database with resetlogs
STARTUP MOUNT
--if you want, you can rename database and redo file's name.
set linesize 200
select 'alter database rename file '''||name ||''' to '''||replace(name, 'ORATST','ORCL') ||''';' from v$datafile;
select 'alter database rename file '''||name ||''' to '''||replace(name, 'ORATST','ORCL') ||''';' from v$tempfile;
select 'alter database rename file '''||member||''' to '''||replace(member, 'ORATST','ORCL')||''';' from v$logfile;
ALTER DATABASE OPEN RESETLOGS;
Hiç yorum yok:
Yorum Gönder