Backing up your CRONTAB
If you are running a lot of scripts through CRON you may want to have a current backup. Since your CRON is simply a text schedule I prefer a daily email backup. It’s simple and does what I need. I add this line to my CRON:
00 0 * * * crontab -l > crontablist.txt; mail -s "DW CRON - Quality Control" email@domain.com < crontablist.txt
Everyday at midnight I get an email with the contents of my CRON.
Finding the 10 largest objects in an Oracle database
Need to find the largest objects in your database? It’s pretty simple, here is the code:
col owner format a15 col segment_name format a30 col segment_type format a15 col mb format 999,999,999 select owner , segment_name , segment_type , mb from ( select owner , segment_name , segment_type , bytes / 1024 / 1024 "MB" from dba_segments order by bytes desc ) where rownum < 11 /
Tags: objects
Remotely Disconnect a Terminal Services Session
okay admittly this is not Oracle related, but I have had to remotely disconnect a terminal services session more than one time. Needed to do it again today so I thought I would post the simple instructions.
So first you need to find the session that you want to kill. From a Windows command prompt type:
qwinsta /server:yourservername
So in my case I typed: qwinsta /server:10.10.11.125
Now I want to kill session #2 so I type:
rwinsta 2 /server:10.10.11.125
Pretty simple. Now I can term serv into the Windows server.
Removing Carriage Return From A File
Dealing with data between Windows and Linux can be a pain at times. On thing I need to do somewhat often is to take data from a users (normally on Windows) load it into an Oracle database. Then I will need to manipulate the data or add to it and dump it back out for the user.
An issue arises when I deal with numbers, especially if they are the last column. There is a very easy way to clean up the data though. At the end of a line Windows uses a carriage return and a line feed. Linux only uses the line feed to the carriage return becomes an actual character. You cannot see a carriage return so most of the time it is missed.
More »
Critical Patch Update – January 2011
The Critical Patch Update for January 2011 was released on January 18th, 2011. Oracle strongly recommends applying the patches as soon as possible. Please note that Sun products are included to this Critical Patch Update.
The Critical Patch Update Advisory is the starting point for relevant information. It includes a list of products affected, pointers to obtain the patches, a summary of the security vulnerabilities, and links to other important documents. Supported Products that are not listed in the “Supported Products and Components Affected” Section of the advisory do not require new patches to be applied.
Tags: security
Restart Dell OpenManage Service
I had some SNMP errors today that required me to restart Dell’s OpenManage Service. It’s actually pretty simple to do, but I wanted to share the commands.
To stop the services:
sh /root/linux/supportscripts/srvadmin-services.sh stop
To start the services again:
sh /root/linux/supportscripts/srvadmin-services.sh start
Oracle Enterprise Manager 11g
Oracle Enterprise Manager 11g is out and looks promising. Oracle Enterprise Manager allows you to monitor your databases from a single web based interface. You can see performance matrix as well as deploy patches and upgrades. I have only used EM to manage databases, but you can also use it for applications, middleware, hardware, as well as the OS.
EM is the base application and from there you can add different “packs” including
- Change Management Pack
- Configuration Management Pack
- Data Masking Pack
- Diagnostic Pack
- Provisioning Pack
- Tuning Pack
Upgraded to WordPress 3.0
SquareDBA.com has been upgraded to WordPress 3.0. If there are any issues let me know.
Tags: wordpress 3.0
ORA-30926: unable to get a stable set of rows in the source tables
I received the error “ORA-30926: unable to get a stable set of rows in the source tables”. It’s the first time I have seen this error. I was doing a merge statement affecting about 1K rows.
The problem was I was not fully matching on all the of the columns that would make the update portion of the merge statement unique. Duh! Added the additional column to my “WHEN MATCHED” criteria and everything ran fine.
Compressing Partitioned Tables
I recently wrote a script to compress certain partitions in a table. Basically any partition that was loaded and analyzed I wanted to move to a new tablespace and compress the data.
