ORACLE RAC数据库修改名称
1.关闭一个实例
[oracle@rac11g2~]$sqlplus/assysdbaSQL>shutdownimmediate;
2.备份spfile文件
SQL>createpfile='/home/oracle/acct1.pfile'fromspfile;
3.修改pfile文件cluster_database为false
*.cluster_database=FALSE
4.使用pfile文件,启动单实例数据库到mount状态
SQL>startupmountpfile='/home/oracle/acct1.pfile';
5.执行nid修改dbname
[oracle@rac11g1~]$nidtarget=sys/oracledbname=crmdbsetname=yDBNEWID:Release11.2.0.4.0-ProductiononTueMay1909:31:482015Copyright(c)1982,2011,Oracleand/oritsaffiliates.Allrightsreserved.ConnectedtodatabaseACCT(DBID=3809824099)Connectedtoserverversion11.2.0ControlFilesindatabase:+DATA_DG/acct/controlfile/current.261.872692963+DATA_DG/acct/controlfile/current.260.872692963ChangedatabasenameofdatabaseACCTtoCRMDB?(Y/[N])=>YProceedingwithoperationChangingdatabasenamefromACCTtoCRMDBControlFile+DATA_DG/acct/controlfile/current.261.872692963-modifiedControlFile+DATA_DG/acct/controlfile/current.260.872692963-modifiedDatafile+DATA_DG/acct/datafile/system.256.87269284-wrotenewnameDatafile+DATA_DG/acct/datafile/sysaux.257.87269284-wrotenewnameDatafile+DATA_DG/acct/datafile/undotbs1.258.87269284-wrotenewnameDatafile+DATA_DG/acct/datafile/users.259.87269284-wrotenewnameDatafile+DATA_DG/acct/datafile/example.267.87269300-wrotenewnameDatafile+DATA_DG/acct/datafile/undotbs2.268.87269351-wrotenewnameDatafile+DATA_DG/acct/tempfile/temp.266.87269298-wrotenewnameControlFile+DATA_DG/acct/controlfile/current.261.872692963-wrotenewnameControlFile+DATA_DG/acct/controlfile/current.260.872692963-wrotenewnameInstanceshutdownDatabasenamechangedtoCRMDB.Modifyparameterfileandgenerateanewpasswordfilebeforerestarting.Succesfullychangeddatabasename.DBNEWID-Completedsuccesfully.
6.修改ORACLE_SID信息
------节点1------
6.1环境变量
[oracle@rac11g1~]$vi.bash_profileexportORACLE_SID=crmdb1
6.2口令文件
[oracle@rac11g1~]$cd$ORACLE_HOME/dbs[oracle@rac11g1dbs]$orapwdfile=orapwcrmdb1password=oracle
6.3修改pfile文件启动数据库
*.cluster_database=TRUE*.db_name='crmdb'替换acct1为crmdb1:%s/acct1/crmdb1/g替换acct2为crmdb2:%s/acct2/crmdb2/g
6.4创建新的spfile参数文件
[oracle@rac11g1~]$sqlplus/assysdbaSQL>startuppfile='/home/oracle/acct1.pfile'nomount;SQL>createspfile='+DATA_DG'frompfile='/home/oracle/acct1.pfile';
6.5创建pfile参数文件
[oracle@rac11g1~]$cd$ORACLE_HOME/dbs[oracle@rac11g1dbs]$viinitcrmdb1.oraSPFILE='+DATA_DG/crmdb/PARAMETERFILE/spfile.293.880105913'
------节点2------
1环境变量
[oracle@rac11g2~]$vi.bash_profileexportORACLE_SID=crmdb2
2.口令文件
[oracle@rac11g2~]$cd$ORACLE_HOME/dbs[oracle@rac11g2dbs]$orapwdfile=orapwcrmdb2password=oracle
3.参数文件
[oracle@rac11g2dbs]$viinitcrmdb2.oraSPFILE='+DATA_DG/crmdb/PARAMETERFILE/spfile.293.880105913'
7.修改crs资源
7.1删除旧实例配置
[oracle@rac11g1~]$srvctlremovedatabase-dacct
7.2添加新实例配置
[oracle@rac11g1~]$srvctladddatabase-dcrmdb-o/oracle/app/oracle/product/11.2.0/db_1/[oracle@rac11g1~]$srvctladdinstance-dcrmdb-icrmdb1-nrac11g1[oracle@rac11g1~]$srvctladdinstance-dcrmdb-icrmdb2-nrac11g2
声明:本站所有文章资源内容,如无特殊说明或标注,均为采集网络资源。如若本站内容侵犯了原著者的合法权益,可联系本站删除。