Category Archives: Uncategorized

VMWare Tools: Searching for a valid kernel header path…

VMware tools throws:
Searching for a valid kernel header path…
The path “” is not a valid path to the 3.10.0-327.el7.x86_64 kernel headers.
Would you like to change it? [yes]

To prevent VMware tools not to find kernel headers, forget about the version delivered with Workstatio.8 or Fusion.8 which is something like VMwareTools-8.8.6-1035889.tar.gz
Instead download latest VMWare Tools from VMware i.e.: VMwareTools-10.0.5-3228253.tar.gz and

# rpm -qa | grep open-vm-tools
# rpm -e open-vm-tools-desktop-
# rpm -e open-vm-tools-
# yum installl gcc
# yum -y install kernel-devel-`uname -r`
# yum -y install kernel-headers-`uname -r`

VMware Tools can be downloaded from the Product Download page.

Stuff comes in a tar.gz containing an .iso image for VMWare tools.

 

  • VMware Tools support for guest operating systems in 10.1.7
    • windows.iso supports Windows Vista and later.
    • linux.iso supports Linux guest operating systems Red Hat Enterprise Linux (RHEL) 5 and later, SUSE Linux Enterprise Server (SLES) 11 and later, Ubuntu 10.04 and later. It also supports other distributions with glibc versions 2.5 and later.
    • darwin.iso supports Mac OS X versions 10.11 and later.
    • freebsd.iso supports FreeBSD versions.
    • solaris.iso supports Solaris versions.

 

# gunzip VMwareTools*.tar.gz
# tar xvf VMwareTools*.tar
# cd vmware-tools-distrib/
# perl vmware-install.pl 

 

Works for:
OEL 7.2 + Fusion 8
Centos 7 + Workstation 8

Cisco AnyConnect VPN Client for Linux

Cisco AnyConnect client supports Red Hat Enterprise Linux 6.x (32-bit) and 6.4 (64-bit), Ubuntu 9.x, 10.x, and 11.x (32-bit) and Ubuntu 12.04 & 12.10 (64-bit). It is a standalone tarball package for Linux platforms.

Installing CiscoAnyConnect VPN Client for Linux

Download Full installation package – Linux 64-bit (tar.gz) anyconnect-predeploy-linux-64-4.3.02039-k9.tar.gz.
With Cisco that ain’t easy because Cisco requires a Login & Valid Contract. Luckily I found the AnyConnect client on:
https://www.auckland.ac.nz/en/for/current-students/cs-current-pg/cs-current-pg-support/vpn/cs-cisco-vpn-client-for-linux.html At the time of this writing that is: anyconnect-predeploy-linux-64-3.1.04072-k9.tar

[root@alpha ~]# cd Downloads/
[root@alpha Downloads]# tar xvf anyconnect-predeploy-linux-64-3.1.04072-k9.tar

[root@alpha Downloads]# cd anyconnect-3.1.04072/
[root@alpha anyconnect-3.1.04072]# cd vpn
[root@alpha vpn]# ./vpn_install.sh

Start AnnyConnect client

[root@alpha vpn]# /opt/cisco/anyconnect/bin/vpnui

AnnyConnect says it requires pangox compatibility

/opt/cisco/anyconnect/bin/vpnui: error while loading shared libraries: libpangox-1.0.so.0: cannot open shared object file: No such file or directory

Install pangox-compat (requires EPEL)
[root@alpha Downloads]# wget http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-8.noarch.rpm
[root@alpha Downloads]# rpm -ivh epel-release-7-8.noarch.rpm
[root@alpha Downloads]# yum -y install pangox-compat
[root@alpha Downloads]# /opt/cisco/anyconnect/bin/vpnui

N4: Universal Query API

Set up API user

Modify node’s tomcat-users.xml. i.e add n4api user like below:

<?xml version='1.0' encoding='utf-8'?>
<tomcat-users>
    <role rolename="tomcat"/>
    <role rolename="role1"/>
   <role rolename="n4api"/>
    <user username="tomcat" password="tomcat" roles="tomcat"/>
    <user username="both" password="tomcat" roles="tomcat,role1"/>
    <user username="role1" password="tomcat" roles="role1"/>
   <user username="n4api" password="showmeinfo" roles="n4api"/>
</tomcat-users>


Continue reading

IMPDP

Prerequisites
Installed Oracle database
Created database

Create Linux user


su root
useradd brv11p2
usermod -g oinstall brv11p2
usermod -a -G dba brv11p2
passwd brv11p2
cd /home
chmod -R g+rwx oinstall

Prepare .bash_profile for Linux user


# .bash_profile

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
        . ~/.bashrc
