Home  >  Article  >  Database  >  Linux环境中Oracle数据导入与导出备份操作

Linux环境中Oracle数据导入与导出备份操作

WBOY
WBOYOriginal
2016-06-07 16:51:101039browse

以Oracle 用户登录Linux启动Oracle:sqlplus quot;scott/tiger as sysdbaquot; startup进入sqlplus以后:以要导入、导出到xzfw

以Oracle 用户登录Linux

启动Oracle:

sqlplus "scott/tiger as sysdba" 

startup

进入sqlplus以后:以要导入、导出到xzfw为例。

必须有/Oracle/oradata/xzfw的写入权限:才可以进行如下操作.

创建表空间:

create tablespace xzfw(表空间名:自己命名) logging datafile '/Oracle/oradata/xzfw(和前边xzfw一致,/Oracle/oradata目录必须存在而且有写入权限)' size 200M autoextend on next 50M extent management local segment space management auto;

创建用户和密码:

create user xzfw(用户名) identified by "sa" default tablespace xzfw(表空间名) temporary tablespace TEMP profile default quota unlimited on users;

添加用户授权:

grant dba,connect,resource,aq_administrator_role,aq_user_role,authenticateduser to xzfw(表空间名);

退出sqlplus,在Oracle用户登录下:

(导入备份)imp xzfw/sa file=/home/Oracle/xzfw.dmp fromuser=xzfw(这个是当时导出数据时Oracle的用户名) ignore=y

(导出备份)exp xzfw/sa file=/home/Oracle/xzfwbk.dmp owner=xzfw

开启Oracle监听:

lsnrctl

start

linux

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn