Home » RDBMS Server » Server Utilities » How to grant a user with some power
How to grant a user with some power [message #73657] Sun, 13 June 2004 18:47 Go to next message
rushing
Messages: 135
Registered: January 2004
Location: Beijing,China
Senior Member
I want give a user these power:

create table

share table to other users

delete record

browse table

 

 
Re: How to grant a user with some power [message #73658 is a reply to message #73657] Sun, 13 June 2004 23:44 Go to previous message
Barbara Boehmer
Messages: 9097
Registered: November 2002
Location: California, USA
Senior Member
-- create user and grant privileges:
scott@ORA92> CREATE USER user1 IDENTIFIED BY user1
  2  DEFAULT TABLESPACE users
  3  QUOTA UNLIMITED ON USERS
  4  /

User created.

scott@ORA92> GRANT CREATE SESSION, CREATE TABLE, CREATE PUBLIC SYNONYM TO user1
  2  /

Grant succeeded.

-- connect as user1 and test privileges:
scott@ORA92> @ CONNECT user1/user1
scott@ORA92> set termout off
user1@ORA92> 
user1@ORA92> set termout on
user1@ORA92> -- create table:
user1@ORA92> CREATE TABLE test_table (col1 NUMBER)
  2  /

Table created.

user1@ORA92> INSERT INTO test_table VALUES (1)
  2  /

1 row created.

user1@ORA92> INSERT INTO test_table VALUES (2)
  2  /

1 row created.

user1@ORA92> COMMIT
  2  /

Commit complete.

user1@ORA92> -- share table to others:
user1@ORA92> CREATE PUBLIC SYNONYM test_table_syn FOR test_table
  2  /

Synonym created.

user1@ORA92> -- delete record:
user1@ORA92> DELETE FROM test_table
  2  WHERE  col1 = 1
  3  /

1 row deleted.

user1@ORA92> -- select from table (Oracle does not have a browse):
user1@ORA92> SELECT * FROM test_table
  2  /

      COL1
----------
         2

user1@ORA92> @ CONNECT scott/tiger
user1@ORA92> set termout off
scott@ORA92> 
scott@ORA92> set termout on
scott@ORA92> -- test sharing:
scott@ORA92> SELECT * FROM test_table_syn
  2  /

      COL1
----------
         2
Previous Topic: Sqlloader
Next Topic: Newbie- what is a data disk?
Goto Forum:
  


Current Time: Mon Jul 01 01:35:04 CDT 2024