oracle 服务启动,关闭脚本(windows系统下)
Windows下的批出理程序,就是dos命令的集合,我们也可以通过运行程序里的命令来开启服务.
一.概念简介脚本:script是使用一种特定的描述性语言,依据一定的格式编写的可执行文件,又称作宏或文件。
二.背景
近来在Windows下安装了oracle数据库,由于此数据库很占系统资源,而安装后此数据库的很多服务都是默认开机启动的,这样系统运行速度就大大受到影响。如何按我们的意愿让这些服务在我们需要用到的时候开启,而我们不用的时候关闭呢。这里我只介绍三种方式。
三.正文
1.利用资源管理器关闭相关进程如oracle.exe,这种方式需要我们非常了解oracle的进程控制程序。
2.利用windows的控制面板管理。步骤:
开始->控制面板->性能和维护->管理工具->服务 然后找到相关以oracle开头的服务,我的系统下如下:
OracleDBConsoleoracle
OracleJobSchedulerORACLE
OracleOraDb10g_home1iSQL*Plus
OracleOraDb10g_home1TNSListener
OracleServiceORACLE
对这些服务进行启动停止等操作。
3.利用脚本,即程序。
我们可以如2,将系统里的
OracleOraDb10g_home1iSQL*Plus
OracleOraDb10g_home1TNSListener
OracleServiceORACLE
这三项设为手动,这样开机就不会启动这三项服务,开机会更快。
然后,我们建立程序:
1.建立dbstart.cmd文件(开启)
2.添加如下内容:
代码如下:
@echo off
net start OracleServiceORACLE
net start OracleOraDb10g_home1iSQL*Plus
net start OracleOraDb10g_home1TNSListener
pause
同样我们可以建立关闭文件(dbstop.cmd)
@echo off
net stop OracleServiceORACLE
net stop OracleOraDb10g_home1iSQL*Plus
net stop OracleOraDb10g_home1TNSListener
pause
这样我们就可以双击这两个文件来开启或关闭oracle的服务程序。
(朋友可能注意到3里面用到的服务正是2里面查找到的服务,确实2也是一种查找自己系统服务的方法)
四.总结
1.Windows下的批出理程序,就是dos命令的集合,我们也可以通过运行程序里的命令来开启服务.
2.熟悉Linux的朋友一定会知道Linux下的shell脚本也是命令的集合,通过脚本我们可以将常用的命令集合写成脚本.这在管理系统的时候非常高效。

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

The retention period of Oracle database logs depends on the log type and configuration, including: Redo logs: determined by the maximum size configured with the "LOG_ARCHIVE_DEST" parameter. Archived redo logs: Determined by the maximum size configured by the "DB_RECOVERY_FILE_DEST_SIZE" parameter. Online redo logs: not archived, lost when the database is restarted, and the retention period is consistent with the instance running time. Audit log: Configured by the "AUDIT_TRAIL" parameter, retained for 30 days by default.

The function in Oracle to calculate the number of days between two dates is DATEDIFF(). The specific usage is as follows: Specify the time interval unit: interval (such as day, month, year) Specify two date values: date1 and date2DATEDIFF(interval, date1, date2) Return the difference in days

The Oracle database startup sequence is: 1. Check the preconditions; 2. Start the listener; 3. Start the database instance; 4. Wait for the database to open; 5. Connect to the database; 6. Verify the database status; 7. Enable the service (if necessary ); 8. Test the connection.

The amount of memory required by Oracle depends on database size, activity level, and required performance level: for storing data buffers, index buffers, executing SQL statements, and managing the data dictionary cache. The exact amount is affected by database size, activity level, and required performance level. Best practices include setting the appropriate SGA size, sizing SGA components, using AMM, and monitoring memory usage.

The INTERVAL data type in Oracle is used to represent time intervals. The syntax is INTERVAL <precision> <unit>. You can use addition, subtraction, multiplication and division operations to operate INTERVAL, which is suitable for scenarios such as storing time data and calculating date differences.

To find the number of occurrences of a character in Oracle, perform the following steps: Get the total length of a string; Get the length of the substring in which a character occurs; Count the number of occurrences of a character by subtracting the substring length from the total length.

The method of replacing strings in Oracle is to use the REPLACE function. The syntax of this function is: REPLACE(string, search_string, replace_string). Usage steps: 1. Identify the substring to be replaced; 2. Determine the new string to replace the substring; 3. Use the REPLACE function to replace. Advanced usage includes: multiple replacements, case sensitivity, special character replacement, etc.

Oracle database server hardware configuration requirements: Processor: multi-core, with a main frequency of at least 2.5 GHz. For large databases, 32 cores or more are recommended. Memory: At least 8GB for small databases, 16-64GB for medium sizes, up to 512GB or more for large databases or heavy workloads. Storage: SSD or NVMe disks, RAID arrays for redundancy and performance. Network: High-speed network (10GbE or higher), dedicated network card, low-latency network. Others: Stable power supply, redundant components, compatible operating system and software, heat dissipation and cooling system.
