当前位置:网站首页>linux下oracle常见操作以及日常积累知识点(函数、定时任务)
linux下oracle常见操作以及日常积累知识点(函数、定时任务)
2022-08-05 10:08:00 【qingfengvssuibian】
oracle的启动、关闭
#用dba的身份登录
sqlplus / nolog conn / as sysdba
#启动
startup
#关闭
shutdown immediate
监听启动:
#监听启动
lsnrctl start
#监听状态
lsnrctl status
#监听停止
lsnrctl stop
Trunk函数:截取日期或者数字
--截取日期
select trunc(sysdate,'yyyy') from dual union all --精确到年,显示当年第一天
select trunc(sysdate,'mm') from dual union all --月
select trunc(sysdate,'dd') from dual union all --天
select trunc(sysdate,'hh') from dual union all --小时
select trunc(sysdate,'mi') from dual union all --分
select trunc(sysdate) from dual union all --和精确到天一样 dd
select sysdate from dual union all
SELECT (sysdate + 1) FROM dual; --下一天 1代表1天的意思,+1就是下一天 +1/24代表加一个小时
--截取数值,不进行四舍五入,可用于保留有效数字
select trunc(155.555) from dual union all --保留三位有效数字
select trunc(155.555,3) from dual union all
select trunc(155.555,2) from dual union all
select trunc(155.555,0) from dual union all
select trunc(155.555,-2) from dual; --保留-2位有效数字
forupdate和rowid修改数据
出现无法修改数据(只读readonly模式),可以尝试只修改一张表。一般建议使用rowid。
定时任务
每隔一段时间执行一次任务。不多说,直接上操作。
创建新表
create table testDsrw(
name varchar2(50),
riqi date
);
创建存储过程
create or replace procedure testPro is
begin
insert into testdsrw(name,riqi)values('tie',sysdate);
commit;
end testPro;
可视化创建定时任务job
在DBMS_JOBS下新建job,并配置红色部分,其中内容写上存储过程的名字(后面必须跟上分号,不然报错),在间隔中写入下次执行时间,例如 TRUNC(sysdate,'mi') + 1/(24*60),代表下一分钟。至此,一个简单的定时任务创建完成。
启动
点击应用即可
停止
点击 断开然后再次应用即可停止定时任务
至此定时任务界面版介绍完成。
边栏推荐
- Can MySQL use aggregate functions without GROUP BY?
- The century-old Nordic luxury home appliance brand ASKO smart wine cabinet in the three-temperature area presents the Chinese Valentine’s Day, and tastes the love of the delicacy
- After Keil upgrades to AC6, what changes?
- 无题四
- Offensive World-PWN-new_easypwn
- 第四章:activiti RuntimeService设置获和取流程变量,及与taskService的区别,开始和完成任务时设置流程变量[通俗易懂]
- SD NAND Flash简介!
- 电竞、便捷、高效、安全,盘点OriginOS功能的关键词
- Microservice Technology Stack
- Still looking for a network backup resources?Hurry up to collect the following network backup resource search artifact it is worth collecting!
猜你喜欢
three.js debugging tool dat.gui use
Meteorological data processing example - matlab string cutting matching and R language date matching (data splicing)
高质量 DeFi 应用构建指南,助力开发者玩转 DeFi Summer
创建一个 Dapp,为什么要选择波卡?
【 temperature warning program DE development 】 event driven model instance
First Decentralized Heist?Loss of nearly 200 million US dollars: analysis of the attack on the cross-chain bridge Nomad
七夕浪漫约会不加班,RPA机器人帮你搞定工作
How can project cost control help project success?
Introduction to SD NAND Flash!
语音社交软件开发——充分发挥其价值
随机推荐
仿SBUS与串口数据固定转换
The founder of the DFINITY Foundation talks about the ups and downs of the bear market, and where should DeFi projects go?
韦东山 数码相框 项目学习(六)tslib的移植
为什么sys_class 里显示的很多表的 RELTABLESPACE 值为 0 ?
无题一
语音社交软件开发——充分发挥其价值
[强网杯2022]WP-UM
Pytorch Deep Learning Quick Start Tutorial -- Mound Tutorial Notes (3)
一个栈的输入序列为1 2 3 4 5 的出站顺序的理解
无题二
入门 Polkadot 平行链开发,看这一篇就够了
无题八
The century-old Nordic luxury home appliance brand ASKO smart wine cabinet in the three-temperature area presents the Chinese Valentine’s Day, and tastes the love of the delicacy
静态链接和动态链接
Custom filters and interceptors implement ThreadLocal thread closure
无题三
多线程(进阶) - 2.5w字总结
百年北欧奢华家电品牌ASKO智能三温区酒柜臻献七夕,共品珍馐爱意
第八章:activiti多用户任务分配
The difference between find, matches, lookingAt matching strings in matcher