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;

  • 相关阅读:
    【基本知识】verilog中 `define 的使用
    netsuite弹出窗体的数据回传例子
    js使用confirm对用户的行为进行判断 和prompt
    银行支付 接口
    关于IT公司的预见性
    js fix小数点 和int的区别
    ajax和Java session监听
    NetSuite全功能介绍 totemsuite netsuite开发模块
    财务软件间的财务接口(转载)
    去除eclipise f2功能 去除浮动窗口
  • 原文地址:https://www.cnblogs.com/luckgood/p/11737220.html
Copyright © 2011-2022 走看看