- bdump로 $ORACLE_BASE/diag/rdbms/cubjin 이 아니라 oracub으로 되어 있었고,
- DIAGNOSTIC_DEST는
<diagnostic_dest>/diag/rdbms/<dbname>/<instname>
인데 oracub으로 되어있었다.- sid와 db_name이 맞지 않았다
17:00:40 SQL> show parameter db_name
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
db_name string ORACUB
17:00:44 SQL> !echo $ORACLE_SID
CUBJIN
1. Database의 유효한 cold/hot backup이 있는지 확인한다.
[root@cubjin4 script]# cat fbackup.scr
run {
allocate channel ch1 type disk format '/BSJ/BACKUP/%U_%T';
backup database plus archivelog delete input;
release channel ch1;
}
$ nohup rman target / cmdfile='fbackup.scr' > rman.log 2>&1 &
2. export ORACLE_HOME=경로
3. cd $ORACLE_HOME/bin
4. dbconsole(EMCA) 삭제
5. database를 mount상태로 한다.
6. TNS를 사용해서 데이터베이스에 접속해야할 경우에는 tnsnames.ora에 DB_OLD가 지정되고, LISTENER가 기동되어 있는 것을 확인한다.
7. nid target, setname 파라미터
nid TARGET=sys/<password>[@<service>선택] DBNAME=<새로운 db명>
[oracle@cubjin4 20250302-18:03:01]:CUBJIN:[/u01/app/oracle/product/19c/dbhome_1/bin]
$ nid target=sys/baeseojin DBNAME=CUBJIN
DBNEWID: Release 19.0.0.0.0 - Production on Sun Mar 2 18:03:16 2025
Copyright (c) 1982, 2019, Oracle and/or its affiliates. All rights reserved.
Connected to database ORACUB (DBID=1372511915)
Connected to server version 19.20.0
Control Files in database:
/u02/oradata/ORACUB/control01.ctl
/u02/oradata/ORACUB/control02.ctl
Change database ID and database name ORACUB to CUBJIN? (Y/[N]) => y
Proceeding with operation
Changing database ID from 1372511915 to 332146788
Changing database name from ORACUB to CUBJIN
Control File /u02/oradata/ORACUB/control01.ctl - modified
Control File /u02/oradata/ORACUB/control02.ctl - modified
Datafile /u02/oradata/ORACUB/system01.db - dbid changed, wrote new name
Datafile /u02/oradata/ORACUB/sysaux01.db - dbid changed, wrote new name
Datafile /u02/oradata/ORACUB/undotbs01.db - dbid changed, wrote new name
Datafile /u02/oradata/ORACUB/users01.db - dbid changed, wrote new name
Datafile /u02/oradata/ORACUB/soe.db - dbid changed, wrote new name
Datafile /u02/oradata/ORACUB/sh.db - dbid changed, wrote new name
Datafile /u02/oradata/ORACUB/tcpd.db - dbid changed, wrote new name
Datafile /u02/oradata/ORACUB/tpcdidx.db - dbid changed, wrote new name
Datafile /u02/oradata/ORACUB/tcph.db - dbid changed, wrote new name
Datafile /u02/oradata/ORACUB/tpch.db - dbid changed, wrote new name
Datafile /u02/oradata/ORACUB/soe2.db - dbid changed, wrote new name
Datafile /u02/oradata/ORACUB/move.db - dbid changed, wrote new name
Datafile /u02/oradata/ORACUB/json.db - dbid changed, wrote new name
Datafile /u02/oradata/ORACUB/hr.db - dbid changed, wrote new name
Datafile /u02/oradata/ORACUB/temp01.db - dbid changed, wrote new name
Control File /u02/oradata/ORACUB/control01.ctl - dbid changed, wrote new name
Control File /u02/oradata/ORACUB/control02.ctl - dbid changed, wrote new name
Instance shut down
Database name changed to CUBJIN.
Modify parameter file and generate a new password file before restarting.
Database ID for database CUBJIN changed to 332146788.
All previous backups and archived redo logs for this database are unusable.
Database has been shutdown, open database with RESETLOGS option.
Succesfully changed database name and ID.
DBNEWID - Completed succesfully.
DBNEWID 유틸리티는 파일로의 I/O를 테스트 하기 전에, 데이터파일과 controlfile의 header의 검증을 실행한다.
- 검증이 성공한 경우에, 명령어를 확인하도록 요구된다.(log file을 지정할 경우, prompt가 표시되지 않는다.)
- offline 읽기 전용 데이터파일을 포함한 데이터파일의 DBID(및 이러한 예처럼 지정한 경우 DBNAME)을 변경하고, 데이터베이스를 shutdown한 후 그 다음 종료한다.
startup mount;
8:07:36 SQL> startup mount;
ORACLE instance started.
Total System Global Area 1.0737E+10 bytes
Fixed Size 8936504 bytes
Variable Size 1577058304 bytes
Database Buffers 9126805504 bytes
Redo Buffers 24616960 bytes
ORA-01103: database name 'CUBJIN' in control file is not 'ORACUB'
$ tail -f alert*.log
Changing di2dbun from ORACUB to CUBJIN
.... (PID:47071): Redo network throttle feature is disabled at mount time
2025-03-02T18:14:39.156301+09:00
Successful mount of redo thread 1, with mount id 332135435
2025-03-02T18:14:39.156676+09:00
Database mounted in Exclusive Mode
Lost write protection disabled
.... (PID:47071): Using STANDBY_ARCHIVE_DEST parameter default value as /u02/ARCH [krsd.c:18301]
Create Relation IPS_PACKAGE_UNPACK_HISTORY
Completed: ALTER DATABASE MOUNT
2025-03-02T18:15:08.055876+09:00
TMON (PID:47070): STARTING ARCH PROCESSES
Starting background process ARC0
2025-03-02T18:15:08.065010+09:00
ARC0 started with pid=36, OS id=47088
Starting background process ARC1
2025-03-02T18:15:08.075283+09:00
ARC1 started with pid=39, OS id=47090
Starting background process ARC2
2025-03-02T18:15:08.085651+09:00
ARC2 started with pid=40, OS id=47092
Starting background process ARC3
2025-03-02T18:15:08.094642+09:00
ARC3 started with pid=41, OS id=47094
TMON (PID:47070): ARC0: Archival started
TMON (PID:47070): ARC1: Archival started
TMON (PID:47070): ARC2: Archival started
2025-03-02T18:15:08.094888+09:00
ARC0 (PID:47088): Becoming a 'no FAL' ARCH
ARC0 (PID:47088): Becoming the 'no SRL' ARCH
2025-03-02T18:15:08.104980+09:00
TMON (PID:47070): ARC3: Archival started
TMON (PID:47070): STARTING ARCH PROCESSES COMPLETE
2025-03-02T18:15:08.115818+09:00
TT00 (PID:47096): Gap Manager starting
2025-03-02T18:15:18.363735+09:00
alter database open resetlogs
2025-03-02T18:15:18.370349+09:00
RESETLOGS after complete recovery through change 5579333
Resetting resetlogs activation ID 1372543403 (0x51cf59ab)
2025-03-02T18:15:29.913578+09:00
Setting recovery target incarnation to 2
2025-03-02T18:15:29.924999+09:00
Smart fusion block transfer is disabled:
instance mounted in exclusive mode.
Endian type of dictionary set to little
2025-03-02T18:15:29.935494+09:00
Assigning activation ID 332135435 (0x13cbfc0b)
Redo log for group 1, sequence 1 is not located on DAX storage
Thread 1 opened at log sequence 1
Current log# 1 seq# 1 mem# 0: /u02/oradata/ORACUB/redo01.log
Successful open of redo thread 1
2025-03-02T18:15:30.002595+09:00
MTTR advisory is disabled because FAST_START_MTTR_TARGET is not set
Stopping change tracking
Undo initialization recovery: Parallel FPTR complete: start:246106294 end:246106296 diff:2 ms (0.0 seconds)
Undo initialization recovery: err:0 start: 246106294 end: 246106296 diff: 2 ms (0.0 seconds)
[47078] Successfully onlined Undo Tablespace 2.
Undo initialization online undo segments: err:0 start: 246106296 end: 246106347 diff: 51 ms (0.1 seconds)
Undo initialization finished serial:0 start:246106294 end:246106352 diff:58 ms (0.1 seconds)
Dictionary check beginning
Dictionary check complete
Database Characterset is AL32UTF8
No Resource Manager plan active
joxcsys_required_dirobj_exists: directory object exists with required path /u01/app/oracle/product/19c/dbhome_1/javavm/admin/, pid 47078 cid 0
replication_dependency_tracking turned off (no async multimaster replication found)
LOGSTDBY: Validating controlfile with logical metadata
2025-03-02T18:15:30.934931+09:00
LOGSTDBY: Validation complete
Starting background process AQPC
2025-03-02T18:15:30.950920+09:00
AQPC started with pid=45, OS id=47108
2025-03-02T18:15:31.031556+09:00
Global Name changed to CUBJIN
Starting background process CJQ0
2025-03-02T18:15:31.348491+09:00
CJQ0 started with pid=53, OS id=47144
Control autobackup written to DISK device
handle '/u01/app/oracle/product/19c/dbhome_1/dbs/c-332146788-20250302-01'
Completed: alter database open resetlogs
18:25:45 SQL> select NAME from v$database;
NAME
---------
CUBJIN
8. pfile/spfile DB_NAME 변경
[oracle@cubjin4 20250302-18:23:46]:CUBJIN:[/u01/app/oracle/product/19c/dbhome_1/dbs]
$ vi initCUBJIN.ora
ORACUB.__data_transfer_cache_size=0
ORACUB.__db_cache_size=8925478912
ORACUB.__inmemory_ext_roarea=0
ORACUB.__inmemory_ext_rwarea=0
ORACUB.__java_pool_size=0
ORACUB.__large_pool_size=33554432
ORACUB.__oracle_base='/u01/app/oracle'#ORACLE_BASE set from environment
ORACUB.__pga_aggregate_target=1073741824
ORACUB.__sga_target=10737418240
ORACUB.__shared_io_pool_size=134217728
ORACUB.__shared_pool_size=1543503872
ORACUB.__streams_pool_size=67108864
ORACUB.__unified_pga_pool_size=0
*.audit_file_dest='/u01/app/oracle/admin/ORACUB/adump'
*.audit_trail='db'
*.compatible='19.0.0'
*.control_files='/u02/oradata/ORACUB/control01.ctl','/u02/oradata/ORACUB/control02.ctl'
*.db_block_size=8192
*.db_name='CUBJIN'👈(ORACUB->CUBJIN)
*.diagnostic_dest='/u01/app/oracle'
*.dispatchers='(PROTOCOL=TCP) (SERVICE=ORACUBXDB)'
*.log_archive_dest_1='location=/u02/ARCH'
*.memory_max_target=0
*.memory_target=0
*.nls_language='AMERICAN'
*.nls_territory='AMERICA'
*.open_cursors=300
*.pga_aggregate_target=1024m
*.processes=320
*.remote_login_passwordfile='EXCLUSIVE'
*.service_names='CUBJIN👈(ORACUB->CUBJIN),ORAKID,ORACOW'
*.sga_target=10g
*.undo_tablespace='UNDOTBS1'
*.use_large_pages='only'