文件名称:Oracle备份还原.doc
文件大小:33KB
文件格式:DOC
更新时间:2023-01-09 03:29:53
ORACLE oracle常用命令语句 数据库备份还原语句 oracle备份命令
oracle数据库备份还原 ------------------------备份------------------------------ 一、全备份 导出整个数据库, 命令 exp 用户名/密码@服务名 file=文件全路径 full=y ------------------------还原------------------------------ 一、环境设置 1。新建数据库或选择已经存在的数据库。 2。新建表空间wzgis,给足够大的空间,最好分文件存放。 在还原之前确保mapgisdba和cadadba两个用户已经存在并且权限正确 3。新建表空间mapgisdba,如果数据库通过mapgis创建过管理过程,可以跳过该步骤和4、5步 4。新建mapgisdba用户,位于表空间mapgisdba上 5。给mapgisdba用户赋权,执行一下脚本 GRANT ANALYZE ANY TO "MAPGISDBA" WITH GRANT OPTION; GRANT CREATE ROLE TO "MAPGISDBA" WITH GRANT OPTION; GRANT CREATE TABLESPACE TO "MAPGISDBA" WITH GRANT OPTION; GRANT CREATE USER TO "MAPGISDBA" WITH GRANT OPTION; GRANT DROP ANY PROCEDURE TO "MAPGISDBA" WITH GRANT OPTION; GRANT DROP ANY ROLE TO "MAPGISDBA" WITH GRANT OPTION; GRANT DROP ANY SEQUENCE TO "MAPGISDBA" WITH GRANT OPTION; GRANT DROP ANY TABLE TO "MAPGISDBA" WITH GRANT OPTION; GRANT DROP USER TO "MAPGISDBA" WITH GRANT OPTION; GRANT SELECT ON "SYS"."V_$VERSION" TO "MAPGISDBA" WITH GRANT OPTION; GRANT SELECT ON "SYS"."ALL_TABLES" TO "MAPGISDBA" WITH GRANT OPTION; GRANT SELECT ON "SYS"."V_$SESSION" TO "MAPGISDBA" WITH GRANT OPTION; GRANT SELECT ON "SYS"."DBA_USERS" TO "MAPGISDBA" WITH GRANT OPTION; GRANT SELECT ON "SYS"."DBA_TAB_PRIVS" TO "MAPGISDBA" WITH GRANT OPTION; GRANT SELECT ON "SYS"."DBA_TAB_COLUMNS" TO "MAPGISDBA" WITH GRANT OPTION; GRANT SELECT ON "SYS"."DBA_ROLES" TO "MAPGISDBA" WITH GRANT OPTION; GRANT SELECT ON "SYS"."DBA_FREE_SPACE" TO "MAPGISDBA" WITH GRANT OPTION; GRANT SELECT ON "SYS"."DBA_TABLESPACES" TO "MAPGISDBA" WITH GRANT OPTION; GRANT SELECT ON "SYS"."DBA_ROLE_PRIVS" TO "MAPGISDBA" WITH GRANT OPTION; GRANT SELECT ON "SYS"."DBA_DATA_FILES" TO "MAPGISDBA" WITH GRANT OPTION; GRANT SELECT ON "SYS"."DBA_IND_COLUMNS" TO "MAPGISDBA" WITH GRANT OPTION; GRANT SELECT ON "SYS"."DBA_INDEXES" TO "MAPGISDBA" WITH GRANT OPTION; 6。新建cadadba用户,位于表空间wzgis上 7。给cadadba用户赋权,给予dba权限