企业的建库脚本(oracle10g)-阿里云开发者社区

开发者社区> 余二五> 正文

企业的建库脚本(oracle10g)

简介:
+关注继续查看
--
-- Create Database Script 
/* InitSNMP.ora file begins here.
#####################################################
# Created by TOAD 
# 2009-08-06 16:03:28
# Note: Only non-default parameters are listed here. 
#####################################################
audit_file_dest = "/oracle_data/admin/snmp/adump" 
background_dump_dest = "/oracle_data/admin/snmp/bdump" 
compatible = "10.2.0.1.0" 
control_files = (/oracle_data/snmp/control01.ctl, /oracle_data/snmp/control02.ctl, /oracle_data/snmp/control03.ctl) 
core_dump_dest = "/oracle_data/admin/snmp/cdump" 
db_block_size = 8192 
db_domain = "" 
db_file_multiblock_read_count = 16 
db_name = "snmp" 
db_recovery_file_dest = "/oracle_data/flash_recovery_area" 
db_recovery_file_dest_size = 17179869184 
dispatchers = "(PROTOCOL=TCP) (SERVICE=snmpXDB)" 
job_queue_processes = 10 
log_archive_format = "%t_%s_%r.dbf" 
open_cursors = 300 
pga_aggregate_target = 1073741824 
processes = 300 
remote_login_passwordfile = "EXCLUSIVE" 
sga_target = 1342177280 
undo_management = "AUTO" 
undo_tablespace = "UNDOTBS1" 
user_dump_dest = "/oracle_data/admin/snmp/udump"
InitSNMP.ora file ends here. */

--
-- SYSAUX  (Tablespace) 
--
CREATE TABLESPACE SYSAUX DATAFILE 
  '/oracle_data/snmp/sysaux01.dbf' SIZE 370M AUTOEXTEND ON NEXT 10M MAXSIZE UNLIMITED
LOGGING
ONLINE
PERMANENT
EXTENT MANAGEMENT LOCAL AUTOALLOCATE
BLOCKSIZE 8K
SEGMENT SPACE MANAGEMENT AUTO
FLASHBACK ON
/

--
-- SYSTEM  (Tablespace) 
--
CREATE TABLESPACE SYSTEM DATAFILE 
  '/oracle_data/snmp/system01.dbf' SIZE 490M AUTOEXTEND ON NEXT 10M MAXSIZE UNLIMITED
LOGGING
ONLINE
PERMANENT
EXTENT MANAGEMENT LOCAL AUTOALLOCATE
BLOCKSIZE 8K
FLASHBACK ON
/

--
-- TEMP  (Tablespace) 
--
CREATE TEMPORARY TABLESPACE TEMP TEMPFILE 
  '/oracle_data/snmp/temp01.dbf' SIZE 1482M AUTOEXTEND ON NEXT 640K MAXSIZE UNLIMITED
TABLESPACE GROUP ''
EXTENT MANAGEMENT LOCAL UNIFORM SIZE 1M
/

--
-- UNDOTBS1  (Tablespace) 
--
CREATE UNDO TABLESPACE UNDOTBS1 DATAFILE 
  '/oracle_data/snmp/undotbs01.dbf' SIZE 450M AUTOEXTEND ON NEXT 5M MAXSIZE UNLIMITED
ONLINE
RETENTION NOGUARANTEE
BLOCKSIZE 8K
FLASHBACK ON
/

--
-- USERS  (Tablespace) 
--
CREATE TABLESPACE USERS DATAFILE 
  '/oracle_data/snmp/users01.dbf' SIZE 5336320K AUTOEXTEND ON NEXT 1280K MAXSIZE UNLIMITED
LOGGING
ONLINE
PERMANENT
EXTENT MANAGEMENT LOCAL AUTOALLOCATE
BLOCKSIZE 8K
SEGMENT SPACE MANAGEMENT AUTO
FLASHBACK ON
/

ALTER DATABASE ADD LOGFILE GROUP 1(
  '/oracle_data/snmp/redo01.log')
    SIZE 300M
/

ALTER DATABASE ADD LOGFILE GROUP 2(
  '/oracle_data/snmp/redo02.log')
    SIZE 300M
/

ALTER DATABASE ADD LOGFILE GROUP 3(
  '/oracle_data/snmp/redo03.log')
    SIZE 300M
/

--
-- DEFAULT  (Profile) 
--
CREATE PROFILE DEFAULT LIMIT
  SESSIONS_PER_USER UNLIMITED
  CPU_PER_SESSION UNLIMITED
  CPU_PER_CALL UNLIMITED
  CONNECT_TIME UNLIMITED
  IDLE_TIME UNLIMITED
  LOGICAL_READS_PER_SESSION UNLIMITED
  LOGICAL_READS_PER_CALL UNLIMITED
  COMPOSITE_LIMIT UNLIMITED
  PRIVATE_SGA UNLIMITED
  FAILED_LOGIN_ATTEMPTS 10
  PASSWORD_LIFE_TIME UNLIMITED
  PASSWORD_REUSE_TIME UNLIMITED
  PASSWORD_REUSE_MAX UNLIMITED
  PASSWORD_LOCK_TIME UNLIMITED
  PASSWORD_GRACE_TIME UNLIMITED
  PASSWORD_VERIFY_FUNCTION NULL
/

--
-- MONITORING_PROFILE  (Profile) 
--
CREATE PROFILE MONITORING_PROFILE LIMIT
  SESSIONS_PER_USER DEFAULT
  CPU_PER_SESSION DEFAULT
  CPU_PER_CALL DEFAULT
  CONNECT_TIME DEFAULT
  IDLE_TIME DEFAULT
  LOGICAL_READS_PER_SESSION DEFAULT
  LOGICAL_READS_PER_CALL DEFAULT
  COMPOSITE_LIMIT DEFAULT
  PRIVATE_SGA DEFAULT
  FAILED_LOGIN_ATTEMPTS UNLIMITED
  PASSWORD_LIFE_TIME DEFAULT
  PASSWORD_REUSE_TIME DEFAULT
  PASSWORD_REUSE_MAX DEFAULT
  PASSWORD_LOCK_TIME DEFAULT
  PASSWORD_GRACE_TIME DEFAULT
  PASSWORD_VERIFY_FUNCTION DEFAULT
/

--
-- CONNECT  (Role) 
--
CREATE ROLE CONNECT NOT IDENTIFIED
/
 
--
-- RESOURCE  (Role) 
--
CREATE ROLE RESOURCE NOT IDENTIFIED
/
 
--
-- DBA  (Role) 
--
CREATE ROLE DBA NOT IDENTIFIED
/
 
--
-- SELECT_CATALOG_ROLE  (Role) 
--
CREATE ROLE SELECT_CATALOG_ROLE NOT IDENTIFIED
/
 
--
-- EXECUTE_CATALOG_ROLE  (Role) 
--
CREATE ROLE EXECUTE_CATALOG_ROLE NOT IDENTIFIED
/
 
--
-- DELETE_CATALOG_ROLE  (Role) 
--
CREATE ROLE DELETE_CATALOG_ROLE NOT IDENTIFIED
/
 
--
-- EXP_FULL_DATABASE  (Role) 
--
CREATE ROLE EXP_FULL_DATABASE NOT IDENTIFIED
/
 
--
-- IMP_FULL_DATABASE  (Role) 
--
CREATE ROLE IMP_FULL_DATABASE NOT IDENTIFIED
/
 
--
-- RECOVERY_CATALOG_OWNER  (Role) 
--
CREATE ROLE RECOVERY_CATALOG_OWNER NOT IDENTIFIED
/
 
--
-- GATHER_SYSTEM_STATISTICS  (Role) 
--
CREATE ROLE GATHER_SYSTEM_STATISTICS NOT IDENTIFIED
/
 
--
-- LOGSTDBY_ADMINISTRATOR  (Role) 
--
CREATE ROLE LOGSTDBY_ADMINISTRATOR NOT IDENTIFIED
/
 
--
-- AQ_ADMINISTRATOR_ROLE  (Role) 
--
CREATE ROLE AQ_ADMINISTRATOR_ROLE NOT IDENTIFIED
/
 
--
-- AQ_USER_ROLE  (Role) 
--
CREATE ROLE AQ_USER_ROLE NOT IDENTIFIED
/
 
--
-- GLOBAL_AQ_USER_ROLE  (Role) 
--
CREATE ROLE GLOBAL_AQ_USER_ROLE IDENTIFIED GLOBALLY
/
 
--
-- SCHEDULER_ADMIN  (Role) 
--
CREATE ROLE SCHEDULER_ADMIN NOT IDENTIFIED
/
 
--
-- HS_ADMIN_ROLE  (Role) 
--
CREATE ROLE HS_ADMIN_ROLE NOT IDENTIFIED
/
 
--
-- AUTHENTICATEDUSER  (Role) 
--
CREATE ROLE AUTHENTICATEDUSER NOT IDENTIFIED
/
 
--
-- OEM_ADVISOR  (Role) 
--
CREATE ROLE OEM_ADVISOR NOT IDENTIFIED
/
 
--
-- OEM_MONITOR  (Role) 
--
CREATE ROLE OEM_MONITOR NOT IDENTIFIED
/
 
--
-- WM_ADMIN_ROLE  (Role) 
--
CREATE ROLE WM_ADMIN_ROLE NOT IDENTIFIED
/
 
--
-- JAVAUSERPRIV  (Role) 
--
CREATE ROLE JAVAUSERPRIV NOT IDENTIFIED
/
 
--
-- JAVAIDPRIV  (Role) 
--
CREATE ROLE JAVAIDPRIV NOT IDENTIFIED
/
 
--
-- JAVASYSPRIV  (Role) 
--
CREATE ROLE JAVASYSPRIV NOT IDENTIFIED
/
 
--
-- JAVADEBUGPRIV  (Role) 
--
CREATE ROLE JAVADEBUGPRIV NOT IDENTIFIED
/
 
--
-- EJBCLIENT  (Role) 
--
CREATE ROLE EJBCLIENT NOT IDENTIFIED
/
 
--
-- JAVA_ADMIN  (Role) 
--
CREATE ROLE JAVA_ADMIN NOT IDENTIFIED
/
 
--
-- JAVA_DEPLOY  (Role) 
--
CREATE ROLE JAVA_DEPLOY NOT IDENTIFIED
/
 
--
-- CTXAPP  (Role) 
--
CREATE ROLE CTXAPP NOT IDENTIFIED
/
 
--
-- XDBADMIN  (Role) 
--
CREATE ROLE XDBADMIN NOT IDENTIFIED
/
 
--
-- XDBWEBSERVICES  (Role) 
--
CREATE ROLE XDBWEBSERVICES NOT IDENTIFIED
/
 
--
-- OLAP_DBA  (Role) 
--
CREATE ROLE OLAP_DBA NOT IDENTIFIED
/
 
--
-- OLAP_USER  (Role) 
--
CREATE ROLE OLAP_USER NOT IDENTIFIED
/
 
--
-- MGMT_USER  (Role) 
--
CREATE ROLE MGMT_USER NOT IDENTIFIED
/
 
--
-- SYSTEM  (Rollback Segment) 
--
CREATE ROLLBACK SEGMENT SYSTEM
  TABLESPACE SYSTEM
  STORAGE    (
              INITIAL          112K
              MINEXTENTS       1
              MAXEXTENTS       32765
             )
