Skip to content

Archive for

mount ntfs file system to linux

When i tried to load my usb (NTFS),It showing “Could not open NTFS file system on Linux”.  So I just followed follow steps and then I can easily access NTFS file system on my Linux machine

Step 1: After inserted USB, Identify file system


[root@localhost ~]# fdisk -l | grep NTFS
/dev/sdh1               1        1940     1955488+   7  HPFS/NTFS

Step 2: Make one directory for mounting point

[root@localhost ~]# mkdir /mount/usb

Step 3: Download Fuse

http://easynews.dl.sourceforge.net/sourceforge/fuse/fuse-2.7.1.tar.gz

Step 4: Install Fuse


[root@localhost tmp]# tar xzf fuse-2.7.1.tar.gz
[root@localhost tmp]# ls
fuse-2.7.1         gconfd-oracle  gedit.oracle.2790729715  mapping-root  ssh-bTFQuC4798       VMwareDnD    VMwareTools-8.1.4-227600.tar.gz
fuse-2.7.1.tar.gz  gconfd-root    keyring-iqtBmT           orbit-root    virtual-root.drjpsz  vmware-root  vmware-tools-distrib
[root@localhost tmp]# cd fuse-2.7.1
[root@localhost fuse-2.7.1]# ls
aclocal.m4  compile       config.sub    COPYING      doc      Filesystems  INSTALL     lib          Makefile.in    NEWS        util
AUTHORS     config.guess  configure     COPYING.LIB  example  fuse.pc.in   install-sh  ltmain.sh    missing        README
ChangeLog   config.rpath  configure.in  depcomp      FAQ      include      kernel      Makefile.am  mkinstalldirs  README.NFS
[root@localhost fuse-2.7.1]# ./configure --exec-prefix=/;
checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-linux-gnu
checking target system type... i686-pc-linux-gnu
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking for style of include used by make... GNU
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking dependency style of gcc... gcc3
checking for a sed that does not truncate output... /bin/sed
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for fgrep... /bin/grep -F
checking for ld used by gcc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 32768
checking whether the shell understands some XSI constructs... yes
checking for /usr/bin/ld option to reload object files... -r
checking how to recognise dependent libraries... pass_all
checking for ar... ar
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/bin/nm -B output from gcc object... ok
checking how to run the C preprocessor... gcc -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC -DPIC
checking if gcc PIC flag -fPIC -DPIC works... yes
checking if gcc static flag -static works... yes
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (/usr/bin/ld) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking for gcc... (cached) gcc
checking whether we are using the GNU C compiler... (cached) yes
checking whether gcc accepts -g... (cached) yes
checking for gcc option to accept ISO C89... (cached) none needed
checking dependency style of gcc... (cached) gcc3
checking whether gcc and cc understand -c and -o together... yes
checking for fork... yes
checking for setxattr... yes
checking for fdatasync... yes
checking for struct stat.st_atim... yes
checking for struct stat.st_atimespec... no
checking for library containing dlopen... -ldl
checking for library containing clock_gettime... -lrt
checking for ld used by GCC... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for shared library run path origin... done
checking for iconv... yes
checking for iconv declaration...
         extern size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
configure: creating ./config.status
config.status: creating fuse.pc
config.status: creating Makefile
config.status: creating lib/Makefile
config.status: creating util/Makefile
config.status: creating example/Makefile
config.status: creating include/Makefile
config.status: creating include/config.h
config.status: executing depfiles commands
config.status: executing libtool commands
=== configuring in kernel (/tmp/fuse-2.7.1/kernel)
configure: running /bin/sh ./configure '--prefix=/usr/local'  '--exec-prefix=/' --cache-file=/dev/null --srcdir=.
checking for a BSD-compatible install... /usr/bin/install -c
checking if FUSE is loaded as a module... no
checking if FUSE module is built into the kernel... no
checking if FUSE module is from official kernel... yes
configure:
NOTE:     Detected that FUSE is already present in the kernel, so
NOTE:     building of kernel module is disabled.  To force building
NOTE:     of kernel module use the '--enable-kernel-module' option.
configure: creating ./config.status
config.status: creating Makefile
config.status: creating config.h
[root@localhost fuse-2.7.1]#

