Script to create Metric Store in Oracle
Make sure appropriate (C:\Oracle11g\app\oradata\data\) folder exist in Oracle installation folder and run below script to create user for Metric Store with required privileges.
CREATE TABLESPACE "MSTBLSPACE" NOLOGGING DATAFILE 'C:\Oracle11g\app\oradata\data\MSTBLSPACE.ora' SIZE 100M;ALTER DATABASE DATAFILE 'C:\Oracle11g\app\oradata\data\MSTBLSPACE.ora' AUTOEXTEND ON;
create user MSTBLSPACEETRICS identified by MSTBLSPACEETRICS default tablespace MSTBLSPACE temporary tablespace temp quota unlimited on MSTBLSPACE;
grant connect to CMMETRICS;
grant create session to CMMETRICS;
grant create procedure to CMMETRICS;
grant create sequence to CMMETRICS;
grant create view to CMMETRICS;
grant create table to CMMETRICS;
grant create trigger to CMMETRICS;
grant create type to CMMETRICS;
grant execute on DBMS_LOCK to CMMETRICS;
grant execute on DBMS_UTILITY to CMMETRICS;
commit;
CREATE TABLESPACE "MSTBLSPACE" NOLOGGING DATAFILE 'C:\Oracle11g\app\oradata\data\MSTBLSPACE.ora' SIZE 100M;ALTER DATABASE DATAFILE 'C:\Oracle11g\app\oradata\data\MSTBLSPACE.ora' AUTOEXTEND ON;
create user MSTBLSPACEETRICS identified by MSTBLSPACEETRICS default tablespace MSTBLSPACE temporary tablespace temp quota unlimited on MSTBLSPACE;
grant connect to CMMETRICS;
grant create session to CMMETRICS;
grant create procedure to CMMETRICS;
grant create sequence to CMMETRICS;
grant create view to CMMETRICS;
grant create table to CMMETRICS;
grant create trigger to CMMETRICS;
grant create type to CMMETRICS;
grant execute on DBMS_LOCK to CMMETRICS;
grant execute on DBMS_UTILITY to CMMETRICS;
commit;
Verify Previlege for aboce User, it should return 7.
ReplyDeleteSELECT COUNT(DISTINCT PRIVILEGE) FROM (SELECT PRIVILEGE FROM role_sys_privs
UNION
SELECT PRIVILEGE FROM user_sys_privs)
WHERE PRIVILGE IN (
'CREATE PROCEDURE',
'CREATE SEQUENCE',
'CREATE SESSION',
'CREATE TABLE',
'CREATE TRIGGER',
'CREATE TYPE',
'CREATE VIEW');