oracle 常用语句
创建用户及授权
create temporary tablespace test_temp
tempfile 'C:\oracle\product\10.2.0\oradata\hszxdbtemp.dbf'
size 32m
autoextend on
next 32m maxsize 2048m
extent management local;
create tablespace hszxdb
logging
datafile 'C:\oracle\product\10.2.0\oradata\hszxdb.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;
oracle 常用语句的更多相关文章
- ORACLE常用语句:
ORACLE常用语句: 1.首先,创建(新)用户: create user username identified by password; username:新用户名的用户名 password: 新 ...
- Oracle常用语句集合
oracle常用经典SQL查询 常用SQL查询: .查看表空间的名称及大小 )),) ts_size from dba_tablespaces t, dba_data_files d where t. ...
- Oracle常用语句
Oracle数据库常用sql语句 ORACLE 常用的SQL语法和数据对象一.数据控制语句 (DML) 部分 1.INSERT (往数据表里插入记录的语句) INSERT INTO 表名(字段名1, ...
- Oracle常用语句语法汇总
第一篇 基本操作 --解锁用户 alter user 用户 account unlock; --锁定用户 alter user 用户 account lock; alter user sco ...
- oracle常用语句总结
一.用户管理类 1.创建用户: Create user username Identified by password Default tablespace tablespacename Tempor ...
- oracle 常用语句3
- oracle 函数 select sign(-3),sign(3), sign(0) from dual; select ceil(3.7) from dual; select floor(3.7 ...
- Oracle 常用语句1
-- 我是注释信息 sql语句 -- 创建用户: create user 用户名 identified by 密码; create user jack identified by j123; -- l ...
- 查锁住的表,以及kill进程,Oracle常用语句
--找出所有被锁的对象,定位出哪个回话占用 select l.session_id,o.owner,o.object_name from v$locked_object l,dba_objects o ...
- Oracle 常用语句备份
1.oracle 11g 用户名和密码默认区分大小写,可更改alter system set sec_case_sensitive_logon=false 设置改为不区分大小写. 2.授权创建视图:G ...
随机推荐
- servlet学习笔记一
Servlet一.基本概念 我们的程序根据是否需要访问网络,可分为网络程序和非网络程序.而 网络程序又分为B/S结构和C/S结构. 什么是C/S?即客户端(Client)/服务器(Server)模式. ...
- Linux command: usermod -- 改变用户状态
应用举例: 1. usermod -g newuser newuser force use GROUP as new primary group. 一般时候是默认的,也是必须的(不能更改).2. 指定 ...
- java应用程序利用Exe4j打包exe文件
1. 使用简介: 把java应用程序打成exe文件我们可以借助第三方软件exe4j来完成.Exe4j大家可以在网上下载,下载地址是: http://www.ej-technologies.c ...
- SPRING IN ACTION 第4版笔记-第十章Hitting the database with spring and jdbc-003-四种方式获取DataSource
一.概述 1.Spring offers several options for configuring data-source beans in your Spring application, i ...
- Data Flow ->> Script Component
和Control Flow中的Script Task非常类似,不同的是Script Component是Per-Row的执行类型.打个比方,在Script Component中加入两个Output的字 ...
- Docker基础技术:Linux Namespace(上)
时下最热的技术莫过于Docker了,很多人都觉得Docker是个新技术,其实不然,Docker除了其编程语言用go比较新外,其实它还真不是个新东西,也就是个新瓶装旧酒的东西,所谓的The New “O ...
- wait、waitpid 僵尸进程 孤儿进程
man wait: NAME wait, waitpid, waitid - wait for process to change state SYNOPSIS #include <sys/ty ...
- Difference between Pragma and Cache-control headers?
Pragma is the HTTP/1.0 implementation and cache-control is the HTTP/1.1 implementation of the same c ...
- linux kernel文件系统启动部分
现在的kernel里,有个叫做ramfs的文件系统,会把initrd(或者ramdisk,为惯性叫法)里的东西挂载到early-rootfs里(即rootfs,是ramfs的一个特殊实例),执行一些在 ...
- Hibernate 中update hql语句
今天在MySQL中用hibernate测试update语句发现以下问题: update语句竟然不去作用: 表机构如下: create table student(sid int primary key ...