当前位置:网站首页>Common operations of oracle under linux and daily accumulation of knowledge points (functions, timed tasks)
Common operations of oracle under linux and daily accumulation of knowledge points (functions, timed tasks)
2022-08-05 10:17:00 【qingfengvssuibian】
oracle startup and shutdown
#Login as dba
sqlplus / nolog conn / as sysdba
#start
startup
#close
shutdown immediate
Monitor start:
#Listening to start
lsnrctl start
#Monitoring status
lsnrctl status
#Monitoring stop
lsnrctl stop
Trunk function: intercept date or number
--Intercept dateselect trunc(sysdate,'yyyy') from dual union all --accurate to the year, showing the first day of the current yearselect trunc(sysdate,'mm') from dual union all --monthselect trunc(sysdate,'dd') from dual union all --daysselect trunc(sysdate,'hh') from dual union all --hourselect trunc(sysdate,'mi') from dual union all -- pointsselect trunc(sysdate) from dual union all -- as accurate as day ddselect sysdate from dual union allSELECT (sysdate + 1) FROM dual; -- next day 1 means 1 day, +1 means the next day +1/24 means add an hour
--Truncate the numerical value without rounding, which can be used to retain valid digitsselect trunc(155.555) from dual union all -- keep three significant digitsselect trunc(155.555,3) from dual union allselect trunc(155.555,2) from dual union allselect trunc(155.555,0) from dual union allselect trunc(155.555,-2) from dual; --reserve -2 significant digits
forupdate and rowid modify data
It appears that the data cannot be modified (read-only readonly mode), you can try to modify only one table.It is generally recommended to use rowid.
Scheduled tasks
Perform a task at regular intervals.Not much to say, just go to the operation.
Create new table
create table testDsrw(name varchar2(50),riqi date);
Create a stored procedure
create or replace procedure testPro isbegininsert into testdsrw(name,riqi)values('tie',sysdate);commit;end testPro;
Visually create a scheduled task job
Create a new job under DBMS_JOBS, and configure the red part, where the name of the stored procedure is written (it must be followed by a semicolon, otherwise an error will be reported), and the next execution time is written in the interval, such as TRUNC(sysdate,'mi') + 1/(24*60), representing the next minute.So far, a simple timed task has been created.
Startup
Click Apply
stop
Click Disconnect and apply again to stop the scheduled task
At this point, the introduction of the scheduled task interface version is completed.
边栏推荐
- 5. Deploy the web project to the cloud server
- 【MindSpore Easy-Diantong Robot-01】You may have seen many knowledge quiz robots, but this one is a bit different
- How does the official account operate and maintain?Public account operation and maintenance professional team
- [Strong Net Cup 2022] WP-UM
- uniapp 连接ibeacon
- MySQL使用聚合函数可以不搭配GROUP BY分组吗?
- Pytorch Deep Learning Quick Start Tutorial -- Mound Tutorial Notes (3)
- three objects are arranged in a spherical shape around the circumference
- 【 temperature warning program DE development 】 event driven model instance
- How can project cost control help project success?
猜你喜欢
DFINITY 基金会创始人谈熊市沉浮,DeFi 项目该何去何从
What is SPL?
egg框架使用(二)
NowCoderTOP35-40——持续更新ing
STM32+ULN2003 drives 28BYJ4 stepper motor (forward and reverse according to the number of turns)
three物体围绕一周呈球形排列
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
leetcode: 529. 扫雷游戏
[强网杯2022]WP-UM
随机推荐
单片机:温度控制DS18B20
PHP operation mangoDb
第六章:activiti流程分流判断之排它网关和并行网关
dotnet OpenXML 解析 PPT 图表 面积图入门
【温度预警程序de开发】事件驱动模型实例运用
Pytorch Deep Learning Quick Start Tutorial -- Mound Tutorial Notes (3)
ffmpeg drawtext add text watermark
第四章:redis 数组结构的set和一些通用命令「建议收藏」
C语言的高级用法
还在找网盘资源吗?快点收藏如下几个值得收藏的网盘资源搜索神器吧!
SD NAND Flash简介!
uniapp 连接ibeacon
DFINITY 基金会创始人谈熊市沉浮,DeFi 项目该何去何从
Egg framework usage (2)
仿SBUS与串口数据固定转换
Meteorological data processing example - matlab string cutting matching and R language date matching (data splicing)
多线程(进阶) - 2.5w字总结
Oracle 19.3 restart 环境
[强网杯2022]WP-UM
Jenkins使用手册(2) —— 软件配置