fi

# User specific environment and startup programs

export ORACLE_INSTALL=/home/oracle
export ORACLE_SID=brv11p2
PATH=$PATH:$ORACLE_INSTALL/bin:$ORACLE_INSTALL/app/oracle/product/11.2.0/dbhome_1/bin/

export PATH

export ORACLE_BASE=$ORACLE_INSTALL/app/oracle
export ORACLE_HOME=$ORACLE_INSTALL/app/oracle/product/11.2.0/dbhome_1

Create table space


SQL> CREATE BIGFILE TABLESPACE "tablespace" DATAFILE '/path/to/dbfile.dbf' SIZE 120G AUTOEXTEND ON NEXT 4G MAXSIZE UNLIMITED LOGGING EXTENT MANAGEMENT LOCAL SEGMENT SPACE MANAGEMENT AUTO;

Create user

SQL> create user whoever identified by password;
SQL> grant create session to whoever;
SQL> grant all privileges to sparcsn4;

Create database directories

Execute the following commands to create a database directory. This directory must point to a valid directory on the same server as the database:

SQL> CREATE DIRECTORY dmpdir AS 'path/to/directory/with/dumpfile/';

SQL> GRANT read, write ON DIRECTORY dmpdir TO whoever;

impdp parameter files
First import step excludes tables that just take space


vi step1.par
EXCLUDE=TABLE:"IN ('EDI_TRANSACTION','ROAD_DOCUMENTS','FRM_JOB_LOG','EDI_TRANSACTION_KEYWORD','EDI_BATCH_PROCESS','EDI_INTERCHANGE','EDI_EVENT','EDI_SEGMENT','EDI_BATCH','EDI_ERROR')"

Second import step creates the skipped tables


vi step2.par
DIRECTORY=dmpdir
CONTENT=METADATA_ONLY
TABLES=EDI_TRANSACTION,ROAD_DOCUMENTS,FRM_JOB_LOG,EDI_TRANSACTION_KEYWORD,EDI_BATCH_PROCESS,EDI_INTERCHANGE,EDI_EVENT,EDI_SEGMENT,EDI_BATCH,EDI_ERROR

Import database

Single dumpfile


impdp DIRECTORY=dmpdir dumpfile=thedumpfile parfile=/path/to/parfile.par

Numbered dumpfile %U


impdp DIRECTORY=dmpdir dumpfile=thedumpfile_%U parfile=/path/to/parfile.par

PS: Oracle introduced a default directory from 10g R2, called DATA_PUMP_DIR, that can be used:

SQL> SELECT directory_path FROM dba_directories WHERE directory_name = 'DATA_PUMP_DIR';

DIRECTORY_PATH
--------------------------------------------------------------------------------
/app/oracle/product/10.2.0/rdbms/log/

Linux Samba Configuration

http://www.oracle-base.com/articles/linux/linux-samba-configuration.php

Installation

The Samba service is installed from a Yum repository using the following command.

# yum install samba

Turn on the Samba server and make sure it starts automatically on reboot.

# service smb start
# chkconfig smb on

Samba is configured by altering the contents of the “/etc/samba/smb.conf” and “/etc/samba/smbusers” files. Configuration changes have to be followed by a reload or a restart of the smb service.

 

Firewall

If you are using the Linux firewall, you need to open ports 139 and 445 specifically. The Samba documentation suggest opening 3 additional ports also. Assuming you are using a firewall setup file, as described here, you can include the following additions to the INPUT chain.

# Open ports for SAMBA.
iptables -A INPUT -p tcp --dport 135 -j ACCEPT
iptables -A INPUT -p tcp --dport 137 -j ACCEPT
iptables -A INPUT -p tcp --dport 138 -j ACCEPT
iptables -A INPUT -p tcp --dport 139 -j ACCEPT
iptables -A INPUT -p tcp --dport 445 -j ACCEPT

SELinux

Install SELinux tools

# yum provides /usr/sbin/semanage
# yum -y install policycoreutils-python

If you are using SELinux, you will need to consider the following points.

The SELinux booleans associated with the Samba service are displayed using the getsebool command.

# getsebool -a | grep samba
samba_create_home_dirs --> off
samba_domain_controller --> off
samba_enable_home_dirs --> off
samba_export_all_ro --> off
samba_export_all_rw --> off
samba_run_unconfined --> off
samba_share_fusefs --> off
samba_share_nfs --> off
sanlock_use_samba --> off
use_samba_home_dirs --> off
virt_use_samba --> off
#

The setsebool command is used to set a specific boolean value.

# setsebool use_samba_home_dirs on
# setsebool use_samba_home_dirs off

