Once you have successfully installed Solaris 10 6/06 (or separate PostgreSQL packages for earlier Solaris 10 releases), there are a few steps that you will need to perform before you can start the database.
- Create a Solaris OS user and group that will be used to administer PostgreSQL. If you choose to use an existing user, skip this step and proceed to Step 2.
Note: PostgreSQL cannot be run as root user.
For example, to create a user called "postgres" and assign it to a "postgres" group, execute the following commands as root. Make sure the directory /export/home exists:# groupadd postgres # useradd -c 'PostgreSQL user' -d /export/home/postgres
-g postgres -m -s /bin/bash postgres - The next step is to decide on a directory to create the database and ensure that the permissions are set correctly. The default location is /var/lib/pgsql/data, but it can be placed anywhere. In fact, in a production environment, you should place it in its own filesystem partition, with consideration for space and growth, performance and availability.
To use the default directory with the Solaris user called "postgres", execute the following commands to set the ownership and permissions:# chown postgres /var/lib/pgsql/data # chmod 700 /var/lib/pgsql/data
- You are now ready to create a database cluster. Login as "postgres" or another user you've selected to run the database and execute the initdb command.
To create a database cluster in /var/lib/pgsql/data, execute the following command:$ initdb -D /var/lib/pgsql/data
- PostgreSQL is now ready to be started using the following command:
$ pg_ctl -D /var/lib/pgsql/data -l postmaster.log start
- You can now test the running database.
To connect to a database called "postgres" running on a default port, execute the following command:$ psql postgres
To configure the database, modify the postgresql.conf file in the database cluster directory used in step 3. For tuning tips on Solaris, visit http://www.sun.com/servers/coolthreads/tnb/applications_postgresql.jsp.
'OS' 카테고리의 다른 글
Notepad 2.0.18 (windows) (1) | 2007.08.21 |
---|---|
"Unknown Host" Error for Solaris 10 (1) | 2007.08.13 |
Disable touchpad tapping while typing (0) | 2007.08.01 |
[devfsadm] solaris 에서 새로운 장치를 인식 시켜 보자 (0) | 2007.07.30 |
How to dual-boot Solaris with Vista step-by-step Guide (2) | 2007.07.24 |