Finding Trace Files Being Written Right Now!

Hey!
I was not sure on the title for this post, but I bet everyone, at least once, needed to know which file is being modified at this exact moment in your filesystem/server.

Some days ago I noticed something was making my filesystem full. I cleared some gigas in logs from Diag Home but the space gone 100% very quickly. What is consuming the space?
Easy:

1. Create a new file.

$ touch a.log

2. Find everything newer than this file.

$ find . -newer a.log

Here you go!

In my situation, after finding this, I noticed there was a session in a bug situation generating thousands of messages on trace file.
Killed the session, got part of the messages, cleared file. Issue solved.

Hope it helps!

How to Setup Automatic Startup and Shutdown of an Oracle Database on Linux (Not Using Oracle-Restart)

Ok, we all have done it several times. I, myself, made some scripts to do it in past. However, do you know there is an official way/script for that?
You can accomplish this with dbstart and dbshut scripts, which are located in the $ORACLE_HOME/bin directory.
This is documented for 12.1 in Stopping and Starting Oracle Software .

Of course that, if you have Oracle Clusterware configured, you can use Oracle Restart and SRVCTL tool, and Clusterware automatically starts and stops the Oracle database instances and listeners. Which is way better.
This post refers to official procedure in case you haven’t Clusterware configured.

Quick Guide:

More“How to Setup Automatic Startup and Shutdown of an Oracle Database on Linux (Not Using Oracle-Restart)”

CRS Not Starting after Removing OS User: How to Workaround and How to Solve!

Hello all!
Turns that a few days ago a client reached me because his CRSD was simply not starting. Like this:

[root@proddb proddb]$ ./crsctl start res ora.crsd -init
CRS-2672: Attempting to start 'ora.crsd' on 'proddb'
CRS-2676: Start of 'ora.crsd' on 'proddb' succeeded

[root@proddb proddb]$ ps -ef |grep crsd
root 19217 13424 0 11:53 pts/0 00:00:00 grep crsd

After some investigation, I found the following:

2017-01-24 14:00:06.859: [ CRSSEC][1690195712]{1:51052:2} Exception: OwnerEntry construction failed to retrieve user id by name with ACL string: owner:jacknobody:rwx and error: 1
2017-01-24 14:00:06.912: [ CRSSEC][1690195712]{1:51052:2} Exception: ACL entry creation failed for: owner:jacknobody:rwx

Hmmm, seems some CRS resources are owned by “Jack Nobody”… Turns that I this us was removed from OS:

[root@proddb proddb]$ cat /etc/passwd |grep jacknobody
[root@proddb proddb]$ 

What to do now?

More“CRS Not Starting after Removing OS User: How to Workaround and How to Solve!”

umount: This utility only unmounts cifs filesystems

Can’t umount Red-Hat filesystem with error “This utility only unmounts cifs filesystems” either with force?

[@Linux-redhat5 ~]$ cat /etc/redhat-release
Red Hat Enterprise Linux Server release 5.11 (Tikanga)

ERROR:

[@Linux-redhat5 /]# umount /cifsfilesystem/data/custom
This utility only unmounts cifs filesystems.
This utility only unmounts cifs filesystems.
This utility only unmounts cifs filesystems.

More“umount: This utility only unmounts cifs filesystems”

Shellscript: Which database is this service_name from?

Hey!
Strange question, right? You should know you applications and databases and how everything works, right?

Happen that some days ago a client requested me to identify from which database is a service_name. Easy? Not if the server have 46 database instances running…

Ok, now how can I can this information as quick as possible?

I know that the command below give me all distinct databases in CRS:

/u01/app/12.1.0.2/grid/bin/crsctl stat res -t -w "TYPE = ora.database.type"

Now, lets make some sed magic:

[root@nprd01dbadm01 ~]# /u01/app/12.1.0.2/grid/bin/crsctl stat res -t -w "TYPE = ora.database.type" |grep ora. |sed 's/ora./srvctl status service -d /' |sed 's/.db/ |grep \$1/' | head -1
srvctl status service -d dba |grep $1

More“Shellscript: Which database is this service_name from?”

Teradata ODBC for Unix OS

To connection between unix machine with teradata environment is needed to install ODBC Driver and some others components (dependencies). All Items can be found in Teradata Downloads site: https://downloads.teradata.com/

Teradata OBDC Driver has 3 dependecies:

1. Shared common components for Internationalization (TDICU)
2. Teradata GSS client package (TeraGSS)
3. Teradata Tools and Utilities Base (TTU)

After download all items, run as root: rpm -ivh “component_name” –nodeps

Eg: rpm -ivh teragss1510-15.10.02.06-1.noarch.rpm --nodeps

Use “–nodeps” only to not need to install in order

More“Teradata ODBC for Unix OS”

Auto start GoldenGate

How to autostart GoldenGate services after system startup?

On Linux: /etc/rc.local

#Auto start GoldenGate 
su - oracle -c "/oracle/goldengate/./ggsci paramfile startGG.obey"

On GoldenGate ggsci path, create follow file:

cd /oracle/goldengate/
echo "start mgr" > startGG.obey
./ggsci
GGSCI  1> edit params mgr
--Startup  MGR
AUTOSTART er *
AUTORESTART er *,RETRIES 5,WAITMINUTES 5,RESETMINUTES 30

Maiquel.

Searching entries on Alert.log: A Better Way

Hi all!
As the oldest readers know, someday I had to found some entries in the alertlog and I had a really big log. So I jerrry-ringed some scripts for grepping alert with auxiliar files and etc.
I can see the posts here: Grepping Alert by Day  and Grepping Entries from Alert.log.

So… They are functional, but probably the worst ways to get it. I didn’t know and was innocent to not search by the view x$dbgalertext.
There is also possible to write on alert through the procedure SYS.DBMS_SYSTEM.KSDWRT.

Ok, so let me fix this situation with theese two good guys: @write_alert and @find_alert

More“Searching entries on Alert.log: A Better Way”

ORA-27054: NFS file system where the file is created or resides is not mounted with correct options

Due to ease in which we can go to the future or return to the past using Goldengate, it becomes increasingly necessary recover archives from backup, sometimes it is necessary to recover a several days.
To do it, generally we need large disk space, at this time, starts a searching for storage disks.

After finding a disk, is need to mount it, i performed with simply mount options in AIX.

More“ORA-27054: NFS file system where the file is created or resides is not mounted with correct options”