/
ALTER ROLLBACK SEGMENT SYSTEM ONLINE
/

--
-- ANONYMOUS  (User) 
--
CREATE USER ANONYMOUS
  IDENTIFIED BY VALUES 'anonymous'
  DEFAULT TABLESPACE SYSAUX
  TEMPORARY TABLESPACE TEMP
  PROFILE DEFAULT
  PASSWORD EXPIRE
  ACCOUNT LOCK
/
  -- 1 System Privilege for ANONYMOUS 
  GRANT CREATE SESSION TO ANONYMOUS
/

--
-- CTXSYS  (User) 
--
--  Dependencies: 
--   CTXAPP (Role)
--   RESOURCE (Role)
--
CREATE USER CTXSYS
  IDENTIFIED BY VALUES '71E687F036AD56E5'
  DEFAULT TABLESPACE SYSAUX
  TEMPORARY TABLESPACE TEMP
  PROFILE DEFAULT
  PASSWORD EXPIRE
  ACCOUNT LOCK
/
  -- 2 Roles for CTXSYS 
  GRANT CTXAPP TO CTXSYS WITH ADMIN OPTION
/
  GRANT RESOURCE TO CTXSYS
/
  ALTER USER CTXSYS DEFAULT ROLE ALL
/
  -- 7 System Privileges for CTXSYS 
  GRANT ALTER SESSION TO CTXSYS
/
  GRANT CREATE PUBLIC SYNONYM TO CTXSYS
/
  GRANT CREATE SESSION TO CTXSYS
/
  GRANT CREATE SYNONYM TO CTXSYS
/
  GRANT CREATE VIEW TO CTXSYS
/
  GRANT DROP PUBLIC SYNONYM TO CTXSYS
/
  GRANT UNLIMITED TABLESPACE TO CTXSYS
/

--
-- DBADMIN  (User) 
--
--  Dependencies: 
--   DBA (Role)
--
CREATE USER DBADMIN
  IDENTIFIED BY VALUES 'CD3BB2FCAD25DED5'
  DEFAULT TABLESPACE USERS
  TEMPORARY TABLESPACE TEMP
  PROFILE DEFAULT
  ACCOUNT UNLOCK
/
  -- 1 Role for DBADMIN 
  GRANT DBA TO DBADMIN
/
  ALTER USER DBADMIN DEFAULT ROLE ALL
/
  -- 1 System Privilege for DBADMIN 
  GRANT UNLIMITED TABLESPACE TO DBADMIN
/

--
-- DBSNMP  (User) 
--
--  Dependencies: 
--   OEM_MONITOR (Role)
--
CREATE USER DBSNMP
  IDENTIFIED BY VALUES '191A2447CC8D1CC2'
  DEFAULT TABLESPACE SYSAUX
  TEMPORARY TABLESPACE TEMP
  PROFILE MONITORING_PROFILE
  ACCOUNT UNLOCK
/
  -- 1 Role for DBSNMP 
  GRANT OEM_MONITOR TO DBSNMP
/
  ALTER USER DBSNMP DEFAULT ROLE ALL
/
  -- 4 System Privileges for DBSNMP 
  GRANT CREATE PROCEDURE TO DBSNMP
/
  GRANT CREATE TABLE TO DBSNMP
/
  GRANT SELECT ANY DICTIONARY TO DBSNMP
/
  GRANT UNLIMITED TABLESPACE TO DBSNMP
/

--
-- DIP  (User) 
--
CREATE USER DIP
  IDENTIFIED BY VALUES 'CE4A36B8E06CA59C'
  DEFAULT TABLESPACE USERS
  TEMPORARY TABLESPACE TEMP
  PROFILE DEFAULT
  PASSWORD EXPIRE
  ACCOUNT LOCK
/
  -- 1 System Privilege for DIP 
  GRANT CREATE SESSION TO DIP
/

--
-- DMSYS  (User) 
--
CREATE USER DMSYS
  IDENTIFIED BY VALUES 'BFBA5A553FD9E28A'
  DEFAULT TABLESPACE SYSAUX
  TEMPORARY TABLESPACE TEMP
  PROFILE DEFAULT
  PASSWORD EXPIRE
  ACCOUNT LOCK
/
  -- 15 System Privileges for DMSYS 
  GRANT ALTER SESSION TO DMSYS
/
  GRANT ALTER SYSTEM TO DMSYS
/
  GRANT CREATE JOB TO DMSYS
/
  GRANT CREATE LIBRARY TO DMSYS
/
  GRANT CREATE PROCEDURE TO DMSYS
/
  GRANT CREATE PUBLIC SYNONYM TO DMSYS
/
  GRANT CREATE SEQUENCE TO DMSYS
/
  GRANT CREATE SESSION TO DMSYS
/
  GRANT CREATE SYNONYM TO DMSYS
/
  GRANT CREATE TABLE TO DMSYS
/
  GRANT CREATE TRIGGER TO DMSYS
/
  GRANT CREATE TYPE TO DMSYS
/
  GRANT CREATE VIEW TO DMSYS
/
  GRANT DROP PUBLIC SYNONYM TO DMSYS
/
  GRANT QUERY REWRITE TO DMSYS
/
  -- 1 Tablespace Quota for DMSYS 
  ALTER USER DMSYS QUOTA 200M ON SYSAUX
/

--
-- EXFSYS  (User) 
--
--  Dependencies: 
--   CONNECT (Role)
--   RESOURCE (Role)
--
CREATE USER EXFSYS
  IDENTIFIED BY VALUES '66F4EF5650C20355'
  DEFAULT TABLESPACE SYSAUX
  TEMPORARY TABLESPACE TEMP
  PROFILE DEFAULT
  PASSWORD EXPIRE
  ACCOUNT LOCK
/
  -- 2 Roles for EXFSYS 
  GRANT CONNECT TO EXFSYS
