A common task when scaling databases is to reindex tables within the database. This process makes lookups faster and databases run butter. Reindexing becomes a pretty easy step before or after backing up the database as a general housekeeping step. To backup the database, you’ll use the pg_dump command, defining the user with -U and then the database with -d. In the case of Profile Manager, the database is device_management. Given that data is distributed across a lot of tables in the device_management database, the below script will backup the device_management database and then reindex each of the tables. If you follow previous articles to enable the Postgres user, you…
-
-
Working with Postgres from the Command Line in Lion Server
Mac OS X Server 10.7, Lion Server, comes with a few substantial back-end changes. One of these is the move from SQLite3 to PostgreSQL for many of the back-end databases, including Wiki and Podcast Producer (collab), Webmail (roundcubemail), iCal Server and Address Book Server (caldav) and as the back-end to the newest service in Lion Server, Profile Manager (device_management). As such, it’s now important to be able to use PostgreSQL the way we once used SQLite3, when trying to augment the data that these databases contains, as there currently aren’t a lot of options for editing this data (aside from manually of course). Postgres has a number of commands that…
-
Final Cut Server: PostgreSQL and FCS
The database that stores the configuration information and assets that you are using with Final Cut Server is built in PostgreSQL. The name of the PostgreSQL database is px. The implementation of PostgreSQL that runs on Mac OS X for Final Cut Server uses port 5433 by default, although only through the localhost. There are two sets of PostgreSQL binaries on a Final Cut Server. The first is in the /Library/Application Support/Final Cut Server/Final Cut Server.bundle/Contents/PostgreSQL/bin directory. However, the tools here do not function. Use the PostgreSQL binary files to manage the database located in the /System/Library/CoreServices/RemoteManagement/rmdb.bundle/bin directory. The actual database information is stored in /var/db/FinalCutServer. Given the above…