2017年2月4日
摘要: --恢复整个数据库run {shutdown immediate;startup mount;restore database;recover database;alter database open;} --恢复表空间usersrun {sql 'alter tablespace users of 阅读全文
posted @ 2017-02-04 11:45 john2017 阅读(5335) 评论(0) 推荐(0) 编辑
摘要: run{ allocate channel d1 type disk; backup database format='/u01/backup/%T_%d_%s.bak'; sql 'alter system archive log current'; backup archivelog all f 阅读全文
posted @ 2017-02-04 11:44 john2017 阅读(354) 评论(0) 推荐(0) 编辑
摘要: 1、shell脚本1)vi rman_backup.cmd#rman_backup.cmdconnect target /run{ allocate channel d1 device type disk; backup database format='/u01/backup/%T_%d_%s.b 阅读全文
posted @ 2017-02-04 11:43 john2017 阅读(566) 评论(0) 推荐(0) 编辑
摘要: --登录rman rman target / rman target sys/passwork rman target sys/passwork nocatalog (控制文件方式) rman target sys/passwork catalog (恢复目录方式) --查看参数 show all 阅读全文
posted @ 2017-02-04 11:42 john2017 阅读(5031) 评论(0) 推荐(0) 编辑
摘要: exp 客户端工具expdp 服务端工具 expdp help=y 帮助命令directory 导出目录逻辑名 --查询默认数据泵目录select * from dba_directorieswhere directory_name='DATA_PUMP_DIR'; --修改默认数据泵目录creat 阅读全文
posted @ 2017-02-04 11:40 john2017 阅读(341) 评论(0) 推荐(0) 编辑
摘要: --导出表exp userid=hr/oracle123 tables=employees direct=y file=/u01/employees.dmp log=/u01/employees.log --导入表 (表存在时要加ignore参数)imp userid=hr/oracle123 ta 阅读全文
posted @ 2017-02-04 11:39 john2017 阅读(229) 评论(0) 推荐(0) 编辑
摘要: --查看存储过程源代码IKKI@ test10g> select text from user_source where name='ADD_DEPT'; TEXT procedure add_dept(dno number, dname varchar2 default null, loc var 阅读全文
posted @ 2017-02-04 11:38 john2017 阅读(140) 评论(0) 推荐(0) 编辑
摘要: --定义包头 create or replace package 包名as 变量、常量声明; 函数声明; 过程声明;end; --定义包体 create or replace package body 包名as 函数实际代码; 过程实际代码;end; create or replace packag 阅读全文
posted @ 2017-02-04 11:37 john2017 阅读(132) 评论(0) 推荐(0) 编辑
摘要: --PL/SQL错误 编译时 运行时--运行时的出错处理 EXCEPTION --异常处理块DECLARE …BEGIN …EXCEPTION WHEN OTHERS THEN handler_error(…);END; --用户自定义的异常DECLARE e_TooManyStudents EXC 阅读全文
posted @ 2017-02-04 11:36 john2017 阅读(170) 评论(0) 推荐(0) 编辑
摘要: --函数 create or replace function 函数名称(参数1 类型1,参数2 类型2,...) return 数据类型as 变量、常量声明;begin 代码;end; create or replace function fun_change_name(name varchar2 阅读全文
posted @ 2017-02-04 11:35 john2017 阅读(195) 评论(0) 推荐(0) 编辑