Data Base  Oracle 常用命令

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

conn /as sysdba;

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

select name from v$datafile;

3.创建表空间:

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

示例:create tablespace test_db datafile 'D:\ORACLE\ORADATA\ORCL\test_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:\test.dmp full=y;
11.导入:
语法:imp 用户名/密码@tns file=路径 full=y;
示例:imp system/123456@orcl file=d:\test.dmp full=y;
 

Data Base Oracle 常用命令的更多相关文章

  1. Data Base oracle常见错误及解决方案

    Data Base oracle常见错误及解决方案 一.TNS协议适配器错误: 原因: 此问题的原因都是由于监听没有配置好. 解决: 1.打开oracle工具Net Manager,删除服务及监听,重 ...

  2. Oracle常用命令1

    一. 安装是用户管理: sqlplus /nolog; connect /as sysdba; alter user sys identified by change_on_install; alte ...

  3. Data Base Oracle下载及安装

    Oracle   下载及安装 一.官方下地址:   http://www.oracle.com/technetwork/database/enterprise-edition/downloads/in ...

  4. oracle常用命令总结

    声明:本文为博主在做项目中用到的一些常用命令,请勿转载,只为保存. oracle常用命令总结 创建表空间: --create tablespace vms--datafile 'e:\vms.dbf' ...

  5. oracle常用命令【转载】

    oracle常用命令 一.Oracle数据库实例.用户.目录及session会话查看: 1.ORACLE SID查看设置 查看SID.用户名 $ env|grep SID .select * from ...

  6. oracle常用命令(1)

    oracle常用命令 一.登录 1.管理员身份登录:sqlplus/nolog--->conn/as sysdba 2.普通用户登录:sqlplus/nolog---->conn 用户名/ ...

  7. Oracle常用命令大全(很有用,做笔记)

    一.ORACLE的启动和关闭 1.在单机环境下 要想启动或关闭ORACLE系统必须首先切换到ORACLE用户,如下 su - oracle a.启动ORACLE系统 oracle>svrmgrl ...

  8. oracle常用命令(比较常见好用)

    一.ORACLE的启动和关闭 1.在单机环境下 要想启动或关闭ORACLE系统必须首先切换到ORACLE用户,如下 su - oracle  a.启动ORACLE系统 oracle>svrmgr ...

  9. linux下 oracle常用命令

    打开图形化窗口: 1)Database Configuration Assistant windows    (添加数据库实例) $ dbca 2)Oracle Net Configuration A ...

随机推荐

  1. Android MVP模式简单易懂的介绍方式 (二)

    Android MVP模式简单易懂的介绍方式 (一) Android MVP模式简单易懂的介绍方式 (二) Android MVP模式简单易懂的介绍方式 (三) 上一篇文章我们介绍完了Model的创建 ...

  2. Java实现主线程等待子线程

    本文介绍两种主线程等待子线程的实现方式,以5个子线程来说明: 1.使用Thread的join()方法,join()方法会阻塞主线程继续向下执行. 2.使用Java.util.concurrent中的C ...

  3. ios常用空间UIScrollViewIndicator的一些属性

    UIScrollView属性: 1  alwaysBounceHorizontal         BOOL值,当水平滚条到达终点,总是(视图)弹跳 2  alwaysBounceVertical   ...

  4. Invalid command 'Header', perhaps misspelled or defined by a module not included in the server configuration

    在Apache的配置文件 httpd.conf 中开启  LoadModule headers_module modules/mod_headers.so  即可解决这个问题.

  5. 阿里巴巴Java开发规约扫描插件-Alibaba Java Coding Guidelines 在idea上安装使用教程

    经过247天的持续研发,阿里巴巴于10月14日在杭州云栖大会上,正式发布众所期待的<阿里巴巴Java开发规约>扫描插件!该插件由阿里巴巴P3C项目组研发.P3C是世界知名的反潜机,专门对付 ...

  6. 关于在64位win7下运行Virtualbox安装系统时出错(提示VBoxDD.DLL错误)的解决方

    安装没有问题,安装了最新版VirtualBox-4.3.18-96516-Win,一点运行想安装系统时就出错. 这是提示的错误: 运行Virtualbox去安装系统时出错:Failed to open ...

  7. Cisco VPP启动流程

    Cisco VPP启动流程,有需要的朋友可以参考一下. VPP初始化 VLIB_INIT_FUNCTION用来定义构造函数,注册函数到vlib_main_t->init_function_reg ...

  8. Python下Pip的安装【get-pip】

    1.下载 下载https://bootstrap.pypa.io/get-pip.py 如果不能下载,可下载:http://files.cnblogs.com/files/zhangzhiming/g ...

  9. btrfs的精简总结版

    Btrfs 也有一个重要的缺点,当 BTree 中某个节点出现错误时,文件系统将失去该节点之下的所有的文件信息.而 ext2/3 却避免了这种被称为”错误扩散”的问题. 扩展性:extent.B-Tr ...

  10. nhibernate 3.x新特性

    http://www.360doc.com/content/14/0226/17/9316347_355904008.shtml