一.drop表 执行drop table xx 语句 drop后的表被放在回收站(user_recyclebin)里,而不是直接删除掉.这样,回收站里的表信息就可以被恢复,或彻底清除. 通过查询回收站user_recyclebin获取被删除的表信息,然后使用语句 flashback table <user_recyclebin.object_name or user_recyclebin.original_name> to before drop [rename to <new_tabl…
1.关于 cascade constraints 假设A为主表(既含有某一主键的表),B为从表(即引用了A的主键作为外键). 则当删除A表时,如不特殊说明,则 drop table A 系统会出现错误警告的讯息而不会允许执行. 此时必须用,drop table A cascade constraints: SQL> select CONSTRAINT_NAME,TABLE_NAME from dba_constraints where owner = 'SYS' and TABLE_NAME =…
drop后的表被放在回收站(user_recyclebin)里,而不是直接删除掉.这样,回收站里的表信息就可以被恢复,或彻底清除. 1.通过查询回收站user_recyclebin获取被删除的表信息,然后使用语句flashback table <user_recyclebin.object_name or user_recyclebin.original_name> to before drop [rename to <new_table_name>]; 将回收站里的表恢复为原名称…
Flashback用于恢复用户误删除的对象(包括表,索引等), 不支持sys用户. system表空间下的对象,也不能从回收站里拿到.故使用SYS 或者SYSTEM用户登陆时, show recyclebin 为空.初始化参数recyclebin 用于控制是否启用recyclebin功能,缺省是ON, 可以使用OFF关闭. SQL> show parameter recyclebin; NAME TYPE VALUE ------------------------------------ --…
drop表 执行drop table xx 语句 drop后的表被放在回收站(user_recyclebin)里,而不是直接删除掉.这样,回收站里的表信息就可以被恢复,或彻底清除. 通过查询回收站user_recyclebin获取被删除的表信息,然后使用语句 flashback table <user_recyclebin.object_name or user_recyclebin.original_name> to before dro…
一个智障操作,drop一个用户,下面的东西比较多,删得比较慢,然后shell突然关了. 就导致了,删不掉,又不能创建新的用户.出版本要得比较急,就先创建新的用户测试去了. 今天要弄个东西,又想起这个事情,就处理一下. 然后发现,报了如下的错: SQL> drop user user cascade; drop user bto cascade * ERROR at line : ORA: error occurred at recursive SQL ORA: can not perform D…
PURGE PurposeUse the PURGE statement to remove a table or index from your recycle bin and release all of the space associated with the object, or to remove the entire recycle bin, or to remove part of all of a dropped tablespace from the recycle bin.…
今天新搭建了一个10g的测试数据库,运行都很正常,但是在打开autotrace功能后执行语句,报错 SQL> set autotrace on SQL> select username,sid,serial#,server,paddr,status from v$session where username=USER; USERNAME SID SERIAL# SERVER PADDR STATUS ---------…
1.查看某用户下所有对象的信息: SELECT owner, object_type, status, COUNT(*) count# FROM all_objects where owner='xxx' GROUP BY owner, object_type, status order by ; 2.查看表行数(多个表)(需先分析表): select 'analyze table '|| table_name||' compute statistics;' from user_tables;…
从外部EXCEl文件导入sqlserver数据库操作命令 reconfigure reconfigure go select * into abc1_1 from OPENROWSET('MICROSOFT.JET.OLEDB.4.0' ,'Excel 5.0;HDR=YES;DATABASE=文件路径',SQLResults$) 注意:文件路径到excel下某个固定的sheet,sheet名字不要有空格 数据库合并 insert into [新数据库名(合并后的)] select [字段] F…
1)掌握多行函数与分组操作 2)掌握多表查询与子查询 3)理解集合查询与掌握Oracle分页语法 4)理解创建.修改和删除表和表约束 -------------------------------------------------------------------------------------准备篇 col empno for 9999;col ename for a10;col job for a10;col mgr for 9999; col hiredate for a12;co…
61. You are working in an online transaction processing (OLTP) environment. You realize that the salary for an employee, John, has been accidentally modified in the EMPLOYEES table. Two days ago, the data was in the correct state. Flashback logs gene…