zoukankan      html  css  js  c++  java
  • oracle常用语句

    create
    tablespace chen1
    datafile 'E:appchendabingoradata estchen1.dbf'
    size 100m
    autoextend on next 50m maxsize 20480m
    extent management local
    /


    创建表空间

    ORA-01031:权限不足的问题
    在 脚本更新时,报错:ORA-01031: 权限不足。
    grant connect,resource,dba to cssy;
    赋权DBA之后,还有这个错误。
    执行 grant all privileges to cssy
    赋予任何主机访问数据的权限,问题得到了解决。


    --删除空的表空间,但是不包含物理文件
    drop tablespace tablespace_name;
    --删除非空表空间,但是不包含物理文件
    drop tablespace tablespace_name including contents;
    --删除空表空间,包含物理文件
    drop tablespace tablespace_name including datafiles;
    --删除非空表空间,包含物理文件
    drop tablespace tablespace_name including contents and datafiles;
    --如果其他表空间中的表有外键等约束关联到了本表空间中的表的字段,就要加上CASCADE CONSTRAINTS
    drop tablespace tablespace_name including contents and datafiles CASCADE CONSTRAINTS;

    sqlplus sys/oracle as sysdba; 登录DBA用户

    创建表空间 create tablespace chen datafile 'F:appAdministratororadataluckChenchen.dbf' size 100m autoextend on next 50m maxsize 20480m extent management local
    /


    1、查询表的数目:select count(*) from tabs
    2、查询用户拥有哪些表:select * from tabs
    3、SELECT * FROM ALL_TABLES WHERE OWNER='用户名'; ----要求是管理员用户
    4.select table_name from user_tables; 查看当前用户所以的表常用


    --删除空的表空间,但是不包含物理文件
    drop tablespace tablespace_name;
    --删除非空表空间,但是不包含物理文件
    drop tablespace tablespace_name including contents;
    --删除空表空间,包含物理文件
    drop tablespace tablespace_name including datafiles;
    --删除非空表空间,包含物理文件
    drop tablespace tablespace_name including contents and datafiles;
    --如果其他表空间中的表有外键等约束关联到了本表空间中的表的字段,就要加上CASCADE CONSTRAINTS
    drop tablespace tablespace_name including contents and datafiles CASCADE CONSTRAINTS;

  • 相关阅读:
    那些年搞不懂的多线程、同步异步及阻塞和非阻塞(一)---多线程简介
    java中IO流详细解释
    Java IO流学习总结
    MySQL数据库中索引的数据结构是什么?(B树和B+树的区别)
    使用Redis存储Nginx+Tomcat负载均衡集群的Session
    Redis 3.2.4集群搭建
    JDK1.8源码分析之HashMap
    java HashMap和LinkedHashMap区别
    Java中原子类的实现
    多线程-传统定时任务
  • 原文地址:https://www.cnblogs.com/luckgood/p/11737220.html
Copyright © 2011-2022 走看看