Set oracle output to unlimited
ORU-10027: buffer overflow, limit of 2000 bytes
BEGIN -- initialization section
dbms_output.enable(null);
end;
Set oracle output to unlimited
ORU-10027: buffer overflow, limit of 2000 bytes
BEGIN -- initialization section
dbms_output.enable(null);
end;
open firewall ports to cpan
cpan
install Mail::Sender
/usr/bin/perl
perl version
locate Sender.pm
/usr/local/share/perl5/Mail/Sender.pm
[cron.d]# cat rhn-virtualization.cron
0-59/2 * * * * root python /usr/share/rhn/virtualization/poller.py
Message 1:
From root@ Fri Jun 22 11:40:01 2012
Date: Fri, 22 Jun 2012 11:40:01 -0400
From: root (Cron Daemon)
To: root
Subject: Cron <root> python /usr/share/rhn/virtualization/poller.py
Content-Type: text/plain; charset=UTF-8
Auto-Submitted: auto-generated
X-Cron-Env: <SHELL=/bin/sh>
X-Cron-Env: <HOME=/root>
X-Cron-Env: <PATH=/usr/bin:/bin>
X-Cron-Env: <LOGNAME=root>
X-Cron-Env: <USER=root>
libvir: error : no connection driver available
rpm -qa | grep libvirt
rpm -e rhn-virtualization-host
C:\>pscp –i <privatekey> <dbsoftware> <server>:<filename>
yum install libaio
unzip <filename>
dd if=/dev/zero of=/swapfile1 bs=1024 count=524288
dd if=/dev/zero of=/swapfile2 bs=1024 count=1048576
mkswap /swapfile1
mkswap /swapfile2
swapon /swapfile1
swapon /swapfile2
vi /etc/fstab
/swapfile1 swap1 swap defaults 0 0
/swapfile2 swap2 swap defaults 0 0
yum install binutils-2.*
yum install compat-libstdc++-33*
yum install elfutils-libelf-0.*
yum install elfutils-libelf-devel-*
yum install gcc-4.*
yum install gcc-c++-4.*
yum install glibc-2.*
yum install glibc-common-2.*
yum install glibc-devel-2.*
yum install glibc-headers-2.*
yum install ksh-2*
yum install libaio-0.*
yum install libaio-devel-0.*
yum install libgcc-4.*
yum install libstdc++-4.*
yum install libstdc++-devel-4.*
yum install make-3.*
yum install sysstat-7.*
yum install unixODBC-2.*
yum install unixODBC-devel-2.*
su - root
groupadd oinstall
groupadd dba
useradd -g oinstall -G dba,oinstall oracle
passwd oracle
chown oracle:oinstall /u01
vi /etc/sysconfig/network
HOSTNAME=<yourHostName>
vi /etc/hosts
Add <yourHostName> to the line containing 127.0.0.1
service network restart
rm -rf /var/lib/rpm/__db.0*
rpm --rebuilddb
Download after copying from http fox in mozilla – first register and login to oracle click the link capture the authorized link and use wget on local machine
wget -c --user=<email> --password=<passwd> http://download.oracle.com/otn/linux/oracle11g/xe/oracle-xe-11.2.0-1.0.x86_64.rpm.zip?AuthParam=<authcode>
http://docs.oracle.com/cd/B28359_01/appdev.111/b28419/d_networkacl_adm.htm
<myupperaccountname> = user name in upper case
<mydomain> = domain you want to access in lower case
<mypartdomain> = *.your domain name you want to access
<myport> = port number
port ranges
<mylowport> = port number
<myhighport> = port number
Using dbconsole or grid to manage acl’s
-- Check users writes to a specific location
SELECT host, lower_port, upper_port, acl,
DECODE(
DBMS_NETWORK_ACL_ADMIN.CHECK_PRIVILEGE_ACLID(aclid, '<myupperaccountname>', 'connect'),
1, 'GRANTED', 0, 'DENIED', null) privilege
FROM dba_network_acls
WHERE host IN
(SELECT * FROM
TABLE(DBMS_NETWORK_ACL_UTILITY.DOMAINS('<mydomain>')));
-- create the acl
BEGIN
DBMS_NETWORK_ACL_ADMIN.create_acl (
acl => 'base_acl.xml',
description => 'Configure the base ACL functionality for all access',
principal => '<myupperaccountname>',
is_grant => TRUE,
privilege => 'connect',
start_date => SYSTIMESTAMP,
end_date => NULL);
COMMIT;
END;
/
--assign a network to the acl
BEGIN
DBMS_NETWORK_ACL_ADMIN.assign_acl (
acl => 'base_acl.xml',
host => '<mypartdomain>',
lower_port => <myport>,
upper_port => null);
COMMIT;
END;
/
-- Unassign an acl
BEGIN
DBMS_NETWORK_ACL_ADMIN.unassign_acl (
acl => 'base_acl.xml',
host => '<mypartdomain>',
lower_port => <myport>,
upper_port => NULL);
COMMIT;
END;
/
-- Assign a range
BEGIN
DBMS_NETWORK_ACL_ADMIN.assign_acl (
acl => 'base_acl.xml',
host => '<mypartdomain>',
lower_port => <mylowport>,
upper_port => <myhighport>);
COMMIT;
END;
/
-- check assignment as app user
/*
SELECT host, lower_port, upper_port, acl
FROM dba_network_acls;
SELECT *
FROM user_network_acl_privileges;
SELECT *
FROM TABLE(DBMS_NETWORK_ACL_UTILITY.domains('<mydomain>'));
*/
Example 2:
BEGIN
DBMS_NETWORK_ACL_ADMIN.create_acl (
acl => 'www_acl.xml',
description => 'Configure the web access acl',
principal => 'SYSDOCS',
is_grant => TRUE,
privilege => 'connect',
start_date => SYSTIMESTAMP,
end_date => NULL);
COMMIT;
END;
/
BEGIN
DBMS_NETWORK_ACL_ADMIN.assign_acl (
acl => 'www_acl.xml',
host => '*.snapdedo.com',
lower_port => 80,
upper_port => 80);
COMMIT;
END;
/
BEGIN
DBMS_NETWORK_ACL_ADMIN.assign_acl (
acl => 'www_acl.xml',
host => '*.google.com',
lower_port => 80,
upper_port => 80);
COMMIT;
END;
/
Steps to start db2 console.
create a vncsession and go into the graphical console.
[~]$ xhost +
access control disabled, clients can connect from any host
[~]$ sudo su - root
[~]# cat /etc/passwd | grep db2
db2inst1:x:503:105::/home/db2inst1:/bin/bash
db2inst2:x:504:106::/home/db2inst2:/bin/bash
[~]# su - db2inst2
[~]$ db2cc
After doing some cleaning on one of my drives to build some additional servers I noticed the free space had not been made available to my VMware Server.
Refresh the free space by choosing “Commands” and then “Refresh Datastore”.
If you’re an oracle admin you probably know little about db2 control panel.
sign into the server with your user
start vncsession
xhost +
sudo su – root
su – <myinstanceuser> –l
db2cc
This will start the db2 command console and allow you to view the table structure.
When using windows live writer I noticed it will convert certain characters to emoticons without me wanting it to. A simple trick to get around this is to go to the source view and remove emoticon and convert to encoded html tags. Like :< can be changed in the code to be :<
qwinsta /server:<myserver>
logoff <mysession> /server:<myserver>
IBM Bladecenter’s have remote management consoles to manager your servers.
Go to a browser enter your bladecenter ip address http://<mybladeip>
If your certificate is not installed choose “continue to website”
Enter your password
Choose start new session
Under Blade tasks choose remote control
Choose Start Remote Control
Choose yes to all java questions and run.
Select your blade in the kvm and media tray owner and the remote control console.
Download the Oracle Linux Dvd to a web server.
mount -o loop -t iso9660 <mywebdirectory>/isos/OEL6-U2-x86_64-V29459-01.iso <mywebdirectory>/isos/oel6u2
http://<mywebip>/isos/oel6u2
http://10.7.2.3/isos/oel6u2
mkdir /www/isos/oel6u2 -p
chown <mywebuser>.<mywebgroup> /www/isos -R
chown <mywebuser>.<mywebgroup> /www/isos/OEL6-U2-x86_64-V29459-01.iso
mount -o loop -t iso9660 <mywebdirectory>/isos/OEL6-U2-x86_64-V29459-01.iso <mywebdirectory>/isos/oel6u2
Examples:
mount -o loop -t iso9660 /www/isos/OEL6-U2-x86_64-V29459-01.iso /www/isos/oel6u2
mount -o loop -t iso9660 /var/www/html/isos/OEL6-U2-x86_64-V29459-01.iso /var/www/html/isos/oel6u2
You could also mount it to a non standard directory and add an alias so as to avoid large back ups of your web directories.
If you have an issue connecting check you ip configurations and your firewall. I install multiple instances 1 in local network and 1 in dmz to avoid requiring access through firewall to unsecure areas.
After a patch set which had a system crash our system starting having these problems.
Reports failed and the wls diagnostic log showed errors like such
java.io.IOException: No locks available
Our ofm11g test instance uses nfs to reduce cost, this is not a supported configuration for Oracle and on occasion will cause us issue. The nfs mount is used to share the reports and cache directory instead of ocfs.
When researching I found the issue was related to a crashed nfs service, some work around talked about using nolock option but that does not seem necessary although it should pose no risk as long as just your reports and cache are in these directories and not your instance files.
[/var/log]# /etc/init.d/nfslock status
rpc.statd dead but pid file exists
[/var/log]# rpcinfo –p
[/var/log]# /etc/init.d/nfslock restart
Stopping NFS locking: [ OK ]
Stopping NFS statd: [ OK ]
Starting NFS statd: [ OK ]
[/var/log]# /etc/init.d/nfslock status
rpc.statd (pid 13972) is running...
I also found the following services in a failed status and restarted them
[/var/log]# service sendmail status
sendmail dead but pid file exists
[/var/log]# service sendmail start
Starting sendmail: [ OK ]
[/var/log]# vi message.txt
[/var/log]# mail -s "test" <myemail> < message.txt
[/var/log]# service crond status
crond dead but pid file exists
[/var/log]# service crond start
Starting crond: [ OK ]
After restarting the services the oracle instance needed to be bounced to clear up all issues.
If you can bounce the whole node to make sure all services are cleared up you should be in better shape.
I recently ran into a problem with a asp.net system that was missing pieces of mail. The developers who owned the system had been downsized due to economy and the business users only knew what the end outcome should be. Developers owning systems being downsized and leaving no technical resources is not an uncommon problem where I work. I am not proficient in asp but it falls in my job role to resolve problems of all forms. After having the business owner walk me through what the asp app end goal was I was able to determine which application it was using. The issue was email was not being sent for certain domains. The logic was straight forward an asp program had an include file was which pointed to a function to send email using a Aspmail 4.x by “ServerObjects.com”. This mail logic looked straight forward and I assumed debugging would be a snap. The only way to run this application seemed to be in a production mode. Since I did not have access to the mail logs of the mail server this service sent to I switched the smtp server to a server I did have access to. This is an easy change in “RemoteHost” configuration of the Aspmail object and had little risk. I took a back up modify the file and proceed to test. To my surprise the mail to the domain that did work still came from the old smtp and the mail that did not work still did not work. This baffled me for awhile since switching the smtp server should have been instant. I looked everywhere to figure out why it had not been routed through my mail server as expected. Finally to my surprise I found an if statement above the send, “if (false)”. What’s this “if (false)”? A little research but me to the understanding that this “if (false)” meant a developer had commented out the whole section of code. Now I was really stuck since now I did not know how the email that was getting sent was sent. I searched all the code and found an insert into a database with the email content and destination. Now I just needed to find a job sending this content. I looked through all the source code and was also surprised to find that the windows search feature “in files” had not even found my reference to the email table. Here I found there is an issue with the windows search feature that does not search all file types. I found a bug note but could not apply the fix do to the instance being production. I copied the source code to another machine and ran ultra edit search on it. There I found a single reference to the code the insert. I finally got the admin of the mail server the mail was coming from to send me his mail logs. I found the log line which should the mail coming from a different box. I found this box had a java program running every ten minutes sending the email, I reconfigured this java app to point to my smtp server. Reran the test to both the email account failing and the one succeeding and monitored the logs, there I found what I expected and access denied from the mail server receiving this mail.
I like using both hosting solutions and Amazon cloud solutions, especially since now Amazon has a micro server for 12 months free. In my case I need higher performance local and little external bandwidth or traffic for testing database and Oracle application servers. When building test servers you do not want to rely on network bandwidth and performance for a large database or many copies. I’ll stick to a custom built pc design to run large databases which can be built and rebuilt with little to no additional cost to me. If you invest about a $1000.00 in todays market you can build a server with a hex core processor, 24gb of ram and 240gb ssd disk and 1tb 7200rpm disk. This type of computing power gives the home user the capability to run and build full installs in minutes rather then hours.
If you don’t have the need to learn technology this is probably not the solution for you, but those of us competing in todays technology market should invest in hardware to meet the demands of our learning appetite.
Running a test server at home has many challenges. First off your network is most likely not designed to run wide area applications exposed such as web pages. Second the home hardware is not the same quality as professional hardware. Third hardware is becomes quickly expensive to justify for testing at home. Forth your home wide area network provider may not allow exposed services. Finally your home machine should be set to install updates as available which may automatically bounce your system when your not around.
Although all of these issues have many ways to address, I’ll go over some simple tricks to help reduce some of these issues. This does not mean I can solve your issues with your network provider but most other areas you can reduce issues with.
Tools:
Windows Vista/7
Microsoft Security Essentials
Team Viewer
VMware Server
Oracle Linux/Centos
Quad/Hex Core processor
Memory (8GB-24GB)
Goals:
Install a test database and web server which can be accessed from the outside world to test and demo application features.
Other options:
Hosting solutions are available from many sites these are fairly inexpensive but often have different limitations and performance issues when dealing with large test databases. Amazon Cloud Solutions (AWS) currently has a free micro cloud offering for 12 months but then you will need to address this cost on going and move your tool.
The webtier has two main components the http server and the cache server. This doc explains the steps to change ports on the http server with no cache server installed. You will install a http server only if you have no need for a cache server, like a token service, or credit card clearing application. These types of applications can not cache any data and do not need the extra component installed to cause greater security risk.
set your instance home
cd $INSTANCE_HOME/ohs/bin
chown root .apachectl
chmod 6750 .apachectl
Change your port in your httpd.conf file or your gui Middleware control and restart the httpd component
When running a script using nohup piping your output to a log you may receive this message “nohup: ignoring input and appending output to `nohup.out'”. This is just a notice to tell you that standard error message will also be sent to standard out which is being redirect to a log file. This is nothing to worry about but if you would prefer not to have the message printed you can tell nohup that you want both stderr and stdout to go to the same file very easily. This is ideal for scripts run in cron or schedule to avoid unnecessary log messages.
Example of message when running a script
nohup $DOMAIN_HOME/startWebLogic.sh > ~/logs/start_$1_domain.`date +%y%m%d%H%M%S`.log &
nohup: ignoring input and appending output to `nohup.out'
Do the following to avoid this message.
nohup $DOMAIN_HOME/startWebLogic.sh > ~/logs/start_$1_domain.`date +%y%m%d%H%M%S`.log 2>&1 &
Using nfs with Oracle Report Server instead of ocfs.
If you run into the java.io.IOException: No locks available while running a report server using nfs to test rather then ocfs. Check this.
If this happens to you check also /var/log/messages /var/log/dmesg no errors for me.
[/var/log]# /etc/init.d/nfslock status
rpc.statd dead but pid file exists
[/var/log]# rpcinfo -p
program vers proto port
100000 2 tcp 111 portmapper
100000 2 udp 111 portmapper
100011 1 udp 880 rquotad
100011 2 udp 880 rquotad
[/var/log]# /etc/init.d/nfslock restart
Stopping NFS locking: [ OK ]
Stopping NFS statd: [ OK ]
Starting NFS statd: [ OK ]
[/var/log]# /etc/init.d/nfslock status
rpc.statd (pid 13972) is running...
[/var/log]#
[~]# service portmap restart
Stopping portmap: [ OK ]
Starting portmap: [ OK ]
[~]# service nfs restart
Shutting down NFS mountd: [FAILED]
Shutting down NFS daemon: [FAILED]
Shutting down NFS quotas: [FAILED]
Starting NFS services: [ OK ]
Starting NFS quotas: [ OK ]
Starting NFS daemon: [ OK ]
Starting NFS mountd: [ OK ]
[~]# cd /<mymount>/