Mount NTFS manually on Ubuntu Linux Server

First, list all the ntfs drives you have: “fdisk -l | grep NTFS”, example output:

/dev/sda1 * 2048 206847 102400 7 HPFS/NTFS/exFAT
/dev/sda2 206848 409599999 204696576 7 HPFS/NTFS/exFAT
/dev/sda3 409600000 976957421 283678711 7 HPFS/NTFS/exFA

Second, create a folder to mount the NTFS filesystem on, e.g.: “sudo mkdir /media/ntfs1”

Finally, mount the filesystem to that folder, e.g. : “sudo mount -t ntfs /dev/sda3 /media/ntfs1”

This can be applied to other distros as well, for example in RHEL or OEL you can just omit the “sudo” and use user “root” to run the commands instead.

Source: http://linuxconfig.org/How_to_mount_partition_with_ntfs_file_system_and_read_write_access

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

Two Simple Methods to Move/Rename Oracle DB Data Files

First Method (must be done as sysdba):

1. First, shut down the database: “shutdown immediate;”
2. Rename and/or move data files to new destination using OS commands (e.g. mv for linux)
3. Startup DB in mount mode: “startup mount;”
4. Change data files names from the DB: “alter database rename file ‘ old_absolute_path_to_old_file_including_filename’ TO ‘new_absolute_path_to_old_file_including_filename’ ;”
5. Open the DB: “alter database open;”

Second Method (must be done as sysdba as well):

1. Take the tablespace offline: “alter tablespace app_data offline;”
2. Rename and/or move data files to new destination using OS commands (e.g. mv for linux)
3. Use the alter tablespace command to rename the file in the database: “alter tablespace tablespace_name rename datafile ‘ old_absolute_path_to_old_file_including_filename’ TO ‘new_absolute_path_to_old_file_including_filename’ ;”
4. Bring the tablespace back online: “alter tablespace tablespace_name online;”

Advantage of the second over the first is that you don’t need to bring the whole DB down, only the tablespace, however I still prefer the first 🙂

Note: To get the names of the existing Data Files, use the following query: “select name from v$datafile;”

Source: Ahmed Ismail

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

SQL Statement to get version of your Oracle DB

> sqlplus / as sysdba

SQL> select * from v$version;

BANNER
——————————————————————————–
Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 – 64bit Production
PL/SQL Release 11.2.0.2.0 – Production
CORE 11.2.0.2.0 Production
TNS for Linux: Version 11.2.0.2.0 – Production
NLSRTL Version 11.2.0.2.0 – Production

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

Alternative way to find files with specific extension in a folder on Linux

If you don’t like the “find” command, you can use the following one instead (I prefer it myself):

ls -R | grep “\.xml”

where “-R” lists all recursively
grep is used to filter filename
“\.xml” you must put the “\” before any special character to return the proper result, you can of course use any other regular expression”

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

How to mount CD on Linux

mount -t iso9660 -o ro /dev/cdrom /mount_point

Posted in Uncategorized | Tagged , , | Leave a comment