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;

  • 相关阅读:
    Dijkstra(单队优化)
    最短路(hdu4725)(建点巧妙)
    次小生成树
    2019暑假集训DAY1(problem3.play)(单调栈思想)
    平衡树
    线段树区间加乘(模板)
    杜恩德的新博客,都来看看-duende99
    oracle 11g如何完全卸载
    如何连接别人电脑上的Oracle数据库--duende99
    Java中的Filter过滤器
  • 原文地址:https://www.cnblogs.com/luckgood/p/11737220.html
Copyright © 2011-2022 走看看