oracle²»¿É¸üеÄÊÔͼ
¹Ø¼ü´Ê£ºwith read only
×÷ÓãºÓÃÓÚÖ¸¶¨Ëù´´½¨µÄÊÔͼ²»¿ÉÒÔͨ¹ý±¾ÊÓͼ¸üбí
Ö´ÐÐÒ»ÏÂSQL£¬´´½¨±íT£¬ºÍÁ½¸öÊÔͼV1£¬V2£º
CREATE TABLE T(ID INTEGER);
CREATE VIEW V1 AS SELECT * from T;
CREATE VIEW V2 AS SELECT * from T WITH READ ONLY;
Ö´ÐÐSQL:
INSERT INTO V1 VALUES(1);
--------------------
1 row created
Ö´ÐÐSQL:
INSERT INTO V2 VALUES(1);
--------------------
Ìáʾ´íÎó
µ¥¶ÀµÄSELECTÓï¾ä²»ÄÜʹÓÃWITH READ ONLY
SELECT * from T WITH READ ONLY;
½«²»ÄÜÔËÐС£
Ïà¹ØÎĵµ£º
OracleÒì³£·ÖΪ3ÖÖ:
(1)Ô¤¶¨ÒåÒì³£:no_data_foundµÈ,ÊÇOracleϵͳ¶¨ÒåµÄÒì³£.
declare
s_test varchar2
begin
select id into s_test from test; --´Ëʱtest±íÎÞÊý¾Ý
exception
when no_data_found then
raise_application_error(-20001, 'ûÓÐÊý¾Ý');
end;
(2)×Ô¶ ......
--1²é¿´±í¿Õ¼äÒѾʹÓõİٷֱÈ
select a.tablespace_name,a.bytes/1024/1024
"Sum MB",(a.bytes-b.bytes)/1024/1024 "used MB",b.bytes/1024/1024
"free MB",round(((a.bytes-b.bytes)/a.bytes)*100,2) "percent_used"
from
(select tablespace_nam ......
1¡¢ÏÂÔØoracleÈí¼þ
http://www.oracle.com/technology/software/tech/oci/instantclient/index.html
oracle-instantclient-basic-10.2.0.4-1.i386.rpm
oracle-instantclient-sqlplus-10.2.0.4-1.i386.rpm
oracle-instantclient-devel-10.2.0.4-1.i386.rpm
2¡¢°²×°rpm°ü
rpm -ivh oracle-instantclient-basic-10.2.0.4 ......
ת×Ô£ºhttp://hi.baidu.com/dashuaiwang/blog/item/47cc680ec35055c37acbe1f8.html
´ò¿ªoracle Êý¾Ý¿âʱ³öÏÖÁË´íÎó:
ORA-00313: ÎÞ·¨´ò¿ªÈÕÖ¾×é 1 (Ïß³Ì 1) µÄ³ÉÔ±
ORA-00312: Áª»úÈÕÖ¾ 1 Ïß³Ì 1: 'D:\ORACLE\ORADATA\GOCOM\REDO01.LOG'
SQL> connect / as sysdba;
ÒÑÁ¬½Ó¡£
SQL> shutdown immediate;
ORA- ......