DB命令二

来源:互联网 发布:淘宝店铺信誉等级表 编辑:程序博客网 时间:2024/05/02 04:18
 

数据库备份SQL
数据库备份是对一个DBA最基本的要求,在维护工作中也是经常要用到,的常用的备份如下,这里不会把所有的参数列出来,根据实际情况需要自己可以添加一些参数:

 

导出表:

  exp name/password@mycon tables=(table1,table2) file=tab1.dmp

导出用户:

  exp name/password@mycon owner=name file=name.dmp

导出数据库:

  exp system/password@mycon full=y inctype=complete file=full1.dmp

 

导入表:

  imp system/password@mycon file= tab1.dmp tables=(table1,table2) touser=name

导入用户:

imp name/password@mycon file=name.dmp full=yes

导入数据库:

  imp system/password@mycon file=full1.dmp full=yes

select * from t_hrstafftemp t where  t.employee_number between '00180000' and '00190000' and to_char(t.creation_date,'yyyymmdd') = to_char(sysdate, 'yyyymmdd')

update t_hrstafftemp t2 set t2.last_update_date=sysdate where t2.employee_number between '00100000' and '00110000';


select sysdate from dual;

select person_mobile_code from t_hrstafftemp where REGEXP_LIKE(person_mobile_code, '^[1-9].*-.*');