Cisco Systems Version 1.1 Network Router User Manual


 
2-3
Cisco Carrier Sensitive Routing User Guide
Chapter2 PostgreSQL Database Operations and Functionalities
Database Operations
Exporting a Database
To export a database to a text file or to back up the entire database system, perform the following steps:
Exporting to a Text File
Step 1 Export a database into a text file by entering the following command:
pg_dump –x databasename > outfile
Note "-x" is optional. When it is used, the “dumped” database loses the ownership information.
Step 2 Reload the dataset by entering the following command:
psql –e database < outfile
Note "-e" is optional. When it is used, every log message “echoes” on the screen.
Backing Up the Database System
You can back up the database system file directory /usr/local/pgsql/data/base into a tar file.
Reintializing a Database
To reinitialize a database, the existing database must be destroyed, and a new one must be created.
To reinitialize a database, performing the following steps:
Step 1 Destroy the database by entering the following command with “csrdb” as the name of the database:
dropdb csrdb
Note The database to be destroyed must not be connected to the CSR application, CSR GUI, and
pgsql.
Step 2 Create a new database by entering the following command:
createcsrdb csrdb
After the database is re-created, the CSR and CSR GUI can be restarted and connected to the new
database. If “csrdb” is not used as the name of the database, note the following:
To have CSR started upon reboot of the Solaris system, modify the following files:
etc/init.d/csr_init
/etc/rc2.d/S99csr_init
To start CSR from the command prompt, specify the database name in command csr newdbname &