郑州到范县物流加盟:[转载]ORACLE 9i下exp和imp备份实例

来源:百度文库 编辑:九乡新闻网 时间:2024/07/14 00:34:30
1 在主服务器上执行exp备份数据库  
exp [email=system/oracle@orcl]system/oracle@orcl[/email] file=SC_200811101220.dmp owner=subcentrex full=y buffer=1024000
exp [email=system/oracel@orcl]system/oracel@orcl[/email] file=BS_200811101220.dmp owner=billing         full=y buffer=1024000
[oracle@localhost oracle]$ exp file=SC_200811101220.dmp owner=subcentrex full=y buffer=1024000
[oracle@localhost oracle]$ exp file=BS_200811101220.dmp owner=billing full=y buffer=1024000

2 在备份服务器上新建数据库
2.1 删除用户
sql>drop user subcentrex cascade;
sql>drop user billing  cascade;
2.2 删除空间,释放资源
sql>drop tablespace subcentrex including contents and datafiles;
sql>drop tablespace billing        including contents and datafiles;
2.3 创建新用户
create tablespace subcentrex datafile '/usr/local/opt/oracle/oradata/subcentrex.dbf' size 1200m autoextend on next 100m maxsize 8192m segment space management auto;
sql>create tablespace billing datafile '/usr/local/opt/oracle/oradata/billing.dbf' size 1700m          autoextend on next 100m maxsize 8192m segment space management auto;
2.4创建新的表空间和新用户
sql> create user subcentrex identified by admin default tablespace  subcentrex temporary tablespace temp;
sql> create user billing identified by  admin default tablespace billing temporary tablespace temp;
3 进入备用服务器的oracle目录,ftp把主服务器上的备份数据ge到备用服务器oracle目录下
4 imp数据库
imp [email=system/oracle@orcl]system/oracle@orcl[/email] fromuser=subcentrex touser=subcentrex file=SC_200811101220.dmp ignore=y
imp [email=system/oracle@orcl]system/oracle@orcl[/email] fromuser=billing  touser=billing file=BS_200811101220.dmp ignore=y
转自:http://www.itpub.net/thread-1084601-1-1.html