oracle相关

1、windows安装oracle11g

https://www.2cto.com/database/201712/704034.html

 

2、卸载

https://www.cnblogs.com/huangjian20112939/p/3413173.html

 

3、oracle 11g,创建用户,表空间,赋予用户权限,导入dmp

https://blog.csdn.net/zhengsaisai/article/details/67631984

 

4、ora-00119和ora-00132问题

https://blog.csdn.net/xb12369/article/details/26720275

 

5、修改用户密码

https://www.cnblogs.com/zhncnblogs/p/6609701.html

 

6、查看/修改字符集

https://www.cnblogs.com/fxyy/p/7795959.html

 

7、将某张表的数据还原到某个时间段(前提是该时间段中表结构没有改变过)

CREATE TABLE tmp AS SELECT * FROM oldTable AS of timestamp to_timestamp('2018-7-12 22:00:00', 'yyyy-mm-dd hh24:mi:ss');

oldTable为要还原表的表名,tmp为运行该sql后创建的临时表

运行之后,数据库中将会生成一张临时表(tmp)

然后将原来的表删除(oldTable)

将tmp表的名字改为oldTable

 

8、查找所有clob字段的表

select t.column_name ,DATA_TYPE,TABLE_NAME from user_tab_columns t where  DATA_TYPE='CLOB'

 

9.wm_concat排序

select m, max(r) from (select m, wm_concat(n) over (partition by m order by n) r from t) group by m ;

把分隔后的 , 改成 | select replace(wm_concat(name),',','|') from test;

 

10.命令行导出全库

在sql下运行    create directory user_dump_tmp as 'd:\user_dump'

expdp xw/root@SERVER_NAME schemas=XW dumpfile=test.dmp directory=user_dump_tmp log=test.log

server_name为:J:\oracle\product\11.2.0\dbhome_1\NETWORK\ADMIN\tnsnames.ora下的

 

11.删除重复数据

DELETE FROM T_ZS_STUDENT_INFO E
  
  WHERE E.ROWID > (SELECT MIN(X.ROWID)
  
  FROM T_ZS_STUDENT_INFO x 
  
  WHERE X.id = E.id  );

 

12.impdb&&expdb  imp&&exp

impdb&&expdb

https://blog.csdn.net/chengxumengzhidui/article/details/78093793

imp&&exp

https://blog.csdn.net/wangchunyu11155/article/details/53635602

---SELECT * FROM dba_directories;

---drop directory dump_dir;

imp需要指定详细路径  impdb需要制定directory

 

13.查找带有换行符的记录

select * from T_SG_LOUDONG_INFO where REMARK like '%'||chr(13)||'%';

 

你可能感兴趣的:(数据库)