/
  GRANT RESOURCE TO EXFSYS
/
  ALTER USER EXFSYS DEFAULT ROLE ALL
/
  -- 8 System Privileges for EXFSYS 
  GRANT ADMINISTER DATABASE TRIGGER TO EXFSYS
/
  GRANT CREATE ANY TRIGGER TO EXFSYS
/
  GRANT CREATE INDEXTYPE TO EXFSYS
/
  GRANT CREATE JOB TO EXFSYS
/
  GRANT CREATE LIBRARY TO EXFSYS
/
  GRANT CREATE OPERATOR TO EXFSYS
/
  GRANT MANAGE SCHEDULER TO EXFSYS
/
  GRANT UNLIMITED TABLESPACE TO EXFSYS
/

--
-- MDDATA  (User) 
--
--  Dependencies: 
--   CONNECT (Role)
--   RESOURCE (Role)
--
CREATE USER MDDATA
  IDENTIFIED BY VALUES 'DF02A496267DEE66'
  DEFAULT TABLESPACE USERS
  TEMPORARY TABLESPACE TEMP
  PROFILE DEFAULT
  PASSWORD EXPIRE
  ACCOUNT LOCK
/
  -- 2 Roles for MDDATA 
  GRANT CONNECT TO MDDATA
/
  GRANT RESOURCE TO MDDATA
/
  ALTER USER MDDATA DEFAULT ROLE ALL
/
  -- 1 System Privilege for MDDATA 
  GRANT UNLIMITED TABLESPACE TO MDDATA
/

--
-- MDSYS  (User) 
--
--  Dependencies: 
--   CONNECT (Role)
--   RESOURCE (Role)
--
CREATE USER MDSYS
  IDENTIFIED BY VALUES '72979A94BAD2AF80'
  DEFAULT TABLESPACE SYSAUX
  TEMPORARY TABLESPACE TEMP
  PROFILE DEFAULT
  PASSWORD EXPIRE
  ACCOUNT LOCK
/
  -- 2 Roles for MDSYS 
  GRANT CONNECT TO MDSYS
/
  GRANT RESOURCE TO MDSYS
/
  ALTER USER MDSYS DEFAULT ROLE ALL
/
  -- 14 System Privileges for MDSYS 
  GRANT CREATE ANY TRIGGER TO MDSYS
/
  GRANT CREATE INDEXTYPE TO MDSYS
/
  GRANT CREATE LIBRARY TO MDSYS
/
  GRANT CREATE OPERATOR TO MDSYS
/
  GRANT CREATE PROCEDURE TO MDSYS
/
  GRANT CREATE PUBLIC SYNONYM TO MDSYS
/
  GRANT CREATE SEQUENCE TO MDSYS
/
  GRANT CREATE SESSION TO MDSYS
/
  GRANT CREATE TABLE TO MDSYS
/
  GRANT CREATE TYPE TO MDSYS
/
  GRANT CREATE VIEW TO MDSYS
/
  GRANT DELETE ANY TABLE TO MDSYS
/
  GRANT DROP PUBLIC SYNONYM TO MDSYS
/
  GRANT UNLIMITED TABLESPACE TO MDSYS
/
  -- 5 Java Privileges for MDSYS 
DECLARE
 KEYNUM NUMBER;
BEGIN
  SYS.DBMS_JAVA.GRANT_PERMISSION(
     grantee           => 'MDSYS'
    ,permission_type   => 'SYS:java.io.FilePermission'
    ,permission_name   => 'md/lib/*'
    ,permission_action => 'read'
    ,key               => KEYNUM
    );
  SYS.DBMS_JAVA.DISABLE_PERMISSION
    (key => KEYNUM);
END;
/
DECLARE
 KEYNUM NUMBER;
BEGIN
  SYS.DBMS_JAVA.GRANT_PERMISSION(
     grantee           => 'MDSYS'
    ,permission_type   => 'SYS:java.io.FilePermission'
    ,permission_name   => 'sdo/demos/georaster/jlibs/*'
    ,permission_action => 'read'
    ,key               => KEYNUM
    );
  SYS.DBMS_JAVA.DISABLE_PERMISSION
    (key => KEYNUM);
END;
/
DECLARE
 KEYNUM NUMBER;
BEGIN
  SYS.DBMS_JAVA.GRANT_PERMISSION(
     grantee           => 'MDSYS'
    ,permission_type   => 'SYS:java.io.FilePermission'
    ,permission_name   => 'md\lib\*'
    ,permission_action => 'read'
    ,key               => KEYNUM
    );
END;
/
DECLARE
 KEYNUM NUMBER;
BEGIN
  SYS.DBMS_JAVA.GRANT_PERMISSION(
     grantee           => 'MDSYS'
    ,permission_type   => 'SYS:java.io.FilePermission'
    ,permission_name   => 'sdo\demos\georaster\jlibs\*'
    ,permission_action => 'read'
    ,key               => KEYNUM
    );
END;
/
DECLARE
 KEYNUM NUMBER;
BEGIN
  SYS.DBMS_JAVA.GRANT_PERMISSION(
     grantee           => 'MDSYS'
    ,permission_type   => 'SYS:java.lang.RuntimePermission'
    ,permission_name   => 'getClassLoader'
    ,permission_action => ''
    ,key               => KEYNUM
    );
END;
/

--
-- MGMT_VIEW  (User) 
--
--  Dependencies: 
--   MGMT_USER (Role)
--
CREATE USER MGMT_VIEW
  IDENTIFIED BY VALUES '4F538DF5F344F348'
  DEFAULT TABLESPACE SYSTEM
  TEMPORARY TABLESPACE TEMP
  PROFILE DEFAULT
  ACCOUNT UNLOCK
