How to change hostname in Redhat & Oracle Linux

As user “root”

“vi /etc/sysconfig/network”, change HOSTNAME value to the new hostname

“hostname NEW_HOST_NAME” to change it for the current sessions

“vi /etc/hosts”, change the old value to point to the new hostname

“service network restart” to restart the networking service and apply all the new changes

Posted in Linux | Tagged , , , , | 2 Comments

Get List of ASM Disks in an 11gR2 Database

select * from v$asm_disk

Posted in Oracle | Tagged , , , | Leave a comment

How to compile all Oracle DB 11gR2 Invalid Objects

Login to SQLPlus
Run the following statement: “@?/rdbms/admin/utlrp.sql”

Posted in Oracle | Tagged , , , , , , | Leave a comment

How to query Oracle DB 11g for user account status

select USERNAME,ACCOUNT_STATUS from dba_users where USERNAME=’PUT_YOUR_USER_NAME_HERE’;

Sample output:

USERNAME                                    ACCOUNT_STATUS
——————————           ——————————–
SADMIN                                           OPEN

Posted in Oracle | Tagged , , , | Leave a comment

How to run the Oracle Data Pump Command as sysdba

If you have access to the Oracle DB server OS and user (e.g. via ssh or telnet), then you don’t need to have credentials for any DB user to be able to run the data pump commands, all you have to do is adding userid=”‘/ as sysdba'”

e.g.

expdp userid=”‘/ as sysdba'” schemas=x,y,z directory=datapump_output_dir dumpfile=data_pump_output_.dmp logfile=data_pump_output.log

Posted in Oracle | Tagged , , , , , | Leave a comment