ORACLE数据库相关操作
2022/1/20 19:12:09
本文主要是介绍ORACLE数据库相关操作,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!
一、数据库新建用户
--切换用户 su - oracle --用户登录 sqlplus /nolog (若sqlplus命令执行失败,先执行source ~/.bash_profile) connect /as sysdba --创建用户 create user financial identified by Hxzq_financial; --查询服务器表空间存储位置 select b.file_id 文件ID, b.tablespace_name 表空间, b.file_name 物理文件名, b.bytes 总字节数, (b.bytes-sum(nvl(a.bytes,0))) 已使用, sum(nvl(a.bytes,0)) 剩余, sum(nvl(a.bytes,0))/(b.bytes)*100 剩余百分比 from dba_free_space a,dba_data_files b where a.file_id=b.file_id group by b.tablespace_name,b.file_name,b.file_id,b.bytes order by b.tablespace_name --创建表空间 create tablespace FINANCIAL_DATA logging datafile 'D:\app\administrator\oradata\orcl\pdmis_data.dbf' size 1024m autoextend on next 500m maxsize UNLIMITED extent management local; --查看表空间是否为自增长 SELECT FILE_NAME,TABLESPACE_NAME,AUTOEXTENSIBLE FROM dba_data_files; --用户关联到表空间 alter user financial default tablespace FINANCIAL_DATA temporary tablespace TEMP profile default; --用户授权 grant connect to financial; grant resource to financial; grant imp_full_database to financial; --用户表空间扩展 alter tablespace FINANCIAL_DATA add datafile '/u01/app/oracle/oradata/orcl/FINANCIAL_DATA_2.dbf' size 1024M autoextend on next 500M Maxsize UNLIMITED;
二、数据导入(不在SQL窗口运行,直接在Linux命令窗口运行)
--impbp导入数据 impdp financial/Hxzq_financial@ORCL directory=dmp_dir dumpfile=financial_0118.dump logfile=implog.log table_exists_action=truncate transform=segment_attributes:n --
这篇关于ORACLE数据库相关操作的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!
- 2024-07-02微服务启动nacos注册上去了,但是一直没有收到请求-icode9专业技术文章分享
- 2024-07-02如何检查文件的编码格式-icode9专业技术文章分享
- 2024-07-02sublime 更改编码格式-icode9专业技术文章分享
- 2024-06-30uniAPP 实现全屏左右滚动滚动的效果-icode9专业技术文章分享
- 2024-06-30如何在本地使用授权或插件-icode9专业技术文章分享
- 2024-06-30伪静态规则配置方法汇总-icode9专业技术文章分享
- 2024-06-29易优CMS安装常见问题汇总-icode9专业技术文章分享
- 2024-06-28易优新手必读安装教程-icode9专业技术文章分享
- 2024-06-28忘记eyoucms后台密码怎么办?-icode9专业技术文章分享
- 2024-06-26终极指南:Scrum中如何设置需求优先级