数据库基本操作
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了数据库基本操作相关的知识,希望对你有一定的参考价值。
建立表空间
create tablespace OPET_MU_DATA datafile ‘/data/oracle/data/OPEN/OPET_MU_DATA.dbf‘ size 10G;
create tablespace OPET_MU_INDX datafile ‘/data/oracle/data/OPEN/OPET_MU_INDX.dbf‘ size 1G;
create tablespace OPET_MU_DATA datafile ‘/data/oracle/data/OPEN/OPET_MU_DATA.dbf‘ size 10G;
create tablespace OPET_MU_INDX datafile ‘/data/oracle/data/OPEN/OPET_MU_INDX.dbf‘ size 1G;
建用户
-- Create the user
create user OPENET_MU identified by "openet9688"
default tablespace OPET_MU_DATA
temporary tablespace TEMP01
--profile DEFAULT
--quota unlimited on opet_bk_data
--quota unlimited on opet_bk_indx;
3.给用户授权
-- Grant/Revoke object privileges
grant execute on DBMS_LOCK to OPEN_MU;
--Create directory OPENETLOG AS ‘/data/oracle/openetlog/‘;
grant read, write on directory OPENETLOG to OPEN_MU;
grant execute on UTL_FILE to OPEN_MU;
-- Grant/Revoke role privileges
grant connect to OPEN_MU;
grant resource to OPEN_MU;
-- Grant/Revoke system privileges
grant create procedure to OPEN_MU;
grant create table to OPENET_MU;
4.用plsql导出原来数据,再导入新的数据库,检查一下有没有缺对象
Select object_name from user_objects order by 1;
linux下切换到oracle下
root登陆进去后,su - oracle
sqlplus / as sysdba
sqlplus / as sysdba
以上是关于数据库基本操作的主要内容,如果未能解决你的问题,请参考以下文章
SQL server学习笔记数据库的基本知识基本操作(分离脱机收缩备份还原附加)和基本语法