[root@localhost fuse-2.7.1]# make
Making all in kernel
make[1]: Entering directory `/tmp/fuse-2.7.1/kernel'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/tmp/fuse-2.7.1/kernel'
Making all in include
make[1]: Entering directory `/tmp/fuse-2.7.1/include'
make  all-am
make[2]: Entering directory `/tmp/fuse-2.7.1/include'
make[2]: Nothing to be done for `all-am'.
make[2]: Leaving directory `/tmp/fuse-2.7.1/include'
make[1]: Leaving directory `/tmp/fuse-2.7.1/include'
Making all in lib
make[1]: Entering directory `/tmp/fuse-2.7.1/lib'
if /bin/sh ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I../include  -I../include -DFUSERMOUNT_DIR=\"//bin\" -D_FILE_OFFSET_BITS=64 -D_REENTRANT -DFUSE_USE_VERSION=26   -Wall -W -Wno-sign-compare -Wstrict-prototypes -Wmissing-declarations -Wwrite-strings -g -O2 -fno-strict-aliasing -MT fuse.lo -MD -MP -MF ".deps/fuse.Tpo" -c -o fuse.lo fuse.c; \
[root@localhost fuse-2.7.1]# make install
Making install in kernel
make[1]: Entering directory `/tmp/fuse-2.7.1/kernel'
make[1]: Nothing to be done for `install'.
make[1]: Leaving directory `/tmp/fuse-2.7.1/kernel'
Making install in include
make[1]: Entering directory `/tmp/fuse-2.7.1/include'
make[2]: Entering directory `/tmp/fuse-2.7.1/include'
make[2]: Nothing to be done for `install-exec-am'.
test -z "/usr/local/include/fuse" || mkdir -p -- "/usr/local/include/fuse"
 /usr/bin/install -c -m 644 'fuse.h' '/usr/local/include/fuse/fuse.h'
 /usr/bin/install -c -m 644 'fuse_compat.h' '/usr/local/include/fuse/fuse_compat.h'
 /usr/bin/install -c -m 644 'fuse_common.h' '/usr/local/include/fuse/fuse_common.h'
 /usr/bin/install -c -m 644 'fuse_common_compat.h' '/usr/local/include/fuse/fuse_common_compat.h'
 /usr/bin/install -c -m 644 'fuse_lowlevel.h' '/usr/local/include/fuse/fuse_lowlevel.h'
 /usr/bin/install -c -m 644 'fuse_lowlevel_compat.h' '/usr/local/include/fuse/fuse_lowlevel_compat.h'
 /usr/bin/install -c -m 644 'fuse_opt.h' '/usr/local/include/fuse/fuse_opt.h'
test -z "/usr/local/include" || mkdir -p -- "/usr/local/include"

Step 5:  Download ntfs-3g

http://linux.softpedia.com/get/System/Hardware/ntfs-3g-15028.shtml

Step 6: Install ntfs-3g


[root@localhost tmp]# tar xzf ntfs-3g-2011.1.15.tgz
[root@localhost tmp]# ls
fuse-2.7.1         gconfd-oracle  gedit.oracle.2790729715  mapping-root       ntfs-3g-2011.1.15.tgz  ssh-bTFQuC4798       VMwareDnD    VMwareTools-8.1.4-227600.tar.gz
fuse-2.7.1.tar.gz  gconfd-root    keyring-iqtBmT           ntfs-3g-2011.1.15  orbit-root             virtual-root.drjpsz  vmware-root  vmware-tools-distrib
[root@localhost tmp]# cd ntfs-3g-2011.1.15
[root@localhost ntfs-3g-2011.1.15]# ls
aclocal.m4  autogen.sh  compile       config.h.in  configure     COPYING      CREDITS  include  install-sh    libntfs-3g  m4           Makefile.in  NEWS    src
AUTHORS     ChangeLog   config.guess  config.sub   configure.ac  COPYING.LIB  depcomp  INSTALL  libfuse-lite  ltmain.sh   Makefile.am  missing      README
[root@localhost ntfs-3g-2011.1.15]#  ./configure
checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-linux-gnu
checking target system type... i686-pc-linux-gnu
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether to enable maintainer-specific portions of Makefiles... no
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
[root@localhost ntfs-3g-2011.1.15]# make
make  all-recursive
make[1]: Entering directory `/tmp/ntfs-3g-2011.1.15'
Making all in include
make[2]: Entering directory `/tmp/ntfs-3g-2011.1.15/include'
Making all in ntfs-3g
make[3]: Entering directory `/tmp/ntfs-3g-2011.1.15/include/ntfs-3g'
make[3]: Nothing to be done for `all'.
make[3]: Leaving directory `/tmp/ntfs-3g-2011.1.15/include/ntfs-3g'
Making all in fuse-lite
make[3]: Entering directory `/tmp/ntfs-3g-2011.1.15/include/fuse-lite'
make[3]: Nothing to be done for `all'.
make[3]: Leaving directory `/tmp/ntfs-3g-2011.1.15/include/fuse-lite'
make[3]: Entering directory `/tmp/ntfs-3g-2011.1.15/include'
make[3]: Nothing to be done for `all-am'.
[root@localhost ntfs-3g-2011.1.15]# make install
Making install in include
make[1]: Entering directory `/tmp/ntfs-3g-2011.1.15/include'
Making install in ntfs-3g
make[2]: Entering directory `/tmp/ntfs-3g-2011.1.15/include/ntfs-3g'
make[3]: Entering directory `/tmp/ntfs-3g-2011.1.15/include/ntfs-3g'
make[3]: Nothing to be done for `install-exec-am'.
test -z "/usr/local/include/ntfs-3g" || /bin/mkdir -p "/usr/local/include/ntfs-3g"
 /usr/bin/install -c -m 644 'acls.h' '/usr/local/include/ntfs-3g/acls.h'
 /usr/bin/install -c -m 644 'attrib.h' '/usr/local/include/ntfs-3g/attrib.h'
 /usr/bin/install -c -m 644 'attrlist.h' '/usr/local/include/ntfs-3g/attrlist.h'
 /usr/bin/install -c -m 644 'bitmap.h' '/usr/local/include/ntfs-3g/bitmap.h'
 /usr/bin/install -c -m 644 'bootsect.h' '/usr/local/include/ntfs-3g/bootsect.h'
 /usr/bin/install -c -m 644 'cache.h' '/usr/local/include/ntfs-3g/cache.h'
 /usr/bin/install -c -m 644 'collate.h' '/usr/local/include/ntfs-3g/collate.h'
 /usr/bin/install -c -m 644 'compat.h' '/usr/local/include/ntfs-3g/compat.h'

Step 7:  Mount ntfs

[root@localhost ~]# mount -t ntfs-3g /dev/sdh1 /mount/usb
The disk contains an unclean file system (0, 0).
The file system wasn't safely closed on Windows. Fixing.
[root@localhost ~]# cd /mount/usb
[root@localhost usb]# ls
hinew.txt  rpm11g
[root@localhost usb]# rm hinew.txt
rm: remove regular empty file `hinew.txt'? y
[root@localhost usb]# ls
rpm11g
[root@localhost usb]#