/
  -- 1 Role for MGMT_VIEW 
  GRANT MGMT_USER TO MGMT_VIEW
/
  ALTER USER MGMT_VIEW DEFAULT ROLE ALL
/

--
-- OLAPSYS  (User) 
--
--  Dependencies: 
--   OLAP_DBA (Role)
--   RESOURCE (Role)
--
CREATE USER OLAPSYS
  IDENTIFIED BY VALUES '3FB8EF9DB538647C'
  DEFAULT TABLESPACE SYSAUX
  TEMPORARY TABLESPACE TEMP
  PROFILE DEFAULT
  PASSWORD EXPIRE
  ACCOUNT LOCK
/
  -- 2 Roles for OLAPSYS 
  GRANT OLAP_DBA TO OLAPSYS
/
  GRANT RESOURCE TO OLAPSYS
/
  ALTER USER OLAPSYS DEFAULT ROLE ALL
/
  -- 13 System Privileges for OLAPSYS 
  GRANT CREATE ANY DIMENSION TO OLAPSYS
/
  GRANT CREATE ANY SYNONYM TO OLAPSYS
/
  GRANT CREATE PROCEDURE TO OLAPSYS
/
  GRANT CREATE PUBLIC SYNONYM TO OLAPSYS
/
  GRANT CREATE SEQUENCE TO OLAPSYS
/
  GRANT CREATE SESSION TO OLAPSYS
/
  GRANT CREATE TABLE TO OLAPSYS
/
  GRANT CREATE VIEW TO OLAPSYS
/
  GRANT DROP ANY DIMENSION TO OLAPSYS
/
  GRANT DROP ANY SYNONYM TO OLAPSYS
/
  GRANT DROP PUBLIC SYNONYM TO OLAPSYS
/
  GRANT SELECT ANY TABLE TO OLAPSYS
/
  GRANT UNLIMITED TABLESPACE TO OLAPSYS
/
  -- 1 Tablespace Quota for OLAPSYS 
  ALTER USER OLAPSYS QUOTA UNLIMITED ON SYSAUX
/

--
-- ORDPLUGINS  (User) 
--
CREATE USER ORDPLUGINS
  IDENTIFIED BY VALUES '88A2B2C183431F00'
  DEFAULT TABLESPACE SYSAUX
  TEMPORARY TABLESPACE TEMP
  PROFILE DEFAULT
  PASSWORD EXPIRE
  ACCOUNT LOCK
/
  -- 10 System Privileges for ORDPLUGINS 
  GRANT CREATE INDEXTYPE TO ORDPLUGINS
/
  GRANT CREATE LIBRARY TO ORDPLUGINS
/
  GRANT CREATE OPERATOR TO ORDPLUGINS
/
  GRANT CREATE PROCEDURE TO ORDPLUGINS
/
  GRANT CREATE PUBLIC SYNONYM TO ORDPLUGINS
/
  GRANT CREATE SESSION TO ORDPLUGINS
/
  GRANT CREATE TABLE TO ORDPLUGINS
/
  GRANT CREATE TYPE TO ORDPLUGINS
/
  GRANT DROP PUBLIC SYNONYM TO ORDPLUGINS
/
  GRANT UNLIMITED TABLESPACE TO ORDPLUGINS
/

--
-- ORDSYS  (User) 
--
--  Dependencies: 
--   JAVAUSERPRIV (Role)
--
CREATE USER ORDSYS
  IDENTIFIED BY VALUES '7EFA02EC7EA6B86F'
  DEFAULT TABLESPACE SYSAUX
  TEMPORARY TABLESPACE TEMP
  PROFILE DEFAULT
  PASSWORD EXPIRE
  ACCOUNT LOCK
/
  -- 1 Role for ORDSYS 
  GRANT JAVAUSERPRIV TO ORDSYS
/
  ALTER USER ORDSYS DEFAULT ROLE ALL
/
  -- 13 System Privileges for ORDSYS 
  GRANT CREATE ANY SYNONYM TO ORDSYS
/
  GRANT CREATE INDEXTYPE TO ORDSYS
/
  GRANT CREATE LIBRARY TO ORDSYS
/
  GRANT CREATE OPERATOR TO ORDSYS
/
  GRANT CREATE PROCEDURE TO ORDSYS
/
  GRANT CREATE PUBLIC SYNONYM TO ORDSYS
/
  GRANT CREATE SESSION TO ORDSYS
/
  GRANT CREATE TABLE TO ORDSYS
/
  GRANT CREATE TYPE TO ORDSYS
/
  GRANT CREATE VIEW TO ORDSYS
/
  GRANT DROP ANY SYNONYM TO ORDSYS
/
  GRANT DROP PUBLIC SYNONYM TO ORDSYS
/
  GRANT UNLIMITED TABLESPACE TO ORDSYS
/
  -- 1 Java Privilege for ORDSYS 
DECLARE
 KEYNUM NUMBER;
BEGIN
  SYS.DBMS_JAVA.GRANT_PERMISSION(
     grantee           => 'ORDSYS'
    ,permission_type   => 'SYS:java.lang.RuntimePermission'
    ,permission_name   => 'getClassLoader'
    ,permission_action => ''
    ,key               => KEYNUM
    );
END;
/

--
-- OUTLN  (User) 
--
--  Dependencies: 
--   RESOURCE (Role)
--
CREATE USER OUTLN
  IDENTIFIED BY VALUES '4A3BA55E08595C81'
  DEFAULT TABLESPACE SYSTEM
  TEMPORARY TABLESPACE TEMP
  PROFILE DEFAULT
  PASSWORD EXPIRE
  ACCOUNT LOCK
/
  -- 1 Role for OUTLN 
  GRANT RESOURCE TO OUTLN
/
  ALTER USER OUTLN DEFAULT ROLE ALL
