MINI MINI MANI MO

Path : /opt/oracle/product/18c/dbhomeXE/olap/admin/
File Upload :
Current File : //opt/oracle/product/18c/dbhomeXE/olap/admin/xoqsys.sql

Rem Copyright (c) 2000, 2017, Oracle and/or its affiliates. 
Rem All rights reserved.
Rem
Rem    NAME
Rem      xoqsys.sql
Rem
Rem    DESCRIPTION
Rem      Create metadata owner schema 'OLAPSYS' with no password
Rem
Rem    NOTES
Rem      Must be run as 'SYS' and requires paramaters for default and
Rem      temporary tablespace.  
Rem
Rem    
Rem    BEGIN SQL_FILE_METADATA
Rem    SQL_SOURCE_FILE: oraolap/admin/xoqsys.sql
Rem    SQL_SHIPPED_FILE:olap/admin/xoqsys.sql
Rem    SQL_PHASE: XOQSYS
Rem    SQL_STARTUP_MODE: NONE
Rem    SQL_IGNORABLE_ERRORS: NONE
Rem    END SQL_FILE_METADATA
Rem    
Rem    MODIFIED   (MM/DD/YY)
Rem    ghicks      12/08/15 - Bug 22303952: revoke INHERT PRIVILEGES
Rem    awesley     01/24/14 - Bug 17639176 move tablespaces defaulting to catxoq.sql, always create XMl_LOAD... objects,
Rem    awesley    `06/11/13 - LRG 9185136 remove all grants from olapsys 
Rem    mstasiew    03/14/13 - 16473621 set ORACLE_SCRIPT
Rem    awesley     01/30/13 - bug 16230256 create OLAPSYS if it does not exist 
Rem    awesley     03/21/12 - deprecate cwm tx 13068864 
Rem                           copy from cwmlite/admin, 
Rem                           consolidate olapsys creaate scripts
Rem    jheng       06/13/11 - Project 32973 grant to olapsys
Rem    glyon       06/24/08 - bug 7204558 XXXeliminate references to sys.user$
Rem    clei        02/13/08 - remove update statement on user$
Rem    glyon       06/04/07 - Make it impossible to connect as olapsys
Rem    jcarey      10/07/04 - Remove unnecessary rights
Rem    cdalessi    04/23/04 - Remove references to all_aw_numbers 
Rem    awesley     04/12/04 - add grant to sys.view$, create/drop any synonym
Rem    dbardwel    03/29/04 - 
Rem    ckearney    11/20/03 - add grant to all_aw_numbers and aw_prop$
Rem    ckearney    11/20/03 - add grant to all_aw_numbers and aw_prop$
Rem    awesley     11/12/03 - add grant select on dba_tables, dba_constraints, dba_objects, create/drop dimension
Rem    cdalessi    07/29/03 - 
Rem    cdalessi    10/21/02 - cdalessi_txn104879
Rem    cdalessi    10/10/02 - Renamed this file from oneuser.sql to amdsys.sql
Rem    dthompso    04/11/01 - B1716330 Add parameter for default temporary tab
Rem    dallan      06/23/00 - Add parameter for tablespace, created in DBCA.
Rem    dthompso    04/27/00 - Initial Version
Rem    dthompso    01/00/00 - Created
Rem

Rem  if user olapsys does not exist create it

@@?/rdbms/admin/sqlsessstart.sql

DECLARE
  isthere     NUMBER;
BEGIN
  
  select count(*) into isthere from dba_users where username ='OLAPSYS';
  if isthere = 0 then

    execute immediate 'create user olapsys identified by no_password'
                  || ' password expire account lock' 
                  || ' default tablespace ' || '&1'
                  || ' temporary tablespace ' || '&2'
                  || ' quota unlimited on ' || '&1';

  end if;
END;
/

Rem revoke INHERIT PRIVILEGES from public
DECLARE
  already_revoked EXCEPTION;
  pragma exception_init(already_revoked,-01927);
BEGIN
   execute immediate 'REVOKE INHERIT PRIVILEGES ON USER OLAPSYS FROM public';
EXCEPTION
  when already_revoked then
    null;
END;
/

Rem copied with changes from cwmlite/admin/ cwm2inst.sql and cwm2mtbl.sql
alter session set current_schema = olapsys
/

BEGIN
  execute immediate 
  'create sequence olapsys.XML_LOADID_SEQUENCE';
EXCEPTION
  when others then
    null;
 END;
/

BEGIN
  execute immediate 
  'create table olapsys.XML_LOAD_RECORDS (
  xml_loadid number not null,
  xml_recordid number not null,
  xml_recordtext varchar2(2000),
  primary key (xml_loadid, xml_recordid))';
EXCEPTION
  when others then
    null;
 END;
/

BEGIN
  execute immediate 
  'create table olapsys.XML_LOAD_LOG (
  xml_loadid number not null,
  xml_recordid number not null,
  xml_date date not null,
  xml_aw varchar2(80),
  xml_message varchar2(2000),
  primary key (xml_loadid, xml_recordid))';
 EXCEPTION
  when others then
    null;
 END;
/

Rem copy from cwmlite/admin/cwm2inst.sql and rename 
@@xoqawmd.sql  -- create active catalog

alter session set current_schema = sys;

@@?/rdbms/admin/sqlsessend.sql

OHA YOOOO