Unmount
[root@localhost ~]# umount /mount/usb
[root@localhost ~]# cd /mount/usb
[root@localhost usb]# ls
[root@localhost usb]# ls -ltr
total 0
[root@localhost usb]#

Disaster Recovery:Restore database from one server to another server when different location

Here I just demonstrated How do we restore database from one server to another server when different location

Download PDF and Read It.

Right click this URL and Save as –> Location.

Disaster Recovery : Restore database from one Server to another Server when Different location

RMAN Configuring Tablespaces for Exclusion

In some cases you may want to exclude specified tablespace part of the regular backup schedule, as in these cases:

  •  A tablespace is easy to rebuild, so it is more cost-effective to rebuild it than back it up every day.
  • A tablespace contains temporary or test data that you do not need to back up.
  • A tablespace does not change often and therefore should be backed up on a different schedule from other backups.

Just a Example :

Step 1 : Create tablespace & User


SQL> create tablespace rman_ex datafile 'd:\backup\rman_ex01.dbf' size 50m;

Tablespace created.

SQL> create user rmanex identified by rmanex default tablespace rman_ex;

User created.

SQL> grant connect,resource to rmanex;

Grant succeeded.

SQL> conn rmanex/rmanex;
Connected.
SQL> create table a(empno number, city varchar2(20));

Table created.

SQL> insert into a values (001,'Riyadh');

1 row created.

SQL> insert into a values (002,'Mecca');

1 row created.

SQL> commit;

Commit complete.

Step 2: Configure tablespace Exclusion


SQL> $rman target /

Recovery Manager: Release 11.2.0.1.0 - Production on Tue Mar 8 09:30:17 2011

Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.

connected to target database: ACEME (DBID=4060208819)

RMAN> configure  exclude for tablespace rman_ex;

using target database control file instead of recovery catalog
Tablespace RMAN_EX will be excluded from future whole database backups
new RMAN configuration parameters are successfully stored.

