zoukankan      html  css  js  c++  java
  • oracle 数据库创建脚本

    以下的mydata是用户名,也是数据库的名字,这种创建数据库的方式不用创建一个实例,还是用orcl 的sid

    =========================脚本开始===========================

    SET ECHO OFF

    PROMPT
    PROMPT specify password for mydata as parameter 1:
    DEFINE pass     = &1
    PROMPT
    PROMPT specify default tablespeace for mydata as parameter 2:
    DEFINE tbs      = &2
    PROMPT
    PROMPT specify temporary tablespace for mydata as parameter 3:
    DEFINE ttbs     = &3
    PROMPT
    PROMPT specify password for SYS as parameter 4:
    DEFINE pass_sys = &4
    PROMPT
    PROMPT specify log path as parameter 5:
    DEFINE log_path = &5
    PROMPT

    -- The first dot in the spool command below is
    -- the SQL*Plus concatenation character

    DEFINE spool_file = &log_path.mydata_main.log
    SPOOL &spool_file

    REM =======================================================
    REM cleanup section
    REM =======================================================

    DROP USER mydata CASCADE;

    REM =======================================================
    REM create user
    REM tmydataee separate commands, so the create user command
    REM will succeed regardless of the existence of the
    REM DEMO and TEMP tablespaces
    REM =======================================================

    CREATE USER mydata IDENTIFIED BY &pass;

    ALTER USER mydata DEFAULT TABLESPACE &tbs
                  QUOTA UNLIMITED ON &tbs;

    ALTER USER mydata TEMPORARY TABLESPACE &ttbs;

    GRANT CREATE SESSION, CREATE VIEW, ALTER SESSION, CREATE SEQUENCE TO mydata;
    GRANT CREATE SYNONYM, CREATE DATABASE LINK, RESOURCE TO mydata;

    REM =======================================================
    REM grants from sys schema
    REM =======================================================

    CONNECT sys/&pass_sys AS SYSDBA;
    GRANT execute ON sys.dbms_stats TO mydata;

  • 相关阅读:
    IE8兼容
    游标
    WARN No appenders could be found for logger (org.springframework.orm.hibernate3.support.OpenSessionInViewFilter)
    sql server 备份数据
    JS页面打印
    jQuery Mobile 入门教程
    jquerymobile入门(文件引用+多页面)
    定位和可见性
    二月份总结
    mailto用法
  • 原文地址:https://www.cnblogs.com/endsock/p/2129125.html
Copyright © 2011-2022 走看看