Oracle的一些安全加固配置
Oracle数据库安全往往容易被SA或者DBA所忽视,实则还是需要提高警惕,一下是一些配置和参数以改进Oracle数据库的安全性。
Oracle数据库安全往往容易被SA或者DBA所忽视,实则还是需要提高警惕,一下是一些配置和参数以改进Oracle数据库的安全性。
0. 限制sysdba角色的用户使用远程登录
alter system set remote_login_passwordfile=none scope=spfile;
这个参数默认值为 EXCLUSIVE ,注意,修改后只能从主机上使用OS认证的方式进行登录。
1. 使用profile进行限定资源和口令安全
如果要使用口令管理,以SYS执行 utlpwdmg.sql 脚本。
@?/rdbms/admin/utlpwdmg.sql;
口令帐户锁定相关参数:
FAILED_LOGIN_ATTEMPTS 锁允许登录失败的次数
PASSWORD_LOCK_TIME 达到登录失败次数后,帐户锁定的天数,过了这个天数之后帐户会自动解锁
口令失效和过期相关参数:
PASSWORD_LIFE_TIME 口令的生存期(天)
PASSWORD_GRACE_TIME 口令失效后从第一次成功登录算起的更改口令的宽限期(天)
口令历史记录相关参数:
PASSWORD_REUSE_TIME 可以重新使用口令前的天数
PASSWORD_REUSE_MAX 可以重新使用口令的最多次数
口令校验相关参数: 【Linux公社 】
PASSWORD_VERIFY_FUNCTION 检验口令设置的PL/SQL 函数
如何使用这些参数呢?一是创建新的配置文件,然后把配置文件绑定到用户:
CREATE PROFILE profile_name LIMIT
FAILED_LOGIN_ATTEMPTS 6
PASSWORD_VERIFY_FUNCTION verify_function
PASSWORD_LOCK_TIME 1/24;
ALTER USER user_name PROFILE profile_name;
如果不需要配置文件了,删除:
DROP PROFILE developer_prof CASCADE
二是直接修改默认的配置文件,,这样对每个使用该配置文件的用户都是生效的:
ALTER PROFILE DEFAULT LIMIT
FAILED_LOGIN_ATTEMPTS 6
PASSWORD_VERIFY_FUNCTION verify_function
PASSWORD_LOCK_TIME 1/24;
2. 设置监听器口令
在10g当中,监听器的口令设置已经过时了,对监听器的任何操作默认情况下变成了OS认证方式,也就是说对监听启动操作的用户可以任意停止监听,而非启动用户则无法对监听器进行停止,但是如果你想要恢复到9i的那种需要口令操作的情况,可以如下设置:
listener.ora文件增加如下一行参数:
LOCAL_OS_AUTHENTICATION_[listener name] = OFF
通过以下方式设置口令:
[oracle@test admin]$ lsnrctl
LSNRCTL for Linux: Version 10.2.0.5.0 - Production on 08-AUG-2012 14:42:03
Copyright (c) 1991, 2010, Oracle. All rights reserved.
Welcome to LSNRCTL, type "help" for information.
LSNRCTL> change_password
Old password:
New password:
Reenter new password:
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.2.4)(PORT=1521)))
Password changed for LISTENER
The command completed successfully
LSNRCTL> save_config --奇怪的是保存失败,需要执行下 set password之后重新保存即可
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.2.4)(PORT=1521)))
TNS-01169: The listener has not recognized the password
LSNRCTL> set password
Password:
The command completed successfully
LSNRCTL> save_config
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.2.4)(PORT=1521)))
Saved LISTENER configuration parameters.
Listener Parameter File /u01/oracle/10g/product/10.2.0/db_1/network/admin/listener.ora
Old Parameter File /u01/oracle/10g/product/10.2.0/db_1/network/admin/listener.bak
The command completed successfully
LSNRCTL>

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

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

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











Apple's latest releases of iOS18, iPadOS18 and macOS Sequoia systems have added an important feature to the Photos application, designed to help users easily recover photos and videos lost or damaged due to various reasons. The new feature introduces an album called "Recovered" in the Tools section of the Photos app that will automatically appear when a user has pictures or videos on their device that are not part of their photo library. The emergence of the "Recovered" album provides a solution for photos and videos lost due to database corruption, the camera application not saving to the photo library correctly, or a third-party application managing the photo library. Users only need a few simple steps

Hibernate polymorphic mapping can map inherited classes to the database and provides the following mapping types: joined-subclass: Create a separate table for the subclass, including all columns of the parent class. table-per-class: Create a separate table for subclasses, containing only subclass-specific columns. union-subclass: similar to joined-subclass, but the parent class table unions all subclass columns.

To handle database connection errors in PHP, you can use the following steps: Use mysqli_connect_errno() to obtain the error code. Use mysqli_connect_error() to get the error message. By capturing and logging these error messages, database connection issues can be easily identified and resolved, ensuring the smooth running of your application.

How to use MySQLi to establish a database connection in PHP: Include MySQLi extension (require_once) Create connection function (functionconnect_to_db) Call connection function ($conn=connect_to_db()) Execute query ($result=$conn->query()) Close connection ( $conn->close())

JSON data can be saved into a MySQL database by using the gjson library or the json.Unmarshal function. The gjson library provides convenience methods to parse JSON fields, and the json.Unmarshal function requires a target type pointer to unmarshal JSON data. Both methods require preparing SQL statements and performing insert operations to persist the data into the database.

Using the database callback function in Golang can achieve: executing custom code after the specified database operation is completed. Add custom behavior through separate functions without writing additional code. Callback functions are available for insert, update, delete, and query operations. You must use the sql.Exec, sql.QueryRow, or sql.Query function to use the callback function.

MySQL is an open source relational database management system. 1) Create database and tables: Use the CREATEDATABASE and CREATETABLE commands. 2) Basic operations: INSERT, UPDATE, DELETE and SELECT. 3) Advanced operations: JOIN, subquery and transaction processing. 4) Debugging skills: Check syntax, data type and permissions. 5) Optimization suggestions: Use indexes, avoid SELECT* and use transactions.

Through the Go standard library database/sql package, you can connect to remote databases such as MySQL, PostgreSQL or SQLite: create a connection string containing database connection information. Use the sql.Open() function to open a database connection. Perform database operations such as SQL queries and insert operations. Use defer to close the database connection to release resources.
