zoukankan      html  css  js  c++  java
  • ORACLE备份与还原

    ----------------------------------*备份数据库*----------------------------------
    1、WINDOWS(图标)+R --> CMD
    2、SQLPLUS RSGL_BJKW/RSGL@127.0.0.1/ORCL
    3、SHOW PARAMETER DEFERRED_SEGMENT_CREATION;(如果为TRUE,则将该参数改为FALSE)
    4、ALTER SYSTEM SET DEFERRED_SEGMENT_CREATION=FALSE;
    5、SELECT 'ALTER TABLE '||TABLE_NAME||' ALLOCATE EXTENT;' FROM USER_TABLES WHERE NUM_ROWS=0 OR NUM_ROWS IS NULL;
    6、EXP RSGL_BJKW/RSGL@127.0.0.1/ORCL FILE=D:RSGL_BJKWRSGL_BJKW.DMP LOG=D:RSGL_BJKWRSGL_BJKW.LOG OWNER=RSGL_BJKW
    ---------------------------------*删除原表空间*---------------------------------
    1、WINDOWS(图标)+R --> CMD
    1、SQLPLUS /NOLOG
    2、CONN /AS SYSDBA
    3、DROP USER RSGL_BJKW CASCADE;
    4、DROP TABLESPACE RSGL_BJKW INCLUDING CONTENTS AND DATAFILES CASCADE CONSTRAINTS;
    5、重启ORACLE服务
    6、手动删除表空间文件(*.DBF)
    ----------------------------------*还原数据库*----------------------------------
    1、WINDOWS(图标)+R --> CMD
    2、SQLPLUS /NOLOG
    3、CONN /AS SYSDBA
    4、CREATE TEMPORARY TABLESPACE RSGL_BJKW_TEMP TEMPFILE 'D:DataBaseOracleTableSpaceRSGL_BJKW_TEMP.DBF' SIZE 500M AUTOEXTEND ON NEXT 50M MAXSIZE 20480M EXTENT MANAGEMENT LOCAL;
    5、CREATE TABLESPACE RSGL_BJKW_DATA LOGGING DATAFILE 'D:DataBaseOracleTableSpaceRSGL_BJKW_DATA.DBF' SIZE 500M AUTOEXTEND ON NEXT 50M MAXSIZE 20480M EXTENT MANAGEMENT LOCAL;
    6、CREATE USER RSGL_BJKW IDENTIFIED BY RSGL DEFAULT TABLESPACE RSGL_BJKW_DATA TEMPORARY TABLESPACE RSGL_BJKW_TEMP;
    7、GRANT CONNECT,RESOURCE,DBA TO RSGL_BJKW;
    8、IMP FILE=H:RSGL_BJKWRSGL_BJKW_2020-02-13.DMP LOG=H:RSGL_BJKWRSGL_BJKW_2020-02-13.LOG STATISTICS=NONE USERID=RSGL_BJKW/RSGL@127.0.0.1/ORCL BUFFER=100000000 COMMIT=NO FULL=YES GRANTS=YES IGNORE=YES INDEXES=YES ROWS=YES SHOW=NO CONSTRAINTS=YES

  • 相关阅读:
    IBM X System ServerGuide 8.41 服务器 系统安装 引导盘
    oracle查找重复记录
    linux的nohup命令的用法。
    最佳设计工作流
    开发的浏览器颠覆微软,引爆了一场互联网大战
    程序员的成长和代码行数的关系
    Oracle SQL Developer 连接 MySQL
    Linux 如何打开端口
    SQLSERVER中如何快速比较两张表的不一样
    我所理解的MVVM
  • 原文地址:https://www.cnblogs.com/hongwei2085/p/12305690.html
Copyright © 2011-2022 走看看