Format Utility

Hi,
i've done the following, have i destroy the data in my disk?
Please help, thanks for any reply.
format[show list of hard disks]
Specify disk (enter its number): 1
selecting c0t1d0
[disk formatted]
Warning: Current Disk has mounted partitions.
FORMAT MENU:
disk - select a disk
type - select (define) a disk type
partition - select (define) a partition table
current - describe the current disk
format - format and analyze the disk
repair - repair a defective sector
label - write label to the disk
analyze - surface analysis
defect - defect list management
backup - search for backup labels
verify - read and display labels
save - save new disk/partition definitions
inquiry - show vendor, product and revision
volname - set 8-character volume name
!<cmd> - execute <cmd>, then return
quit
format> p
PARTITION MENU:
0 - change `0' partition
1 - change `1' partition
2 - change `2' partition
3 - change `3' partition
4 - change `4' partition
5 - change `5' partition
6 - change `6' partition
7 - change `7' partition
select - select a predefined table
modify - modify a predefined partition table
name - name the current table
print - display the current table
label - write partition map and label to the disk
!<cmd> - execute <cmd>, then return
quit
partition> p
Current partition table (original):
Total disk cylinders available: 4924 + 2 (reserved cylinders)
Part Tag Flag Cylinders Size Blocks
0 unassigned wm 0 0 (0/0/0) 0
1 unassigned wm 0 - 514 903.01MB (515/0/0) 1849365
2 backup wm 0 - 4923 8.43GB (4924/0/0) 17682084
3 unassigned wm 515 - 1099 1.00GB (585/0/0) 2100735
4 unassigned wm 1100 - 1684 1.00GB (585/0/0) 2100735
5 unassigned wm 1685 - 2853 2.00GB (1169/0/0) 4197879
6 unassigned wm 2854 - 3139 501.48MB (286/0/0) 1027026
7 unassigned wm 3140 - 4892 3.00GB (1753/0/0) 6295023
partition> 1
selecting c0t1d0
[disk formatted]

Hi,
SolBetaTester_1, thanks for your reply.
Sorry, i posted the wrong output from screen. Here is the correct one (last few lines).
Did i destroy my disk? [disk formatted] appeared.
Thanks for any reply.
<snip>
Current partition table (original):
Total disk cylinders available: 4924 + 2 (reserved cylinders)
Part Tag Flag Cylinders Size Blocks
0 unassigned wm 0 0 (0/0/0) 0
1 unassigned wm 0 - 514 903.01MB (515/0/0) 1849365
2 backup wm 0 - 4923 8.43GB (4924/0/0) 17682084
3 unassigned wm 515 - 1099 1.00GB (585/0/0) 2100735
4 unassigned wm 1100 - 1684 1.00GB (585/0/0) 2100735
5 unassigned wm 1685 - 2853 2.00GB (1169/0/0) 4197879
6 unassigned wm 2854 - 3139 501.48MB (286/0/0) 1027026
7 unassigned wm 3140 - 4892 3.00GB (1753/0/0) 6295023
partition> quit
format> 2
selecting c0t2d0
[disk formatted]