The samba_share_t context should be assigned to all content.

# semanage fcontext -a -t samba_share_t "/u01(/.*)?"
# restorecon -F -R -v /u01

You can check the current context setting on files and directories using the “ls -alZ” command.

More information on SELinux can be found here.

Create Network Shares for Group Collaboration

This section describes the steps necessary to create Samba shares suitable for group collaboration.

Create a group that will act as the owner of the shared files.

# groupadd developers

Create some users that are assigned to the “developers” group.

# useradd dev1 -G developers
# passwd dev1 # password set to dev1

# id dev1
uid=501(dev1) gid=504(dev1) groups=504(dev1),506(developers)
#

# useradd dev2 -G developers
# passwd dev2 # password set to dev2

# id dev2
uid=502(dev2) gid=505(dev2) groups=505(dev2),506(developers)
#

Set the Samba password for the users.

# smbpasswd -a dev1
New SMB password:
Retype new SMB password:
Added user dev1.
#

# smbpasswd -a dev2
New SMB password:
Retype new SMB password:
Added user dev2.
#

Create a directory to own the shared files, making sure its group is set correctly. The permissions are set to “g+rwx” (0770), since the group is the defining factor in accessing data in this directory.

# mkdir /developers_dir
# chgrp developers /developers_dir
# chmod g+s /developers_dir
# chmod -R 770 /developers_dir

Add the following share into the “/etc/samba/smb.conf” file. Notice the 0770 permissions again, so users don’t accidentally create files that can’t be amended by other members of the group.

 

Create Network Shares

Shares are created by editing the “/etc/samba/smb.conf” file. In RHEL5 and Fedora distributions you can use a GUI tool called system-config-samba, but this has been removed from RHEL6.

The “/etc/samba/smb.conf” file contains an example share definition towards the bottom of the file. The “;” characters are comments.

[benkel]
path = /media/benkel
force group = benkel
valid users = @benkel
create mask = 0775
force create mode = 660
write list = @benkel
browseable = yes
hosts allow 192.168.178.*

Mount from Mac OS X

cd /Users/userdir/
mkdir -p mountpoint
mount -t smbfs //smbuser:smbpass@smbhost/benkel /Users/userdir/mountpoint

Permanent Mount from Mac OS X

Create a Permanent SMB Mount in OSX (Updated)

DPWA database import

Create BIG table space

sqlplus / as sysdba


sql> CREATE BIGFILE TABLESPACE "DPW04N4_DATA" DATAFILE '/home/beagw/dpwa/sparcsn4.dbf' SIZE 120G AUTOEXTEND ON NEXT 4G MAXSIZE UNLIMITED LOGGING EXTENT MANAGEMENT LOCAL SEGMENT SPACE MANAGEMENT AUTO

Set up users, roles etc

sqlplus / as sysdba

create profile DPWORLD_NOEXPIRE limit password_life_time UNLIMITED;
create role webfocus;
create role report_prod;
create user billsys identified by Humvee;
create user sparcsn4 identified by Humvee;
alter user sparcsn4 profile DPWORLD_NOEXPIRE;
alter user sparcsn4 default tablespace DPW04N4_DATA;

Create impdp parameter file to exclude some huge files

# vi n4-imp.par

exclude=TABLE:"IN ('EDI_TRANSACTION','ROAD_DOCUMENTS','FRM_JOB_LOG','EDI_TRANSACTION_KEYWORD','EDI_BATCH_PROCESS','EDI_INTERCHANGE','EDI_EVENT','EDI_SEGMENT','EDI_BATCH','EDI_ERROR')"

Import database

# impdp dumpfile=sparcsn4_30042013.dmp parfile=n4-imp.par

[oracle@marauder ~]$ impdp system/Humvee dumpfile=sparcsn4_30042013.dmp parfile=n4-imp.par

