import etiketine sahip kayıtlar gösteriliyor. Tüm kayıtları göster
import etiketine sahip kayıtlar gösteriliyor. Tüm kayıtları göster

1 Temmuz 2010 Perşembe

Birden fazla import için shell script

Bir dizinde içindeki dump dosyalarını import etmem gerekti(yaklaşık 500 dosya).
Bunun için basit bir script yazdım. Arayanlar için paylaşmak istedim.
Script tabloyu import ediyor ve dosya adı ile yeniden anlandırıyor.
dosya isimleri şöyle TABLE1_A29012009.dmp
Tablonun adı TABLE1 yeniden isimlendirilecek tablo adı da TABLE1_A29012009 oluyor.

-----------------


#!/bin/bash
touser=expuser
fromuser=appuser
echo "Asagidakileri calistirir..."
echo "imp \$kullanici/\$sifre@$dbname fromuser=\$fromuser touser=$touser commit=y file=\$dosya.dmp log=\$dosya.imp.log"
echo "rename \$edosya to \$onek\$dosya;"
echo
echo
read -p "Username:" kullanici
echo
read -p "Database:" dbname
echo
echo -n "Password: "
stty -echo
read sifre
stty echo
echo
echo
read -p "tablo on eki(eski_):" onek


#for file in $(pwd)/*.txt
for file in $(ls -l *.dmp | awk '{print $9}')
do
edosya=${file%_*}
dosya=${file%.*}
imp $kullanici/$sifre@$dbname fromuser=$fromuser touser=$touser commit=y file=$dosya.dmp log=$dosya.imp.log
sqlplus -s $kullanici/$sifre@$dbname << EOF
--rename $edosya to $onek$dosya;
set echo on
alter table $touser.$edosya rename to $onek$dosya;
grant select on $onek$dosya to r_ofsdata;
exit
EOF
done


4 Ağustos 2007 Cumartesi

Oracle EM (Enterprise Manager) üzerinde export/import işlemindeki hata

Oracle EM üzerinde normal kullanıcı veya SYS kullanıcısının export/import işlemlerini yapabilmesi için Preferred Credential host username, password bilgilerini girmek gerekiyor. burda hosta ait kullanıcı ve şifreyi doğru girseniz de çalışmıyor. bunun için yapılması gerekenler şöyle :

You have to provide the 'Log on as a batch job' privilege:

1. Go to control panel/administrative tools
a. click on "local security policy"
b. click on "local policies"
c. click on "user rights assignments"
d. double click on "log on as a batch job"
e. click on "add" and add the user that was entered in the "normal username" or "privileged username" section of the EM Console.

2. Go to the Preferences link in the EM GUI
a. click on Preferred Credentials (link on the left menu)
b. under "Target Type: Host" click on "set credentials"
c. enter the OS user who has logon as a batch job privilege into the "normal username" and "normal password" fields

3. Test the connection
a. while in the Set Credentials window, click on "Test"


Aslında bu yöntemde Türkçe Windows XP Pro SP2 üzerinde çalışmadı. Dil ayarları English olduğu halde yine çalışmadı.

Çalıştırmayı başardığım andan Türkçe sistemde içinde uygun yöntemi paylaşacağım.

Ayrıntı bilgi ve diğer dillerdeki sonuçlar için :

http://www.orafaq.com/forum/t/45729/0/

http://forums.oracle.com/forums/thread.jspa?threadID=305172&start=45&tstart=0