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;

  • 相关阅读:
    getText() 获取properties中的变量
    Vue----渐进式框架的理解
    appium---学习
    css----overflow(布局)
    css----display(显示) 与 Visibility(可见性)
    css----position(定位)
    中秋节
    找工作清闲的一天
    两天没有好好休息的感觉
    开始正式步入找工作的节奏
  • 原文地址:https://www.cnblogs.com/luckgood/p/11737220.html
Copyright © 2011-2022 走看看