oracle 9i修改DBID_和DBNAME总结

整理文档很辛苦,赏杯茶钱您下走!

免费阅读已结束,点击下载阅读编辑剩下 ...

阅读已结束,您可以下载文档离线阅读编辑

资源描述

9I修改DBID和DBNAME总结原创作者:XIE30009I修改DBID和DBNAME总结:(一)说明:环境:9I(9201)+WINDOWS2000使用工具:NID(装数据库时已经装上拉直接用就可以)参考(二)修改步骤(1).进行数据库完全备份以防万一修改失败(2).将数据库正常关闭然后MOUNTSQLconnect/assysdba已连接。SQLSHUTDOWNIMMEDIATESQLSTARTUPMOUNT(3).运行NID指定一个具有SYSDBA权限的ORACLE用户C:\NIDTARGET=SYS/SYSYTMFDBNAME=O9201NEW注:改变DBID,新DBID值由工具自动生成不用指定,O9201NEW是指定的新数据库NAME也可以用NIDTARGET=SYS/SYSYTMF@service_nameDBNAME=O9201NEW如果没有使用DBNAME参数则操作只改变DBID也可以用操作系统验证如:NIDTARTET=/(4).修改提示成功后正常关闭数据库SQLshutdownimmediate;ORA-01109:??????已经卸载数据库。ORACLE例程已经关闭。(5).创建密码文件(要求还用原来的密码文件名字PWDO9201.ORA如果生成PWDO9201NEW.ORA则提示错误:原来文件找不到)将原来的密码文件PWDO9201。ORA随便改个名字然后执行:c:\orapwdfile=f:\oracle\ora92\database\pwdo9201.orapassword=sysytmfenters=10确认是否成功生成密码文件(6),修改数据初始化参数文件中的DB_NAME为新的的DB_NAME(O9201NEW)SQLstartupnomount;ORACLE例程已经启动。TotalSystemGlobalArea135338868bytesFixedSize453492bytesVariableSize109051904bytesDatabaseBuffers25165824bytesRedoBuffers667648bytesSQLaltersystemsetdb_name=o9201newscope=spfile;系统已更改。(如果使用PFILE就手工修改相应值)(7)SQLshutdownimmediate;ORA-01507:??????ORACLE例程已经关闭。(8)startupSQLstartup;ORACLE例程已经启动。TotalSystemGlobalArea135338868bytesFixedSize453492bytesVariableSize109051904bytesDatabaseBuffers25165824bytesRedoBuffers667648bytes数据库装载完毕。ORA-01589:要打开数据库则必须使用RESETLOGS或NORESETLOGS选项(9)用RESETLOGS模式OPEN数据库(如果没有修改DBNAME就不必用RESETLOGS选项)SQLalterdatabaseopenresetlogs;数据库已更改。SQLselectdbid,namefromv$database;DBIDNAME-------------------3677577861O9201NEW已选择1行。xie3000上传了这个图片:OraclebyExamplemodule(OTN)ChangingYourDatabaseNameandDatabaseIdentifierPurposeThismoduledescribeshowyoucanchangethenameofyourdatabaseandyourdatabaseidentifier.TopicsThismodulediscussesthefollowing:OverviewOracle9iRelease2:UsingtheDBNEWIDUtilityChangingYourDatabaseIdentifier(DBID)OnlyChangingYourDatabaseName(DBNAME)OnlyChangingBothYourDatabaseNameandDatabaseIdentifierOracle9iRelease1andEarlier:ChangingYourDatabaseNameViewingScreenshotsMoveyourmouseoverthisicontoshowallscreenshots.Youcanalsomoveyourmouseovereachindividualicontoseeonlythescreenshotassociatedwithit.OverviewBacktoListofTopicsInthislessonyouwilllearnhowtochangethenameofyourdatabase.IfyouareusingOracle9iDatabaseRelease2oralaterreleaseofOracleDatabase,youcanusetheDBNEWIDdatabaseutilitytochangethedatabasename(DBNAME)andtheinternaldatabaseidentifier(DBID)foranoperationaldatabase.IfyouareusingareleasepriortoOracle9iDatabaseRelease2,youcanchangethedatabasename(DBNAME)byre-creatingthecontrolfile.RefertotheappropriatesectionbelowdependingonthereleaseofOracleyouareusing:UsingtheDBNEWIDUtilitytoChangetheDatabaseNameChangingtheDatabaseNameNote:OracleCorporationrecommendsthatyourdatabasenameandORACLE_SIDbesettothesamevalueinasingleinstanceenvironment.Oracle9iRelease2:UsingtheDBNEWIDUtilityBacktoListofTopicsYoucanusetheDBNEWIDdatabaseutilitytochangetheinternaldatabaseidentifier(DBID)andthedatabasename(DBNAME)foranoperationaldatabase.TheDBNEWIDdatabaseutilityisavailablewithOracle9iDatabaseRelease2.PriortotheintroductionoftheDBNEWIDutility,youcouldmanuallycreateacopyofadatabaseandgiveitanewdatabasename(DBNAME)byre-creatingthecontrolfile.However,youcouldnotgivethedatabaseanewidentifier(DBID).TheDBIDisaninternal,uniqueidentifierforadatabase.BecauseRecoveryManager(RMAN)distinguishesdatabasesbyDBID,youcouldnotregisteraseeddatabaseandamanuallycopieddatabasetogetherinthesameRMANrepository.TheDBNEWIDutilitysolvesthisproblembyallowingyoutochangeanyofthefollowing:OnlytheDBIDofadatabaseOnlytheDBNAMEofadatabaseBoththeDBNAMEandDBIDofadatabaseWhentheDBIDofadatabaseischanged,allpreviousbackupsandarchivedlogsofthedatabasebecomeunusable.AfteryouchangetheDBID,youmustopenthedatabasewiththeRESETLOGSoption.Thisre-createstheonlineredologfilesandresetstheirsequenceto1.Consequently,youshouldmakeabackupofthewholedatabaseimmediatelyafterchangingtheDBID.ChangingtheDBNAMEwithoutchangingtheDBIDdoesnotrequireyoutoopenwiththeRESETLOGSoption,sodatabasebackupsandarchivedlogsarenotinvalidated.However,changingtheDBNAMEdoeshaveconsequences.YoumustchangetheDB_NAMEinitializationparameterafteradatabasenamechangetoreflectthenewname.Also,youmayhavetore-createtheOraclepasswordfile.Ifyourestoreanoldbackupofthecontrolfile(beforethenamechange),thenyoushouldusetheinitializationparameterfileandpasswordfilefrombeforethedatabasenamechange.ChangingYourDatabaseIdentifier(DBID)OnlyBacktoListofTopicsYoucanchangetheDBIDbycompletingthefollowingsteps:1.Makeawholedatabasebackup.2.InvokeSQL*PlusandconnectasauserwithSYSDBAprivileges.3.IssuethefollowingquerytodeterminethecurrentDBID:SELECTdbid,nameFROMv$database;4.ShutdowntheinstanceusingtheNORMAL,IMMEDIATE,orTRANSACTIONALoptions:SHUTDOWNIMMEDIATE5.Starttheinstanceandmountthedatabase,specifyingtheparameterfileifyouarenotusingaserverparameterfileorthetextinitializationparameterfileisnotinthedefaultlocation:STARTUPMOUNT6.InvoketheDBNEWIDutilityonthecommandline,specifyingavaliduserwiththeSYSDBAprivilege.TheDBNEWIDutilityperformsvalidationsoftheheadersofthedatafilesandcontrolfiles

1 / 17
下载文档,编辑使用

©2015-2020 m.777doc.com 三七文档.

备案号:鲁ICP备2024069028号-1 客服联系 QQ:2149211541

×
保存成功