1. 程式人生 > >ORA-03113: 通訊通道的檔案結束 ORA-24324: 未初始化服務控制代碼 ORA-01041: 內部錯誤, hostdef 副檔名不存在

ORA-03113: 通訊通道的檔案結束 ORA-24324: 未初始化服務控制代碼 ORA-01041: 內部錯誤, hostdef 副檔名不存在

環境:win7+oracle11g

情景:

登入OEM失敗:

檢查過oracle服務都是開啟狀態,回到命令列,嘗試重新啟動oracle,如下圖:

又嘗試重新配置網路,測試不成功:

報錯:.ORA-01034: ORACLE not available

ORA-27101: sharedmemory realm does not exist

百度到以下方式,

嘗試後,還是報ORA-03113: 通訊通道的檔案結尾

資料庫裝載完畢。
    ORA-03113:
通訊通道的檔案結尾
    程序 ID: 2984

會話 ID: 5 序列號: 3

此時執行shutdown immediate命令無法關閉,並報錯如下:

ORA-24324: 未初始化服務控制代碼 

ORA-01041: 內部錯誤, hostdef副檔名不存在 ;

百度到:則需要檢查系統登錄檔中的ORACLE_HOME路徑了。

 2、把sqlnet.ora檔案中SQLNET.AUTHENTICATION_SERVICES = (NTS) 將NTS換成NONE。

嘗試後依然如此;

折騰了一天還是沒有解決,於是準備採用:資料庫出現問題,第一個就要去看alert log。 這個要養成習慣。 不看log,不能準確定位問題。 

尤其在生產環境,alert log 都是部署指令碼,實時監控的,有錯誤都會發送報警資訊。

果然,在alert——orcl.log中,找到了錯誤,及其建議解決方式:

Mon May 07 08:17:582018
ARC2 started with pid=22, OS id=3204 
ARC1: Archival started
ARC2: Archival started
ARC1: Becoming the 'no FAL' ARCH
ARC1: Becoming the 'no SRL' ARCH
ARC2: Becoming the heartbeat ARCH
Errors in filee:\anzhuang\oracle\diag\rdbms\orcl\orcl\trace\orcl_arc1_4356.trc:
ORA-19815: WARNING: db_recovery_file_dest_size of 4102029312 bytes is 100.00%used, and has 0 remaining bytes available.
Errors in file e:\anzhuang\oracle\diag\rdbms\orcl\orcl\trace\orcl_ora_9564.trc:
ORA-19815:

璀﹀憡: db_recovery_file_dest_size 瀛楄妭 (鍏?4102029312 瀛楄妭) 宸蹭嬌鐢?100.00%, 灝氭湁 0 瀛楄妭鍙敤銆?
************************************************************************
You have following choices to free up space from recovery area:
1. Consider changing RMAN RETENTION POLICY. If you are using Data Guard,
   then consider changing RMAN ARCHIVELOG DELETION POLICY.
2. Back up files to tertiary device such as tape using RMAN
   BACKUP RECOVERY AREA command.
3. Add disk space and increase db_recovery_file_dest_size parameter to
   reflect the new space.
4. Delete unnecessary files using RMAN DELETE command. If an operating
   system command was used to delete files, then use RMAN CROSSCHECKand
   DELETE EXPIRED commands.
************************************************************************
Errors in file e:\anzhuang\oracle\diag\rdbms\orcl\orcl\trace\orcl_ora_9564.trc:
ORA-19809: 瓚呭嚭浜嗘仮澶嶆枃浠舵暟鐨勯檺鍒?
ORA-19804: 鏃犳硶鍥炴敹 35256832 瀛楄妭紓佺洏絀洪棿 (浠?4102029312 闄愬埗涓?

ARCH: Error 19809Creating archive log file to'E:\ANZHUANG\ORACLE\FLASH_RECOVERY_AREA\ORCL\ARCHIVELOG\2018_05_07\O1_MF_1_144_%U_.ARC'

原來是db_recovery_file_dest_size 位元組 (共 4322230272 位元組) 已使用 100.00%,

日誌無法歸檔了,所以要先增加閃回區大小,把庫啟動起來:

SQL>startup mount

            ORACLEinstance started.

TotalSystem Global Area 3206836224bytes

            FixedSize                  2257520 bytes

            VariableSize            2365590928 bytes

            DatabaseBuffers          822083584 bytes

            RedoBuffers               16904192 bytes

            Database  mounted.

SQL>show parameter db_recover

NAME                                 TYPE        VALUE

----------------------------------------------- ------------------------------

db_recovery_file_dest                string/opt/app/oracle/fast_recovery_

                                      area

db_recovery_file_dest_size           big integer  4122M

SQL>alter system set db_recovery_file_dest_size=10G;

System  altered.

SQL>alter database open;

此處還百度到,最好增加一步:制定對應的歸檔日誌刪除策略

SQL>set linesize 120
SQL> select * from v$flash_recovery_area_usage;

FILE_TYPE            PERCENT_SPACE_USEDPERCENT_SPACE_RECLAIMABLE NUMBER_OF_FILES
-------------------- ------------------ ----------------------------------------
CONTROL FILE                         0                        0              0
REDO LOG                             0                        0              0
ARCHIVED LOG                     41.54                        0            133
BACKUP PIECE                         0                        0              0
IMAGE COPY                           0                        0              0
FLASHBACK LOG                        0                        0              0
FOREIGN ARCHIVED LOG                 0                        0               0
rows selected.
可以rman直接刪除不再需要的歸檔,比如刪除1天之前的歸檔
RMAN> delete noprompt archivelog until time 'sysdate-1';
此處省略刪除歸檔的輸出..
RMAN> exit


Recovery Manager complete.


SQL> select * from v$flash_recovery_area_usage;


FILE_TYPE            PERCENT_SPACE_USEDPERCENT_SPACE_RECLAIMABLE NUMBER_OF_FILES
-------------------- ------------------ ----------------------------------------
CONTROL FILE                         0                        0              0
REDO LOG                             0                        0              0
ARCHIVED LOG                       .35                        0              1
BACKUP PIECE                         0                        0              0
IMAGE COPY                           0                        0              0
FLASHBACK LOG                        0                        0              0
FOREIGN ARCHIVED LOG                 0                        0               0
rows selected.

還可以設定crontab定時每天刪除1天前的歸檔

$ crontab -l
04 * * * /opt/shell/del_arch.sh
$ more /opt/shell/del_arch.sh
#!/bin/bash
export ORACLE_BASE=/opt/app/oracle
export ORACLE_HOME=/opt/app/oracle/product/11.2.0.4/dbhome_1 
export ORACLE_SID=JJFAB
export NLS_LANG="simplified chinese_china.ZHS16GBK"
export NLS_DATE_FORMAT="YYYY -MM-DD HH24:Mi:SS"
exportPATH=.:/opt/app/oracle/product/11.2.0.4/dbhome_1:/usr/sbin:$ORACLE_HOME/bin:$PATH
export LD_LIBRARY_PATH=$ORACLE_HOME/lib


rman target / log=/opt/backup/del_arch.log <<EOF
list archivelog all;
delete noprompt archivelog until time 'sysdate-1';
show all;
list archivelog all;
EOF

資料庫可以打開了,OEM也就能正常使用了!