oracle 授權用戶只能查看幾張表

--用system用戶登錄,創建用戶並授權

conn system/system as sysdba

create user username identified by password

grant connect to username

grant select on ta1 to username

--例如:

SQL> conn system/system as sysdba;

已連接。

SQL> create user test identified by test;

 

用戶已創建。

 

SQL> grant connect to test;

 

授權成功。

SQL> grant select on scott.emp to test;

 

授權成功。

 

SQL> conn test/test;

已連接。

 

SQL> select * from scott.emp;

 

     EMPNO ENAME      JOB              MGR HIREDATE              SAL       COMM     DEPTNO

---------- ---------- --------- ---------- -------------- ---------- ---------- ----------

      7369 SMITH      CLERK           7902 17-12月-80            800        900         20

      7499 ALLEN      SALESMAN        7698 20-2月 -81           1600        300         30

      7521 WARD       SALESMAN        7698 22-2月 -81           1250        500         30

      7566 JONES      MANAGER         7839 02-4月 -81           2975        900         20

      7654 MARTIN     SALESMAN        7698 28-9月 -81           1250       1400         30

      7698 BLAKE      MANAGER         7839 01-5月 -81           2850                    30

      7782 CLARK      MANAGER         7839 09-6月 -81           2450                    10

      7788 SCOTT      ANALYST         7566 19-4月 -87           3000        900         20

      7839 KING       PRESIDENT            17-11月-81           5000                    10

      7844 TURNER     SALESMAN        7698 08-9月 -81           1500          0         30

      7876 ADAMS      CLERK           7788 23-5月 -87           1100        900         20

      7900 JAMES      CLERK           7698 03-12月-81            950                    30

      7902 FORD       ANALYST         7566 03-12月-81           3000        900         20

      7934 MILLER     CLERK           7782 23-1月 -82           1300                    10

 

已選擇14行。


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章