/
  -- 3 System Privileges for OUTLN 
  GRANT CREATE SESSION TO OUTLN
/
  GRANT EXECUTE ANY PROCEDURE TO OUTLN
/
  GRANT UNLIMITED TABLESPACE TO OUTLN
/

--
-- SCOTT  (User) 
--
--  Dependencies: 
--   CONNECT (Role)
--   RESOURCE (Role)
--
CREATE USER SCOTT
  IDENTIFIED BY VALUES 'F894844C34402B67'
  DEFAULT TABLESPACE USERS
  TEMPORARY TABLESPACE TEMP
  PROFILE DEFAULT
  PASSWORD EXPIRE
  ACCOUNT LOCK
/
  -- 2 Roles for SCOTT 
  GRANT CONNECT TO SCOTT
/
  GRANT RESOURCE TO SCOTT
/
  ALTER USER SCOTT DEFAULT ROLE ALL
/
  -- 1 System Privilege for SCOTT 
  GRANT UNLIMITED TABLESPACE TO SCOTT
/

--
-- SI_INFORMTN_SCHEMA  (User) 
--
CREATE USER SI_INFORMTN_SCHEMA
  IDENTIFIED BY VALUES '84B8CBCA4D477FA3'
  DEFAULT TABLESPACE SYSAUX
  TEMPORARY TABLESPACE TEMP
  PROFILE DEFAULT
  PASSWORD EXPIRE
  ACCOUNT LOCK
/
  -- 1 System Privilege for SI_INFORMTN_SCHEMA 
  GRANT UNLIMITED TABLESPACE TO SI_INFORMTN_SCHEMA
/

--
-- SNMP  (User) 
--
--  Dependencies: 
--   CONNECT (Role)
--   DBA (Role)
--   RESOURCE (Role)
--   SELECT_CATALOG_ROLE (Role)
--
CREATE USER SNMP
  IDENTIFIED BY VALUES '324C7198FC46365C'
  DEFAULT TABLESPACE USERS
  TEMPORARY TABLESPACE TEMP
  PROFILE DEFAULT
  ACCOUNT UNLOCK
/
  -- 4 Roles for SNMP 
  GRANT CONNECT TO SNMP WITH ADMIN OPTION
/
  GRANT DBA TO SNMP WITH ADMIN OPTION
/
  GRANT RESOURCE TO SNMP WITH ADMIN OPTION
/
  GRANT SELECT_CATALOG_ROLE TO SNMP WITH ADMIN OPTION
/
  ALTER USER SNMP DEFAULT ROLE ALL
/
  -- 16 System Privileges for SNMP 
  GRANT CREATE ANY MATERIALIZED VIEW TO SNMP WITH ADMIN OPTION
/
  GRANT CREATE ANY SYNONYM TO SNMP WITH ADMIN OPTION
/
  GRANT CREATE ANY TABLE TO SNMP WITH ADMIN OPTION
/
  GRANT CREATE ANY VIEW TO SNMP WITH ADMIN OPTION
/
  GRANT CREATE PROCEDURE TO SNMP WITH ADMIN OPTION
/
  GRANT CREATE PUBLIC SYNONYM TO SNMP WITH ADMIN OPTION
/
  GRANT CREATE ROLE TO SNMP WITH ADMIN OPTION
/
  GRANT CREATE TABLE TO SNMP WITH ADMIN OPTION
/
  GRANT CREATE VIEW TO SNMP WITH ADMIN OPTION
/
  GRANT DROP ANY PROCEDURE TO SNMP WITH ADMIN OPTION
/
  GRANT DROP ANY SYNONYM TO SNMP WITH ADMIN OPTION
/
  GRANT DROP ANY TABLE TO SNMP WITH ADMIN OPTION
/
  GRANT DROP ANY VIEW TO SNMP WITH ADMIN OPTION
/
  GRANT DROP PUBLIC SYNONYM TO SNMP WITH ADMIN OPTION
/
  GRANT SELECT ANY DICTIONARY TO SNMP WITH ADMIN OPTION
/
  GRANT UNLIMITED TABLESPACE TO SNMP WITH ADMIN OPTION
/
  -- 1 Tablespace Quota for SNMP 
  ALTER USER SNMP QUOTA UNLIMITED ON USERS
/

--
-- SYS  (User) 
--
--  Dependencies: 
--   AQ_ADMINISTRATOR_ROLE (Role)
--   AQ_USER_ROLE (Role)
--   AUTHENTICATEDUSER (Role)
--   CONNECT (Role)
--   CTXAPP (Role)
--   DBA (Role)
--   DELETE_CATALOG_ROLE (Role)
--   EJBCLIENT (Role)
--   EXECUTE_CATALOG_ROLE (Role)
--   EXP_FULL_DATABASE (Role)
--   GATHER_SYSTEM_STATISTICS (Role)
--   HS_ADMIN_ROLE (Role)
--   IMP_FULL_DATABASE (Role)
--   JAVADEBUGPRIV (Role)
--   JAVAIDPRIV (Role)
--   JAVASYSPRIV (Role)
--   JAVAUSERPRIV (Role)
--   JAVA_ADMIN (Role)
--   JAVA_DEPLOY (Role)
--   LOGSTDBY_ADMINISTRATOR (Role)
--   MGMT_USER (Role)
--   OEM_ADVISOR (Role)
--   OEM_MONITOR (Role)
--   OLAP_DBA (Role)
--   OLAP_USER (Role)
--   RECOVERY_CATALOG_OWNER (Role)
--   RESOURCE (Role)
--   SCHEDULER_ADMIN (Role)
--   SELECT_CATALOG_ROLE (Role)
--   XDBADMIN (Role)
--   XDBWEBSERVICES (Role)
--
CREATE USER SYS
  IDENTIFIED BY VALUES '84906AB6DF7EEC2C'
  DEFAULT TABLESPACE SYSTEM
  TEMPORARY TABLESPACE TEMP
  PROFILE DEFAULT
  ACCOUNT UNLOCK