Step 3: Backup Database , We can check here Whether that tablespace Include or Exclude.


RMAN> backup database;

Starting backup at 08-MAR-11
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=16 device type=DISK
file 5 is excluded from whole database backup
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00001 name=C:\APP\MAZAR\ORADATA\ACEME\SYSTEM01.DBF
input datafile file number=00003 name=C:\APP\MAZAR\ORADATA\ACEME\UNDOTBS01.DBF
input datafile file number=00002 name=C:\APP\MAZAR\ORADATA\ACEME\SYSAUX01.DBF
input datafile file number=00004 name=C:\APP\MAZAR\ORADATA\ACEME\USERS01.DBF
channel ORA_DISK_1: starting piece 1 at 08-MAR-11
channel ORA_DISK_1: finished piece 1 at 08-MAR-11
piece handle=C:\APP\MAZAR\FLASH_RECOVERY_AREA\ACEME\BACKUPSET\2011_03_08\O1_MF_NNNDF_TAG20
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:56
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
including current control file in backup set
including current SPFILE in backup set
channel ORA_DISK_1: starting piece 1 at 08-MAR-11
channel ORA_DISK_1: finished piece 1 at 08-MAR-11
piece handle=C:\APP\MAZAR\FLASH_RECOVERY_AREA\ACEME\BACKUPSET\2011_03_08\O1_MF_NCSNF_TAG20
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 08-MAR-11.

Not Included Here.

Step 4: How do we take tablespace backup while configured exlcude option.


RMAN> backup database noexclude;

Starting backup at 08-MAR-11
using channel ORA_DISK_1
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00001 name=C:\APP\MAZAR\ORADATA\ACEME\SYSTEM01.DBF
input datafile file number=00003 name=C:\APP\MAZAR\ORADATA\ACEME\UNDOTBS01.DBF
input datafile file number=00002 name=C:\APP\MAZAR\ORADATA\ACEME\SYSAUX01.DBF
input datafile file number=00005 name=D:\BACKUP\RMAN_EX01.DBF
input datafile file number=00004 name=C:\APP\MAZAR\ORADATA\ACEME\USERS01.DBF
channel ORA_DISK_1: starting piece 1 at 08-MAR-11
channel ORA_DISK_1: finished piece 1 at 08-MAR-11
piece handle=C:\APP\MAZAR\FLASH_RECOVERY_AREA\ACEME\BACKUPSET\2011_03_08\O1_MF_NNNDF_TAG20
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:55
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
including current control file in backup set
including current SPFILE in backup set
channel ORA_DISK_1: starting piece 1 at 08-MAR-11
channel ORA_DISK_1: finished piece 1 at 08-MAR-11
piece handle=C:\APP\MAZAR\FLASH_RECOVERY_AREA\ACEME\BACKUPSET\2011_03_08\O1_MF_NCSNF_TAG20
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 08-MAR-11

Step 5: Disable Configure Exclude method.


RMAN> configure exclude for tablespace rman_ex clear;

Tablespace RMAN_EX will be included in future whole database backups
old RMAN configuration parameters are successfully deleted

Ref : http://download.oracle.com/docs/cd/B28359_01/backup.111/b28270/rcmconfa.htm#i1015029

ORA-12203: TNS:unable to connect to destination

I just created one test db on my local PC (Windows 7) .This pc connected through Domain network.When I trying to connect this db one of the schema from application server. It shows
Enter user-name: prem_saico_auh/prem_saico_auh@azardb
ERROR:
ORA-12203: TNS:unable to connect to destination

This Error may be occur, your db server not reachable for client machine Either Ipaddress wrong or ping or Firewall Blocked.

Firewall : This is the case for me. So I looked my firewall settings of my local PC, The Firewall is OFF. But the Domain network firewall is ON.

So I need to Switch OFF firewall for my domain network. But I cann’t without Network Administrator Advise. So I just decided , Atleast I want to Enable allow inbound connections, I just fixed and then I can easily connect my db from Appication Server.

How do We do?

Go –> Control Panel –> Adminisrative Tools –> Windows Firewal with Advanced Security

It shows like

So I need to change or allow Inbound connections for Domain network.

Click –> Windows Firewall Properties.

Choose Domain Profile

Choose Inbound connections –> Allow and then Apply.Now I just try to connect my db from client, Its works fine.

Enter user-name: prem_saico_auh/prem_saico_auh@azardb

Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 – Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL>