当前位置:网站首页>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.
边栏推荐
猜你喜欢
什么是CRM决策分析管理?
还在找网盘资源吗?快点收藏如下几个值得收藏的网盘资源搜索神器吧!
High-quality DeFi application building guide to help developers enjoy DeFi Summer
What is SPL?
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
RT-Thread记录(一、RT-Thread 版本、RT-Thread Studio开发环境 及 配合CubeMX开发快速上手)
我们的Web3创业项目,黄了
电竞、便捷、高效、安全,盘点OriginOS功能的关键词
Which big guy has the 11G GI and ojvm patches in April or January 2020, please help?
Confessing in the era of digital transformation: Mai Cong Software allows enterprises to use data in the easiest way
随机推荐
egg框架使用(一)
语音社交软件开发——充分发挥其价值
Analysis and practice of antjian webshell dynamic encrypted connection
牛刀小试基本语法,Go lang1.18入门精炼教程,由白丁入鸿儒,go lang基本语法和变量的使用EP02
偏向锁/轻量锁/重级锁锁锁更健康,上锁解锁到底是怎么完成实现的
C语言的高级用法
用户考试分数大于单科科目平均分的查询
[Android]如何使用RecycleView in Kotlin project
19. Server-side session technology Session
Oracle 19.3 restart 环境
仿SBUS与串口数据固定转换
uniapp connect ibeacon
MySQL使用聚合函数可以不搭配GROUP BY分组吗?
微服务 技术栈
Which big guy has the 11G GI and ojvm patches in April or January 2020, please help?
数据中台建设(十):数据安全管理
你最隐秘的性格在哪?
导火索:OAuth 2.0四种授权登录方式必读
第七章,activiti个人任务分配,动态指定和监听器指定任务委派人「建议收藏」
还在找网盘资源吗?快点收藏如下几个值得收藏的网盘资源搜索神器吧!