Guidance on solaris/c++
Hi all,
i know its not the group for me to post but still .. i thought i could get more information from this group rather. ..
I would like you to recommend some sites or books for the Solaris o/s on sun sparc and what is the best compiler for C++ for socket programming that anyone can recommend . Can i Use Richrard Stevens Unix network programming ???
advice pls..
Hi
This is taken from Solaris forum for Sun Studio C++
The default libCstd implementation of the C++ Standard Library is incomplete. As explained in the compiler docs, we continue to provide a version of this library that is source and binary compatible from compiler release to release. Fixing its deficiencies would break compatibility.
If you don't need compatibility with libCstd, STLport is a standard-conforming implementation of the C++ Standard Library , along with some popular extensions like hash_map and rope.
To compensate for some missing functionality, libCstd has some non-standard interfaces. If your code depends on these non-standard interfaces, it won't compile using STLport. If your code conforms to the interface defined by the C++ Standard, it will compile with STLport.
Most programmers find that they can just switch to STLport without problems.
As I noted above, an entire program, including shared libraries, must all use the same standard library implementation. You can't mix them. Binaries compiled without the -library=stlport4 option must be recompiled using that option.
Do you disagree with Sun support personal?
"You have run into a documented limitation of the default libCstd implementation of the C++ standard library. The default library is not a complete implementation, and In particular, the template "sort" member of list that takes a parameter is not available."
/Lars
Similar Messages
-
Need guidance on using ddi_regs_map_setup solaris system call
Hi all,
Am a beginner in using Sun Solaris.
I am working on porting our source code from linux to solaris.
In Linux we are using inb/outb to read/write to keyboard data port(0x60) .
I know that there is an equivalent system call for inb/outb in solaris. But in man page(of sun os) it is mentioned that inb/ outb are obsolete. It was mentioned that we can use ddi_get8/ddi_put8 functions respectively.
ddi_get8 call requires ddi_acc_handle_t as a parameter which we can get it from ddi_regs_map_setup system call.
Syntax for this call is:
int ddi_regs_map_setup(dev_info_t *dip, uint_t rnumber,
caddr_t *addrp, offset_t offset, offset_t len,
ddi_device_acc_attr_t accattrp, ddi_acc_handle_t handlep);
Please let me know where does the 0x60 port number fits in the above system call and what does these parameters rnumber, offset, len corresponds to ?Hi,
The Fault_PC 0x13575e8 tells you exactly where you
die. I assume you have used this in mdb on
the core file to find you are dying in the ddi_get8 call?
Are you checking return value of ddi_regs_map_setup?
Are you sure the register you are accessing is in register set 1?
Are there other places prior to the panic where
the ddi_get/ddi_put routines work correctly? A bus error
here generally means the location you are trying to access
does not exist on the device. (It could also be alignment,
but not with ddi_get8). The address
looks like 1fe.02001400, which looks like a possibly
valid address in I/O space.
I would print the value of wc->ioaddr to make sure
it is a valid virtual address.
Hi,
I'm in the middle of porting a device driver for a
PCI card from linux to solaris (it's wcfxo from
zaptel - part of asterisk).
>
WARNING: [AFT1] Bus Error on System Bus in privileged
mode from CPU0 Data access at TL=0, errID
0x0000000b.985ccf88
AFSR 0x00000000.84000000<PRIV,BERR> AFAR
AFAR 0x000001fe.02001400
AFSR.PSYND 0x0000(Score 05) AFSR.ETS 0x00
0x00 Fault_PC 0x13575e8
UDBH 0x0000 UDBH.ESYND 0x00 UDBL 0x0000
0000 UDBL.ESYND 0x00
panic[cpu0]/thread=2a10007dd40: [AFT1] errID
0x0000000b.985ccf88 BERR Error(s)
See previous message(s) for detailsThe actual code which seems to cause the panic is:
#define inb(a) ddi_get8(wc->devhandle, a)
ints = inb(wc->ioaddr + WC_INTSTAT);where there initialisation includes:
static struct ddi_device_acc_attr dev_attr = {
DDI_DEVICE_ATTR_V0,
DDI_STRUCTURE_LE_ACC,
DDI_STRICTORDER_ACC
ddi_regs_map_setup(wc->dip, 1, &wc->ioaddr, 0, 255,
&dev_attr,
&dev_attr, &wc->devhandle);I've tested the same card in a linux x86 box, and it
works fine, so I'm happy it's not a hardware
problem.
Any suggestions on what might be causing this?
Thanks,
Simon -
Install a new printer on Solaris 9
Hi All,
I am new to Solaris OS.I have np prior experience of working in Solaris.My requirement at the client site, is to configure a new HP printer with a server running on Solaris 9 OS.I do not have access to the desktop environment(No GUI), as a result I need to achieve the entire task through command prompt.Can anyone provide the steps or guide me in achieving my requirement?.Do I need to install the printer driver??Is yes, then how to install the printer driver??How do we print a test page?( i know there is a command lpadmin, but don't have any idea on its usage..).
PS: All the steps to be done through command line.
Waiting for any response/guidance
Regards,
RupHave a look here:
http://docs.huihoo.com/opensolaris/system-administration-guide-advanced-administration/html/ch07s03.html
All you will ever need! -
How to Reorganize CSM200 Shared Storage in Solaris 10 x86 Oracle 10gR2
I could use some guidance from those who are more experienced in RAC administration in a Solaris environment with ASM. I have a three-node RAC with Oracle 10gR2 instances on top of Solaris 10 x86 where the shared storage is a Sun CSM200 disk array which looks like a single disk to the rest of the world. I'm not very familiar with the CSM200 Common Array Manager but I do have access to use it.
During initial setup, I followed the Oracle cookbook and defined a storage slice for each of the following: OCR, OCR mirror, three voting disks, and +DATA, for a total of six slices. I brought up the RAC and we've used it for a couple of weeks.
This is a Dev and QA environment, so it changes pretty fast. The new requirement is to add a +FRA and to add a mount point for a file system on the shared storage, so that all three Oracle instances can refer to the same external table(s).
However, I've already used all the available slices in the VTOC on the shared logical drive. I'm not sure how to proceed.
1) Is it necessary to use the CAM to create two logical disks out of the single existing logical disk?
2) If so, how destructive is that? I don't need to keep the contents of the database, but I do not want to reinstall CRS or ASM or the DB instances.
3) Is it possible to combine the OCR and its mirror on the same slice, thus freeing a slice for reuse?
4) Is it possible to combine all three voting disks on the same slice, thus freeing two slices for reuse?
Edited by: user12006221 on Mar 29, 2011 3:30 PM
Another question: Under 10.2.0.4, is it possible for the OCR and voting disks to be managed by ASM? I know it would be possible under 11g, but that's not an option as I am trying to match a customer's environment and they aren't going to 11g any time real soon.What you see is what happens when the Java runtime running on Solaris 10 x86 tries to load a library which is compiled for SPARC.
Because of the native parts in SAP GUI for Java, compilations and installers are required for each OS - HW combination.
The supported platforms can be seen in SAP note 954572. For Solaris only SPARC is currently supported.
Because of the effort needed for compiling, testing, support etc. it is required to focus on OS - HW combinations widely used on desktop machines and Solaris 10 on x86 currently does not seem to be one of those. -
Solaris 10 x86 & 2 x NIC. Can some1 pls have a look if i do all correctly?
i have a server with two NICs and Solaris 10 x86 installed.
i want to use NIC1 with ADSL router (10.0.0.x) and NIC2 with switch (192.168.16.x). i also want to setup a DHCP server for LAN machines (NIC2) and DNS server.
can someone pls confirm/correct my thoughts/steps in configuring two interfaces?
1. during install i had to chose a default route for both interfaces. for NIC1 it was easy - i just entered the ADSL router IP which was 10.0.0.1.
however, i have a difficulty with NIC2. what default route if at all should i use here?
2. my understanding is that after configuring two interfaces they should act as a bridge so that i could setup a DNS server using my LAN machine addresses (192.168.16.x) and traffic coming from outside the office will be converted properly to reach LAN machines (mail, web servers, etc). is that correct or will i need to setup and configure 2 DNS servers for each NIC respectively?
3. DHCP server. any guidance here in terms of two NICs machine?
many thanks
Alexi have a server with two NICs and Solaris 10 x86
installed.
i want to use NIC1 with ADSL router (10.0.0.x) and
NIC2 with switch (192.168.16.x). i also want to setup
a DHCP server for LAN machines (NIC2) and DNS
server.
can someone pls confirm/correct my thoughts/steps in
configuring two interfaces?
1. during install i had to chose a default route for
both interfaces. for NIC1 it was easy - i just
entered the ADSL router IP which was 10.0.0.1.
however, i have a difficulty with NIC2. what default
route if at all should i use here?You don't choose a default route for an interface, you choose a default route for a system. It isn't very useful to have multiple default routes for one machine. You will presumably want your default route to point to the internet-facing router.
2. my understanding is that after configuring two
interfaces they should act as a bridgeNo. You can use 'routeadm' on recent releases to configure routing. Otherwise, you need correct routing tables and make sure IP forwarding is enabled.
so that i
could setup a DNS server using my LAN machine
addresses (192.168.16.x) and traffic coming from
outside the office will be converted properly to
reach LAN machines (mail, web servers, etc). is that
correct or will i need to setup and configure 2 DNS
servers for each NIC respectively?Unless your ADSL router understands the routes behind the solaris machine (it almost certainly doesn't), it will never send traffic there. Instead, you would have to run a NAT setup on the machine. ipfilter/ipnat can be used to do that.
3. DHCP server. any guidance here in terms of two
NICs machine?Should be no issues. Just create a scope for the 192.x subnet. If you're using the Solaris DHCP server, you can create a file which prevents it from listening on the other interface, but that's not required.
Darren -
How to Setup Multicast Address on Solaris 2.6 (Back to the well again)
Basic Cluster Query,
Several weeks ago, I was thrashing about trying to verify the syntax for setting
up a multicast address on Solaris 2.6 in preparation for implementing Weblogic
6.0 clustering. The command syntax was:
ifconfig {interface}:{virtual#} plumb
ifconfig {interface}:{virtual#} {multicast_address} up
The commands succeeded on the first and second servers without errors, but unbeknownst
to me there were errors reported on the second host concerning duplicate address.
The errors were:
unix: WARNING: IP: Hardware address '08:00:20:a6:ed:0a'
trying to be our address 237.000.000.008!
The server halted today after several weeks; however, it is not clear whether
the multicast address caused the halt. Neither Weblogic nor Sun documentation
have been helpful. Can anyone provide guidance on setting up multicast address
on Solaris 2.6?
Bewildered,
Dan
Dan,
I don't think that BEA specifically takes any stand regarding the
configuration of operating systems. The problem is that the
administration of Unix machines and networking is a very complex and
sensitive subject for most companies (e.g., they have entire departments
dedicated to this) and BEA tries not to enforce any more configuration
specifications than it has to.
With regards to multicast, most newer versions of the major operating
systems (including Solaris) have support for multicast turned on "out of
the box". However, it is possible for your administrator to muck around
with your machine's network settings so that multicast does not work
properly or is disabled entirely. Most people in BEA support do not
know enough about low-level Unix TCP/IP administration to be able to
properly guide you to "configure multicast" if it is not working
properly. Even if they did, we wouldn't know what your administrator
might have done or why they did what they did so it is generally best to
get your Unix administrators involved because they really (should) have
the knowledge of the machine's configuration.
We do, however, provide a Java utility program called
utils.MulticastTest that can help you to determine whether or not
multicast is working correctly on your machine.
Hope this helps,
Robert
Dan wrote:
> Dennis,
>
> Thank you for the reply. I have tried working through the support line and
> even opened a case, but BEA will not provide any guidance on system or platform
> specific multicast addressing. They wouldn't even confirm the fact that "nothing"
> had to be done in Solaris; however, I did not mention your comments. I don't
> know why BEA takes such a position for common or well known architectures like
> Solaris, AIX, or HP/UX. Thanks again for your comments.
>
> Sincerely,
> Dan
>
>
> "Dennis Munsie" <[email protected]> wrote:
>
>>Hi,
>>
>>Multicast addresses do not need to be set from the command line. Multicast
>>addresses are independent of the normal IP address for an interface,
>>and
>>they are specified programatically when a socket is opened.
>>
>>--
>>Dennis Munsie
>>Developer Relations Engineer
>>BEA Support
>>
>>"Dan" <[email protected]> wrote in message
>>news:[email protected]...
>>
>>>Basic Cluster Query,
>>>
>>> Several weeks ago, I was thrashing about trying to verify the syntax
>>>
>>for
>>setting
>>
>>>up a multicast address on Solaris 2.6 in preparation for implementing
>>>
>>Weblogic
>>
>>>6.0 clustering. The command syntax was:
>>>
>>> ifconfig {interface}:{virtual#} plumb
>>> ifconfig {interface}:{virtual#} {multicast_address} up
>>>
>>>The commands succeeded on the first and second servers without errors,
>>>
>>but
>>unbeknownst
>>
>>>to me there were errors reported on the second host concerning duplicate
>>>
>>address.
>>
>>> The errors were:
>>>
>>> unix: WARNING: IP: Hardware address '08:00:20:a6:ed:0a'
>>> trying to be our address 237.000.000.008!
>>>
>>>The server halted today after several weeks; however, it is not clear
>>>
>>whether
>>
>>>the multicast address caused the halt. Neither Weblogic nor Sun
>>>
>>documentation
>>
>>>have been helpful. Can anyone provide guidance on setting up multicast
>>>
>>address
>>
>>>on Solaris 2.6?
>>>
>>>Bewildered,
>>> Dan
>>>
>>
>
-
Oracle 11.2 in Solaris 10 non-global zone?
When I try to install in a non-global zone in Solaris 10, the installer system check fails; I think this problem is well-known, but I can't find the guidance notes any more. The generic documentation isn't much help, I'm afraid. This is what I get from the system check, all round:
Expected Value: n/a
Actual Value: n/a
Not long ago I had a link to some notes that addressed thisproblem specifically, but I can't find them any more, unfortunately - does anybody here know?Check Oracle® Database Installation Guide 10g Release 2 (10.2) for Solaris Operating System.
-
Memory leak detecting tools for Solaris 10 X86
Hi All,
Greetings!
We are experiencing a crash defect while porting our application from Sol4 to Sol10.
Stack trace :
(dbx) where
=>[1] realfree(0x81b7d60), at 0xfeac3237
[2] freeunlocked(), at 0xfeac37e9
[3] free(0x831f1a8), at 0xfeac376f
[4] tLList_Done(0x831f1a8), at 0x8074255
[5] tKeyFile_Free(0x8306c60), at 0x8075af5
[6] tKeyFile_Done(0x8306c60), at 0x8075c6c
[7] tBGA_Var_Adj_LD(0x81b5eb0, 0x8302b48, 0x0), at 0x807a5f7
[8] tGen_Var_GenLead(0x81b5eb0, 0x8302b48, 0x0, 0x1), at 0x807b6e7
[9] tBGA_Var_GenLead(0x81b5eb0, 0x8302b48, 0x0, 0x1), at 0x807a7f8
[10] tCPD_DevProc_Init_Lead(0x825e6e8, 0x8302b48, 0x0, 0x1), at 0x809b363
[11] tCPD_DevProc_Init_Data(0x825e6e8, 0x8302b48, 0x0, 0x0, 0x0, 0x0, 0x1), at 0x809b970
[12] TrayRep_Execute(0x81b1cb4), at 0x80aab45
[13] TrayRep_RunFrom(0x0, 0x0), at 0x80a997a
[14] main(0x0, 0x804770c, 0x8047710), at 0x80a946a
We suspect it to be a memory leak issue. Are there memory leak debugging tools for sol10.
we were unable to use dbx as we got the following error.
(dbx) check -memuse
dbx: Incompatible libthread.so/libthread_db.so found. Error checking disabled
See `help rtc mt' for details.
Also dbx's 'check -access' option is not supported for X86.
Waiting eagerly for any support/guidance.
Thanks in advance.
DeepakI had the same problem on Solaris 10 sparc. The problem seems to relate to symbolic links with
long names not being extracted correctly from the tar file (resulting in @LongLink files popping
up around the place). If you use the .zip source file then the build goes fine.
Philip. -
Installing OAS 10g Release 2 (10.1.2) for Solaris 10 sparc
I am installing Oracle® Application Server 10g Release 2 (10.1.2) for Solaris Operating System (SPARC) for the first time on an unix server. What is required in unix as far as directories, mount-points and etc. before I start. After downloading the product, it says to extract the cpio file, move the cpio file to an empty directory, then do: cat filename.cpio | cpio -icd What directory do I run installerer in. I have reviewed the doumentation in Oracle for installing the OAS but it is the prep work that i am not sure about.
Thank you for any help and guidance.OK, when you unzip this or untar or make cpio, you will get Disk1, Disk2, Diskn folders, the mount for this could be anywere, even if they are in different mount points of folders, it's better to have them all in a same folder cause the installer will find the disks by his own, but ifyou have them in diferent folders, the installer will ask for the directory where the disk are.
Hope this helps
Greetings. -
Hi Freinds,
I am trying installing DNS on Solaris 10 10/09 s10s_u8wos_08a SPARC. I could not find named.conf file in the entire harddisk. So #svcadm enable /network/dns/server:default
makes the dns server service in to "maintenance" mode. Can anybody guide me to find a good guide for configuring DNS on this syetm? How can I find named.conf file?
Thanks,
abelk_12An old thread provides some guidance: [http://forums.sun.com/thread.jspa?threadID=5074659]
[Introduction to the Domain Name System|http://www.sun.com/bigadmin/features/articles/intro_dns.jsp] -
Solaris 10 (sparc) disk utilities problems
I'm running Solaris 10 (1/06) on an E450 with 1.5G RAM, 4 300Mhz US-2's. And am having a devil of a time partioning my unmounted spare drives that I'm trying to use to set up Raid 1 and Raid 5. I am logged on as the root user. This is a system I just rebuilt this weekend. I had the same problems with it in the previous build S10 (3/05). I can partition the drives any way I wish during the build process. It's just once I have the server built I can't figure it out.
The drives are a mix of:
Seagate ST336704LC <SUN36G>
Seagate ST336605LC <SUN36G>
I have tried using SMC with the following results: If I try to partition the disks (4 or 7 partitions) the drive manager will let me do 2 or 4 of the partitions then simply cease to proceed when the NEXT button is pushed. Also using the SMC if I right click, then do properties on a partition SMC will hang, also if I doubleclick on any partition, mounted or unmounted.
Using the terminal commands Format, Partition, Modify I can change the size of partitions but this does not allow me to Tag the partitions. I can not configure partitions any other way. If I try to modify the partitions using format-partition-"part#" then save infomation, it will be lost when I exit the terminal session.
Any guidance on what I am doing wrong would be greatly appreciated.
DaveFound it... was not doing 'label' after making my changes. All better and root mirroring has been successful.
Cheers -
Solaris 10, Oracle 10g, and Shared Memory
Hello everyone,
We've been working on migrating to Solaris 10 on all of our database servers (I'm a UNIX admin, not a DBA, so please be gentle) and we've encountered an odd issue.
Server A:
Sun V890
(8) 1.5Ghz CPUs
32GB of RAM
Server A was installed with Solaris 10 and the Oracle data and application files were moved from the old server (the storage hardware was moved between servers). Everything is running perfectly, and we're using the resource manager to control the memory settings (not /etc/system)
The DBAs then increase the SGA of one of the DBs on the system from 1.5GB to 5GB and it fails to start (ORA-27102). According to the information I have, the maximum shared memory on this system should be 1/4 of RAM (8 GB, actually works out to 7.84 GB according to prctl). I verified the other shared memory/semaphore settings are where they should be, but the DB would not start with a 5 GB SGA. I then decided to just throw a larger max shared memory segment at it, so I used the projmod to increase project.max-shm-memory to 16GB for the project Oracle runs under. The DB now starts just fine. I cut it back down to 10GB for project.max-shm-memory and the DB starts ok. I ran out of downtime window, so I couldn't continue refining the settings.
Running 'ipcs -b' and totalling up the individual segments showed we were using around 5GB on the test DB (assuming my addition is correct).
So, the question:
Is there a way to correlate the SGA of the DB(s) into what I need the project.max-shm-memory to? I would think 7.84GB would be enough to handle a DB with 5GB SGA, but it doesn't appear to be. We have some 'important' servers getting upgraded soon and I'd like to be able to refine these numbers / settings before I get to them.
Thanks for your time,
StevenTo me, setting a massive shared memory segment just seems to be inefficient. I understand that Oracle is only going to take up as much memory (in general) as the SGA. And I've been searching for any record of really large shared memory segments causing issues but haven't found much (I'm going to contact Sun to get their comments).
The issue I am having is that it doesn't make sense that the DB with a 5GB SGA is unable to startup when there is an 8GB max shared memory segment, but a 10GB (and above) seems to work. Does it really need double the size of the SGA when starting up, but 'ipcs' shows it's only using the SGA amount of shared memory? I have plans to cut it down to 4GB and test again, as that is Oracle's recommendation. I also plan to run the DB startup through truss to get a better handle on what it's trying to do. And, if it comes down to it, I'll just set a really big max shared memory segment, I just don't want it to come back and cause an issue down the road.
The current guidance on Metalink still seems to be suggesting a 4GB shared memory segment (I did not get a chance to test this yet with the DB we're having issues with).
I can't comment on how the DBA specifically increased the SGA as I don't know what method they use. -
Solaris 10 VPN server/gateway setup
Hi all,
I have a V20z running Solaris 10 at home, and I would like to set it up as a VPN server. The Solaris 10 is behind a router with a reserved private IP assigned by DHCP and port forwarding set up for only SSH at the moment. The router has a static external IP.
I'm not exactly sure what the terms are for what I'm trying to do, but this is basically it:
When I am out of town or overseas, I want to be able to connect from my laptop running OS X or Linux to my Solaris 10 server at home, and have the S10 server act as a proxy(?) (gateway?) for all the traffic from my laptop; for example, if I was in a place where nytimes.com was blocked and wanted to be able to browse from my laptop by having the Solaris 10 server proxy (transparently) my requests and forward the responses back to me. I hope I'm explaining this ok...
I have searched a lot online for how to do this, and I have found a lot of info, but nothing that really ties it all together. I'm pretty comfortable working in the shell and doing config stuff, but it would be a huge help if anyone could explain all the pieces I need to snap together to get this working.
These are my questions:
1. What is what I have described called? Just "VPN" or "VPN router," or "VPN gateway"?
2. What software do I need on my Solaris 10 server to do this?
A lot of what I read pointed me to OpenVPN, but I am not clear if OpenVPN alone would enable me to use the public web via the VPN.
If not, then what would I need to have on the server to enable incoming requests over the VPN connection to be rerouted to the public internet?
3. I'm sure I can figure this out if I can just get the server VPN working, but if anyone happens to know, I'd appreciate it:
Built into OS X Networking Prefs I have the ability to add a VPN interface of either of these 2 types:
"PPTP"
"L2TP over IPsec"
From what I have read so far, it seems like IPsec is likely the only reasonable choice, but the option of "L2TP over IPsec" confuses me since I haven't read that they are required to be used together.
Will this option work for connecting to my Solaris VPN server or will I need a 3rd-party app?
Any guidance would be a tremendous help.
Thanks guys!
JamieMobile IP???
Assuming that you had the right security in place you could have the "Home" box export it's display back to the "Roving" box and then just run a web browser over X. Something like SSH with X forwarding.
alan -
Intalling Postgresql in solaris 10
I have downloaded the postgresql package from
www.postgresql.org/download/bittorent
i have unziped the files. i dont know how to continue with the installation.Here is some documentation to get you started......It available online.
Author : Chris Drawater
Date
: May 2005
Version : 1.2
PostgreSQL 8.0.02 for J2EE applications on Solaris 10
Abstract
Advance planning enables PostgreSQL 8 and its associated JDBC driver to be quickly deployed in a
basic but resilient and IO efficient manner.
Minimal change is required to switch JDBC applications from Oracle to PostgreSQL.
Document Status
This document is Copyright � 2005 by Chris Drawater.
This document is freely distributable under the license terms of the GNU Free Documentation License
(http://www.gnu.org/copyleft/fdl.html). It is provided for educational purposes only and is NOT
supported.
Introduction
This paper documents how to deploy PostgreSQL 8 and its associated JDBC driver in a basic but both
resilient and IO efficient manner. Guidance for switching from Oracle to PostgreSQL is also provided.
It is based upon experience with the following configurations =>
PostgreSQL 8.0.2 on Solaris 10
PostgreSQL JDBC driver on Windows 2000
using the PostgreSQL distributions =>
postgresql-base-8.0.2.tar.gz
postgresql-8.0-311.jdbc3.jar
� Chris Drawater, 2005
PostgreSQL 8.0.2 on Solaris, v1.2
p1/10
Page 2
Background for Oracle DBAs
For DBAs coming from an Oracle background, PostgreSQL has a number of familiar concepts including
Checkpoints
Tablespaces
MVCC concurrency model
Write ahead log (WAL)+ PITR
Background DB writer
Statistics based optimizer
Recovery = Backup + archived WALs + current WALs
However , whereas 1 Oracle instance (set of processes) services 1 physical database, PostgreSQL differs in
that
1 PostgreSQL �cluster� services n * physical DBs
1 cluster has tablespaces (accessible to all DBs)
1 cluster = 1 PostgreSQL instance = set of server processes etc ( for all DBs) + 1 tuning config +
1 WAL
User accts are cluster wide by default
There is no undo or BI file � so to support MVCC, the �consistent read� data is held in the tables
themselves and once obsolete needs to be cleansed out using the �vacuum� utility.
The basic PostgreSQL deployment guidelines for Oracle aware DBAs are to =>
Create only 1 DB per cluster
Have 1 superuser per cluster
Let only the superuser create the database
Have one user to create/own the DB objects + n* endusers with appropriate read/write access
Use only ANSI SQL datatypes and DDL.
Wherever possible avoid DB specific SQL extensions to ensure cross-database portability
IO distribution & disc layouts
It is far better to start out with good disc layouts rather than reto-fix for a production database.
As with any DBMS, for resilience, the recovery components ( eg. backups , WAL, archived WAL logs)
should kept on devices separate from the actual data.
So the basic rules for resilience are as follows.
For non disc array or JBOD systems =>
keep recovery components separate from data on dedicated discs etc
keep WAL and data on separate disc controllers
mirror WAL across discs ( preferably across controllers) for protection against WAL spindle loss
For SAN based disc arrays (eg HP XP12000) =>
keep recovery components separate from data on dedicated LUNs etc
use Host Adapter Multipathing drivers (such as mpxio) with 2 or more HBAs for access to SAN .
Deploy application data on mirrored/striped (ie RAID 1+0) or write-cache fronted RAID 5 storage.
The WAL log IO should be configured to be osync for resilience (see basic tuning in later section).
Ensure that every PostgreSQL component on disc is resilient (duplexed) !
Recovery can be very stressful�
Moving onto IO performance, it is worth noting that WAL IO and general data IO access have different IO
characteristics.
� Chris Drawater, 2005
PostgreSQL 8.0.2 on Solaris, v1.2
p2/10
Page 3
WAL sequential access (write mostly)
Data sequential scan, random access write/read
The basic rules for good IO performance �.
use tablespaces to distribute data and thus IO across spindles or disc array LUNs
keep WAL on dedicated spindles/LUNs (mirror/stripe in preference to RAID 5)
keep WAL and arch WAL on separate spindles to reduce IO on WAL spindles.
RAID or stripe data across discs/LUNs in 1 Mb chunks/units if unsure as what chunk size to use.
For manageability, keep the software distr and binaries separate from the database objects.
Likewise, keep the system catalogs and non-application data separate from the application specific data.
5 distinct storage requirements can be identified =>
Software tree (Binaries, Source, distr)
Shared PG sys data
WAL logs
Arch WAL logs
Application data
For the purposes of this document , the following minimal set of FS are suggested =>
/opt/postgresql/8.0.2
# default 4 Gb for software tree
/var/opt/postgresql
# default 100 Mb
/var/opt/postgresql/CLUST/sys
# default size 1Gb for shared sys data
/var/opt/postgresql/CLUST/wal
# WAL location # mirrored/striped
/var/opt/postgresql/CLUST/archwal
# archived WALs
/var/opt/postgresql/CLUST/data
# application data + DB sys catalogs # RAID 5
where CLUST is your chosen name for the Postgres DB cluster
For enhanced IO distribution , a number of �/data FS (eg data01, data02 etc) could be deployed.
Pre-requisites !
The GNU compiler and make software utilities (available on the Solaris 10 installation CDs) =>
gcc (compiler) ( $ gcc --version => 3.4.3 )
gmake (GNU make)
are required and should be found in
/usr/sfw/bin
Create the Unix acct
postgres
in group dba
with a home directory of say /export/home/postgresql
using
$ useradd utility
or hack
/etc/group then /etc/passwd then run pwconv and then passwd postgres
Assuming the following FS have been created =>
� Chris Drawater, 2005
PostgreSQL 8.0.2 on Solaris, v1.2
p3/10
Page 4
/opt/postgresql/8.0.2
# default 4 Gb for the PostgreSQL software tree
/var/opt/postgresql
# default 100 Mb
create directories
/opt/postgresql/8.0.2/source
# source code
/opt/postgresql/8.0.2/distr
# downloaded distribution
all owned by user postgres:dba with 700 permissions
To ensure, there are enough IPC resources to use PostgreSQL, edit /etc/system and add the following lines
=>
set shmsys:shminfo_shmmax=1300000000
set shmsys:shminfo_shmmin=1
set shmsys:shminfo_shmmni=200
set shmsys:shminfo_shmseg=20
set semsys:seminfo_semmns=800
set semsys:seminfo_semmni=70
set semsys:seminfo_semmsl=270 # defaults to 25
set rlim_fd_cur=1024
# per process file descriptor soft limit
set rlim_fd_max=4096
# per process file descriptor hard limit
Thenn on the console (log in as root) =>
$ init 0
{a} ok boot -r
Download Source
Download the source codes from http://www.postgresql.org (and if downloaded via Windows, remember
to ftp in binary mode) =>
Distributions often available include =>
postgresql-XXX.tar.gz => full source distribution.
postgresql-base-XXX.tar.gz => Server and the essential client interfaces
postgresql-opt-XXX.tar.gz => C++, JDBC, ODBC, Perl, Python, and Tcl interfaces, as well as multibyte
support
postgresql-docs-XXX.tar.gz => html docs
postgresql-test-XXX.tar.gz => regression test
For a working, basic PostgreSQL installation supporting JDBC applications, simply use the �base�
distribution.
Create Binaries
Unpack Source =>
$ cd /opt/postgresql/8.0.2/distr
$ gunzip postgresql-base-8.0.2.tar.gz
$ cd /opt/postgresql/8.0.2/source
$ tar -xvof /opt/postgresql/8.0.2/distr/postgresql-base-8.0.2.tar
� Chris Drawater, 2005
PostgreSQL 8.0.2 on Solaris, v1.2
p4/10
Page 5
Set Unix environment =>
TMPDIR=/tmp
PATH=/usr/bin:/usr/ucb:/etc:.:/usr/sfw/bin:usr/local/bin:n:/usr/ccs/bin:$PATH
export PATH TMPDIR
Configure the build options =>
$ cd /opt/postgresql/8.0.2/source/postgresql-8.0.2
$ ./configure prefix=/opt/postgresql/8.0.2 with-pgport=5432 --without-readline
CC=/usr/sfw/bin/gcc
Note => --enable-thread-safety option failed
And build =>
$ gmake
$ gmake install
On an Ultra 5 workstation, this gives 32 bit executables
Setup Unix environment
Add to environment =>
LD_LIBRARY_PATH=/opt/postgresql/8.0.2/lib
PATH=/opt/postgresql/8.0.2/bin:$PATH
export PATH LD_LIBRARY_PATH
Create Database(Catalog) Cluster
Add to Unix environment =>
PGDATA=/var/opt/postgresql/CLUST/sys
# PG sys data , used by all DBs
export PGDATA
Assuming the following FS has been created =>
/var/opt/postgresql/CLUST/sys
# default size 1Gb
where CLUST is your chosen name for the Postgres DB cluster,
initialize database storage area, create shared catalogs and template database template1 =>
$ initdb -E UNICODE -A password
-W
# DBs have default Unicode char set, user basic passwords, prompt for super user password
Startup, Shutdown and basic tuning of servers
Check servers start/shutdown =>
$ pg_ctl start -l /tmp/logfile
$ pg_ctl stop
Next, tune the PostgreSQL instance by editing the configuration file $PGDATA/postgresql.conf .
� Chris Drawater, 2005
PostgreSQL 8.0.2 on Solaris, v1.2
p5/10
Page 6
First take a safety copy =>
$ cd $PGDATA
$ cp postgresql.conf postgresql.conf.orig
then make the following (or similar changes) to postgresql.conf =>
# listener
listen_addresses = 'localhost'
port = 5432
# data buffer cache
shared_buffers = 10000
# each 8Kb so depends upon memory available
#checkpoints
checkpoint_segments = 3
# default
checkpoint_timeout = 300
# default
checkpoint_warning = 30
# default � logs warning if ckpt interval < 30s
# log related
fsync = true
# resilience
wal_sync_method = open_sync
# resilience
commit_delay = 10
# group commit if works
archive_command = 'cp "%p" /var/opt/postgresql/CLUST/archwal/"%f"'
# server error log
log_line_prefix = '%t :'
# timestamp
log_min_duration_statement = 1000
# log any SQL taking more than 1000ms
log_min_messages = info
#transaction/locks
default_transaction_isolation = 'read committed'
Restart the servers =>
$ pg_ctl start -l /tmp/logfile
Create the Database
This requires the FS =>
/var/opt/postgresql/CLUST/wal
# WAL location
/var/opt/postgresql/CLUST/archwal
# archived WALs
/var/opt/postgresql/CLUST/data
# application data + DB sys catalogs
plus maybe also =>
/var/opt/postgresql/CLUST/backup
# optional for data and config files etc as staging
area for tape
Create the clusterwide tablespaces (in this example, a single tablespace named �appdata�) =>
$ psql template1
� Chris Drawater, 2005
PostgreSQL 8.0.2 on Solaris, v1.2
p6/10
Page 7
template1=# CREATE TABLESPACE appdata LOCATION '/var/opt/postgresql/CLUST/data';
template1=# SELECT spcname FROM pg_tablespace;
spcname
pg_default
pg_global
appdata
(3 rows)
and add to the server config =>
default_tablespace = 'appdata'
Next, create the database itself (eg name = db9, unicode char set) =>
$ createdb -D appdata -E UNICODE -e db9
# appdata = default TABLESPACE
$ createlang -d db9 plpgsql
# install 'Oracle PL/SQL like' language
WAL logs are stored in the directory pg_xlog under the data directory. Shut the server down & move the
directory pg_xlog to /var/opt/postgresql/CLUST/wal and create a symbolic link from the original location in
the main data directory to the new path.
$ pg_ctl stop
$ cd $PGDATA
$ mv pg_xlog /var/opt/postgresql/CLUST/wal
$ ls /var/opt/postgresql/CLUST/wal
$ ln -s /var/opt/postgresql/CLUST/wal/pg_xlog $PGDATA/pg_xlog
# soft link as across FS
$ pg_ctl start -l /tmp/logfile
Assuming all is now working OK, shutdown PostgreSQL & backup up all the PostgreSQL related FS
above� just in case�!
� Chris Drawater, 2005
PostgreSQL 8.0.2 on Solaris, v1.2
p7/10
Page 8
User Accounts
Create 1 * power user to create/own/control the tables (using psql) =>
$ pgsql template1
create user cxd with password 'abc';
grant create on tablespace appdata to cxd;
Do not create any more superusers or users that can create databases!
Now create n* enduser accts to work against the data =>
$pgsql template1
CREATE GROUP endusers;
create user enduser1 with password 'xyz';
ALTER GROUP endusers ADD USER enduser1;
$ psql db9 cxd
grant select. on <table>. to group endusers;
JDBC driver
A pure Java (Type 4) JDBC driver implementation can be downloaded from
http://jdbc.postgresql.org/
Assuming the use of the SDK 1.4 or 1.5, download
postgresql-8.0-311.jdbc3.jar
and include this in your application CLASSPATH.
(If moving JAR files between different hardware types, always ftp in BIN mode).
Configure PostgreSQL to accept JDBC Connections
To allow the postmaster listener to accept TCP/IP connections from client nodes running the JDBC
applications, edit the server configuration file and change
listen_addresses = '*'
# * = any IP interface
Alternatively, this parameter can specify only selected IP interfaces ( see documentation).
In addition, the client authetication file will need to edited to allow access to our database server.
First take a backup of the file =>
$ cp pg_hba.conf pg_hba.conf.orig
Add the following line =>
host db9
cxd
0.0.0.0/0
password
where , for this example, database db9, user cxd, auth password
� Chris Drawater, 2005
PostgreSQL 8.0.2 on Solaris, v1.2
p8/10
Page 9
Switching JDBC applications from Oracle to PostgreSQL
The URL used to connect to the PostgreSQL server should be of the form
jdbc:postgresql://host:port/database
If used, replace the line (used to load the JDBC driver)
Class.forName ("oracle.jdbc.driver.OracleDriver");
with
Class.forName("org.postgresql.Driver");
Remove any Oracle JDBC extensions, such as
((OracleConnection)con2).setDefaultRowPrefetch(50);
Instead, the row pre-fetch must be specified at an individual Statement level =>
eg.
PreparedStatement pi = con1.prepareStatement(�select�.�);
pi.setFetchSize(50);
If not set, the default fetch size = 0;
Likewise, any non ANSI SQL extensions will need changing.
For example sequence numbers
Oracle => online_id.nextval
should be replaced by
PostgreSQL => nextval('online_id')
Oracle �hints� embedded within SQL statements are ignored by PostgreSQL.
Now test your application!
Concluding Remarks
At this stage, you should now have a working PostgreSQL database fronted by a JDBC based application,
and the foundations will have been laid for :
A reasonably level of resilience (recoverability)
A good starting IO distribution
The next step is to tune the system under load� and that�s another doc�
Chris Drawater has been working with RDBMSs since 1987 and the JDBC API since late 1996, and can
be contacted at [email protected] or [email protected] .
� Chris Drawater, 2005
PostgreSQL 8.0.2 on Solaris, v1.2
p9/10
Page 10
Appendix 1 � Example .profile
TMPDIR=/tmp
export TMPDIR
PATH=/usr/bin:/usr/ucb:/etc:.:/usr/sfw/bin:usr/local/bin:n:/usr/ccs/bin:$PATH
export PATH
# PostgreSQL 802 runtime
LD_LIBRARY_PATH=/opt/postgresql/8.0.2/lib
PATH=/opt/postgresql/8.0.2/bin:$PATH
export PATH LD_LIBRARY_PATH
PGDATA=/var/opt/postgresql/CLUST/sys
export PGDATA
� Chris Drawater, 2005
PostgreSQL 8.0.2 on Solaris, v1.2
p10/10 -
How to increase the size of /opt solaris 10 x86
Solaris 10 X86, /opt runs out space, would anyone please tell me how to increase the size of /opt?
The Solaris is installed on the whole disk, and I believe there are still some free hard disk space available somewhere.
I need step by step guidance please.
thanks.Hi
Looks like you have installed your Solaris 10 on traditional UFS disk partitions and not using the ZFS whole disk. If so then you need to resize de underlying partition using the format command and then run the growfs to resize the /opt.
Maybe you are looking for
-
Can you open a calculator and add or subtract within a cell?
I am trying to see if there is a way to use the number pad as a calculator and add figures then enter into a cell for further use. I want to eliminate the use of my adding machine if possible and just use my keyboard to do my additions and enter dir
-
MB1B - Mvt Type 322 to Move Unrestricted to Quality.
I am trying to move stock to Quality using Movement type 322 in transaction MB1B and getting the message "Change Inspection Stock of Material XX in QM Only". I checked the Material Master QM view and found that Inspection Setup is active which wont l
-
What is Security by FA Book in Fixed Assets Module
Hi, Could anyone explain the concepts on 'Security by FA Book in Fixed Assets' In my opinion,, 'Security by Book is the model that allows organization security in Fixed Asset module'. To achieve this, do we need any setup to do. Anyone can help me? I
-
HT1386 USB sync problem on iPhone 4
My iPhone will not sync via usb. I get an error message stating usb device not recognized. Does anyone know what I can do to correct this? p.s. Seagate external hard drive connected by usb can not be found.
-
Get element attributes with JDOM
Dear JDOM experts, I am learning JDOM. Here is a piece of codes: SAXBuilder saxBuilder = new SAXBuilder(); doc = saxBuilder.build(new File(filename)); Element rootElement=doc.getRootElement(); System.out.println ("rootElement.getName() = "+ rootEleme