国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 數(shù)據(jù)庫 > Oracle > 正文

ORACLE常見錯誤代碼的分析與解決

2024-08-29 13:28:55
字體:
供稿:網(wǎng)友

在使用oracle的過程過,我們會經(jīng)常遇到一些oracle產(chǎn)生的錯誤,對于初學者而言,這些錯誤可能有點模糊,而且可能一時不知怎么去處理產(chǎn)生的這些錯誤,本人就使用中出現(xiàn)比較頻繁的錯誤代碼一一做出分析,希望能夠幫助你找到一個合理解決這些錯誤的方法,同時也希望你能夠提出你的不同看法。畢竟作為一種交流的手段,個人意見難免過于偏頗,而且也必定存在著不足,出錯之處在所難免。寫這篇文章的目的就是想通過相互之間的交流共同促進,共同進步。ora-01650:unable to extend rollback segment name by num intablespace name  產(chǎn)生原因:上述oracle錯誤為回滾段表空間不足引起的,這也是oracle數(shù)據(jù)管理員最常見的oracle錯誤信息。當用戶在做一個非常龐大的數(shù)據(jù)操作導致現(xiàn)有回滾段的不足,使可分配用的回滾段表空間已滿,無法再進行分配,就會出現(xiàn)上述的錯誤。  解決方式:使用“alter tablespace tablespace_name add datafile filename size size_of_file”命令向指定的數(shù)據(jù)增加表空間,根據(jù)具體的情況可以增加一個或多個表空間。當然這與還與你主機上的裸盤設備有關,如果你主機的裸盤設備已經(jīng)沒有多余的使用空間,建議你不要輕意的增加回滾段表空間的大小,可使用下列的語句先查詢一下剩余的tablespace空間有多少:select user_name,sql_text from v$open_cursor where user_name=’<user_name>’;  如果多余的空間比較多,就可以適當追加一個大的回滾段給表空間使用,從而避免上述的錯誤。你也可以用以下語句來檢測一下rollback segment的競爭狀況:select class,count from v$waitstat where calss in(‘system undo header’,’system undo block’,’undo header’,’undo block’);和select sum(value) from v$sysstat where name in (‘db_block_gets’,’consistents gets’);如果任何一個class in count/sum(value)大于1%,就應該考慮增加rollback segment。相應的英文如下:cause:failed to allocate extent from the rollback segment in tablespaceaction:use the alter tablespace add datafile statement to add one or more files to the specified tablespace.ora-01652:unable to extend temp segment by num in tablespace name  產(chǎn)生原因:oracle臨時段表空間不足,因為oracle總是盡量分配連續(xù)空間,一但沒有足夠的可分配空間或者分配不連續(xù)就會出現(xiàn)上述的現(xiàn)象。  解決方法:我們知道由于oracle將表空間作為邏輯結(jié)構(gòu)-單元,而表空間的物理結(jié)構(gòu)是數(shù)據(jù)文件,數(shù)據(jù)文件在磁盤上物理地創(chuàng)建,表空間的所有對象也存在于磁盤上,為了給表空間增加空間,就必須增加數(shù)據(jù)文件。先查看一下指定表空間的可用空間,使用視圖sys.dba_free_space,視圖中每條記錄代表可用空間的碎片大小:sql>select file_id,block_id,blocks,bytes from sys.dba_free_space where tablespace_name=’<users>’;  返回的信息可初步確定可用空間的最大塊,看一下它是否小于錯誤信息中提到的尺寸,再查看一下缺省的表空間參數(shù):sql>select initial_extent,next_extent,min_extents,pct_increase from sys.dba_tablespaces where tablespace_name=name;通過下面的sql命令修改臨時段表空間的缺省存儲值:sql>alter tablespace name default storage (initial xxx next yyy);適當增大缺省值的大小有可能解決出現(xiàn)的錯誤問題,也可以通過修改用戶的臨時表空間大小來解決這個問題:sql>alter user username temporary tablespace new_tablespace_name;使用alter tablespace命令,一但完成,所增加的空間就可使用,無需退出數(shù)據(jù)庫或使表空間脫機,但要注意,一旦添加了數(shù)據(jù)文件,就不能再刪除它,若要刪除,就要刪除表空間。一個報錯例子如下:ora-1652:unable to extend temp segment by 207381 in tablespace tempspace相應的英文如下:cause: failed to allocate extent for temp segment in tablespaceaction:use the alter tablespace add datafile statement to add one or more files to the specified tablespace or create the object in another tablespace.