Similar Messages

  • Format utility unable to select labeled disk

    I have a system running Solaris 10 x86, booted with 64 bit kernel.
    Recently, i decided to add a second hard drive to the system.
    The drive is Seagate ST340014A (40GB ATA drive). I ran format and managed to fdisk, partition & label the disk, but later, i found the partition scheme ineffective and decided to re-partition the disk. Here my troubles have started.
    When i ran format utiltity again, and select the drive number it gave me:
    "selecting c1d0"
    and freezed.
    On the system console and in /var/adm/messages i had the following:
         Apr 17 19:01:20 host.tld.com scsi: WARNING: /pci@0,0/pci-ide@f,1/ide@1 (ata5):
         Apr 17 19:01:20 host.tld.com timeout: abort request, target=0 lun=0
         Apr 17 19:01:20 host.tld.com scsi: WARNING: /pci@0,0/pci-ide@f,1/ide@1 (ata5):
         Apr 17 19:01:20 host.tld.com timeout: abort device, target=0 lun=0
         Apr 17 19:01:20 host.tld.com scsi: WARNING: /pci@0,0/pci-ide@f,1/ide@1 (ata5):
         Apr 17 19:01:20 host.tld.com timeout: reset target, target=0 lun=0
         Apr 17 19:01:20 host.tld.com scsi: WARNING: /pci@0,0/pci-ide@f,1/ide@1 (ata5):
         Apr 17 19:01:20 host.tld.com timeout: reset bus, target=0 lun=0
         Apr 17 19:01:20 host.tld.com gda: WARNING: /pci@0,0/pci-ide@f,1/ide@1/cmdk@0,0 (Disk4):
         Apr 17 19:01:20 host.tld.com Error for command '<undecoded cmd>' Error Level: Informational
         Apr 17 19:01:20 host.tld.com gda: Requested Block 8065, Error Block: -27779
         Apr 17 19:01:20 host.tld.com gda: Sense Key: aborted command
         Apr 17 19:01:20 host.tld.com gda: Vendor 'Gen-ATA ' error code: 0x3
         Apr 17 19:01:20 host.tld.com genunix: ata_disk_iosetup: byte count zero
    This set of messages was repeated on a regular time intervals.
    The format utility neither exited nor seleted the disk. I had to kill -9 it several times in order to stop it.
    I have created the filesystems on the drive, without problems and i can use it, but i can't re-partition it :(
    Could someone point me to the root of the problem and/or its decision ?
    Thanks in advance!

    i'm encountering exactly the same problem.
    One question : How does your partition table looks like ?

  • Format utility in Solaris 10

    During the preparation of my SCSA exam I found the folowing:
    Place each format utility by the right function
    Updates the disks VTOC ---- Partition
    Reads and displays labels ---- Disk
    Allows you to select a new disk ---- Label
    Saves disk and slice information to a file ---- Save
    Alters size slices ---- Fomat
    Formats and analyzes the disk ---- Verify
    My answers are:
    Updates the disks VTOC --> Label
    Reads and displays labels --> Verify
    Allows you to select a new disk --> Disk
    Saves disk and slice information to a file --> Save
    Alters size slices --> Partition
    Formats and analyzes the disk --> Format
    But the answers in the course are:
    Updates the disks VTOC --> Save
    Reads and displays labels --> Label
    Allows you to select a new disk --> Verify
    Saves disk and slice information to a file --> Format
    Alters size slices --> Partition
    Formats and analyzes the disk --> Disk
    So can someone tell me what the real answers are because I don't know it anymore. ;-)

    I would say your answers are correct:
    FORMAT MENU:
    disk - select a disk
    type - select (define) a disk type
    partition - select (define) a partition table
    current - describe the current disk
    format - format and analyze the disk
    fdisk - run the fdisk program
    repair - repair a defective sector
    label - write label to the disk
    analyze - surface analysis
    defect - defect list management
    backup - search for backup labels
    verify - read and display labels
    save - save new disk/partition definitions
    inquiry - show vendor, product and revision
    volname - set 8-character volume name
    !<cmd> - execute <cmd>, then return
    quit
    format>
    Your instructor agrees with the answers in the course???

  • Format Utility not detecting the external HardDrive

    Hi,
    I have got a new WesternD 1TB hardDrive.
    I am trying to add it to my unix box but I have some problems.
    I can do fdisk and set 10% of it as Solaris2:
    # fdisk /dev/rdsk/c2t0d0p0
    Cylinders
    Partition Status Type Start End Length %
    ========= ====== ============ ===== === ====== ===
    1 Active Solaris2 1 6080 6080 10
    2 DOS-BIG 6081 12160 6080 10
    Still when I run the "format" utility I don't see the Drive.
    I need to know how can I slice the fdisk partition as just trying to mount the fdisk partition is failing with:
    # mount /dev/dsk/c2t0d0p1 /mount-part1/
    mount: /dev/dsk/c2t0d0p1 is not this fstype
    Even-though I have specifiied in the fdisk the partition to be of type SOLARIS2 or UNIX.
    Thanks,
    JavaMoh

    Hi Everyone,
    I have found the solution, we should use rmformat instead of format to partition removable media.
    JavaMoh.

  • R100 low level format utility

    Hi all, I think I got a problem with my R100 hard drive. I cannot high level format by some reasons, bad sectors I guess. So, I'm trying to find a solution and I guess the low level format could be a solution for this. But, I couldn't find a utility for low level format. So, is there any utility I can do low level format R100 Hard?
    Thanks in advance

    Hi,
    You don't wanna low-level format anything these days! All current hard drives won't even let you. I had a problem with bad sectors and metallic noises from my drive last month and I tried to fix it with utilities like "spinrite" and a myriad of other software without success. I used spinrite to rebuild the hd. It took three(!!!) days! The drive then worked for a couple of hours before it developed new read errors. This symptom means that there are un-recoverable errors on the drive and you want to buy a new one.
    If you have warranty left, RMA it, otherwise go and buy a new drive. In Sweden the HD was incredibly expensive, about $400 (ridiculus, right!!). I had to buy this drive: http://www.sarotech.com/english/cgi/pd.cgi?cmd=view&rno=5
    for $260 and grab the hd from the casing.
    The Toshiba part# for the 40gb hd is: MK4004GAH
    Search for it. Here's one link: http://www.span.com/catalog/product_info.php?cPath=23_504&products_id=3149
    Also, read some more about low-level formatting and try out spinrite here: www.spinrite.com

  • Raid manager and format utility inconsistency

    Hi,
    I have two A1000 module attached to Sun Fire 280 R with X6541A through both channels. Here is raidutil info for (c3t4d0 and c4t8d0)
    # raidutil -c c3t4d0 -i
    LUNs found on c3t4d0.
    LUN 0 RAID 3 381620 MB
    Vendor ID Symbios
    ProductID StorEDGE A1000
    Product Revision 0301
    Boot Level 03.01.02.33
    Boot Level Date 06/16/99
    Firmware Level 03.01.02.35
    Firmware Date 08/12/99
    raidutil succeeded
    # raidutil -c c4t8d0 -i
    LUNs found on c4t8d0.
    LUN 0 RAID 5 172345 MB
    Vendor ID Symbios
    ProductID StorEDGE A1000
    Product Revision 0205
    Boot Level 03.01.04.00
    Boot Level Date 04/05/01
    Firmware Level 03.01.04.68
    Firmware Date 06/22/01
    raidutil succeeded!
    # lad
    c3t4d0 1T04469376 LUNS: 0
    c4t8d0 1T03843281 LUNS: 0
    Those output actually reflecting the settings,
    But what format command gave me is inconsistent with raid manager:
    AVAILABLE DISK SELECTIONS:
    0. c1t0d0 <SUN36G cyl 24620 alt 2 hd 27 sec 107>
    /pci&#64;8,600000/SUNW,qlc&#64;4/fp&#64;0,0/ssd&#64;w21000004cf092afe,0
    1. c1t1d0 <SUN36G cyl 24620 alt 2 hd 27 sec 107>
    /pci&#64;8,600000/SUNW,qlc&#64;4/fp&#64;0,0/ssd&#64;w2100002037cd9c32,0
    2. c3t4d0 <Symbios-StorEDGEA1000-0205 cyl 43084 alt 2 hd 128 sec 64>
    /pseudo/rdnexus&#64;3/rdriver&#64;4,0
    Select 2 -->partition-->print
    Part Tag Flag Cylinders Size Blocks
    0 root wm 0 - 43083 168.30GB (43084/0/0) 352944128
    1 swap wu 0 0 (0/0/0) 0
    2 backup wu 0 - 43083 168.30GB (43084/0/0) 352944128
    so in format, c3t4d0 is actually reflecting c4t8d0
    Anyone can give me a hint,
    Thanks,
    Wei

    Yeah, you probably want to go through rebuilding the device paths. This amounts to removing everything in /dev/osa/dev/dsk, /dev/osa/dev/rdsk, and /devices/pseudo/rdnexus. Then performing
    a reconfiguration boot.
    If you're uncomfortable with this, open a service call, or look for
    the string hot_add, under Infodocs and Symptoms and Resolutions in the Sunsolve search engine.
    Another string is "Syncing lad and format".
    Good luck!

  • Portege M200 - SD Format Utility and Boot utility won't work

    I can't get either the SD format or the boot utilities to work. Neither of them see the SD card which is a new Panasonic 256MB one. I've uninstalled the utilities and SD drivers and reinstalled them (in the correct order, as far as I can tell) but to no avail.
    Has any one any suggestions as to why these won't work?

    Smart Card services are not set to automatic but I've resolved the problem in any event. It turns out that the SD host controller driver was incorrect. I had obviously updated it at some stage and that resulted in a Microsoft driver being installed instead of the Toshiba one. Once I installed the correct Toshiba driver and reinstalled the format and boot utilities evrything is now working properly.
    But thanks for your suggestion.

  • How can I format an SD card on my mac?  I have tried the erase thing but when I put the card into my 35mm camera it says that the card has to be formatted.

    I just purchased two new SanDisk 8gb SD cards for my trail cameras.  When I put the cards into the trail cameras, the cameras will take pictures but it won't store them on the cards.  When I put the cards into my 35mm camera the camera tells me that the cards need to be formatted.  I have went through the steps in the disk utilities and erased the cards, which I assume is the same as formatting them??  I have tried this for hours and have had no luck getting these things to work at all.  It was awful disgusting when I checked my two trail cameras the first time and found out that they had taken close to 75 pictures but the cards were empty.  When I bought my 35mm camera several years ago, I bought a couple of Kodak SD cards and used them right out of the package and never had to do any of this formatting thing.  I don't understand what is going on and could sure use some help with this.  Thanks for any information anyone can give me with this problem.  I would love to have seen what animals set my cameras off 75 times in the last few days.  Thanks again.
    Respectully
    Jim

    AFAIK cameras offer their own built-in format utility for inserted SD cards.  You should use that.  Otherwise, refer to the manual that came with your camera to determine precisely how your SD cards need to be formatted to work properly.  Personally, I'd suggest Partition Scheme: MBR, and Filesystem: FAT32.
    Try to limit the number of formats you perform on the SD cards, though, as you're reducing their lifespan.  I believe formatting causes re-writes to a portion of the SD card that has fewer read/write cycles than the rest of the card as a whole.

  • How to format an external drive as FAT32?

    Hi. In 10.4, you used to be able to format drives as FAT32. Seems 10.5 has lost this ability. I need to format a drive in order to recover some lost data from a nearly dead PC. Unfortunately, the PC cannot do the formatting so the only "live" computer I have is my Mac. If this cannot be done in 10.5, is there an external utility that can do this for me?
    Thanks!
    p.s I've got Parallels and XP2, but it won't recognize my Lacie USB drive when I plug it in, perhaps because it's formatted for Mac.

    I take it then that you don't have XP running natively either on your Mac.
    Leopard has made changes so that sometimes a FW or USB2 drive won't mount or show up, which often means that new OS X requires a firmware update for the bridge it uses - Oxford or some other - and the vendor needs updated firmware.
    That leads to a 'catch-22' situation.
    If you boot from a DVD (Tiger or Leopard) same problem? FAT (or MSDOS) has always worked here, any size, even mixed.
    If you do get it to mount, I would go to Partition tab in DU, then Options... and change it to Master Boot Record.
    I know you want FAT, but just to see if it helps, you could try the NTFS driver MacFUSE 3G to see if it helps any (it can format to NTFS if the drive is using MBR).
    Try plugging in the USB drive after the system is booted if you haven't yet. IntechUSA Speedtools has a PC Format utility, but I don't think it really adds anything and costs as much as a new drive would, which is always one option.
    http://www.macsales.com/firewire - never had any trouble with these.

  • DIsk Utility will not recognize my drive to erase.

    Hello,
    I am trying to erase my hard drive to install a new OS. I will be installing either OS 8.6 onto the 12 GIG ATA internal hard drive - the original hard drive.
    I am using an OS 10.1 installer CD.
    (I thought that DIsk Utility would be a better hard drive formatting utility than OS 8's drive setup utility.)
    I first started up from the OS 10.1 installer CD and it first takes me through a few basic questions about the language (I chose English) and then a licencing question and I clicked agree. When it asks me which volume I would like to choose, both of my hard drives are shown but they are greyed-out (dimmed). When I hover over them with the mouse pointer, a small message appears to the left that says something like:
    "This hard drive is dimmed because the CD installs all the languages"
    This doesn't seem to make any sense. I was booted form the CD.
    Why can I not use this installer to erase my hard drive?
    This is a retail version of OSX with a white label. It came with two disks: OS9 and 10.1. The symptoms described above happened with the 10.1 disk. Next I will try OS 9. However I would like to know why my DIsk Utility on the OS 10.1 CD didn't show my drive as available. Any suggestions why the hard dirves were grayed out?
    Thanks

    Thanks Lau for you comments.
    I need to install os8 because I need to run some old apps and I am using my os 9 for another computer I have.
    By the way, the HFS+ file system was suuported from OS 8.1 and after and so that is not an issue. Good idea though.
    And so I am back at my original question. It would appear that my OS X install disk doesn't like my blue and white G3's internal 12 GIG ATA drive and so I cannot format it with OSX Disk Utility. I would like to know why but for now I will just use OS 9 or OS8 drive setup. And so I have two choices: OS9 drive setup or OS8.5 Drive setup. Does it matter which I use? In other words is one better than the other? I will be later installing OS 8.6 onto this drive - and maybe OS 9 in the far future. I will try OS9's drive setup first.
    Yes, and so this is my most immediate question at this point:
    is there a difference between OS8.5 drive setup and OS9's Drive setup? (in terms or formatting a drive to install OS 8, 9 or even X maybe one day?) I will be using HFS+.
    And then my second question is my original question which is why doesn't my OS 10.1.5 Disk Utility select my 12 GIG ATA drive? (its greyed out - dimmed?)
    Thanks

  • Formatting a CF Card?

    I have a 16 GB CF card that has developed some "bad spots" internally. That is, I can't transfer files to or from it reliably. Finder reports data integrity errors either in the files themselves or in the catalog file whenever I use the card.
    I'd like to format the card with a low-level formatter (NOT just initialize it) but I can't seem to find any vendor selling such a product.
    I have a variety of hardware devices and computers so I don't want to limit your response by listing a particular configuration. My only strict requirement is Mac OS 9.2.2.
    Please make a recommendation.
    Gary

    How does the card reader connect - USB, or firewire?
    I have both types.
    One of the problems is that OS 9's Drive Setup can not format a volume that >connects via firewire or USB. You can do a simple erase of such a volume via the >Erase function in Finder's Special mune, but this does nothing as far as being >able to do things like a low-level wipe and format.
    Too TRUE!!!
    Third-party formatting utilities that run in OS 9 are difficult to find these >days. One that had lots of capabilities was FWB's Hammer (later replaced, I >believe, by HardDisk ToolKit and Partition ToolKit) - but I haven't been able to >find those for a long time.
    I have the last OS 9 version of HD SpeedTools. Are you referring to something else here?
    It is possible that the OS 9 version of LaCie's SilverLining can do it - I've >never used that utility, nor know if it is still available.
    I have a copy of SilverLining. I'll give it a try.
    If the card reader connects via firewire, it is possible that a firewire drive >formatting utility can do it. One such is an old one from VST Technologies, >which I still use with firewire drives. You can download it from here -
    VST Format 2.3.1
    I didn't know about that one. Thanks for the reference.
    Gary

  • Dvd+rw-format & growisofs

    Gday folks,
    Im having some dramas with burning to a DVDRW.
    growisofs -Z /dev/scd0 -r -J /home/fukawi1/asdf
    Works fine with a DVDR, or virgin DVDRW.
    The trouble comes in with:
    $ dvd+rw-format -blank /dev/scd0
    * BD/DVD±RW/-RAM format utility by <[email protected]>, version 7.1.
    * 4.7GB DVD-RW media in Sequential mode detected.
    * blanking 99.8%
    This never actually reaches 100%, sometimes stops at 20-30%, often 98-99.9%, and then growisofs gives me:
    :-[ WRITE@LBA=0h failed with SK=5h/ILLEGAL MODE FOR THIS TRACK]: Input/output error
    :-( attempt to re-run with -dvd-compat -dvd-compat to engage DAO or apply full blanking procedure
    :-( write failed: Input/output error
    using -dvd-compat as the output suggested provides, the same error.
    Google tells me it appears to be a generic error that isnt particularly helpful...
    Thanks in advance
    fukawi1
    Last edited by fukawi1 (2009-04-04 05:36:50)

    Hi! You're wasting your time trying to make a dvd as the startup disk. The minimum install for 10.3 Panther was about 6 gigs and the regular install for 10.5 takes up about 12 gigs so using even a double layer dvd won't work. It was possible in 10.3 but it took several minutes to load the system and the performance was terrible. What kind of machine are you using and what kind of install disc are you trying to install from? Complete the install process?....not sure what you're trying to say there. Tom

  • UTL FILE OUTPUT FILE FORMAT ISSUE ON ORACLE 11G

    how to format util file output align with column value with proper format.
    set serveroutput on
    DECLARE
       CURSOR h1
       IS
       select  'TOTAL_ACCOUNT_REJECTS' as TOTAL_ACCOUNT_REJECTS   ,
         'PC' as  PC ,
          'RT' as  RT,
          'SERIAL' as  SERIAL
          from dual;
       --    l_app_nm              := RTRIM( TRIM( l_line ), CHR(13) );
       CURSOR c1
       IS
      SELECT
      company  ,
    user,
    app,
    account
            FROM account_auth
           WHERE ROWNUM < = 5;
       lc_file_handle        UTL_FILE.file_type;
       lc_file_dir           VARCHAR2 (100);
       lc_file_name          VARCHAR2 (50);
       gov_005_payment_rec   VARCHAR2 (1000);
    BEGIN
       lc_file_dir := 'OUTB';
       lc_file_name := 'test.txt';
       lc_file_handle := UTL_FILE.fopen (lc_file_dir, lc_file_name, 'W',1024);
      FOR i IN h1
       LOOP
          gov_005_payment_rec :=
                i.TOTAL_ACCOUNT_REJECTS
             ||' '
             || i.PC
             || ' '
             || i.RT
             || ' '
             || i.SERIAL;
          UTL_FILE.put_line (lc_file_handle, gov_005_payment_rec);
       END LOOP;
       FOR i IN c1
       LOOP
          gov_005_payment_rec :=
                 i.company
             ||' '
             || i.user
             ||' '
             || i.app
             ||' '
             || i.account;
          UTL_FILE.put_line (lc_file_handle, gov_005_payment_rec);
       END LOOP;
    EXCEPTION
    WHEN UTL_FILE.INVALID_PATH        THEN DBMS_OUTPUT.PUT_LINE('Invalid
    path!');
      WHEN UTL_FILE.INVALID_MODE        THEN DBMS_OUTPUT.PUT_LINE('Invalid
    mode!');
      WHEN UTL_FILE.INVALID_OPERATION   THEN DBMS_OUTPUT.PUT_LINE('Invalid
    operation!');
      WHEN OTHERS
    RAISE;
    END ;
    OUTPUT :  issue with file format
    TOTAL_ACCOUNT_REJECTS PC RT SERIAL
    &&&&&846  000000000000 APPLICATION123 20570
    &&&&284  000000000000 APPLICATION133 20570
    &&&2&&846  000000000000 APPLICATION163 20570
    EXPECTED output   ==> please advise me , how to create proper formatted output file using utl_file?  thanks in advance.
    TOTAL_ACCOUNT_REJECTS      PC                         RT                            SERIAL
    &&&&&846                                 000000000000        APPLICATION123       20570
    &&&&284                                  000000000000         APPLICATION133       20570
    &&&2&&846                              000000000000         APPLICATION163       20570

    Example of creating a fixed width format file for a dynamically provided query, using the DBMS_SQL package...
    As SYS user:
    CREATE OR REPLACE DIRECTORY TEST_DIR AS '\tmp\myfiles'
    GRANT READ, WRITE ON DIRECTORY TEST_DIR TO myuser
    As myuser:
    CREATE OR REPLACE PROCEDURE run_query(p_sql IN VARCHAR2
                                         ,p_dir IN VARCHAR2
                                         ,p_header_file IN VARCHAR2
                                         ,p_data_file IN VARCHAR2 := NULL) IS
      v_finaltxt  VARCHAR2(4000);
      v_v_val     VARCHAR2(4000);
      v_n_val     NUMBER;
      v_d_val     DATE;
      v_ret       NUMBER;
      c           NUMBER;
      d           NUMBER;
      col_cnt     INTEGER;
      f           BOOLEAN;
      rec_tab     DBMS_SQL.DESC_TAB;
      col_num     NUMBER;
      v_fh        UTL_FILE.FILE_TYPE;
      v_samefile  BOOLEAN := (NVL(p_data_file,p_header_file) = p_header_file);
    BEGIN
      c := DBMS_SQL.OPEN_CURSOR;
      DBMS_SQL.PARSE(c, p_sql, DBMS_SQL.NATIVE);
      d := DBMS_SQL.EXECUTE(c);
      DBMS_SQL.DESCRIBE_COLUMNS(c, col_cnt, rec_tab);
      FOR j in 1..col_cnt
      LOOP
        CASE rec_tab(j).col_type
          WHEN 1 THEN DBMS_SQL.DEFINE_COLUMN(c,j,v_v_val,2000);
          WHEN 2 THEN DBMS_SQL.DEFINE_COLUMN(c,j,v_n_val);
          WHEN 12 THEN DBMS_SQL.DEFINE_COLUMN(c,j,v_d_val);
        ELSE
          DBMS_SQL.DEFINE_COLUMN(c,j,v_v_val,2000);
        END CASE;
      END LOOP;
      -- This part outputs the HEADER
      v_fh := UTL_FILE.FOPEN(upper(p_dir),p_header_file,'w',32767);
      FOR j in 1..col_cnt
      LOOP
        CASE rec_tab(j).col_type
          WHEN 1 THEN v_finaltxt := v_finaltxt||rpad(lower(rec_tab(j).col_name),rec_tab(j).col_max_len,' ');
          WHEN 2 THEN v_finaltxt := v_finaltxt||rpad(lower(rec_tab(j).col_name),rec_tab(j).col_max_len,' ');
          WHEN 12 THEN v_finaltxt := v_finaltxt||rpad(lower(rec_tab(j).col_name),greatest(19,length(rec_tab(j).col_name)),' ');
        END CASE;
      END LOOP;
      UTL_FILE.PUT_LINE(v_fh, v_finaltxt);
      IF NOT v_samefile THEN
        UTL_FILE.FCLOSE(v_fh);
      END IF;
      -- This part outputs the DATA
      IF NOT v_samefile THEN
        v_fh := UTL_FILE.FOPEN(upper(p_dir),p_data_file,'w',32767);
      END IF;
      LOOP
        v_ret := DBMS_SQL.FETCH_ROWS(c);
        EXIT WHEN v_ret = 0;
        v_finaltxt := NULL;
        FOR j in 1..col_cnt
        LOOP
          CASE rec_tab(j).col_type
            WHEN 1 THEN DBMS_SQL.COLUMN_VALUE(c,j,v_v_val);
                        v_finaltxt := v_finaltxt||rpad(nvl(v_v_val,' '),rec_tab(j).col_max_len,' ');
            WHEN 2 THEN DBMS_SQL.COLUMN_VALUE(c,j,v_n_val);
                        v_finaltxt := v_finaltxt||rpad(nvl(to_char(v_n_val,'fm99999999999999999999999999999999999999'),' '),rec_tab(j).col_max_len,' ');
            WHEN 12 THEN DBMS_SQL.COLUMN_VALUE(c,j,v_d_val);
                        v_finaltxt := v_finaltxt||rpad(nvl(to_char(v_d_val,'DD/MM/YYYY HH24:MI:SS'),' '),greatest(19,length(rec_tab(j).col_name)),' ');
          END CASE;
        END LOOP;
        UTL_FILE.PUT_LINE(v_fh, v_finaltxt);
      END LOOP;
      UTL_FILE.FCLOSE(v_fh);
      DBMS_SQL.CLOSE_CURSOR(c);
    END;
    This allows for the header row and the data to be written to seperate files if required.
    e.g.
    SQL> exec run_query('select * from emp','TEST_DIR','output.txt');
    PL/SQL procedure successfully completed.
    Output.csv file contains:
    empno                 ename     job      mgr                   hiredate           sal                   comm                  deptno               
    7369                  SMITH     CLERK    7902                  17/12/1980 00:00:00800                                         20                   
    7499                  ALLEN     SALESMAN 7698                  20/02/1981 00:00:001600                  300                   30                   
    7521                  WARD      SALESMAN 7698                  22/02/1981 00:00:001250                  500                   30                   
    7566                  JONES     MANAGER  7839                  02/04/1981 00:00:002975                                        20                   
    7654                  MARTIN    SALESMAN 7698                  28/09/1981 00:00:001250                  1400                  30                   
    7698                  BLAKE     MANAGER  7839                  01/05/1981 00:00:002850                                        30                   
    7782                  CLARK     MANAGER  7839                  09/06/1981 00:00:002450                                        10                   
    7788                  SCOTT     ANALYST  7566                  19/04/1987 00:00:003000                                        20                   
    7839                  KING      PRESIDENT                      17/11/1981 00:00:005000                                        10                   
    7844                  TURNER    SALESMAN 7698                  08/09/1981 00:00:001500                  0                     30                   
    7876                  ADAMS     CLERK    7788                  23/05/1987 00:00:001100                                        20                   
    7900                  JAMES     CLERK    7698                  03/12/1981 00:00:00950                                         30                   
    7902                  FORD      ANALYST  7566                  03/12/1981 00:00:003000                                        20                   
    7934                  MILLER    CLERK    7782                  23/01/1982 00:00:001300                                        10                   
    The procedure allows for the header and data to go to seperate files if required.  Just specifying the "header" filename will put the header and data in the one file.
    Adapt to output different datatypes and styles are required (this is currently coded for VARCHAR2, NUMBER and DATE)

  • Trying to format a PC drive

    having a hard time with this one particular drive, even though I have successfully formatted external drives in FAT32 before.
    When I look at this drive in disk utility - it gives me two levels (as usual)
    top level - Mac OS extended journaled
    bottom level - FAT32
    how can I change the top level so that it's either FAT32 or NTFS?
    no matter what I try (in disk util) the top level is always Mac OS.
    I can not read this drive in any PC or linux OS machine that I have tried, it only mounts and shows up on my Mac Pro.
    any suggestions? Is there another formatting utility beyond disk util?
    thanks!
    w

    NTFS is generally only supported in read/only mode on Macs. Two packages offer NTFS support on Macs:
    http://code.google.com/p/macfuse/
    http://www.paragon-software.com/home/ntfs-mac/
    FAT32 formatting on the Mac is done this way:
    http://www.macosxhints.com/article.php?story=20030613121738812
    Of course you can also use MediaFour's MacDrive to read Mac formatted drives on PCs:
    http://www.mediafour.com/
    Or network your Mac's hard drive to a PC using one of these methods while it is hooked up to your Mac:
    http://support.apple.com/kb/HT2959?viewlocale=en_US
    The advantage of Mac formatted hard drives, is that they will boot Macs, and maintain the necessary metadata to keep Mac compatible applications together.
    If your drive is primarily for using Windows and Linux applications that may be when you want alternative formatting.

  • Backup and Restore image fails 3TB Advanced Format Drive Windows 7-32 SP1

    Windows native backp fails to create an System Image, or a Complete PC Backup.
    This occurs in Windows 7, 64 bit Professional, Windows 7, 32bit Ultimate, Windows Vista Business, 32 bit. It occurs in 6 different computers I've tried. All the backup drives are 3TB. I have tried Seagte USB and Hitachi USB drives. 4 of them. The Windows
    7 Ultimate, 32bit machine has SP1. All operating systems are using the current Service Packs, and all of the MS Updates including all of the recommended harware drivers. All of the systems are using the latest BIOS, firmware and OEM drivers as well.
    It looks like the issue may be causes by a deficiency in Windows related to the Advanced Format drive spec. All of the computers that qualified had the AF hotfix applied; Advanced Format Drives 512e 4k, Vista
    and 2008 - KB2470478, Windows 7, and 2008 R2 KB982018
    Error messages follow:
    The Backup Failed.
    Error message: One of the backup files could not be created. (0x8078002A)
    The request could not be perfomed because of an I/O error. (0x8007045D)
    This deficiency seems to apply across the board to different hardware manufacturers of external hard drives.
    From what I have heard, Western Digital may have a format utility that addresses this issue, but only for WD drives.
    Help.

    Hi David,
    Did you have found any error message?
    Check if all the files have been created on the hard drive.
    Check the Volume shadow copy service in services window. To check follow these steps:
    i.                   
    Click Start and type services.msc in the search box
    ii.                 
    Search for the Volume shadow copy service
    Make sure the start- up type is automatic.  Steps to set the services to automatic
    i.                   
    Search for the service
    ii.                 
    Right click on the service
    iii.               
    If the service is stopped then Start the service
    iv.                
    Select Properties
    v.                  
    And in the Start-up type select Automatic
     This is the most definitive answer I can find so am taking this as the answer.
    http://social.technet.microsoft.com/Forums/en/windowsbackup/thread/889b01be-d333-4fc7-b005-e12b7b236ad7
    http://social.technet.microsoft.com/Forums/en-US/windowsbackup/thread/444e8ea2-6417-45dc-83d4-f5ae45bbaa02
    Thanks,
    Jeff
    如果您对我们的论坛在线支持服务有任何的意见或建议,请通过邮件告诉我们。
    立刻免费下载 
    TechNet
    论坛好帮手

Maybe you are looking for

  • TRIP Workflow approval issue

    Dear All We have developed custom workflow for TRIP workflow, with single level approval of line manager. We are raising Trip request using Transaction PR05.Workitem goes to line manager for approval in SAP inbox and NWBC (SAP netweaver ) for approva

  • How to add the BexAnalyser as standard radio button to the add-ins?

    HI All, how to add the BexAnalyser as standard radio button to the add-ins. Thanks Vasu

  • Help!  iMac G5 no longer turns on!

    Hey Guys, i hope you're all well on this fine Monday! Over the last week my iMac G5 has been acting a little peculiarly - as in, heading downstairs to make a cup of coffee, only to return to find that it has merrily turned itself off. This was worryi

  • CS6 actions batch saving images to a clipping mask issue

    Hey all, Been at this for quite some while now and searched the www thin for suggestion - so really hope someone can help me out here. Objective: - Target a folder with xxx .gif patterns (in the same size) - Setup actions to batch open each image fro

  • Having Trouble importing? No Video's in Log and Transfer?

    I have video footage's in my HD camera, and I want to import it to Final Cut, so first I got to Easy Setup and set the format to HD and set the ''use'' to HDV 1080i60. Then I open up Log and Transfer and they are no clips. There's just a blank row/li