Import: Release 11.2.0.1.0 - Production on Tue Oct 8 12:40:44 2013

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

Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
Master table "SYSTEM"."SYS_IMPORT_FULL_01" successfully loaded/unloaded
Starting "SYSTEM"."SYS_IMPORT_FULL_01":  system/******** dumpfile=sparcsn4_30042013.dmp parfile=n4-imp.par 
Processing object type SCHEMA_EXPORT/USER
ORA-31684: Object type USER:"SPARCSN4" already exists
Processing object type SCHEMA_EXPORT/SYSTEM_GRANT
Processing object type SCHEMA_EXPORT/DEFAULT_ROLE
Processing object type SCHEMA_EXPORT/TABLESPACE_QUOTA
Processing object type SCHEMA_EXPORT/PRE_SCHEMA/PROCACT_SCHEMA
Processing object type SCHEMA_EXPORT/SEQUENCE/SEQUENCE
Processing object type SCHEMA_EXPORT/TABLE/TABLE
Processing object type SCHEMA_EXPORT/TABLE/TABLE_DATA
. . imported "SPARCSN4"."SRV_EVENT"                      11.21 GB 102943957 rows
. . imported "SPARCSN4"."ARGO_CHARGEABLE_UNIT_EVENTS"    6.960 GB 13282798 rows
. . imported "SPARCSN4"."SRV_EVENT_FIELD_CHANGES"        4.835 GB 123798109 rows
. . imported "SPARCSN4"."ARGO_PROPERTY_SOURCE"           3.030 GB 52470519 rows
..
..
. . imported "SPARCSN4"."CRG_PRODUCT_TYPE"                   0 KB       0 rows
. . imported "SPARCSN4"."XPS_WHEELEDMT_FILT_WEIGHTS"         0 KB       0 rows
. . imported "SPARCSN4"."XPS_WHERENETALARM"                  0 KB       0 rows
Processing object type SCHEMA_EXPORT/TABLE/GRANT/OWNER_GRANT/OBJECT_GRANT
Processing object type SCHEMA_EXPORT/TABLE/INDEX/INDEX
Processing object type SCHEMA_EXPORT/TABLE/CONSTRAINT/CONSTRAINT
Processing object type SCHEMA_EXPORT/TABLE/INDEX/STATISTICS/INDEX_STATISTICS
Processing object type SCHEMA_EXPORT/TABLE/CONSTRAINT/REF_CONSTRAINT
ORA-39083: Object type REF_CONSTRAINT failed to create with error:
ORA-00942: table or view does not exist
Failing sql is:
ALTER TABLE "SPARCSN4"."ROAD_DOCUMENT_MESSAGES" ADD CONSTRAINT "FKE1FA50918010750D" FOREIGN KEY ("DOC_GKEY") REFERENCES "SPARCSN4"."ROAD_DOCUMENTS" ("GKEY") ENABLE
Processing object type SCHEMA_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS
ORA-39083: Object type TABLE_STATISTICS failed to create with error:
ORA-06550: line 1, column 3747:
PLS-00103: Encountered the symbol "~" when expecting one of the following:
..
..
ORA-39083: Object type TABLE_STATISTICS failed to create with error:

Ignore the table statistics creation errors.

Create new database to contain the complete schema.

De tabellen die niet zijn geimporteerd in de eerste database kunnen in iedfer geval via de SQl create scripts vanuit deze tweede database worden gecreeerd.
Maak de tabelspace kleiner want er komt geen data in deze database terecht.



$ dbca 

$ export ORACLE_SID=dpwaschema

$ sqlplus / as sysdba

CREATE BIGFILE TABLESPACE "DPW04N4_DATA" DATAFILE '/home/beagw/dpwaschema/sparcsn4.dbf' SIZE 4G AUTOEXTEND ON NEXT 1G MAXSIZE UNLIMITED LOGGING EXTENT MANAGEMENT LOCAL SEGMENT SPACE MANAGEMENT AUTO
create profile DPWORLD_NOEXPIRE limit password_life_time UNLIMITED;
create user sparcsn4 identified by Nephew default tablespace DPW04N4_DATA profile DPWORLD_NOEXPIRE;
create role webfocus;
create role report_prod;
create user billsys identified by Humvee;


$ find . -name "sparcsn4_30042013.dmp" -print
./app/oracle/admin/dpwa/dpdump/sparcsn4_30042013.dmp
[oracle@marauder ~]$ mv ./app/oracle/admin/dpwa/dpdump/sparcsn4_30042013.dmp ./app/oracle/admin/dpwaschema/dpdump/sparcsn4_30042013.dmp

$ impdp dumpfile=sparcsn4_30042013.dmp CONTENT=METADATA_ONLY

Create missing tables
Maak de gemiste tabellen aan in de eerste database.

EDI_INTERCHANGE
EDI_BATCH
EDI_BATCH_PROCESS
EDI_INTERCHANGE
EDI_TRANSACTION
EDI_TRANSACTION_KEYWORD
EDI_ERROR
EDI_EVENT
EDI_SEGMENT

FRM_JOB_LOG

ROAD_DOCUMENTS


sql> truncate table sparcsn4.road_document_messages;

sql> ALTER TABLE "SPARCSN4"."ROAD_DOCUMENT_MESSAGES" ADD CONSTRAINT "FKE1FA50918010750D" FOREIGN KEY ("DOC_GKEY") REFERENCES "SPARCSN4"."ROAD_DOCUMENTS" ("GKEY") ENABLE