当前位置:网站首页>Oracle 常用语句
Oracle 常用语句
2022-07-27 14:44:00 【fd-度假的鱼】
https://download.csdn.net/download/u014096024/21109113
oracle练习
1.如何查询一个角色包括的权限
a.一个角色包含的系统权限
select * from dba_sys_privs where grantee='DBA';
b.一个角色包含的对象权限
2.oracle究竟有多少种角色
(查询oracle中所有的角色,一般是dba)
select * from dba_roles;
3.查询oracle中所有的系统权限,一般是dba
select * from system_privilege_map order by name;
4.查询oracle中所有的对象权限,一般是dba
select distinct privilege from dba_tab_privs;
注意:这里如果不写distinct的话,容易造成死机
5.查询数据库的表空间
select tablespace_name from dba_tablespaces;
6.查询某个用户具有什么样的角色
select * from dba_role_privs where grantee='用户名';
7.查询某个角色包括哪些系统权限
select * from dba_sys_privs where grantee='DBA';
或者:
select * from role_sys_privs where role='DBA';
8.查询某个角色包括的对象权限
select * from dba_tab_privs where grantee='角色名';
练习oracle导入导出
第一步:
在导入和导出的时候,要到oracle目录的bin目录下
先找到exp.exe的目录:E:\oracle\product\10.2.0\db_1\BIN
运行cmd进入控制台
E: 回车
cd E:\oracle\product\10.2.0\db_1\BIN回车
------------------------------------------
第二步:
导出
导出表
若要导出本用户的表,则:
exp userid=scott/[email protected] tables=(emp) file=e:\Oracle资料\LearnOracleByMyself\emp.dmp 回车
导出表的结构
exp userid=scott/[email protected] tables=(emp) file=d:\emp3.dmp rows=n
使用直接导出方式
exp userid=scott/[email protected] tables=(emp) file=d:\e3.dmp direct=y
若要导出其他用户的表,则:
exp userid=system/[email protected] tables=(scott.emp) file=e:\Oracle资料\LearnOracleByMyself\emp.dmp 回车
导出方案
若要导出本用户的方案,则:
exp userid=scott/[email protected] owner=scott file=e:\Oracle资料\LearnOracleByMyself\scott.dmp
若要导出其他用户的方案,则:
exp userid=system/[email protected] tables=(scott.emp) file=e:\Oracle资料\LearnOracleByMyself\scott2.dmp 回车
导出数据库
exp userid=system/[email protected] full=y inctype=complete file=e:\Oracle资料\LearnOracleByMyself\orcl.dmp
导入
导入表
若要导入本用户的表,则:
imp userid=scott/[email protected] tables=(emp) file=e:\Oracle资料\LearnOracleByMyself\emp.dmp
若要导入表到其他用户,则:
imp userid=system/[email protected] tables=(emp) file=e:\Oracle资料\LearnOracleByMyself\emp.dmp touser=scott
若只是要导入表的结构而不导入数据,则:
imp userid=scott/[email protected] tables=(emp) file=e:\Oracle资料\LearnOracleByMyself\emp.dmp rows=n
若给已存在的表导入数据,则:
imp userid=scott/[email protected] tables=(emp) file=e:\Oracle资料\LearnOracleByMyself\emp.dmp ignore=y
导入方案
若要导入自身的方案,则:
imp userid=scott/[email protected] file=e:\Oracle资料\LearnOracleByMyself\emp.dmp
若要导入其他方案,要求该用户具有dba的权限或是imp_full_database
imp userid=system/[email protected] file=e:\Oracle资料\LearnOracleByMyself\emp.dmp touser=scott
导入数据库
在默认情况下,当导入数据库时,会导入所有对象结构和数据,案例如下:
imp userid=system/[email protected] full=y file=d:\xx.dmp
边栏推荐
- 移动端h5常见问题
- Common tool classes under JUC package
- Ncnn reasoning framework installation; Onnx to ncnn
- 初识MySQL数据库
- Inter thread wait and wake-up mechanism, singleton mode, blocking queue, timer
- Flask连接mysql数据库已有表
- Solve the compilation warning of multiple folders with duplicate names under the openwrt package directory (call subdir function)
- Vant UI toast and dialog use
- [regular expression] single character matching
- 渗透测试-干货 | 80篇+网络安全面试经验帖(面试篇)
猜你喜欢

openwrt 增加RTC(MCP7940 I2C总线)驱动详解

无线网络分析有关的安全软件(aircrack-ng)

微信小程序个人号开通流量主

Embedded development: tips and techniques -- seven techniques to meet the real-time deadline

Addition, deletion, query and modification of MySQL table data

Mlx90640 infrared thermal imager temperature sensor module development notes (VII)
![[tensorboard] oserror: [errno 22] invalid argument processing](/img/bf/c995f487607e3b307a268779ec1e94.png)
[tensorboard] oserror: [errno 22] invalid argument processing

Nacos

JWT简介

新版jmeter函数助手不在选项菜单下-在工具栏中
随机推荐
scrapy爬虫框架
数据表的约束以及设计、联合查询——8千字攻略+题目练习解答
实现浅拷贝和深拷贝+
profileapi. h header
台积电的反击:指控格芯侵犯25项专利,并要求禁售!
drf使用:get请求获取数据(小例子)
Under the ban, the Countermeasures of security giants Haikang and Dahua!
Reduce program ROM ram, GCC -ffunction sections -fdata sections -wl, – detailed explanation of GC sections parameters
单机高并发模型设计
Personal perception of project optimization
禁令之下,安防巨头海康与大华的应对之策!
Breaking through soft and hard barriers, Xilinx releases Vitis unified software platform for developers
leetcode25题:K 个一组翻转链表——链表困难题目详解
快速高效删除node_modules
Network principle (1) - overview of basic principles
Solve mt7620 continuous cycle uboot (LZMA error 1 - must reset board to recover)
Have you ever used the comma operator?
传音控股披露被华为起诉一事:已立案,涉案金额2000万元
TSMC's counterattack: it accused lattice core of infringing 25 patents and asked for prohibition!
Stock account opening commission discount, stock trading account opening which securities company is good, is online account opening safe