zoukankan      html  css  js  c++  java
  • Data Base Oracle 常用命令

    Data Base  Oracle 常用命令

    1.登录:(不需要密码,属于管理员权限)

    conn /as sysdba;

    2.查看数据库存储位置:

    select name from v$datafile;  

    3.创建表空间:

    语法:create tablespace 表空间名称 datafile '数据文件的路径' size 大小;

    示例:create tablespace test_db datafile 'D:ORACLEORADATAORCL est_db.dbf' size 3000m;  

    删除表空间:

    --删除空的表空间,但是不包含物理文件
    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;

    4.创建用户:

    语法:create user 用户名 identified by 密码 default tablespace 用户默认使用哪一个表空间;  

    示例:create user test_db identified by test_db default tablespace test_db; 

    删除用户:

    drop user username cascade

    5.修改密码:

    语法:alter user 用户名 identified by 新密码;

    示例:alter user scott identified by tiger;

    6.解锁:

    语法:alter user 用户名 account unlock;

    示例:alter user test account unlock;

    7.加锁:

    语法:alter user 用户名 account lock;

    示例:alter user test account lock;

    8.授权:

    语法:grant 角色1,角色2 to 用户名;  

    示例:grant dba, connect to test_db;

    9.连接远程oracle:

    sqlplus username/password@//host:port/sid
    sid:
    常规的是:orcl
    如果是域账号:orcl.域账号
    10.导出:
    exp
    语法:exp 用户名/密码@tns file=路径 full=y;
    示例:exp system/123456@orcl file=d: est.dmp full=y;
    11.导入:
    语法:imp 用户名/密码@tns file=路径 full=y;
    示例:imp system/123456@orcl file=d: est.dmp full=y;
     
  • 相关阅读:
    消除 transition 闪屏
    解决audio和video在手机端无法自动播放问题
    css3让图文不能复制
    改变placeholder的字体颜色大小
    css3实现水平、垂直居中
    link 和@import 的区别
    JSON与对象的相互转换
    indexOf与includes的比较
    DOM盒子模型
    关于Meta标签的一些知识
  • 原文地址:https://www.cnblogs.com/zlp520/p/7349244.html
Copyright © 2011-2022 走看看