1、关闭数据库启动到mout
SQL> shut immediate Database closed. Database dismounted. ORACLE instance shut down. SQL> SQL> startup mount ORACLE instance started. Total System Global Area 3.5568E+10 bytes Fixed Size 37245408 bytes Variable Size 4294967296 bytes Database Buffers 3.1139E+10 bytes Redo Buffers 96968704 bytes Database mounted.
2、备份spfile
create pfile='/home/oracle/pfile0412' from spfile;
3、nid修改数据库实例
nid target=sys/oracle DBNAME=ncctest LOGFILE=/home/oracle/nid.log
cat nid.log DBNEWID: Release 19.0.0.0.0 - Production on Fri Apr 12 16:58:49 2024 Copyright (c) 1982, 2019, Oracle and/or its affiliates. All rights reserved. Connected to database ORCL (DBID=1689820245) Connected to server version 19.18.0 Control Files in database: /oracle/ORCL/control01.ctl /oracle/ORCL/control02.ctl Changing database ID from 1689820245 to 2514432329 Changing database name from ORCL to NCCTEST Control File /oracle/ORCL/control01.ctl - modified Control File /oracle/ORCL/control02.ctl - modified Datafile /oracle/ORCL/system01.db - dbid changed, wrote new name Datafile /oracle/ORCL/nnc_index001.db - dbid changed, wrote new name Datafile /oracle/ORCL/sysaux01.db - dbid changed, wrote new name Datafile /oracle/ORCL/undotbs01.db - dbid changed, wrote new name Datafile /oracle/ORCL/nnc_data001.db - dbid changed, wrote new name Datafile /oracle/ORCL/users01.db - dbid changed, wrote new name Datafile /oracle/ORCL/nnc_data002.db - dbid changed, wrote new name Datafile /oracle/ORCL/nnc_data003.db - dbid changed, wrote new name Datafile /oracle/ORCL/nnc_data004.db - dbid changed, wrote new name Datafile /oracle/ORCL/nnc_index002.db - dbid changed, wrote new name Datafile /oracle/ORCL/undotbs02.db - dbid changed, wrote new name Datafile /oracle/ORCL/nnc_data005.db - dbid changed, wrote new name Datafile /oracle/ORCL/nnc_data006.db - dbid changed, wrote new name Datafile /oracle/ORCL/nnc_data007.db - dbid changed, wrote new name Datafile /oracle/ORCL/nnc_data008.db - dbid changed, wrote new name Datafile /oracle/ORCL/nnc_data009.db - dbid changed, wrote new name Datafile /oracle/ORCL/nnc_data010.db - dbid changed, wrote new name Datafile /oracle/ORCL/nnc_data011.db - dbid changed, wrote new name Datafile /oracle/ORCL/nnc_data012.db - dbid changed, wrote new name Datafile /oracle/ORCL/nnc_data013.db - dbid changed, wrote new name Datafile /oracle/ORCL/nnc_data014.db - dbid changed, wrote new name Datafile /oracle/ORCL/nnc_data015.db - dbid changed, wrote new name Datafile /oracle/ORCL/nnc_data016.db - dbid changed, wrote new name Datafile /oracle/ORCL/nnc_data017.db - dbid changed, wrote new name Datafile /oracle/ORCL/nnc_data018.db - dbid changed, wrote new name Datafile /oracle/ORCL/nnc_index003.db - dbid changed, wrote new name Datafile /oracle/ORCL/nnc_index004.db - dbid changed, wrote new name Datafile /oracle/ORCL/nnc_index005.db - dbid changed, wrote new name Datafile /oracle/ORCL/temp01.db - dbid changed, wrote new name Datafile /oracle/ORCL/temp02.db - dbid changed, wrote new name Control File /oracle/ORCL/control01.ctl - dbid changed, wrote new name Control File /oracle/ORCL/control02.ctl - dbid changed, wrote new name Instance shut down Database name changed to NCCTEST. Modify parameter file and generate a new password file before restarting. Database ID for database NCCTEST changed to 2514432329. 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.
4、修改pfile
使用vi %s#orcl#ncctest
5、修改.bash_profile
修改oracle_sid
################OracleBegin#########################
umask 022
export TMP=/tmp
export TMPDIR=$TMP
export ORACLE_BASE=/oracle
export ORACLE_HOME=$ORACLE_BASE/product/19.3.0/db
export ORACLE_SID=ncctest
export PATH=/usr/sbin:$PATH
export PATH=$ORACLE_HOME/bin:$ORACLE_HOME/OPatch:$PATH
#export NLS_LANG=AMERICAN_AMERICA.AL32UTF8
#export NLS_LANG=AMERICAN_AMERICA.ZHS16GBK
export LANG=en_US.UTF-8
export PS1=`hostname`'<$PWD>$'
export CV_ASSUME_DISTID=RHEL7.6
################OracleEnd#########################
source .bash_profile
6、启动数据库
SQL> startup pfile='/home/oracle/pfile0412'; ORACLE instance started. Total System Global Area 3.5568E+10 bytes Fixed Size 37245408 bytes Variable Size 4294967296 bytes Database Buffers 3.1139E+10 bytes Redo Buffers 96968704 bytes Database mounted. ORA-01589: must use RESETLOGS or NORESETLOGS option for database open SQL> alter database open NORESETLOGS; alter database open NORESETLOGS * ERROR at line 1: ORA-01588: must use RESETLOGS option for database open SQL> alter database open RESETLOGS; Database altered.
7、创建密码文件
orapwd file=$ORACLE_HOME/dbs/orapworcl password=oracle entries=5 force=y format=12
标签:name,dbid,changed,nid,ORCL,实例,oracle,new From: https://www.cnblogs.com/omsql/p/18131764