Amazon

Showing posts with label Schema. Show all posts
Showing posts with label Schema. 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';

Monday, June 8, 2009

DB2 Basic Essentails

Listing the details(metadata) of a table.
SELECT * FROM SYSIBM.SYSCOLUMNS WHERE TBNAME = ‘MYTABLE’ AND TBCREATOR = ‘MYSCHEMA’ ORDER BY COLNO
where TBNAME is table name and TBCREATOR is schema name

Listing column name, column type, size, tablename of column of a table
SELECT name, coltype, length, tbname FROM SYSIBM.SYSCOLUMNS WHERE TBNAME = ‘MYTABLE’ AND TBCREATOR = ‘MYSCHEMA’ ORDER BY name

Selecting current date and current time
SELECT CURRENT DATE, CURRENT TIME FROM MYSCHEMA.MYTABLE

Using current date, current time in insert query
INSERT INTO MYSCHEMA.MYTABLE(MYDATE, MYTIME) VALUES (CURRENT TIME, CURRENT DATE)

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...