管理员用户登录oracle数据库

[oracle@DBORACLE ~]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.4.0 Production on Tue Jan 1 14:59:27 2019

Copyright (c) 1982, 2013, Oracle. All rights reserved.

Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL>

1、创建临时表空间

select name from v$tempfile;查出当前数据库临时表空间,主要是使用里面的存放路径;

得到其中一条记录/u01/oracle/app/oradata/DBPRIMARY/temp01.dbf

创建临时表空间:create temporary tablespace plncontrol_temp tempfile '/u01/oracle/app/oradata/DBPRIMARY/plncontrol_temp.dbf' size 200m reuse autoextend on next 40m maxsize unlimited;

2、创建表空间

select name from v$datafile;查询出当前数据库表空间,使用里面的路径

得到其中一条记录/u01/oracle/app/oradata/DBPRIMARY/system01.dbf

创建表空间:create tablespace plncontrol datafile '/u01/oracle/app/oradata/DBPRIMARY/plncontrol.dbf' size 200M reuse autoextend on next 80M maxsize unlimited default storage(initial 128k next 128k minextents 2 maxextents unlimited);

3、创建用户并指定表空间

create user plncontrol identified by plncontrol default tablespace plncontrol temporary tablespace plncontrol_temp;

4、赋予用户权限

grant connect,resource,dba to plncontrol;

5、查看表空间的名称及大小

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;

6、查看各表空间空闲情况

select tablespace_name, sum(bytes) / 1024 / 1024  from dba_free_space  group by tablespace_name;

7、更改数据表大小(2G)

alter database datafile '/u01/oracle/app/oradata/DBPRIMARY/WEBONLINEPRE.dbf' resize 2048m;

8、查看表空间是否自动增长

select file_name,tablespace_name,autoextensible from dba_data_files;

9、设置表空间自动增长

alter database datafile '/u01/oracle/app/oradata/DBPRIMARY/WEBONLINEPRE.dbf' autoextend on; //打开自动增长
alter database datafile '/u01/oracle/app/oradata/DBPRIMARY/WEBONLINEPRE.dbf' autoextend on next 200M; //每次自动增长200m
alter database datafile '/u01/oracle/app/oradata/DBPRIMARY/WEBONLINEPRE.dbf' autoextend on next 200M maxsize 2048M; //每次自动增长200m,数据表最大不超过2G

oracle_创建表空间_临时表空间_修改表空间_以及自增长的更多相关文章

  1. c#Winform程序调用app.config文件配置数据库连接字符串 SQL Server文章目录 浅谈SQL Server中统计对于查询的影响 有关索引的DMV SQL Server中的执行引擎入门 【译】表变量和临时表的比较 对于表列数据类型选择的一点思考 SQL Server复制入门(一)----复制简介 操作系统中的进程与线程

    c#Winform程序调用app.config文件配置数据库连接字符串 你新建winform项目的时候,会有一个app.config的配置文件,写在里面的<connectionStrings n ...

  2. oracle 创建表、删除表、添加字段、删除字段、表备注、字段备注、修改表属性

    1.创建表 create table 表名( classid number() primary key, 表字段 数据类型 是否允许为空(not null:不为空/null:允许空) 默认值(defa ...

  3. django orm 改动数据库中已存在的表(添加、删除、修改表字段)

    python3 manage.py makemigrations --empty api # 因为我的models.py文件并直接在项目根目录,而是根目录下的api目录中 python3 manage ...

  4. oracle 修改表空间名

    1.登录使用sys用户登录 sqlplus sys/ as sysdba 2.修改表空间名字 SQL> alter tablespace 旧表空间名 rename to 新表空间名; 表空间已更 ...

  5. SQL知识整理一:触发器、存储过程、表变量、临时表

    触发器 触发器的基础知识 create trigger tr_name on table/view {for | after | instead of } [update][,][insert][,] ...

  6. MySQL的外键,修改表,基本数据类型,表级别操作,其他(条件,通配符,分页,排序,分组,联合,连表操作)

    MySQL的外键,修改表,基本数据类型,表级别操作,其他(条件,通配符,分页,排序,分组,联合,连表操作): a.创建2张表 create table userinfo(nid int not nul ...

  7. SQL批量修改表名

    SELECT NAME FROM SYS. ALL_OBJECTS WHERE TYPE= 'U' ORDER BY MODIFY_DATE DESC --查询所有表名 SELECT NAME FRO ...

  8. alter修改表

    alter修改表的基础语句,语法如下: ALTER TABLE table_name ADD column_name|MODIFY column_name| DROP COLUMN column_na ...

  9. Oracle常用操作——创建表空间、临时表空间、创建表分区、创建索引、锁表处理

    摘要:Oracle数据库的库表常用操作:创建与添加表空间.临时表空间.创建表分区.创建索引.锁表处理 1.表空间 ■  详细查看表空间使用状况,包括总大小,使用空间,使用率,剩余空间 --详细查看表空 ...

  10. oracle创建用户、表空间、临时表空间、分配权限步骤详解

    首先登陆管理员账号,或者有DBA权限的用户,接下来依次: --查询所有用户select * from dba_users;--创建新用户create user gpmgt identified by ...

随机推荐

  1. PHP 【四】

    数组 $string = array(x,y,z); <?php$cars=array("Volvo","BMW","Toyota") ...

  2. .NET垃圾回收机制(一)

    垃圾收集器(GarbageCollection)是组成.Net平台一个很重要的部分,.NET垃圾回收机制降低了编程复杂度,使程序员不必分散精力去处理析构.不妨碍设计师进行系统抽象.减少了由于内存运用不 ...

  3. robot framework 上个用例的输出作为下个用例的输入 (Set Global Variable的用法)

    变量的作用域 通常情况下,每个变量默认都是局部变量. 一个case里的变量,作用域在这个case内部: 一个userkeyword里的变量,作用域在这个userkeyword内部: 一个文件型suit ...

  4. Linux安装配置git

    1.查看git安装版本 git version 2.查看git安装位置 whereis git 3.yum安装git yum install git 4.生成ssh key cd /root/.ssh ...

  5. element-ui修改全局样式且只作用于当前页面

    1)修改组件的样式,但是只作用于当前页面,其他页面不受影响,做法有两种: 法一:使用关键字“/deep/” 1)在当前页面添加样式: <style lang="scss" s ...

  6. JS 判断传入的变量类型是否是Array

    function f(arr){ 1.通过_proto_ 进行判断 (arr._proto_ 指向Array.prototype); 2.通过constructor进行判断 (arr.construc ...

  7. RedHat 6配置yum源为网易镜像(转)

    概述 由于版权的问题,RedHat6不能直接使用yum一些指令,需要配置yum源为网易镜像,但是网上谈到很多:整理一下,将有用的信息整理如下,以便于能够为其他的配置服务配置使用:需要卸载掉原理系统自带 ...

  8. Cordova IOT Lesson002

    hello index.html <!DOCTYPE html> <html> <head> <meta charset="utf-8"& ...

  9. 设置通过Maven创建工程的JDK版本

    在eclipse中创建的Maven工程默认的运行环境为JDK1.5,如果想修改JDK的版本,无非是右键项目点击Build Path->Configure Build Path修改JDK信息-&g ...

  10. JS-排序详解-冒泡排序

    说明 时间复杂度指的是一个算法执行所耗费的时间 空间复杂度指运行完一个程序所需内存的大小 稳定指,如果a=b,a在b的前面,排序后a仍然在b的前面 不稳定指,如果a=b,a在b的前面,排序后可能会交换 ...