oracle基础操作

1.linux中的oracle用户登录:
2.使用:
sqlplus /nolog进入sqlplus
3.连接:
conn /as sysdba
4.创建表空间指定存储文件:
SQL> create tablespace bbsp_data datafile ‘/oradata/bbsp_data.dbf‘ size 1024M autoextend on next 50M maxsize unlimited;
5.为指定表空间创建用户名,设置密码
SQL> create user bbspyz identified by bbspyz default tablespace bbsp_data;
6.修改用户默认表空间:
SQL> alter user bbspyz default tablespace bbsp_data;
7.给用户授权:
SQL> grant create session,dba,connect,resource to bbspyz;
SQL> alter user bbspyz account unlock;
8.创建存储目录:
SQL>create directory bbsp as ‘/oradata‘;
9.增加数据dbf数据存储文件(一个文件最大存储32G):
SQL>alter tablespace bbsp_data add datafile ‘/oradata/bbsp_data2.dbf‘ size 1024M autoextend on next 100m maxsize unlimited;
10.数据泵导入(linux命令):
linux命令:impdp bbspyz/bbspyz directory=bbsp dumpfile=bbsp_202008100200.dmp remap_schema=bbsp:bbspyz remap_tablespace=users:bbsp_data
(1).directory:导入文件地址,
(2).remap_schema:从用户bbsp到用户bbspyz
(3).remap_tablespace:从表空间users到表空间bbsp_data
11.数据泵导出(linux命令):
expdp bbspyz/bbspyz@57.25.1.141:1521/bbsp dumpfile=bbsp20200817.dmp directory=bbsp
(1).directory:导出文件地址,
(2).remap_schema:导出用户bbspyz
(3).remap_tablespace:默认表空间bbsp_data

oracle基础操作

上一篇:Docker mysql 1045处理办法


下一篇:Host is not allowed to connect to this MySQL server 解决方法