Oracle+sde資料備份、恢複
1.資料庫完整備份
EXP SYSTEM/PASSWORD@SID FULL=Y FILE=D:\SYSTEM.DMP LOG=D:\SYSTEM.LOG
2.資料入庫
(a)從資料庫中刪除SDE和SDE USER使用者
DROP USER SDE CASCADE;
DROP USER SDEUSER CASCADE;
(b)建立新的SDE使用者和SDEUSER
下為建立SDE使用者過程:
(i)建立資料表空間
CREATE TABLESPACE "SDE"
LOGGING
DATAFILE 'C:\ORACLE\ORADATA\ORACLE\SDE.ora' SIZE 200M
EXTENT MANAGEMENT LOCAL SEGMENT SPACE MANAGEMENT AUTO
(ii)建立使用者
CREATE USER "SDE" PROFILE "DEFAULT"
IDENTIFIED BY "PASSWORD" DEFAULT TABLESPACE "SDE"
TEMPORARY TABLESPACE "TEMP"
ACCOUNT UNLOCK;
(iii)建立角色
GRANT "DBA" TO "SDE";
GRANT "CONNECT" TO "SDE";
GRANT "RESOURCE" TO "SDE";
(iiii)系統許可權
GRANT ALTER ANY INDEX TO "SDE" WITH ADMIN OPTION;
GRANT ALTER ANY TABLE TO "SDE" WITH ADMIN OPTION;
GRANT ANALYZE ANY TO "SDE" WITH ADMIN OPTION;
GRANT CREATE ANY INDEX TO "SDE" WITH ADMIN OPTION;
GRANT CREATE ANY PROCEDURE TO "SDE" WITH ADMIN OPTION;
GRANT CREATE ANY SEQUENCE TO "SDE" WITH ADMIN OPTION;
GRANT CREATE ANY TRIGGER TO "SDE" WITH ADMIN OPTION;
GRANT CREATE ANY VIEW TO "SDE" WITH ADMIN OPTION;
GRANT CREATE SESSION TO "SDE" WITH ADMIN OPTION;
GRANT DROP ANY INDEX TO "SDE" WITH ADMIN OPTION;
GRANT DROP ANY TABLE TO "SDE" WITH ADMIN OPTION;
GRANT DROP ANY VIEW TO "SDE" WITH ADMIN OPTION;
GRANT DROP ANY PROCEDURE TO "SDE" WITH ADMIN OPTION;
GRANT DROP ANY SEQUENCE TO "SDE" WITH ADMIN OPTION;
GRANT EXECUTE ANY PROCEDURE TO "SDE" WITH ADMIN OPTION;
GRANT SELECT ANY SEQUENCE TO "SDE" WITH ADMIN OPTION;
GRANT SELECT ANY TABLE TO "SDE" WITH ADMIN OPTION;
GRANT UNLIMITED TABLESPACE TO "SDE" WITH ADMIN OPTION;
3.匯入SDE和SDEUSER的資料
注意順序,先SDE,後SDEUSER
IMP SYSTEM/PASSWOR@SID FROMUSER=SDE TOUSER=SDE
IMP SYSTEM/PASSWOR@SID FROMUSER=SDEUSER TOUSER=SDEUSER
以上提到的SDE和SDEUSER是不同的使用者,SDE是ArcSDE安裝時的預設使用者,SDEUSER
是指使用者儲存資料的使用者,如果之間使用SDE預設使用者儲存,則省去所以的SDEUSER操作