ora-01578:oracle data block corrupted(file # num,block # num)產(chǎn)生原因:當oracle訪問一個數(shù)據(jù)塊時,由于1、硬件的i/o錯誤;2、操作系統(tǒng)的i/o錯誤或緩沖問題;3、內(nèi)存或paging問題;4、oracle試圖訪問一個未被格式化的系統(tǒng)塊失敗;5、數(shù)據(jù)文件部分溢出等上述幾種情況的一種引起了邏輯壞塊或者物理壞塊,這時就會報ora-01578的錯誤。解決方式:由于oracle只有在訪問到有問題的數(shù)據(jù)文件時才會報錯,所以報錯的時間有可能會比實際出錯的時間要晚,如果ora-01578出錯信息提示數(shù)據(jù)壞塊指向的是用戶自己的數(shù)據(jù)文件,則用以下方法來解決:如果通過下面的sql語句查出的壞塊出現(xiàn)有索引上,則只需重建索引即可 sql>select owner,segment_name,segment_type from dba_extents where file_id=<f> and <b> between block_id and block_id+blocks-1;(<f>和<b>分別是ora-01578報出的壞塊出現(xiàn)的文件號和塊號)如果壞塊出現(xiàn)在表上,先用以下語句分析是否為永久性壞塊(建議多執(zhí)行一兩次,有助于鑒別數(shù)據(jù)壞塊是永久性的(硬盤上的物理壞塊)還是隨機性的(內(nèi)存或硬件錯誤引起)): sql>analyze table <table_name> validate structure cascade;執(zhí)行該命令后,可能會出現(xiàn)以下的結(jié)果:ora-01578:與原先錯誤信息有相同的參數(shù),為永久性的物理或邏輯壞塊;與原先錯誤信息有不同的參數(shù),可能與內(nèi)存,page space和i/o設備有關。如果用戶有此表的最新備份,那么最好是用此備份來恢復此表,或者使用event 10231來取出壞塊以外的數(shù)據(jù):<1>.先關閉數(shù)據(jù)庫<2>.編輯init<sid>.ora文件,加入:event=”10231 trace name context forever,level 10”<3>.startup restrict<4>.創(chuàng)建一個臨時表:sql>create table errortemp as select * from error;(error是壞表的表名)<5>.把event從init<sid>.ora文件中刪掉并重起數(shù)據(jù)庫<6>.rename壞表,把臨時表rename成壞表的表名<7>.創(chuàng)建表上的index等如果ora-01578出錯信息提示數(shù)據(jù)壞塊指向的是數(shù)據(jù)字典或者是回滾段的話,你應該立即與oracle公司聯(lián)系,共同商量一個好的解決辦法。這里所講的解決方法只是比較常見的一種,一些更為具體的解決辦法可以查看一下oracle的故障解決手冊,那里面有浞及使用rowid方法來取出壞塊以外的數(shù)據(jù)的方法,這里就不介紹了。相應的英文如下:cause:the given data block was corrupted,probably due to program errorsaction:try to restore the segment containing the given data block,this may involve dropping the segment and recreating it,if there is a trace file,report the messages recorded in it to customer support.ora-01628:max # of extents num reached for rollback segment num產(chǎn)生原因:這種錯誤通常為一個回滾段和一個表空間已經(jīng)達到maxextents參數(shù)設置的極限。要注意的是這個maxextents不是該回滾段或表空間的硬件極限,硬件極限取決于數(shù)據(jù)庫創(chuàng)建時在init.ora文件中指定的db_block_size參數(shù)的值。解決方法:使用sql命令alter tablespace…storage(maxextents xxxx)來增加 maxextents,其中“xxxx”值必須大于錯誤信息中所指的數(shù)值,但不能大于largest maxextent的值,如果已經(jīng)達到了largest maxextent value,解決的辦法就是重新創(chuàng)建較大的范圍尺寸,使用帶有選項compress=y的export工具導出表,如果表空間有可用空間,先給表做一個備份,用alter tablespace tablespace_name更改其名字,然后再裝載表回數(shù)據(jù)庫。查看其錯誤出現(xiàn)的地方,如果出現(xiàn)在回滾段或索引上,那么必須將其刪除并重建,如果出現(xiàn)在臨時表空間,修改臨時表空間的存儲字段,便可解決這個問題。一個報錯例子如下:ora-1628:max # extents 50 reached for rollback segment rbs_1相應的英文如下:cause: an attempt was made to extend a rollback segment that already has reached its maximum size or space could not be allocated in the data dictionary to contain the definition of the object.action:if possible,increase the value of either the maxextents or pctincrease initialization parameters or find the data dictionary table lacking space and alter the storage parameters,as described in the oracle8 server administrator’s guide.

ora-00600:internal error code,arguments:[num],[?],[?],[?],[?]產(chǎn)生原因:這種錯誤通常為oracle的內(nèi)部錯誤,只對oss和oracle開發(fā)有用。ora-600的錯誤經(jīng)常伴隨跟蹤文件的狀態(tài)轉(zhuǎn)儲(系統(tǒng)狀態(tài)和進程狀態(tài)),系統(tǒng)狀態(tài)存儲將包括oracle rdbms持有的當前對象的信息,進程狀態(tài)轉(zhuǎn)儲則將顯示特殊進程持有的對象,當進程符合了某錯誤條件時,經(jīng)常是由于一些信息取自它持有的一個塊,如果我們知道這些錯誤進程持有的塊,就容易跟蹤問題的來源。解決方法:一般來說出現(xiàn)這個錯誤我們本身是無法解決的,只有從提高系統(tǒng)本身各方面來解決這個內(nèi)部問題,如增加硬件設備,調(diào)整系統(tǒng)性能,使用ops(當然ops從某種意義上說并不是一種好的解決方式)等。ora-600錯誤的第一個變量用于標記代碼中錯誤的位置(代碼中的每個部分的第一變量都不一樣),從第二個到第五個變量顯示附加信息,告訴oss代碼在哪里出現(xiàn)了錯誤。一個報錯例子如下:ora-00600: internal error code, arguments: [1237], [], [], [], [], [], [], []相應的英文如下:cause:this is a catchall internal error message for oracle program exceptions.it indicates that a process has met a low-level,unexpected condition.various causes of this message include:time-outs(超時)file corruption(文件太老)failed data checks in memory(內(nèi)存檢索失敗)hardware,memory,or i/o errors(硬件、內(nèi)存或者磁盤錯誤)incorrectly restored files(錯誤的重建文件)ora-03113:end-of-file on communication channel產(chǎn)生原因:通訊不正常結(jié)束,從而導致通訊通道終止解決方法:1>.檢查是否有服進程不正常死機,可從alert.log得知2>.檢查sql*net driver是否連接到oracle可執(zhí)行程序3>.檢查服務器網(wǎng)絡是否正常,如網(wǎng)絡不通或不穩(wěn)定等4>.檢查同一個網(wǎng)上是否有兩個同樣名字的節(jié)點5>.檢查同一個網(wǎng)上是否有重復的ip地址相應的英文如下:cause:an unexpected end-of-file was processed on the communication channel.the problem could not be handled by the net8,two task,software.this message could occur if the shadow two-task process associated with a net8 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 commection attempt,check the setup files for the appropriate net8 driver and confirm net8 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.ora-00942:table or view does not exist產(chǎn)生原因:這是由于裝載的表或視圖不存在,多半是catexp.sql還沒有運行,無法執(zhí)行export視圖,如果catexp.sql已經(jīng)運行,則可能是版本錯誤。解決方法:因為import和export共享的一些視圖是通過運行catexp.sql來裝載的(它們具有相同的視圖),并不生成單獨的catexp.sql,因而造成視圖與export代碼不同步,較難保持彼此之間的兼容,用戶就必須建立自己的export應用,從而避免ora-00942的錯誤。相應的英文如下:cause:the table or view entered does not exist,a synonym that is jnot allowed here was used,or a view was referenced where a table is required.existing user tables and views can be listed by querying the data dictionary.certain privileges may required to access the table.if an application returned this message,the table the application tried to access does not exist in the database,or the application does not have access to it.action:check each of the following:the spelling of the table or view name.that a view is not specified where a table is requiredthat an existing table or view name exists.contact the database administrator if the table needs to be created or if user or application priviledes are required to access the table.also, if attempting to access a table or view in another schema,make certain thecorrect schema is referenced and that access to the object is granted.ora-01598:rollback segment “name” is not onlinecause:the rollback segment was taken offline either manually or by smon.action:check the status of the rollback segment in dba_rollback_segs.ora-1636: rollback segment “name” is already onlinecause:a rollback segment can only be used by one instance and an instance is trying to bring a rollback segment online that is already in use.action:check that the values set in the initialization parameter file for parameters rollback_segments,rollback_segment_initial,and rollback_segment_count are correctly set for the instance whiththe problem,also check that the instance is using the correct initialization parameter file.make sure you are not confused about the difference between private and public rollback segments.see the oracle8 server administrator’s guide for more information about using rollback segments in paraller mode.上述錯誤均為我們在使用回滾段時比較常見的問題,ora-01598指明當前使用的回滾段的狀態(tài)為“not online”,不能使用,將它改為“online”狀態(tài)即可使用;ora-01636指明當前回滾段已經(jīng)為“online”狀態(tài),可以直接使用,不用再集合它。ora-1636 signalled during: alter rollback segment rb00 online我們在做統(tǒng)計時還可能遇到下述問題:一個rollback segment的狀態(tài)為”needs recovery”的現(xiàn)象,這是由于oracle回退一個事物表中的沒有提交的事物時失敗所造成的。通常原因為一個datafile或者tablespace是在offline的狀態(tài)或者一個undo的目標被破壞或者rollback segment被破壞。解決的辦法是將所有的tablespace和datafile都置為online狀態(tài),如果不能解決則做下面的工作:1>.在initsid.ora中加入event=”10015 trace name context forever lever 10”;2>.shutdown數(shù)據(jù)庫然后重啟;3>.在$oracle_home/rdbms/log下,找到startup時生成的trace file;4>.在trace文件中,找到下列信息“error recovery tx(#,#) object #”;5>.根據(jù)object#(與sys.dba_objects表中的object_id相同)在sys.dba_objects表中查出該object的名字;6>.將該object drop掉;7>.在init.ora文件中將該rollback segment放回rollback_segments參數(shù)中,刪除event;8>.shutdown數(shù)據(jù)庫然后重啟。此時”needs recovery”的問題應該是完全解決了,否則就是rollback segment被破壞了。ora-01688:unable to extend table name.name partition name by num in tablespace name產(chǎn)生原因:指定的tablespace空間已經(jīng)被占用滿,無法擴展。解決方法:使用“alter tablespace add datafile”命令增加文件系統(tǒng)文件和原始分區(qū),或者增加initial的大小(如:alter tablespace cdrs101 default storage(next 500m pctincrease 1))應該能夠解決,否則就是有人使用你的表空間上創(chuàng)建了一個比較大的數(shù)據(jù)文件導致你的表空間不夠用。一個報錯例子如下:ora-1688: unable to extend table rmmcdr.local_cdr partition local_cdr101 by 460800 in tablespace cdrs101相應的英文如下:cause:an extent could not be allocated for a table segment in tablespaceaction:use the alter tablespace add datafile statement to add one or more files to the specified tablespace
中國最大的web開發(fā)資源網(wǎng)站及技術社區(qū),
發(fā)表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發(fā)表
主站蜘蛛池模板: 临夏市| 淳化县| 边坝县| 太白县| 固始县| 北票市| 新竹市| 含山县| 谢通门县| 彭泽县| 梁山县| 项城市| 成安县| 保定市| 板桥市| 龙游县| 晋城| 乌拉特前旗| 信宜市| 四会市| 定陶县| 奇台县| 博兴县| 沅陵县| 浦北县| 呈贡县| 班玛县| 桑日县| 张家界市| 长沙市| 平阳县| 游戏| 定边县| 郁南县| 灵川县| 蒲城县| 独山县| 虹口区| 建阳市| 佛冈县| 涟源市|