/
  -- 31 Roles for SYS 
  GRANT AQ_ADMINISTRATOR_ROLE TO SYS WITH ADMIN OPTION
/
  GRANT AQ_USER_ROLE TO SYS WITH ADMIN OPTION
/
  GRANT AUTHENTICATEDUSER TO SYS WITH ADMIN OPTION
/
  GRANT CONNECT TO SYS WITH ADMIN OPTION
/
  GRANT CTXAPP TO SYS WITH ADMIN OPTION
/
  GRANT DBA TO SYS WITH ADMIN OPTION
/
  GRANT DELETE_CATALOG_ROLE TO SYS WITH ADMIN OPTION
/
  GRANT EJBCLIENT TO SYS WITH ADMIN OPTION
/
  GRANT EXECUTE_CATALOG_ROLE TO SYS WITH ADMIN OPTION
/
  GRANT EXP_FULL_DATABASE TO SYS WITH ADMIN OPTION
/
  GRANT GATHER_SYSTEM_STATISTICS TO SYS WITH ADMIN OPTION
/
  GRANT HS_ADMIN_ROLE TO SYS WITH ADMIN OPTION
/
  GRANT IMP_FULL_DATABASE TO SYS WITH ADMIN OPTION
/
  GRANT JAVADEBUGPRIV TO SYS WITH ADMIN OPTION
/
  GRANT JAVAIDPRIV TO SYS WITH ADMIN OPTION
/
  GRANT JAVASYSPRIV TO SYS WITH ADMIN OPTION
/
  GRANT JAVAUSERPRIV TO SYS WITH ADMIN OPTION
/
  GRANT JAVA_ADMIN TO SYS WITH ADMIN OPTION
/
  GRANT JAVA_DEPLOY TO SYS WITH ADMIN OPTION
/
  GRANT LOGSTDBY_ADMINISTRATOR TO SYS WITH ADMIN OPTION
/
  GRANT MGMT_USER TO SYS WITH ADMIN OPTION
/
  GRANT OEM_ADVISOR TO SYS WITH ADMIN OPTION
/
  GRANT OEM_MONITOR TO SYS WITH ADMIN OPTION
/
  GRANT OLAP_DBA TO SYS WITH ADMIN OPTION
/
  GRANT OLAP_USER TO SYS WITH ADMIN OPTION
/
  GRANT RECOVERY_CATALOG_OWNER TO SYS WITH ADMIN OPTION
/
  GRANT RESOURCE TO SYS WITH ADMIN OPTION
/
  GRANT SCHEDULER_ADMIN TO SYS WITH ADMIN OPTION
/
  GRANT SELECT_CATALOG_ROLE TO SYS WITH ADMIN OPTION
/
  GRANT XDBADMIN TO SYS WITH ADMIN OPTION
/
  GRANT XDBWEBSERVICES TO SYS WITH ADMIN OPTION
/
  ALTER USER SYS DEFAULT ROLE ALL
/
  -- 159 System Privileges for SYS 
  GRANT ADMINISTER ANY SQL TUNING SET TO SYS
/
  GRANT ADMINISTER DATABASE TRIGGER TO SYS
/
  BEGIN
SYS.DBMS_RESOURCE_MANAGER_PRIVS.GRANT_SYSTEM_PRIVILEGE
  (GRANTEE_NAME   => 'SYS', 
   PRIVILEGE_NAME => 'ADMINISTER_RESOURCE_MANAGER',
   ADMIN_OPTION   => FALSE);
END;
/
  GRANT ADMINISTER SQL TUNING SET TO SYS
/
  GRANT ADVISOR TO SYS
/
  GRANT ALTER ANY CLUSTER TO SYS
/
  GRANT ALTER ANY DIMENSION TO SYS
/
  BEGIN
SYS.DBMS_RULE_ADM.GRANT_SYSTEM_PRIVILEGE(
  PRIVILEGE    => SYS.DBMS_RULE_ADM.ALTER_ANY_EVALUATION_CONTEXT,
  GRANTEE      => 'SYS',
  GRANT_OPTION => TRUE);
END;
/
  GRANT ALTER ANY INDEX TO SYS
/
  GRANT ALTER ANY INDEXTYPE TO SYS
/
  GRANT ALTER ANY LIBRARY TO SYS
/
  GRANT ALTER ANY MATERIALIZED VIEW TO SYS
/
  GRANT ALTER ANY OUTLINE TO SYS
/
  GRANT ALTER ANY PROCEDURE TO SYS
/
  GRANT ALTER ANY ROLE TO SYS
/
  BEGIN
SYS.DBMS_RULE_ADM.GRANT_SYSTEM_PRIVILEGE(
  PRIVILEGE    => SYS.DBMS_RULE_ADM.ALTER_ANY_RULE,
  GRANTEE      => 'SYS',
  GRANT_OPTION => TRUE);
END;
/
  BEGIN
SYS.DBMS_RULE_ADM.GRANT_SYSTEM_PRIVILEGE(
  PRIVILEGE    => SYS.DBMS_RULE_ADM.ALTER_ANY_RULE_SET,
  GRANTEE      => 'SYS',
  GRANT_OPTION => TRUE);
END;
/
  GRANT ALTER ANY SEQUENCE TO SYS
/
  GRANT ALTER ANY SQL PROFILE TO SYS
/
  GRANT ALTER ANY TABLE TO SYS
/
  GRANT ALTER ANY TRIGGER TO SYS
/
  GRANT ALTER ANY TYPE TO SYS
/
  GRANT ALTER DATABASE TO SYS
/
  GRANT ALTER PROFILE TO SYS
