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

Oracle TimesTen In-memory Database Quick Commands & Tips

Commands to Start TimesTen Service:

./ttdaemonadmin -start
./ttdaemonadmin -startserver

Commands to Stop TimesTen Service:

./ttdaemonadmin -stopserver
./ttdaemonadmin -stop

Command to get status of TimesTen DB:

./ttstatus

Note: Important to notice is whether the Data is loaded into RAM or not

Command to load the data into RAM:

./ttAdmin -connstr “dsn=DATA_SOURCE_NAME” -ramLoad

Command to unload data from RAM:

./ttAdmin -connstr “dsn=DATA_SOURCE_NAME” -ramUnload

Command to run quick query on the TimesTen DB:

./ttIsql -connstr “dsn=DATA_SOURCE_NAME” -e “SQL_STATEMENT_1; SQL_STATEMENT_2;”

Location of Log Files for Troubleshooting:

TimesTen/t1122/info, the two most important files are tterrors.log and ttmesg.log

If you would like to know more about Oracle TimesTen Database:

Overview: http://www.oracle.com/us/products/database/timesten/overview/index.html

Product Documentation: http://docs.oracle.com/cd/E13085_01/doc/index.htm

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

Frequently-used VirtualBox Commands

You might be surprised that VirtualBox can be perfectly managed from the command line, you can create VMs, modify VM settings, startup/shutdown VMs, take snapshots …etc

Here is the collection of commands I commonly use for my VirtualBox VMs:

  • “VBoxManage list vms” –> List the existing VMs as well as their IDs
  • “nohup VBoxHeadless -s VM_NAME &” –> Start the VM in the background, and isn’t dependent on your session, i.e. when you logout, the VM will not terminate. Note: This command starts the VRDP server automatically (available only with the extension pack installed), even if it’s not enabled
  • “VBoxManage controlvm VM_NAME poweroff” –> Shut the VM down
  • “VBoxManage snapshot VM_NAME take snapshot_name” –> Take a snapshot of your VM
Posted in VirtualBox | Tagged , , , , , , | Leave a comment

How to edit network settings manually in Ubuntu Server 12.04 (Precise)

Changing network settings in new versions of Ubuntu (don’t know when exactly this new methodology started) like Ubuntu 12.04 Precise Server Edition, has a major difference from the old methodology.

The major change is that you no longer need to edit “/etc/resolv.conf”, and if you try to, your settings will be lost or overwritten once you reboot.

All what you need to change if you want to apply a static address (which is the case in almost all server installations) is the “/etc/network/interfaces” file.

For example:

auto eth0
iface eth0 inet static
address xx.xx.xx.xx
netmask xx.xx.xx.xx
gateway xx.xx.xx.xx
dns-nameservers xx.xx.xx.xx xx.xx.xx.xx xx.xx.xx.xx

You will notice that everything is the same, except the last line which used to be added to the /etc/resolv.conf directly before. With this new methodology the “resolvconf” utility will automatically read the “dns-nameservers” one by one (separated by a space) and will append them to the “etc/resolv.conf” file.

After that to apply your changes, you can just do “sudo /etc/init.d/networking restart” or simply reboot your machine if you wish.

Enjoy!

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