Amazon

Showing posts with label oracle. Show all posts
Showing posts with label oracle. Show all posts

Friday, January 16, 2015

Oracle : Grants and checking Grants for a Schema

How would you enable one schema to do SELECT on another schema?

Step 1: Login to Srouce Schema SOURCE_SCHEMA, to provide grant to client schema
GRANT SELECT ON SRC_TAB TO CLIENT_SCHEMA;

Step 2: Login to Client Schema to select data from table present in source schema
SELECT * FROM SOURCE_SCHEMA.SRC_TAB;

Same steps can be used for UPDATE, DELETE and other ddl and dml grants.


How would you find from Client Schema that which tables of source schema are granted to Client Schema?

select * from USER_TAB_PRIVS where owner like 'SOURCE_SCHEMA';


How would you find the which objects (TABLE, FUNCTION, SEQUENCE etc) are present in a schema?

select * from ALL_OBJECTS where OWNER like 'SOURCE_SCHEMA' and OBJECT_TYPE like 'TABLE';

select * from ALL_OBJECTS where OWNER like 'SOURCE_SCHEMA' and OBJECT_TYPE like 'FUNCTION';

Tuesday, November 17, 2009

Oracle - Creating Database Schema

Schema is contained in tablespace. So very first step is to creating the db schema and aligning to a datafile

create tablespace oracler_tb datafile 'C:\\oracle\\oradata\\oracler_tb.dat' -- datafile to contain schema
size 200m default storage ( initial 100k next 100k pctincrease 0) ;

Creating the schema and its default user

create user oracler identified by sanjeev --user/password to access the schema
default tablespace oracler_tb
temporary tablespace temp
quota unlimited on oracler_tb ;

grant dba to oracler ;

Login into schema

user : oracler@orasid
password : sanjeev

Amazon Best Sellors

TOGAF 9.2 - STUDY [ The Open Group Architecture Framework ] - Chap 01 - Introduction

100 Feet View of TOGAF  What is Enterprise? Collection of Organization that has common set of Goals. Enterprise has People - organized by co...