2014年12月18日 星期四

oracle read only transaction

ORA-16000: database open for read-only access

set transaction read only;

在 read only mode 下,不允許新增 undo 所以要在操作之前先告訴 oracle 說這個 transaction 是 read-only 的。

--
另外 需要用到 TEMP 。
但是 TEMP 其實跟資料一致性沒什麼關係。
所以在 rean-only 模式之下還是可以設定 TEMP .( enable/disable , add , drop 等 )



ORA-04052: error occurred when looking up remote object
ORA-04053: error occurred when validating remote object P@MP.US.ORACLE.COM
ORA-00604: error occurred at recursive SQL level 1
ORA-16000: database open for read-only access
--
這個好像是另一個情況 透過  dblink  呼叫 function 時加上 schema 會找不到?
把 schema name 抽掉似乎就找到了

oracle re-create temp space

在移動 database 之後出現了 temp tablespace 找不到的情況

ERROR at line 1:
ORA-01157: cannot identify/lock data file 10001 - see DBWR trace file
ORA-01110: data file 10001: '/h1/tempSSD/TEMP/temp-001.dbf'


這時候好像不可以去 alter relocate (反正原本的也不在了 就直接建一批新的出來


select name from  V$TEMPFILE;

新增新的 TEMPFILE
ALTER TABLESPACE TEMP ADD TEMPFILE '/h1/oratemp/TEMP01/temp01-044.dbf' SIZE 2048M AUTOEXTEND OFF;

把舊的 TEMPFILE DROP
ALTER TABLESPACE TEMP DROP TEMPFILE '/h1/tempSSD/TEMP/temp-001.dbf';

或

把舊的 TEMPFILE OFFLINE
ALTER DATABASE TEMPFILE '/h1/tempSSD/TEMP/TEMP-048.dbf' OFFLINE;


2014年12月12日 星期五

TSM 6 CLI


https://www.ibm.com/developerworks/community/wikis/home?lang=en#!/wiki/Tivoli%20Storage%20Manager/page/PDF%20versions%20of%20the%20IBM%20Tivoli%20Storage%20Manager%20Version%206.1.x%20documentation

http://www-01.ibm.com/support/docview.wss?uid=swg27041126&aid=1



QUERY AUDITOCCUPANCY 
QUERY OCCUPANCY 

QUERY NODE {NODENAME}

--刪除 debbyg 使用的空間
delete filespace debbyg * type=any
-- 刪除節點 NODE02
remove node NODE02

query process

2014年11月14日 星期五

AIX LVM VG Mirror 操作

Mirror 操作

首先,將新的 PV 加入 VG 。 新的 PV 大小要大於現有的資料量。

extendvg hissp1_v2 hdisk2
extendvg hissp1_v2 hdisk15
extendvg hissp1_v2 hdisk16
extendvg hissp1_v2 hdisk17
extendvg hissp1_v2 hdisk18
extendvg hissp1_v2 hdisk47


smitty vg
選 "Mirror a Volume Group"
sync mode 選 Background
VOLUME names 選剛剛加入的那些 pv
然後 enter 開始

[Entry Fields] * VOLUME GROUP name hissp1_v2 Mirror sync mode [Background] PHYSICAL VOLUME names [hdisk2 hdisk15 hdisk16 hdisk17 hdisk18 hdisk47] Number of COPIES of each logical 2 partition Keep Quorum Checking On? no Create Exact LV Mapping? no
COMMAND STATUS Command: running stdout: yes stderr: no Before command completion, additional instructions may appear below. 0516-1804 chvg: The quorum change takes effect immediately.
COMMAND STATUS Command: OK stdout: yes stderr: no Before command completion, additional instructions may appear below. 0516-1804 chvg: The quorum change takes effect immediately.
確認是否搬完的方式 mirror vg 指令還在跑的時候 vg 會被鎖住不能動也不能看 f6n1:/> lsvg -l hissp1_v2 0516-1201 lsvg: Warning: Volume group hissp1_v2 is locked. This command will continue retries until lock is free. If lock is inadvertent and needs to be removed, execute 'chvg -u hissp1_v2'. f6n1:/> 然後因為剛剛是 background sync 所以 mirror vg 指令跑完就可以回到交談式輸入 用 lsvg -l 看 lv 的狀態。正常時應該是 open/syncd 在抄寫時會變成 open/stale 狀態都回到 open/syncd 代表抄完了 另一個方式 lsvg hissp1_v2 看 STALE PPs 降到 0 代表抄完了
UNMIRROR
smitty vg -> Unmirror a Volume Group

> smitty vg
                                     Unmirror a Volume Group

Type or select values in entry fields.
Press Enter AFTER making all desired changes. 
          
                                                        [Entry Fields]               
* VOLUME GROUP name                                   hissp1_v2                      
  PHYSICAL VOLUME names                              [hdisk19 hdisk20 hdisk21 hdisk22 hdisk2> +
  Number of COPIES of each logical                    1                                       +
    partition


COMMAND STATUS Command: running stdout: yes stderr: no Before command completion, additional instructions may appear below. 0516-1804 chvg: The quorum change takes effect immediately.
COMMAND STATUS Command: OK stdout: yes stderr: no Before command completion, additional instructions may appear below. 0516-1804 chvg: The quorum change takes effect immediately.
用 lspv -l {HDISK} 看看還有沒有 LV 在要移掉的這些 PV 上面 沒有的話 就可以 reducevg 然後 rmdev 了
--------
補充
要強制斷開的話
直接從來源端把 volumn mapping 抽掉
然後再unmirror
然後再砍

--------
選 UnMirror VG 的時候,選擇 PV 那邊選的是"要移掉的"PV
---------
/usr/sbin/mirrorvg '-S' {VGName} hdisk46 <--要加進去的
/usr/sbin/unmirrorvg {VGName} hdisk7 <--要拿出來的

2014年11月5日 星期三

oracle 對特定欄位作授權的方式


 SELECT 授權 
The following test granting select access to a specified table column.
connect pubs/pubs;

drop user fred;
create user fred identified by fred;
grant connect, resource to fred;

drop view temp;

create view
   temp
as
select
   price
from
   titles;

grant select on temp to fred;

connect fred/fred

select price from pubs.temp;

http://www.dba-oracle.com/class_audit/select_grant_on_specific_table_column.htm



  INSERT, UPDATE, and REFERENCES

Only INSERT, UPDATE, and REFERENCES privileges can be granted at the column level. When granting INSERT at the column level, you must include all the not null columns in the row.

GRANT  update (emp_name)
ON  edwin.emp
TO  joan;


http://www.dba-oracle.com/concepts/column_privileges.htm