惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

V
Visual Studio Blog
Stack Overflow Blog
Stack Overflow Blog
G
Google Developers Blog
Microsoft Azure Blog
Microsoft Azure Blog
Engineering at Meta
Engineering at Meta
L
LangChain Blog
T
The Blog of Author Tim Ferriss
J
Java Code Geeks
Y
Y Combinator Blog
月光博客
月光博客
雷峰网
雷峰网
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
F
Fortinet All Blogs
A
About on SuperTechFans
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
P
Proofpoint News Feed
小众软件
小众软件
H
Help Net Security
Last Week in AI
Last Week in AI
B
Blog RSS Feed
宝玉的分享
宝玉的分享
N
Netflix TechBlog - Medium
博客园 - 叶小钗
The GitHub Blog
The GitHub Blog

博客园 - 迷

如何升级一台老macbook air的macOS到最新版本 IDEA错误的忽略了智能补全代码,导致正确的代码自动提示不出来的问题 校准liunx时间简单好用的命令 服务器安装Ubuntu的那些坑 闭包的应用案例 Activiti 乱码问题 Activiti 整合的小插曲 IDEA 提示找不到 javax 等 tomcat 的相关包 Oracle 日志报错导致的 “没有登录” 问题 WebPack 从安装到闲置 Android Studio 编译提示 No installed build tools found. Please install the Android build tools VBox 安装 Ubuntu Server 的那些坑,键盘乱码、网卡互连、共享目录等 nginx 的 upstream timed out 问题 产品是什么? 如何管理? 如何远程工作? 远程工作的手段 PhoneGap 3.4 开发配置及问题 错误:找不到或无法加载主类
一些好用的 Oracle 批处理和语句
· 2017-08-09 · via 博客园 - 迷

2017-08-09 11:20    阅读(358)  评论()    收藏  举报

# 备份脚本 backup.bat

@ECHO OFF
COLOR 0A
SET DaysAgo=1
SET Today=%date:~0,4%%date:~5,2%%date:~8,2%
EXP user/password BUFFER=64000 FILE=D:/database/db_%Today%.dmp OWNER=user
RAR a db_
%Today%.rar db_%Today%.dmp DEL db_20170809.dmp /q PAUSE

# 查询主外键

select a.owner 外键拥有者, a.table_name 外键表, substr(c.column_name,1,127) 外键列, b.owner 主键拥有者, b.table_name 主键表, substr(d.column_name,1,127) 主键列
from user_constraints a, user_constraints b, user_cons_columns c, user_cons_columns d
where a.r_constraint_name=b.constraint_name
  and a.constraint_type='R'
  and b.constraint_type='P'
  and a.r_owner=b.owner
  and a.constraint_name=c.constraint_name
  and b.constraint_name=d.constraint_name
  and a.owner=c.owner
  and a.table_name=c.table_name
  and b.owner=d.owner
  and b.table_name=d.table_name