当前位置:网站首页>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.
边栏推荐
- 我们的Web3创业项目,黄了
- 蚁剑webshell动态加密连接分析与实践
- 为什么sys_class 里显示的很多表的 RELTABLESPACE 值为 0 ?
- Development common manual link sharing
- Jenkins manual (2) - software configuration
- ffmpeg drawtext 添加文本水印
- Confessing in the era of digital transformation: Mai Cong Software allows enterprises to use data in the easiest way
- Getting started with Polkadot parachain development, this article is enough
- The founder of the DFINITY Foundation talks about the ups and downs of the bear market, and where should DeFi projects go?
- Imitation SBUS fixed with serial data conversion
猜你喜欢
How can project cost control help project success?
Meteorological data processing example - matlab string cutting matching and R language date matching (data splicing)
RT-Thread记录(一、RT-Thread 版本、RT-Thread Studio开发环境 及 配合CubeMX开发快速上手)
NowCoderTOP35-40 - continuous update ing
Analysis and practice of antjian webshell dynamic encrypted connection
5. Deploy the web project to the cloud server
Egg framework usage (2)
Advanced usage of C language
IDEA performs the Test operation, resulting in duplicate data when data is inserted
Keil升级到AC6后,到底有哪些变化?
随机推荐
Oracle 19.3 restart 环境
Meteorological data processing example - matlab string cutting matching and R language date matching (data splicing)
华为轻量级神经网络架构GhostNet再升级,GPU上大显身手的G-GhostNet(IJCV22)
第五章:多线程通信—wait和notify
uniapp connect ibeacon
第七章,activiti个人任务分配,动态指定和监听器指定任务委派人「建议收藏」
第六章:activiti流程分流判断之排它网关和并行网关
[Unity] [UGUI] [Display text on the screen]
egg框架使用(一)
气象数据数据处理实例——matlab字符串切割匹配与R语言日期匹配(数据拼接)
如何选币与确定对应策略研究
dotnet OpenXML parsing PPT charts Getting started with area charts
Development common manual link sharing
Oracle temporary table space role
Getting started with Polkadot parachain development, this article is enough
uniapp 连接ibeacon
牛刀小试基本语法,Go lang1.18入门精炼教程,由白丁入鸿儒,go lang基本语法和变量的使用EP02
dotnet OpenXML 解析 PPT 图表 面积图入门
The founder of the DFINITY Foundation talks about the ups and downs of the bear market, and where should DeFi projects go?
第九章:activit内置用户组设计与组任务分配和IdentityService接口的使用