Oracle常见问题和解决办法

 

今天机房几个服务器之间IP冲突郁闷。随后Oracle也崩溃了找网上找到解决办法,收集以下相关的解决办法:无法启动监听器——Ora-12560错误1、控制面板–>管理工具–>服务下面的查看OracleOraHome92TNSListener服务有没有启动,如果没有启动则启动。2、把tnsnames.ora和listener.ora里面的HOST(等于机器名或者等于IP地址例如:HOST = springal)值一定要保持一致。3、多配置几次监听器然后启动尝试。4、DOS下lsnrctl命令进入监听器信息窗口,使用help查看命令帮助,然后使用相关命令查看监听器情况,并多次stop和start。5、查看注册表HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServicesOracleOraHome92TNSListener项并设置ImagePath>D:OracleOra92BINTNSLSNR(你的安装目录)6、查看你配置的监听器端口有没有被其他服务站用(默认的是1521端口),DOS下可以使用netstat –a查看。7、查看你的防火墙或者防病毒软件是否屏蔽掉了1521端口。8、据说还与你的系统有关系,重新安装一下windows 2000 SP3,这个问题通常与sp3有关系。Oracle启动时,监听器不启动或打开出错软件环境:1、Windows NT4.0+ORACLE 8.0.42、ORACLE安装路径为:C:ORANT错误现象:1、ORACLE启动时,监听器不启动或打开出错2、服务器端:用username/password登录正常,但用username/password@alias登录不成功3、客户端:用username/password@alias登录不成功解决方法:1、如果是因为修改了NT的机器名,则把listener.ora文件中的host参数全部改为新的NT机器名,重新启动OracleTNSListenr80服务即可。  例如:  LISTENER =  (ADDRESS_LIST =  (ADDRESS = (PROTOCOL = TCP)(Host = NT_Name)(Port = 1521))  (ADDRESS = (PROTOCOL = TCP)(Host = NT_Name)(Port = 1526))  )2、使用监听器实用程序:LSNRCTL80.exe3、检查监听器参数文件:c:orantNET80adminlistener.ora4、检查监听器日志文件:c:orantNET80loglistener.log5、Tnsnames.ora文件配置错误,重新配置。6、检查client 端 Tnsnames.ora在单机上安装805,OracleTNSListener80不能启动问题:我在win2000下安装了ORACLE805,有网卡,但是没有没有连网。解答:1.805必须联网,设置Microsoft loopback或使用816。直接把Listener的侦听地址设到127.0.0.1上试试看。2.把(PROTOCOL=ipc 和snmp)的配置删除,我是在win98下装的804,listener.ora配置如下:    LISTENER =   (ADDRESS_LIST =         (ADDRESS =           (PROTOCOL = TCP)           (Host = 192.168.1.4)           (Port = 1521)         )         (ADDRESS =           (PROTOCOL = TCP)           (Host = 127.0.0.1)           (Port = 1521)         )#被注释 (ADDRESS =# (PROTOCOL = SPX)# (Service = y_lsnr)# )   )STARTUP_WAIT_TIME_LISTENER = 0CONNECT_TIMEOUT_LISTENER = 10TRACE_LEVEL_LISTENER = ADMINSID_LIST_LISTENER =   (SID_LIST =     (SID_DESC =       (GLOBAL_DBNAME = y)       (SID_NAME = ORCL)     )     (SID_DESC =       (SID_NAME = extproc)       (PROGRAM=extproc)     )   )运行正常。ORA-12516 TNS:监听程序无法找到匹配的信息栈的可用句柄错误先打开 TNSNAMES.ORA 这个文件, (位于 //OraHome1/network/admin/tnsnames.ora) ,确定(INSTANCE_NAME=) 和 INITsid.ORA 文件中的 实例名(执行项次) 匹配ORA-12154 TNS不能解析服务名使用Oracle的网络配置助手“net configration assistant”删除所有的网络的配置(主要是监听程序的配置和本地网络服务名的配置),然后重新配置。可以使用如下命令察看是否你的数据库服务器已经启动(在 *** 作系统中的“服务”中显示为启动,但你的数据库并不一定启动了。在MS-Dos提示符下输入:C:svrmgrlSVRMGR:>connect to internal密码:<输入你的密码,如果不知道,输入ORACLE试试>如果连接成功,执行help可以察看命令。SVRMGR>startup如果提示你的数据库已经启动,则执行“stop”停止数据库,然后再执行“startup”启动。无法启动实例服务控制面板–>管理工具–>服务下面的查看OracleServiceTest服务有没有启动,如果没有启动则启动。如果启动时候报找不到路径,则查看注册表HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServicesOracleServiceTest项并设置 ImagePath>D:OracleOra92BINOracle.exe test(你的安装目录,参数为你的服务名)以上两则都可能是由于运行了注册表软件造成,比如优化大师之类,我个人的解决办法是在扫描注册表的时候略过HKEY_LOCAL_MACHINE。在Windows平台上,安装Oracle后产生如下服务OracleMTSRecoveryServiceOracleOraHome92AgentOracleOraHome92HTTPServerOracleOraHome92TNSListenerOracleServiceTest——以上为缺省配置为自动启动的OracleOraHome92ClientCacheOracleOraHome92PagingServerOracleOraHome92SNMPPeerEncapsulatorOracleOraHome92SNMPPeerMasterAgent设置自动启动数据库可通过修改注册表来实现:      hkey_local_machine->software->microsoft->windows->currentversion->run->添加一个键值Oraclestart->其值为:c:Oracleora81binoradim.exe -startup -sid 数据库别名 -usepwd Oracle -starttype inst在启动ORACLE服务时无法启动‘OracleOracleAgent’问题:提示错误如下:“在本地计算机无法启动OracleOracleAgent服务。错误:3221356559”原因:The Intelligent Agent stores all jobs and event requests in a series of queue files in the network/agent directory. Upon startup, the Agent compares the actual hostname of the server to the hostname stored in the queue files. If the hostname of the server changes, the Agent will not recognize the queue files and will consider them corrupt. Then, the Agent will not start.解答:1. Remove the services.ora and all “q” files (*.q) from the $Oracle_Homenetworkagent directory2. Re-start the Intelligent Agent.技巧:This fix should be done with the understanding that any jobs or events registered against that Agent will be lost. Any active jobs or registered events against this agent should be removed from OEM console before deleting the agent’s *.q files.ORA-01034: ORACLE not availableORA-27101: shared memory realm does not exist错误问题:刚刚装上Oracle8.1.7以后(安装过程非常正常),运行以下操作,一切正常。C:>sqlplus system/managerSQL*Plus: Release 8.1.7.0.0 – Production on 星期四 11月 13 20:01:20 2003(c) Copyright 2000 Oracle Corporation. All rights reserved.连接到:Oracle8i Enterprise Edition Release 8.1.7.0.0 – ProductionWith the Partitioning optionJServer Release 8.1.7.0.0 – ProductionSQL>但是只要重启电脑,再运行同样操作,就会出现如下的问题:C:>sqlplus system/managerSQL*Plus: Release 8.1.7.0.0 – Production on 星期四 11月 13 19:28:25 2003(c) Copyright 2000 Oracle Corporation. All rights reserved.ERROR:ORA-01034: ORACLE not availableORA-27101: shared memory realm does not exist此时查看Oracle进程,所占用内存不到10m。但是只要执行完Database Configuration Assistant–〉更改数据库设置后,再次执行如上操作,就能正常运行:此时Oracle进程占用内存接近100m,应该比较正常。但是只要重新启动,就会依然出现ERROR:ORA-01034: ORACLE not availableORA-27101: shared memory realm does not exist这种错误,只能用Database Configuration Assistant更改数据库设置后才能使用,重启后问题依旧。让我百思不得其解。解答:数据库实例没随计算机启动。1.数据库启动参数中是否有非PUBLIC回滚段! 要是有的话就先屏蔽掉,等创建完回滚段后重新打开,应该就没有问题了。当时在ORACLE 7下成功。当时我用原有的数据库配置参数(*.ORA)文件创建以后就出现了上面的问题。2.建议此时手动启动服务,观察如果出现缺少路径的提示,可以参照上文设定相关路径。ORA-12500: TNS: 监听程序无法启动专用服务器进程1.lsnrctl status2.lsnrctl start3.sqlplus /nolog4.connect / as sysdba5.startup nomount6.alter database open逐步分解查找问题。有可能是listener.ora文件被破坏了,遇到过类似的问题,重新配置listener.ora就可以了。ORA-04031:unable to allocate … byters of shared memory(“shared pool”,”unknown object”,”sga heap”,”db_block_buffers”)问题:DELL服务器装不上ORACLE8.1.5的问题,出现下面的错误提示是在建立数据库之前,系统先要检查内存时出现的,ORA-04031:unable to allocate 85141440 byters of shared memory(“shared pool”,”unknown object”,”sga heap”,”db_block_buffers”),是不是内存不够?但实际物理内存是2G?什么原因呢?解答:在安装时,把SGA区、JAVA池等东西的内存配小一些ORA-01092 : Oracle instance terminated disconnection forced错误Problem:Your Oracle Server database on OpenVMS crashes. The following errors are reported: Background process DBWR unexpectedly terminated with error 1092ORA-1092 Oracle instance terminatedORA-313 open failed for members of log group ‘n’ of thread ‘n’ORA-600 [3228] reported from a PL/SQL script.Explanation:The most significant error reported here is the ORA-313 error. This error indicates a failure to open a file which indicates a problem with OpenVMS resources. When either CHANNELCNT and/or FILLM are too small, these errors can result.Solution:  Increase the SYSGEN parameter CHANNELCNT. This should be done by an OpenVMS system manager and requires a reboot of your OpenVMS node. For more information on SYSGEN, please review the OpenVMS documentation.  If the CHANNELCNT parameter is already large enough to allow the expected number of files to be opened, check the FILLM quota. Review two areas when you check FILLM:1) The Oracle background processes (PMON, DBWR, LGWR etc.)2) The SERVER side (or SHADOW) process created when you use SVRMGRL to start the database. To get an idea of the quota available, use the command: $ SHOW PROCESS /QUOTA /ID= Where is the OpenVMS pid of the process to be reviewed. This command displays the remaining ‘Open file quota’ (FILLM) for the process, as well as other available quotas.Example:You have 226 data files, eight REDO log files and three control files for a total of 237 files. The SYSGEN setting for CHANNELCNT is at the default of 256. During normal operation, Oracle periodically needs to open additional files. These include the INIT parameter files, the ALERT log, various DCL scripts, trace files, etc. Under these conditions, a CHANNELCNT value of 256 is too small to accommodate the number of files that Oracle/OpenVMS needs open at the same time.For most systems the default quotas should be adequate.If not, please describe the infor u’ve encounteredORA-00059错误及字符集修改问题:在DBA studio中下的例程‘数据库’自动变为已启动,无法装载也无法打开,提示‘ORA-00059??LOG–FILES????’在这种情况下如果不卸载重装解决,能有其它的办法吗?一般来说ORA-00059多出现maximum number of DB_FILES exceeded的错误,由于你机器上的字符集设置有些问题,所以 错误提示 变成了??,(字符集设置不对照成的) 虽然看的出于问题可能和Log file有关,但不确定.请修改Oracle的字符集[字符集修改方法]SQL> desc props$列名 可空值否 类型——————————- ——– —-NAME NOT NULL VARCHAR2(30)VALUE$ VARCHAR2(2000)COMMENT$ VARCHAR2(2000)SQL> col value$ format a40SQL> select name,value$ from props$;NAME VALUE$—————————— ————————-DICT.BASE 2NLS_LANGUAGE AMERICANNLS_TERRITORY AMERICANLS_CURRENCY$NLS_ISO_CURRENCY AMERICANLS_NUMERIC_CHARACTERS.,NLS_DATE_FORMAT DD-MON-YYNLS_DATE_LANGUAGE AMERICANNLS_CHARACTERSET ZHS16GBKNLS_SORT BINARYNLS_CALENDAR GREGORIANNLS_RDBMS_VERSION 7.3.4.0.0GLOBAL_DB_NAME ORACLE.WORLDEXPORT_VIEWS_VERSION 3查询到14记录.NLS_CHARACTERSET这个参数应该是ZHS16GBK,如不是,改为它。ORA-12203:TNS:unable to connect destination错误问题:在Windows2000下安装8.0.5,选择none,没有建立实例,为什么在执行svrmgr30 时报告Ora-12203:tns:unable to connect destination!解答:因为没有创建实例,也就没有环境变量。可参考“手工创建数据库的全部脚本和说明”。注意其中:    set ORACLE_SID=test    D:OracleOra81binoradim -new -sid test -startmode manual -pfile “D:Oracleadmintestpfileinittest.ora”Ora-12571:TNS:包写入程序失败  把虚拟内存设的大一些Ora-12705错误Cause: There are two possible causes: Either an attempt was made to issue an ALTER SESSION statement with an invalid NLS parameter or value; or the NLS_LANG environment variable contains an invalid language, territory, or character set.Action: Check the syntax of the ALTER SESSION command and the NLS parameter, correct the syntax and retry the statement, or specify correct values in the NLS_LANG environment variable. For more information about the syntax of the ALTER SESSION command, see Oracle8i SQL Reference.ORA-03113:通信通道的文件结束Cause:An unexpected end-of-file was processed on the communication channel. The problem could not be handled by the SQL*Net, two task, software. This message could occur if the shadow two-task process associated with a SQL*Net connect has terminated abnormally, or if there is a physical failure of the interprocess communication vehicle, that is, the network or server machine went down.Action:If this message occurs during a connection attempt, check the setup files for the appropriate SQL*net driver and confirm SQL*Net software is correctly installed on the server. If the message occurs after a connection is well established, and the error is not due to a physical failure, check if a trace file was generated on the server at failure time. Existence of a trace file may suggest an Oracle internal error that requires the assistance of customer support.Explanation:There are numerous causes of this error. It is a ‘catch all’ type error which means ‘I cannot communicate with the Oracle shadow process’. This usually occurs when the Oracle server process has died for some reason.ORA-12515:TNS:监听进程无法找到该演示文稿的句柄解决方案是检查目标服务器网络配置,并使其接受HTTP的协议。如果你是使用一般数据使用,建议使用新的数据库实例。ORA-01031:insufficient privilegesCause: An attempt was made to change the current username or password without the appropriate privilege. This error also occurs if attempting to install a database without the necessary operating system privileges. When Trusted Oracle is configure in DBMS MAC, this error may occur if the user was granted the necessary privilege at a higher label than the current login.Action: Ask the database administrator to perform the operation or grant the required privileges. For Trusted Oracle users getting this error although granted the appropriate privilege at a higher label, ask the database administrator to regrant the privilege at the appropriate label.ORA-01017:invalid username/password; logon deniedCause: An invalid username or password was entered in an attempt to log on to Oracle. The username and password must be the same as was specified in a GRANT CONNECT statement. If the username and password are entered together, the format is: username/password.Action: Enter a valid username and password combination in the correct format.问题:ORACLE8.1.7.0.0版本,,不知是哪里的问题,用internal 和 system 都无法登陆,错误提示:ORA1031 、ORA1017解答:还有没有其他DBA身份的用户,如果有,最好登陆进去,然后alter user system identified by YOURPASSWORD; 你的系统密码被人修改了ORA-03121:没连接接口驱动程序Cause: This message occurs usually because the Net8 driver is not loaded into memory or there is a mismatch of the version of the driver. A user program linked with an obsolete library may also cause this message. Only programs provided by Oracle Corporation should use this interface.Action: If the message occurred during use of a program provided by Oracle Corporation, contact Oracle Support Services. If a user program caused the message, relink the program with current versions of the Oracle libraries.ORA-12638:凭证检索失败问题:2000ad server SP2 具域网,在网络连接的情况下按装ORACLE8I,到创建数据库,初始化数据库时,提示“ORA-12638 凭证检索失败”,装了几次都是这样解答:凭证检索失败的错误一般都与网络用户集成有关,ORACLE中对于这个问题的管理是在SQLNET.ORA文件的SQLNET.AUTHENTICATION_SERVICES进行控制的,默认安装都是SQLNET.AUTHENTICATION_SERVICES= (NTS)表示安装ORACLE的用户是通过操作系统的集成认证控制的,所以,我们只要把这个参数值屏蔽掉就行了。修改OracleOra81networkADMIN目录下SQLNET.ORA文件的SQLNET.AUTHENTICATION_SERVICES= (NTS)为# SQLNET.AUTHENTICATION_SERVICES= (NTS)ORA-00604: error occurred at recursive SQL level 2Cause: An error occurred while processing a recursive SQL statement (a statement applyingto internal dictionary tables).Action: If the situation described in the next error on the stack can be corrected, doso; otherwise contact Oracle Customer Support.ORA-04030 out of process memory when trying to allocate string bytes (string,string)Cause: Operating system process private memory has been exhausted.Action: See the database administrator or operating system administrator to increase process memory quota. There may be a bug in the application that causes excessive allocations of process memory space.ORA-04031:unable to allocate string bytes of shared memory(“string”,”string”,”string”,”string”)Cause: More shared memory is needed than was allocated in the shared pool.Action: If the shared pool is out of memory, either use the DBMS_SHARED_POOL package topin large packages, reduce your use of shared memory, or increase the amount ofavailable shared memory by increasing the value of the initialization parametersSHARED_POOL_RESERVED_SIZE and SHARED_POOL_SIZE. If the large pool is out of memory,increase the initialization parameter LARGE_POOL_SIZE.ORA-01555:snapshot too old: rollback segment number 9 with name “USER_RS5″ too small问题:一个存储过程执行的数据大概有100万条,在执行到几十万条的时候,遇到了如上异常。解答:原因有两个方面:1、由于你的这个操作执行的时间太长,导致SNAP SHOT失效(太老了),导致你的操作失败;2、你的RBS太小,无法容纳那么多的操作。处理方法:1、加大回滚段的大小(增加RBS表空间,修改回滚段的参数等)2、你这种编程方法有问题,如果第一个方法不能解决问题,说明是因为执行时间过长,SNAPSHOT失效,需要你调整一下程序。是不是先把100万记录读到内存里(内存不够,可以采用文件作为缓冲),然后再做处理。也可以采用分段处理的方法,一次处理10万条。ORA-01589:must use RESETLOGS or NORESETLOGS option for database open问题:在startup 之后出现错误提示解答:Cause: Either incomplete or backup control file recovery has been performed. After these types of recovery you must specify either the RESETLOGS option or the NORESETLOGS option to open your database.Action: Specify the appropriate option.你的数据库以前做过Media Recovery,用OPEN DATABASE RESETLOGS或OPEN DATABASE NORESETLOGS打开数据库就可以了。ORA-01017:invalid username/password; logon deniedCause: An invalid username or password was entered in an attempt to log on to Oracle. The username and password must be the same as was specified in a GRANT CONNECT statement. If the username and password are entered together, the format is: username/password.Action: Enter a valid username and password combination in the correct format.缺省密码8i:scott/tigerinternal/change_on_installsystem/managersys/oralce(密码也可能是manager或change_on_install)9i:scott/tigersys/change_on_installOEM的用户名/密码:sysman/oem_temp重设system用户的密码可以通过以下方法登陆sqlplus /nologconn / as sysdbaalter user system identifed by ’123′Oracle的密码文件8i一般位于$ORACLE_HOME/PRODUCT/8.1.6/DBS/ORAPWD_[SID].ORA如何激活用户8i:在DBA Studio里面,有“用户”–然后找到用户名—>然后选中“未锁定”就可以了Oracle的初始化文件8i:安装时设定的ORACLEHOME的目录下会有:admin、oradata和ora81三个目录,其中在admin目录下的你安装的数据库目录下的Prfile下的init.ora就是。9i:在原来的目录下看不到init文件了。不过你可以这样:create pfile from spfile;这样就可以看到init的文件了,因为9i里面的初始化文件有点变化。Oracle 数据库自带数据的生成脚本ORACLE_HOMErdbmsadminSCOTT.SQL日期乱码Oracle Server的设置如下NLS_CHARACTERSET WE8ISO8859P1NLS_LANGUAGE AMERICANNLS_NCHAR_CHARACTERSET AL16UTF16机器上的注册表NLS_LANGUAGE AMERICAN_AMERICA.WE8ISO8859P1问题:Java程序传日期到Oracle的function里,经过lower(to_char(xsched_date,’DY’))函数后,日期变成了乱码。请问:1. 我的字符集应当怎样设置呢?2. server的 NLS_CHARACTERSET 和 NLS_NCHAR_CHARACTERSET 不一样,没关系吧?NLS_NCHAR_CHARACTERSET 是什么意思?解答:1 先查看有关字符集的信息SQL>col value$ format a40SQL> select * from nls_database_parameters;SQL> select * from V$NLS_PARAMETERS;2 查得的主要对应client端的显示SQL> select * from sys.props$ WHERE NAME=’NLS_LANGUAGE’;//可以把’AMERICAN’ 改为’SIMPLIFIED CHINESE ‘,不过这个于本问题无关3修改字符集SQL> select * from sys.props$ WHERE NAME=’NLS_CHARACTERSET’;//把你机器上的WE8ISO8859P1改为SQL>UPDATE sys.PROPS$ SET VALUE$=’ZHS16GBK’ WHERE NAME=’NLS_CHARACTERSET’;SQL>commit;4 NLS_NCHAR_CHARACTERSET AL16UTF16 其中的UTF16为ZHS16GBK的子集,可显示大多数汉字。更改字符集最好不要修改 props$表,可能会引起不正常的工作。如果是客户端 ,修改注册表即可;服务器端 “alter database character set 字符集”即可Oracle客户端打包安装问题我的程序是C/S架构的,所以客户端电脑都要安装ORACLE的客户端程序,不知道有没有办法,将ORACLE的客户端安装程序打包进我的安装程序,进行自动安装。解答:1.其实ORACLE的安装很简单,你先安装一套客户端,然后把这些文件打包(从ORACLE_HOME开始全部取出),把注册表中的ORACLE部分导出。然后自己编写一个安装程序,把这些文件按照某个路径拷贝(不要修改相对路径),如果你安装的ORACLE_HOME改变了,就修改REG中的ORACLE_hone参数,然后将REG文件装入。这些都可以通过编写程序来实现。2.实际上Oracle驱动微软也有,主要就缺那个网络服务名,用Filemon.exe软件跟踪一下,看看要用到些什么东西。无法确定主机IP错误问题:Win2003+Oracle 9iR2安装的时候告诉我无法确定主机的IP,忽略后又报了几次,最后还是不能安装解答:修改hosts文件。确认nslookup命令可以正确执行没有域名时设置Oracle9i中全局数据库名set globle_name=false双网卡连接外网问题问题:服务器双网卡,一个内部用,一个通外网,装ORACLE8I,客户端连接服务器,当把外网网线拔掉,连接正常,把外网网线插上,连不上。解答:把内部网的网关去掉,再在上面加一个NETBEUI协议这样就可以了。Oracle9i数据库的企业版和标准版的区别Oracle9i数据库的企业版和标准版最主要的区别在于企业版有更强大的并行和分布式处理能力,标准版是专为开发、部署和管理部门级 Internet 应用程序而设计的数据库管理系统,是用于传统的部门级应用程序的一流数据库。而应用超出部门级标准或访问数据库的人较多时,则应当选用企业版。标准版包含下列组件: Jserver Enterprise EditionInterMediaEnterprise ManagerWorkflow Standard EditionStandard Management PackObject OptionNetworking kitObject for OLEDistributed Option64 bit OptionODBC DriverSql*PlusOCI企业版包括标准版中所有组件,并且还含有下列额外的组件:Jserver Enterprise EditionInterMediaObject OptionNetworking kitObject for OLEAdvance Replication OptionDistributed OptionParallel Query OptionSQL*PlusVIRWorkflow Enterprise EditionAdvanced backup & recoveryConnection Pool64 bit OptionODBC DriverOCIEnterprise ManagerEnterprise Backup Utility另请参考http://www.Oracle.com.cn/cgi-bin/topic_show.cgi?id=117&h=1&bpg=13&age=0Oracle与IIS地址冲突问题:我的机器的系统盘是 c 盘,Oracle8i也安装在c盘,以前我把我的网站在“控制面板—-管理工具——Internet服务管理器”中已经设置好了IIS的配置,所以在以前一打开http://127.0.0.1就可以看见我的网站,自从安装了Oracle8i后,在打开http://127.0.0.1时,显示的是关于Oracle的一个页面,在IIS中的默认WEB站点已经“停止”了,当我再重新启动的时候,说是“地址已被使用!”。我不知道该怎样恢复成以前的情形。解答:在服务管理里面停止ORACLE HTTP服务一个控制文件被损坏,如何启动系统环境:1、操作系统:Windows 2000 Server,机器内存128M2、数据库:Oracle 8i R2 (8.1.6) for NT 企业版3、安装路径:C:ORACLE错误现象:因硬盘有坏道,一个控制文件损坏了,或人工误删一个控制文件,控制面板的Oracle相关服务可以启动成功,但用SQL*Plus无法连接,显示以下错误ORA-01034: ORACLE not available解决方法:C:>svrmgrlsvrmgrl>connect internalsvrmgrl>shutdown abort修改init.ora(C:Oracleadminoradbpfileinit.ora)文件,使无法使用的控制文件不在control_files参数中定义修改前control_files = (“C:Oracleoradataoradbcontrol01.ctl”, “C:Oracleoradataoradbcontrol02.ctl”,     “C:Oracleoradataoradbcontrol03.ctl”)修改后control_files = (“C:Oracleoradataoradbcontrol01.ctl”, “C:Oracleoradataoradbcontrol02.ctl”)svrmgrl>startup注意:最少要有两个控制文件的存在,即使一个也可以正常应用。某个数据文件损坏,如何打开数据库——ORA-01033: ORACLE initialization or shutdown in progress错误系统环境:1、操作系统:Windows 2000 Server,机器内存128M2、数据库: Oracle 8i R2 (8.1.6) for NT 企业版3、安装路径:C:ORACLE错误现象:因误操作,数据库中某一数据文件被误删,控制面板的Oracle相关服务显示已启动,但用SQL*Plus无法连接,显示以下错误ORA-01033: ORACLE initialization or shutdown in progress模拟现象:create tablespace test datafile’c:test.ora’ size 5MAUTOEXTEND ON NEXT 1M MAXSIZE UNLIMITEDdefault storage (initial 128K next 1M pctincrease 0)/关闭所有服务stop.batnet stop “OracleWebAssistant0″net stop “OracleOraHome81TNSListener”net stop “OracleServiceORADB”shutdown在操作系统中删除test.ora文件重新启动服务start.batnet start “OracleWebAssistant0″net start “OracleOraHome81TNSListener”net start “OracleServiceORADB”服务里OracleServiceORADB显示已启动,但用SQL*Plus无法连接,显示ORA-01033: ORACLE initialization or shutdown in progress解决方法:先让该数据文件脱机,就可以打开数据库C:>svrmgrlsvrmgrl>connect internalsvrmgrl>shutdownsvrmgrl>startup mount–ARCHIVELOG模式命令,文件名要大写svrmgrl>alter database datafile ‘C:TEST.ORA’ offline;–NOARCHIVELOG模式命令svrmgrl>alter database datafile ‘C:TEST.ORA’ offline drop;svrmgrl>alter database open;–查询数据文件联、脱机状态SQL> select file#,name,status from v$datafile;SQL> drop tablespace test;表空间已丢弃。丢失联机日志文件分两种情况处理1、丢失的是非活动的日志文件;2、丢失的是当前激活的日志文件。如果是第一种情况,而发生故障的日志文件组又具有多个成员,可以先将数据库shutdown,然后用操作系统命令将损坏日志文件组中好的日志成员文件把损坏的成员文件覆盖(在同一个日志成员组中的所有日志文件的各为镜象的),如果其物理位置不可用可将其拷贝到新的驱动器上,使用alter database rename file ‘xxxx’ to ‘xxxx’改变文件位置,之后启动数据库,如果正常马上进行一个冷备份。如果损坏的日志组中只有一个日志成员,先mount上数据库,将其转换为noarchivelog模式,执行alter database add logfile member ‘xxx’ to group ‘x’给相关组增加一个成员,再执行alter database drop logfile member ‘bad_file’将损坏的日志文件删除,由于数据库的结构发生变动需要备份控制文件,之后将数据库改回archivelog模式,做一个冷备份。如果丢失的是当前激活的日志文件,数据库又没有镜像而且当前日志组中所有成员均变为不可用。首先将数据库shutdown abort,从最近的一次全备份中恢复所有的数据文件,将数据库启动到mount状态。如果原来的日志文件物理位置不可用,使用alter database rename file ‘xxx’ to ‘xxx’改变文件的存放位置。然后,使用recover database until cancel命令来恢复数据库,直到提示最后一个归档日志运用完之后,输入cancel。之后用alter database open resetlogs打开数据库,如果没有问题,立即进行一个冷备份。注意!所有包含在损坏的redo log中的信息将会丢失,也就是说数据库崩溃前已经提交的数据有可能会丢失。这对于某些要求很高的应用将会损失惨重,因此应尽量使每个日志组具有多个日志成员,并且放置在不同的驱动器上防止发生介质故障。

你可能感兴趣的:(经验,oracle,数据库,database,initialization,server,sql)