Tak jako každý den, otevíráte poštovního klienta s došlou poštou. Spam, spam, Peníze pro popálené děvčátko za šíření e-mailu, Oznámení o změně pravidel pro parkování v areálu, spam a vida, zpráva která vypadá legitimně:
On Sep 29 “Alexander Sale - Senior Sales Manager” wrote:
Hi DBA,
developers need Pgsql database for our sales app on db server 02. Please solve it and fill the db
with data from our previous sw (send me
backup of your db after finished).
ok?
thx
Alex
–
Alexander Sale
Sales IC
Enterprise Representative of ACME, Inc.
alexander.sale@acme.biz
I'm a signature virus. Please add me to your signature and help me spread!
On Sep 24 “Peter Bug - Java Programmer” wrote:
We need an instance of PostgreSQL on server db01.acme.biz, please provide us with connection string
for a new cluster via AF_UNIX socket and TCP/IP. We expect to use UTF-8, authentication via password.
New database name: `salesapp'
User name: `sales'
Password: `iaKnikIm5'
Thank you!
Information from NOD32
This message was checked by NOD32 Antivirus System for Linux Mail Server.
http://www.nod32.com
Information from NOD32
This message was checked by NOD32 Antivirus System for Linux Mail Server.
http://www.nod32.com
This document is intended for, and should only be read by, those persons to whom it is addressed. Its contents
are confidential and if you have received this message in error, please delete it and notify us immediately,
e-mail leaks@acme.example.com. Any form of reproduction, dissemination, copying, disclosure, modification,
distribution and / or publication of this message without our prior written consent is strictly prohibited.
Any views expressed in this message are those of the individual sender, and do not necessarily represent the
position of ACME. Furthermore ACME does not authorise or use e-mail for official contractual correspondence.
Nothing received in e-mail has any contractual validity.
ACME and each legal entity in ACME Corporation reserve the right to monitor all e-mail communications through
its networks.
This footnote also confirms that this email message has been checked for known computer viruses.
Information from NOD32
This message was checked by NOD32 Antivirus System for Linux Mail Server.
http://www.nod32.com
Takže máme nový úkol, rovnou ho vyřešíme.
Díky minulému postupu jsme systém ovládli a změnili heslo superuživatele:
username: root password: hippo
Heslo uživatele zůstává:
username: dba password: dba
Základní systém serveru db03 je úplně připravený, beží na Ubuntu 10.04 LTS, takže:
Pár snad užitečných tipů:
pg_hba.conf. (dokumentace)postgres. “Přepnout” se na něj dá pomocí su - postgres.createdb, createuser.psql.sed -i 's/FOO/BAR/' foobar.sql.enca: enca -L czech uknown-charset.txt, pro jeho instalaci musíme nejprve do /etc/apt/sources.list přidat řádekdeb http://cz.archive.ubuntu.com/ubuntu/ maverick universe
a udělat aptitude update.
recode: recode iso8859-1..utf8 known-charset.txt.su - postgrescreateuser -P sales,createdb -O sales -E UTF8 salesapp,dropdb salesapp,ifconfigpsql -H192.168.9.100 -U sales\dt,pg_dump sales | gzip > sales.sql.gzpsql sales < sales.sql,enca -L czech tanketa.sql,recode latin2..utf8 t*sql,ls t*sql | while read file; do psql -d salesapp -f $file; done Vytvořte skript, který dokáže konvertovat databázi podobnou té testovací mezi Firebird (zdroj) a PostgreSQL (cíl). Konkrétní realizace je čistě na vás, nejdůležitější je bezpečnost dat a funkčnost. Výsledek bude otestován na vám neznámé, ale poměrně jednoduché tabulce, pokud koverze proběhne správně, máte to. ;)