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. UINavigation,UiView,ModalView Controller之间的关系

    如果当前是个VC,那么就太简单了,直接就可以push到下一个vc AddShopViewController *controller = [[AddShopViewController alloc] ...

  2. Delphi三层开发小技巧:TClientDataSet的Delta妙用

    Delphi三层开发小技巧:TClientDataSet的Delta妙用 转载 2014年10月13日 09:41:14 标签: 三层 / ClientDataSet 318 from :http:/ ...

  3. ActiveMQ集群整体认识

    出自:https://segmentfault.com/a/1190000014592517 前言 最终需要掌握 Replicated LevelDB Store部署方式,这种部署方式是基于ZooKe ...

  4. Spark会产生shuffle的算子

    去重 def distinct() def distinct(numPartitions: Int) 聚合 def reduceByKey(func: (V, V) => V, numParti ...

  5. css水平居中,竖直居中技巧(二)

    css水平居中,竖直居中技巧(二)===### 1.效果 ### 2.代码#### 2.1.index.html <!DOCTYPE html> <html lang="z ...

  6. 开发 WebAPP 的几个前端框架(不断更新中)

    http://mobileangularui.com/ http://ionicframework.com/ http://www.idangero.us/framework7/ (中文文档:http ...

  7. RedHat Linux设置yum软件源为本地ISO

    先挂载ISO到某个目录下(如我的:/media/RHEL_6.0 x86_64 Disc 1) # mount –o loop rhel-server-6.4-x86_64-dvd.iso /medi ...

  8. mysql oracle计算两点之间的距离

    mysql函数: SET FOREIGN_KEY_CHECKS=0; DROP FUNCTION IF EXISTS `getDistance`;DELIMITER ;;CREATE DEFINER= ...

  9. SpringBoot30 整合Mybatis-Plus、整合Redis、利用Ehcache实现二级缓存、利用SpringCache和Redis作为缓存

    1 环境说明 JDK: 1.8 MAVEN: 3. SpringBoot: 2.0.4 2 SpringBoot集成Mybatis-Plus 2.1 创建SpringBoot 利用IDEA创建Spri ...

  10. 16-多线程爬取糗事百科(python+Tread)

    https://www.cnblogs.com/alamZ/p/7414020.html   课件内容 #_*_ coding: utf-8 _*_ ''' Created on 2018年7月17日 ...