/
  GRANT ALTER RESOURCE COST TO SYS
/
  GRANT ALTER ROLLBACK SEGMENT TO SYS
/
  GRANT ALTER SESSION TO SYS
/
  GRANT ALTER SYSTEM TO SYS
/
  GRANT ALTER TABLESPACE TO SYS
/
  GRANT ALTER USER TO SYS
/
  GRANT ANALYZE ANY TO SYS
/
  GRANT AUDIT ANY TO SYS
/
  GRANT AUDIT SYSTEM TO SYS
/
  GRANT BACKUP ANY TABLE TO SYS
/
  GRANT BECOME USER TO SYS
/
  GRANT CHANGE NOTIFICATION TO SYS
/
  GRANT COMMENT ANY TABLE TO SYS
/
  GRANT CREATE ANY CLUSTER TO SYS
/
  GRANT CREATE ANY CONTEXT TO SYS
/
  GRANT CREATE ANY DIMENSION TO SYS
/
  GRANT CREATE ANY DIRECTORY TO SYS
/
  BEGIN
SYS.DBMS_RULE_ADM.GRANT_SYSTEM_PRIVILEGE(
  PRIVILEGE    => SYS.DBMS_RULE_ADM.CREATE_ANY_EVALUATION_CONTEXT,
  GRANTEE      => 'SYS',
  GRANT_OPTION => TRUE);
END;
/
  GRANT CREATE ANY INDEX TO SYS
/
  GRANT CREATE ANY INDEXTYPE TO SYS
/
  GRANT CREATE ANY JOB TO SYS
/
  GRANT CREATE ANY LIBRARY TO SYS
/
  GRANT CREATE ANY MATERIALIZED VIEW TO SYS
/
  GRANT CREATE ANY OPERATOR TO SYS
/
  GRANT CREATE ANY OUTLINE TO SYS
/
  GRANT CREATE ANY PROCEDURE TO SYS
/
  BEGIN
SYS.DBMS_RULE_ADM.GRANT_SYSTEM_PRIVILEGE(
  PRIVILEGE    => SYS.DBMS_RULE_ADM.CREATE_ANY_RULE,
  GRANTEE      => 'SYS',
  GRANT_OPTION => TRUE);
END;
/
  BEGIN
SYS.DBMS_RULE_ADM.GRANT_SYSTEM_PRIVILEGE(
  PRIVILEGE    => SYS.DBMS_RULE_ADM.CREATE_ANY_RULE_SET,
  GRANTEE      => 'SYS',
  GRANT_OPTION => TRUE);
END;
/
  GRANT CREATE ANY SEQUENCE TO SYS
/
  GRANT CREATE ANY SQL PROFILE TO SYS
/
  GRANT CREATE ANY SYNONYM TO SYS
/
  GRANT CREATE ANY TABLE TO SYS
/
  GRANT CREATE ANY TRIGGER TO SYS
/
  GRANT CREATE ANY TYPE TO SYS
/
  GRANT CREATE ANY VIEW TO SYS
/
  GRANT CREATE CLUSTER TO SYS
/
  GRANT CREATE DATABASE LINK TO SYS
/
  GRANT CREATE DIMENSION TO SYS
/
  BEGIN
SYS.DBMS_RULE_ADM.GRANT_SYSTEM_PRIVILEGE(
  PRIVILEGE    => SYS.DBMS_RULE_ADM.CREATE_EVALUATION_CONTEXT_OBJ,
  GRANTEE      => 'SYS',
  GRANT_OPTION => TRUE);
END;
/
  GRANT CREATE EXTERNAL JOB TO SYS
/
  GRANT CREATE INDEXTYPE TO SYS
/
  GRANT CREATE JOB TO SYS
/
  GRANT CREATE LIBRARY TO SYS
/
  GRANT CREATE MATERIALIZED VIEW TO SYS
/
  GRANT CREATE OPERATOR TO SYS
/
  GRANT CREATE PROCEDURE TO SYS
/
  GRANT CREATE PROFILE TO SYS
/
  GRANT CREATE PUBLIC DATABASE LINK TO SYS
/
  GRANT CREATE PUBLIC SYNONYM TO SYS
/
  GRANT CREATE ROLE TO SYS
/
  GRANT CREATE ROLLBACK SEGMENT TO SYS
/









本文转自 jxwpx 51CTO博客,原文链接:http://blog.51cto.com/jxwpx/189795,如需转载请自行联系原作者

版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。

相关文章
【转】Oracle 查看表空间使用率 SQL 脚本
文章转自:http://blog.csdn.net/tianlesoftware/article/details/7619732 1 /* Formatted on 2012/5/31 14:51:13 (QP5 v5.
658 0
PowerDesigner生成的ORACLE 建表脚本中去掉对象的双引号,设置大、小写
原文:PowerDesigner生成的ORACLE 建表脚本中去掉对象的双引号,设置大、小写 若要将 CDM 中将 Entity的标识符都设为指定的大小写,则可以这么设定: 打开cdm的情况下,进入Tools-Model Options-Naming Convention,把Name和Code的标...
720 0
Oracle 数据库增量备份周计划脚本
####------------------------------------------------------------------------------#### ##    shell db_incremental_database_backup.
1154 0
通过shell脚本监控oracle session
最近数据库碰到了连接紧张的问题,想通过一个脚本对数据库的session情况一目了然。 以下是自己写的脚本。实现的效果如下。 对session的总体情况,那些program主要在占用,每个用户所拥有的session(active,inactive,killed,sniped...)都能够一目了然。
660 0
+关注
20382
文章
0
问答
文章排行榜
最热
最新
相关电子书
更多
《2021云上架构与运维峰会演讲合集》
立即下载
《零基础CSS入门教程》
立即下载
《零基础HTML入门教程》
立即下载