Lipiec « 2014 « Różności …

Różności …

29 lipca 2014

dbfdump

Zaszufladkowany do: Bazy danych — Jacek @ 08:52

dbfdump.pl –fs “,” mytable.dbf > mytable.csv

21 lipca 2014

datapump expdp impdp

Zaszufladkowany do: Bazy danych,Oracle — Tagi: — Jacek @ 09:33

CONN / AS SYSDBA
ALTER USER scott IDENTIFIED BY tiger ACCOUNT UNLOCK;

CREATE OR REPLACE DIRECTORY test_dir AS ‘/u01/app/oracle/oradata/’;
GRANT READ, WRITE ON DIRECTORY test_dir TO scott;

expdp scott/tiger@db10g tables=EMP,DEPT directory=TEST_DIR dumpfile=EMP_DEPT.dmp logfile=expdpEMP_DEPT.log

impdp hr/HR directory=DATADUMP dumpfile=FMC_LOGICAL_VESSELS.DMP remap_schema=VTRACK:HR exclude=index,constraint,grant,trigger

expdp user/pass schemas= directory=dumpdir \
dumpfile=.dmp \
logfile=expdp_.log

impdp user/pass schemas=schema1 directory=dumpdir \
remap_schema=schema1:schema2 \
dumpfile=schema1.dmp \
logfile=impdp_schema2.log

http://www.oracle-base.com/articles/10g/oracle-data-pump-10g.php

http://oradbaeasy.wordpress.com/2009/06/11/importing-and-exporting-oracle-database-using-datapump-utility/

expdp username/password FULL=y INCLUDE=GRANT INCLUDE= INDEX DIRECTORY=dpump_dir1 DUMPFILE=dba.dmp CONTENT=ALL

17 lipca 2014

table to csv

Zaszufladkowany do: Bazy danych,Linux,Oracle,Oracle — Tagi: — Jacek @ 18:19

#!/usr/bin/bash

FILE=”emp.csv”

sqlplus -s scott/tiger@XE <

SET PAGESIZE 50000
SET COLSEP ","
SET LINESIZE 200
SET FEEDBACK OFF

SPOOL $FILE

SELECT * FROM EMP;

SPOOL OFF
EXIT
EOF

- See more at: http://www.theunixschool.com/2012/12/shell-script-how-to-dump-oracle-table-into-csv-file.html

SET PAGESIZE 50000 => Set this to a much bigger value. This value indicates the number of lines per page. The header line will get printed in every page. In order to avoid this, set it to a bigger value so that the header appears only once.

SET COLSEP “,” => Setting the column separator to “,”. With this setting, the list displayed by the SELECT clause will be comma separated. This is the most important setting of this script.

SET LINESIZE 200 => The number of characters per line. The default is 80 which means after 80 characters, the rest of the content will be in the next line. Set this to a value which is good enough for the entire record to come in a single line.

SET FEEDBACK OFF => When a select query is executed, a statement appears at the prompt, say “25 rows selected”. In order to prevent this from appearing in the CSV file, the feedback is put off.

SPOOL $FILE => Spool command records the session queries and results into the file specified. In other words, this will write the results of the query to the file.

SELECT * FROM EMP => The query which gives the entire table contents of EMP. If only a part of the table is desired, the query can be updated to get the desired result.

SPOOL OFF => To stop writing the contents of the sql session to the file.

- See more at: http://www.theunixschool.com/2012/12/shell-script-how-to-dump-oracle-table-into-csv-file.html#sthash.XLJ9iSpO.dpuf

ovm cdrom boot problem

Zaszufladkowany do: Oracle — Tagi: , — Jacek @ 12:27

Its funny how things work in Oracle VM ..

I made some changes in configuration file and its working for me.. But I think this needs to be corrected.

xvdb is replaced with hdc..

Before

disk = ['file:/OVS/Repositories/0004fb0000030000aa8563ec6175dcfb/VirtualDisks/0004fb000012000095516dd08c3b253f.img,hda,w', 'file:/OVS/Repositories/0004fb0000030000aa8563ec6175dcfb/ISOs/slampp.iso,xvdb:cdrom,r']

After

disk = ['file:/OVS/Repositories/0004fb0000030000aa8563ec6175dcfb/VirtualDisks/0004fb000012000095516dd08c3b253f.img,hda,w', 'file:/OVS/Repositories/0004fb0000030000aa8563ec6175dcfb/ISOs/slampp.iso,hdc:cdrom,r']

I didn’t upload the iso using OVM managers import option ..Instead i have uploaded the iso file to ISO folder.refreshed repository from Manager..

ISO was reflected in Manager.

Hope this will be helpful for other guys facing similar issue.

———————————————————————————

So you broke lilo. Well done.

Insert your Slackware install DVD or CD1 and boot with defaults.
Once booted:

mkdir /foo
mount /dev/sda1 /foo
mount –bind /proc /foo/proc
mount –bind /sys /foo/sys
mount –bind /dev /foo/dev
chroot /foo
vi /etc/lilo.conf
lilo
exit
reboot

where /dev/sda1 is your installed / partition. Adjust as necessary.

lilo -F -r /mnt/sda2 -b /dev/sda -C /etc/lilo.conf

Strona startowa: www.jaceksen.pl