ARCHIVE檔案把磁碟塞滿的時候,
會因為無法寫入ARCHIVE而無法進入資料庫。
這時候要找到ARCHIVE檔案,將過久的檔案刪除就可以解決這個問題。
進入資料庫
sqlplus /nolog@資料庫SID
connect / as sysdba
show pararmeter archive
使用這個指令可以找出archive存放的位址
然後進去將過舊的ARCHIVE刪除,問題就解決了
2014年4月28日 星期一
2014年4月8日 星期二
[EBS]抓出GL_CODE_COMBINATIONS的中文摘要
在EBS開發中,輸入的科目在資料庫中被一堆代碼取代,無法辨識。
要透過一個Package才能將正確的中文摘要抓出來,否則要抓到正確的非常困難。
語法如下:
select distinct code_combination_id, gl_flexfields_pkg.get_concat_description
(chart_of_accounts_id,
code_combination_id
) description from gl_code_combinations;
(chart_of_accounts_id,
code_combination_id
) description from gl_code_combinations;
ORA-12514: TNS: 監聽程序當前無法識別連接描述符中請求的服務解决
將資料庫重啟時,發生ORA-12514問題。
在網路上找到解決方法,並記錄如下:
監聽程序找不到服務的原因,在於LISTENER沒有確切的指定到要求服務的資料庫。
因此LISTENER設定中加入服務的SID,就能夠正確抓到指定的服務。
打開%Oracle_Home%/network/admin/listener.ora
會看到內容如下,
SID_LIST_LISTENER= (SID_DESC = (SID_NAME = CLRExtProc) (ORACLE_HOME = H:\Oracle\product\11.2.0\dbhome_1) (PROGRAM = extproc) (ENVS ="EXTPROC_DLLS=ONLY:D:\Oracle\product\11.2.0\dbhome_1\bin\oraclr11.dll") ) )
將內容更改如下,
SID_LIST_LISTENER=
(SID_DESC =
(SID_NAME = CLRExtProc)
(ORACLE_HOME = H:\Oracle\product\11.2.0\dbhome_1)
(PROGRAM = extproc)
(ENVS ="EXTPROC_DLLS=ONLY:H:\Oracle\product\11.2.0\dbhome_1\bin\oraclr11.dll")
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME = Your_DB_SID)
(ORACLE_HOME =D:\Oracle\product\11.2.0\dbhome_1)
(SID_NAME = Your_DB_SID)
)
)
)
接著就能順利開啟資料庫了。
2014年3月11日 星期二
2014年2月24日 星期一
Oracle 開啟/關閉archivelog mode
首先檢查一下archivelog mode是否開啟
archive log list
若要開啟/關閉Archivelog mode,必須要先將資料庫關閉再進入mount模式,
Shutdown immediate;
startup mount;
alter database archivelog/noarchivelog;
alter database open;
這時進入資料庫,再檢查一次,
archive log list
會看見archivelog mode已經開啟/關閉。
archive log list
若要開啟/關閉Archivelog mode,必須要先將資料庫關閉再進入mount模式,
Shutdown immediate;
startup mount;
alter database archivelog/noarchivelog;
alter database open;
這時進入資料庫,再檢查一次,
archive log list
會看見archivelog mode已經開啟/關閉。
ORA-28002錯誤解決
測試資料庫出現ORA-28002問題,
ERROR:
ORA-28002 : the password will expire within 7 days
記錄從網路上找到的解法如下:
這個原因是因為11g在default profile 設定了 180 days.
SELECT * FROM dba_profiles s WHERE s.profile='DEFAULT' AND resource_name='PASSWORD_LIFE_TIME';
最快的方法就是更改該user的密碼,不過還是換成同一個 ^^
另一個一勞永逸的方法就是更改profile的設定.
1、檢查該用戶的profile是哪個, 一般是DEFAULT:
sql>SELECT username,PROFILE FROM dba_users;
2、確認該Profile(ex. DEFAULT)的密碼有效期配置:
sql>SELECT * FROM dba_profiles s WHERE s.profile='DEFAULT' AND resource_name='PASSWORD_LIFE_TIME';
3、將密碼有效期由預設180天改成無限制:
sql>ALTER PROFILE DEFAULT LIMIT PASSWORD_LIFE_TIME UNLIMITED;
4、修改之後, 還沒有出現ORA-28002的user不會再碰到相同的Error:
已有出現這個Error的帳號需再修改一次密碼如下,
$sqlplus / as sysdba
sql> alter user username identified by 原來的密碼;
資料來源:http://dba.tw/index.php?topic=524.0
ERROR:
ORA-28002 : the password will expire within 7 days
記錄從網路上找到的解法如下:
這個原因是因為11g在default profile 設定了 180 days.
SELECT * FROM dba_profiles s WHERE s.profile='DEFAULT' AND resource_name='PASSWORD_LIFE_TIME';
最快的方法就是更改該user的密碼,不過還是換成同一個 ^^
另一個一勞永逸的方法就是更改profile的設定.
1、檢查該用戶的profile是哪個, 一般是DEFAULT:
sql>SELECT username,PROFILE FROM dba_users;
2、確認該Profile(ex. DEFAULT)的密碼有效期配置:
sql>SELECT * FROM dba_profiles s WHERE s.profile='DEFAULT' AND resource_name='PASSWORD_LIFE_TIME';
3、將密碼有效期由預設180天改成無限制:
sql>ALTER PROFILE DEFAULT LIMIT PASSWORD_LIFE_TIME UNLIMITED;
4、修改之後, 還沒有出現ORA-28002的user不會再碰到相同的Error:
已有出現這個Error的帳號需再修改一次密碼如下,
$sqlplus / as sysdba
sql> alter user username identified by 原來的密碼;
資料來源:http://dba.tw/index.php?topic=524.0
2014年2月19日 星期三
Oracle解鎖
當有lock發生時,檢查 v$session 觀察哪個session卡住其他人。
select username, sid, serial#, program, machine, status, blocking_session from v$session where blocking_session is not null;
其中blocking_session的值就是顯示該session被哪個session block。
若是沒顯示資料時,表示沒有session被lock住。
若是沒顯示資料時,表示沒有session被lock住。
這時候若可以的話,查一下那個session的使用者在做甚麼,是否可以先關掉。
select username, sid, serial#, program, machine, status, blocking_session from v$session where sid=[blocking_session中的數值];
檢查確認該session是可以關閉的程式時,便把他關閉。
若不行關閉,還是必須等他跑完。
select username, sid, serial#, program, machine, status, blocking_session from v$session where sid=[blocking_session中的數值];
檢查確認該session是可以關閉的程式時,便把他關閉。
若不行關閉,還是必須等他跑完。
可以關的話,輸入指令kill掉那個session
alter system kill session '[sid],[serial#]';
訂閱:
文章 (Atom)