• oracle 常用语句


    创建用户及授权
    create temporary tablespace test_temp
    tempfile 'C:oracleproduct10.2.0oradatahszxdbtemp.dbf'
    size 32m
    autoextend on
    next 32m maxsize 2048m
    extent management local;


    create tablespace hszxdb
    logging
    datafile 'C:oracleproduct10.2.0oradatahszxdb.dbf'
    size 32m
    autoextend on
    next 32m maxsize 2048m
    extent management local;


    create user hszx identified by hszx
    default tablespace hszxdb
    temporary tablespace test_temp;


    grant connect,resource to hszx;


    删除用户
    drop user username cascade

    查看表空间及使用情况

    SELECT t.tablespace_name, round(SUM(bytes / (1024 * 1024)), 0) ts_size
    FROM dba_tablespaces t, dba_data_files d
    WHERE t.tablespace_name = d.tablespace_name
    GROUP BY t.tablespace_name;

    删除表空间
    DROP TABLESPACE HSZXDB INCLUDING CONTENTS AND DATAFILES;

    -------------oracle创建自增列开始-------------------

    -- Create sequence
    create sequence ELUSER_SEQUENCE2
    minvalue 1
    maxvalue 999999999999999999999999999
    start with 6480
    increment by 1
    cache 10;

    --ELUSER_SEQUENCE2为名称

    --创建一个触发器
    CREATE OR REPLACE TRIGGER
    "HSZX".auto_id_eluser2 before insert on ELUSER for each row
    WHEN(new.id is null)
    begin
    select ELUSER_SEQUENCE2.nextval into :new.id from dual;
    end;

    --"HSZX"为表空间名称

    -------------oracle创建自增列结束-------------------

    --该语句是有时候用户权限不足的时候使用。

    grant create any trigger to user_name;

  • 相关阅读:
    win7(64bit)python相关环境模块搭建
    memcached在windows下的安装与命令使用方法
    pomelo流程
    pomelo 初始化配置...
    pomelo组件..
    <转>如何高效快速看懂Android源码
    源码学习
    计划
    Android面试题集锦 (转)
    Android 面试题(转)
  • 原文地址:https://www.cnblogs.com/lvlv/p/3641103.html
Copyright © 2020-2023  润新知