共計 1873 個字符,預計需要花費 5 分鐘才能閱讀完成。
這篇文章主要介紹 Oracle 如何備份還原,文中介紹的非常詳細,具有一定的參考價值,感興趣的小伙伴們一定要看完!
創建表分區
create tablespace apps datafile 1\apps.dbf size 10m autoextend on next 8m;
create tablespace appsys datafile 1\appsys.dbf size 10m autoextend on next 8m;
創建分區表空間
create tablespace APPS_00 datafile 1\APPS_00.dbf size 10M autoextend on next 8M;
create tablespace APPSYS_00 datafile 1\APPSYS_00.dbf size 10M autoextend on next 8M;
刪除用戶
drop user apps cascade;
drop user appsys cascade;
創建用戶
create user apps identified by cape default tablespace apps;
create user appsys identified by cape default tablespace appsys;
授權
grant dba to apps with admin option;
grant dba to appsys;
grant create any table to apps;
grant alter any table to apps;
grant drop any table to apps;
grant create any index to apps;
grant drop any index to apps;
創建目錄
create or replace directory expdp_wms_dir as D:\data_bak\
grant read, write on directory expdp_wms_dir to APPS;
EXP/IMP 備份與還原
exp user/pwd@SID file=d:\db_20101010.dmp log=d:\db_20101010.log owner=(apps,appsys)
imp user/pwd@SID file=D:\db_20101010.dmp log=D:\db_20101010.log fromuser=apps touser=apps fromuser=appsys touser=appsys ignore=y
EXPDP/IMPDP 備份還原
expdp user/pwd@SID dumpfile=DB20141216.dmp logfile=DB20141216.log schemas=(apps,appsys) directory=expdp_dir job_name=expdp_job version=11.1.0.2
impdp user/pwd@SID dumpfile=DB20141216.DMP logfile=DB20141216.log schemas=(apps,appsys) directory=impdp_dir job_name=impdp_job
表空間映射
impdp user/pwd@SID dumpfile=DB20141216.DMP logfile=DB20141216.log remap_schema=QA_SOA:SNPW remap_tablespace=DEV_ODI_USER:JJE_ODI_USER directory=impdp_dir job_name=impdp_job
忘記 ORACLE 的管理員 sys 用戶密碼
在服務器本地登錄,無須密碼
sqlplus / as sysdba
登陸之后更改密碼
sql alter user sys identified by sys;
user test lacks CREATE SESSION privilege; logon denied.
使用 DBA 登陸,執行下面的授權語句。
grant connect,resource to test;
grant create session to test;
以上是“Oracle 如何備份還原”這篇文章的所有內容,感謝各位的閱讀!希望分享的內容對大家有幫助,更多相關知識,歡迎關注丸趣 TV 行業資訊頻道!
正文完