Skip to main content

Posts

Showing posts from February, 2024

πŸ”Locking and Unlocking Schemas in Oracle Database

πŸ” Locking and Unlocking Schemas in Oracle Database In Oracle Database, schemas (users) can be locked or unlocked to manage access, enhance security, or perform administrative tasks. This feature allows DBAs to temporarily disable a user without dropping the schema or affecting stored data. πŸ‘€ Why Lock or Unlock Schemas? There are many use cases where locking or unlocking a schema becomes essential: πŸ”§ Maintenance: Prevent access during application or database maintenance windows. πŸ›‘️ Security: Disable suspicious or inactive users temporarily. 🚫 Compliance: Block access for terminated employees or deprecated applications. πŸ”’ Locking a Schema Use the below SQL command to lock a user account. This prevents new connections using that user but doesn’t affect existing sessions unless explicitly terminated. ALTER USER <username> ACCOUNT LOCK; -- Example ALTER USER HR ACCOUNT LOCK; πŸ”“ Unlocking a Schema To allow a previously locked user to connect again, you...

Monitoring Tablespace Utilization in Oracle Database

πŸ“Š Monitoring Tablespace Usage in Oracle Database Tablespaces in Oracle are logical storage units that group related logical structures such as segments. They act as a layer between the database and the physical storage, allowing database administrators to manage space allocation, performance, and maintenance more efficiently. πŸ“ What are Tablespaces? Oracle Database uses tablespaces to logically organize data stored in physical datafiles. Each tablespace can contain one or more datafiles, and each datafile belongs to exactly one tablespace. Permanent Tablespaces: Store user and application data. Temporary Tablespaces: Used for sorting operations and temporary storage needs. Undo Tablespaces: Hold undo records for rolling back transactions and for read consistency. πŸ“ˆ Checking Tablespace Utilization The following SQL query helps you monitor permanent tablespace usage, showing total, used, free space, and percentage utilized. COLUMN tablespace_name FORMAT A20 CO...