Home » RDBMS Server » Server Administration » create a view for Database Schema
create a view for Database Schema [message #123133] Fri, 10 June 2005 00:59 Go to next message
Mahesh P
Messages: 69
Registered: September 2004
Member
Hi Guys,

i just want to know how can we create a view for Database schema so that we can give read-only access to the schema.here is the scenario:
i am having a schema called "Production". for maintenance of the project i have to give some users only read-only access to this schema. how best can i achieve this. is there anything similar like creating a view for a table ,the same as creating a view for a schema.
pls help me.
thanks & regards,
Mahesh P
Re: create a view for Database Schema [message #123206 is a reply to message #123133] Fri, 10 June 2005 09:18 Go to previous message
Frank Naude
Messages: 4587
Registered: April 1998
Senior Member
Hi,

Here is an example:

SQL> CREATE USER production IDENTIFIED BY production;

User created.

SQL> CREATE USER user1 IDENTIFIED BY user1;

User created.

SQL> GRANT dba TO production;

Grant succeeded.

SQL> GRANT connect TO user1;

Grant succeeded.

SQL> CONNECT production/production
Connected.
SQL> CREATE TABLE tab1 (col1 DATE);

Table created.

SQL> GRANT SELECT ON tab1 TO user1;

Grant succeeded.

SQL> CONNECT user1/user1
Connected.
SQL> CREATE SYNONYM tab1 FOR production.tab1;

Synonym created.

SQL> DESC tab1
 Name                                      Null?    Type
 ----------------------------------------- -------- ----------------------------
 COL1                                               DATE

SQL> CREATE VIEW view1 AS SELECT * FROM production.tab1;

View created.


Best regards.

Frank
Previous Topic: Indoubt Transaction
Next Topic: unable to extend TEMP -- Did I do all that needs to be done?
Goto Forum:
  


Current Time: Fri Jan 10 07:43:42 CST 2025