最近由於項目需要,用shell程式大量刪除業務表資料,但還需要按業務需求保留業務曆史資料,由於項目中用的是db2,db2在刪除資料時會產生大量的日誌,會把記錄檔充滿,會報57011錯誤.通過在網上尋找一些資料,最終在不改變原表結構參數的基礎上,減少其他們人員的工作量的基礎上動態調整參數。以下為具體操作步驟:-- db2 delete 大表不寫日誌操作1.update command options using c off -- //關閉自動認可 2.alter table
create or replace function fn_get_myjob_interval return date is Result date; v_nextdate date; v_nexthours number;begin if to_number(to_char(sysdate, 'dd')) >= 25 then
Linux 下面 登入使用者名稱:Oraclesqlplus / as sysdbaalter system set os_authent_prefix='' scope =spfile;startup force;create user oracle identified externally;grant connect to oracle;退出當前會話 再su到oracleexitsu - oraclepasswd ...sqlplus / as
在Oracle 11gR2 RAC 建立執行個體的時候,會讓我們選擇配置類型:Admin-Managed 和 Policy-Managed ,如下:官網文檔解釋如下:6.1 Understanding ServerPoolsServer pools arelogical divisions of a cluster into pools of servers, which are allocated tohost databases or other applications. Server
早上在上班的路上接到警示簡訊,警示一個庫的歸檔有問題。alert.log檔案內容如下:Wed Jul 25 06:00:02 2012Errors in file /Oracle/app/oracle/admin/skate/bdump/skate_arc0_3618.trc:ora-19510: failed to set size of 84875 blocks for file "/oracle/oradata/skate/archive/1_59432_713742632.dbf"
原因: This is the generic internal error number for Oracle program exceptions. It indicates that a process has encountered a low-level, unexpected condition. Causes of this message include: 1.timeouts(逾時) 2.file corruption(檔案太老)
如果你用Oracle,那你有很大的可能會使用PL/SQL Developer。在使用PL/SQL Developer時,當你在Table列表或者其他對象列表中右擊並選擇Drop操作時,會彈出確認對話方塊。這些對話方塊的底部會有個Don't show this message again的勾選框,如果你不小心勾上並點擊了確定,那慘了,以後如果不小心再選了Drop,沒有提示就會刪掉這個對象! 如何恢複呢?工具-喜好設定
Trigger常見有兩種:行(Row Trigger)和語句(Statement Trigger)還有:Instead of Trigger和Event trigger。例子1-Row Trigger:CREATE OR REPLACE TRIGGER client AFTERINSERT ON tt1 FOR EACH rowBEGIN dbms_application_info.set_client_info(userenv('client_info')+1
Data Guard Services 以下的三部分組成Data Guard的日誌資料轉送、日誌資料應用以及改變資料庫角色:a)、日誌傳輸服務(Redo Transport Services)b)、日誌應用服務c)、角色轉換1、Redo Transport Services(日誌傳輸服務)控制生產資料庫自動將redo data發送至一個或多個歸檔地址1.1、使用ARCH進程用ARCH模式傳輸不寫Standby Redo