Exporting A Database; Reintializing A Database - Cisco PXM Version 1.1 User Manual

Cisco sensitive routing user guide
Table of Contents

Advertisement

Chapter2
PostgreSQL Database Operations and Functionalities

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
Step 2
Reload the dataset by entering the following command:
psql –e database < outfile
Note
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
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:
"-x" is optional. When it is used, the "dumped" database loses the ownership information.
"-e" is optional. When it is used, every log message "echoes" on the screen.
The database to be destroyed must not be connected to the CSR application, CSR GUI, and
pgsql.
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 &
Cisco Carrier Sensitive Routing User Guide
Database Operations
2-3

Advertisement

Table of Contents
loading

Table of Contents