用什么方法可以禁止对表中数据进行增加、删除、修改操作,而只能进行查询操作 

解决方案 »

  1.   

    select * from tablename for update 
      

  2.   

    lock table test in exclusive mode nowait;
      

  3.   

    把这个表放在一个单独的表空间中设置该表空间为read only
      

  4.   

    create tablespace tbsname 
    datafile 'd:\123.mdf'
    size 10M;alter tablespace tbsname  read only;然后把表建在这个表空间上面这只是换了一个思路
      

  5.   

    对于用户只给某些表的查询权限就行grant select on table_name to user_name;个人意见,你可以试试!
      

  6.   

    有权限来控制把。grant select  on username ;
      

  7.   


      使用lock table test in exclusive mode nowait之后,也可以插入数据。SQL> create table test(x number(2));
     
    Table created
     
    SQL> lock table test in exclusive mode nowait;
     
    Table(s) locked
     
    SQL> insert into test(x) values(1);
     
    1 row inserted
     
    SQL> commit;
     
    Commit complete
     
    SQL> select * from test;
     
      X
    ---
      1
     
    SQL> 
      

  8.   

    SQL> create table test(x number(2));
     
    Table created
     
    SQL> lock table test in exclusive mode nowait;
     
    Table(s) locked
     
    SQL> insert into test(x) values(1);
     
    1 row inserted
     
    SQL> commit;
     
    Commit complete
     
    SQL> select * from test;
     
      X
    ---
      1
     
    SQL> 
      

  9.   

    lock table test in exclusive mode nowait;
      

  10.   


    你这是在当前 session。
    在新session里试试?
    无限期等待。
    虽然无法实现11g里真正的只读表的目的,但是其他session肯定无法写该表!!!!!
      

  11.   

    ww20042005
     
    (ww20042005) 等 级: 
    结帖率:0.00% 
      

  12.   

    如果用同一oracle用户访问,只读视图是较好的
    create view v_test as select * from test with read only;
      

  13.   


    新的session一样可以写表,我的是ORACLE 9I。
      

  14.   

    select * from tablename for update 
      

  15.   

    select * from tablename for update  是表锁定。
      

  16.   

    用触发器
    或者在建一个用户,将表的select权限赋给他