• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

How To Find When The Spfile Was Created On Linux Server

by admin

Question: The user needs to know when was the last time spfile was created or modified on a Linux server. How this can be found out?

Use the below approach to get the creation time of spfile.

1. Find the inode of the file using the ‘ls -i‘ command:

$ ls -i spfile[SID].ora
3950836 spfile[SID].ora  

Here 3950836 is the inode number of the spfile.

2. Find the root/parent filesystem that our file resides in.

$ cd $ORACLE_HOME/dbs

$ df -h .
Filesystem Size Used Avail Use% Mounted on
/dev/mapper 96G 86G 4.9G 95% /

3. Use the debugfs command to find the creation time of the file. Run the command using root user or sudo if the oracle user has the privileges.

# debugfs -R 'stat [inode]' [FIlesystem from above]

For Example :

# debugfs -R 'stat <3950836>' /dev/mapper
debugfs 1.43-WIP (20-Jun-2013)
Inode: 3950836 Type: regular Mode: 0640 Flags: 0x80000
Generation: 679845444 Version: 0x00000000:00000001
User: 8000 Group: 8000 Size: 3584
File ACL: 0 Directory ACL: 0
Links: 1 Blockcount: 8
Fragment: Address: 0 Number: 0 Size: 0
 ctime: 0x5c5cd3c4:1bf05f78 -- Fri Feb 8 00:56:36 2019
 atime: 0x5c5e00b1:e1953d14 -- Fri Feb 8 22:20:33 2019
 mtime: 0x5c5cd3c4:1bf05f78 -- Fri Feb 8 00:56:36 2019
 crtime: 0x5c5cb6f3:895fa1d0 -- Thu Feb 7 22:53:39 2019
Size of extra inode fields: 28
EXTENTS:
(0):10470261

As shown in the output above the creation time of the spfile is “Thu Feb 7 22:53:39 2019”. Similarly, you can get the modification time of the spfile from the “mtime” line just above it.

Filed Under: Linux, oracle

Some more articles you might also be interested in …

  1. acountry Command Examples in Linux
  2. chgrp Command Examples in Linux
  3. PL/SQL Cursor Variables with REF CURSOR
  4. datamash Command Examples in Linux
  5. Linux OS Service ‘haldaemon’
  6. How to move ASM spfile to a different disk group
  7. How to Install dmg File on Mac from Command Line
  8. How to verify if NX/XD is Enabled or Disabled in CentOS/RHEL 7 and 8
  9. Oracle RAC: How to modify private hostname, Private network IP & MTU
  10. RMAN Pluggable Database Backup and Recovery in a Multitenant Environment

You May Also Like

Primary Sidebar

Recent Posts

  • ncat Command Examples in Linux
  • ncat: command not found
  • nautilus Command Examples in Linux
  • namei: command not found

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright