Sunday, November 2, 2014

GIT - Supress the popup on git gui - Compres loose objects

Are you one another annoyed user by seeing the pop-up when you run 'git gui' ?

The root cause is loose objects. Better do gc on your gitrepo.

git gc    # This actually prunes objects older than two weeks


Alternatively, you can suppress the dialog permanently.

git config --global gui.gcwarning false



Markdown format (.md file) to a word doc





+

Sublime Text is a marvel and this developer who created a plugin to convert mark down in to .doc format is marvelous.

http://plaintext-productivity.net/2-05-how-to-set-up-sublime-text-for-markdown-export-to-word.html

Keep rocking you wonderful people !

Friday, November 23, 2012

Auditing changes to data on a Table

Have you faced the following situations ?
1. Some data changed in production, and you dont have a clue of who did it.
2. Surprising structural changes to your schema objects

Beginning 10g, Oracle provides AUDIT command to audit all your changes to schema objects.
My topic of interest is to audit data changes. Traditionally, developers used last_updated_user, last_updated_date columns filled by triggers. These columns are necessary only when you have ETL jobs that depend on the audit columns. If your use case is to know what has changed, then you should have AUDIT on your objects.
AUDIT INSERT, UPDATE, DELETE ON my_table;
More details are available on the Oracle documentation website. We need to keep in mind that such audit in action can generate a lots of info.
http://docs.oracle.com/cd/B28359_01/server.111/b28286/statements_4007.htm

Monday, April 2, 2012

Oracle listener failing to start (Broken pipe)

Have you faced this ?
Oracle listener broken pipe error as given below...


Starting /u01/app/oracle/product/9.2.0/bin/tnslsnr: please wait...

TNS-12547: TNS:lost contact
 TNS-12560: TNS:protocol adapter error
  TNS-00517: Lost contact
   Linux Error: 32: Broken pipe

Solution:

Go to $ORACLE_HOME/network/logs
Examine the size of the listener log and if it has reached 2GB, archive it and now try starting the listener. 

Wednesday, February 8, 2012

Disable "Save Password" in SQL Developer

Handy information for people who connect to various databases, yet share their workstations. You may have SQL Developer where you tend to store passwords, and to prevent accidental connection to your databases when others use the machine, it is safe to disable the "Save password" option on your SQL Developer.

Edit the sqldeveloper/bin/sqldeveloper.conf and add this:
AddVMOption -Dsqldev.savepasswd=false



Tuesday, February 7, 2012

DDL Made easy for developers- Oracle

How much do you understand the implication of running a DDL on your database schema ?


So, this section has been presented in a mini FAQ format so as to keep the content concise to the point.


What is DDL ?

Data definition language (DDL) statements let you to perform these tasks:

    Create, alter, and drop schema objects

    Grant and revoke privileges and roles

    Analyze information on a table, index, or cluster

    Establish auditing options

    Add comments to the data dictionary

The CREATE, ALTER, and DROP commands require exclusive access to the specified object. For example, an ALTER TABLE statement fails if another user has an open transaction on the specified table.

The GRANT, REVOKE, ANALYZE, AUDIT, and COMMENT commands do not require exclusive access to the specified object. For example, you can analyze a table while other users are updating the table.

Oracle Database implicitly commits the current transaction before and after every DDL statement.

Source: Oracle documentation


What are the side -effects ?

- Implicit commit before and after every DDL statement
- If you alter the definition of a referenced object, dependent objects may or may not continue to function without error, depending on the type of alteration. For example, if you drop a table, no view or procedure or package based on the dropped table is usable. Same is the effect with ALTER.

Dependency management - How does this affect us ?

- When DDLs are checked-in, it may result in invalidating the objects that have direct or indirect dependency.
- The invalidated object could be a trigger on a table, which might even show you a failed INSERT result because one of the trigger in invalid.

If you are interested further in knowing the invalid objects in your schema...

Run the following query to view the invalid objects in your database
- select object_name, object_type from user_objects where status !='VALID' order by object_type, object_name;

Run the query below BEFORE and AFTER running a DDL to know how many objects are being invalidated by your change.
- select count(*) from
user_objects where status !='VALID';


How do you compile the invalid objects ?
I have a log on how to compile invalid DB objects in the same blog.
http://databasetiger.blogspot.in/2009/04/recompiling-to-validate-invalid-objects.html