Avoiding lenghty fsck

our DB version: 11.2
our OS: SLES11
our fs: ext3
My question: with the FRA residing on ext3, how can I avoid lengthy fsck runs on server reboots: even with clean shutdowns, Linux will eventually trigger forced fsck runs after a period of time (see also [Why the ext3 fsck’s after X days or Y mounts?|http://prefetch.net/blog/index.php/2010/04/18/why-the-ext3-fscks-after-x-days-or-y-mounts]).
Turning off this mechanism with tune2fs is not recommended.
Novell recommends using xfs instead of ext3. But would that really help (and xfs, although supported is not tested by Oracle according to MOS)?
With the FRA partition of a size of 2.1 TB, fsck can take up to 30 minutes or more, and this is a long time for the db server to come back to operation.
Of course, ASM comes to mind, but that would be just another slab of complexity in an otherwise simple installation.
Thanks for your opinion or sharing your XFS experience,
Thomas

here we have some further insight to share.
We did an extensive test to see which filesystem to choose for
our Samba shares, and took EXT3, BTRFS und XFS in the boat (all
supported by Novell SLES 11).
Novell's statement is that BTRFS is mainly a boot partition
choice, and recommends XFS for large amount of data.
The - only for testing purposes - setup, very shortly:
10 TB striping RAID on NearLine Disks in Fujitus Eternus,
formatted in a VMFS5 Datastore.
A VM (SLES11 SP2) on ESXi 5.1 (2 vCPU, 1 GB RAM) gets the space
as vdisks, and will format 3 * 3 TB file systems.
*1st test: creating the 3 TB file systems*
Btrfs: a few seconds
Ext3: about 30 minutes
XFS: about 9 minutes
as we create filesystems only once, let's not further look at
that.
*2nd test: fio throughput*
Without going into many fio details (we took 8GB samples, using
128 KB blocksize):
1.) linear read/write
KB/s | Btrfs Ext3 XFS
------+-------------------------------
read | 89.045 83.262 91.740
write | 13.722 198.622 208.947
2.) random read/write
KB/s | Btrfs Ext3 XFS
------+-------------------------------
read | 41.702 28.920 17.548
write | 59.792 128.033 74.353
Btrfs shows some linear writing lazyness, because of its
checksumming. XFS dissappoints with its random read throughput.
*3dr test: find performance*
we tested how quickly a file is found using the find command. For
that, we filled the file systems with about 1.2 TB test data from
production systems (typical shared Samba drives, with office
documents and all that stuff). After each test, we did a reboot
to ensure a clean file system cache.
Btrfs: 2 m 53 s
Ext3: 9 m 58 s
Xfs: 1 m 9 s
Similarly, we queried du Info for each and the whole of the three
file systems:
Btrfs: 8 m 4 s
Ext3: 19 m 35 s
Xfs: 4 m 20 s
We see that Ext3 is not very efficient when it comes to
traversing large file systeme metadata.
*4th test: fsck runtime*
We force a file system check.
It's worth considering the CAVEAT from the btrfsck man page:
"btrfsck is part of btrfs-progs. Btrfs is currently under heavy
development, and not suitable for any uses other than benchmarking
and review. Please refer to the btrfs wiki
http://btrfs.wiki.kernel.org for further details."
Btrfs (command was "time btrfsck ..."): 9 m 6 s
Ext3 (command was "time fsck -f ..."): 72 m 35 s
XFS (command was "time xfs_repair -n ..."): 11 m 18 s
Ext3 is far slower when checking that sizy file systems: might
its checks simply be more exhaustive?
Back to initial topic: "avoiding lenghty fsck". It does not
appear irrelevant which cooke file system we choose. XFS appears
to be a far better choice in terms of fsck run time.
According to MOS 414673.1 (SuSE/Novell: Linux, Filesystem & I/O
Type Supportability), XFS is a supported choice, although there
are some important CAVEATS regarding bugs and taking most recent
versions.
Also, we read
Oracle does not run certifications on local
filesystems (i.e. except for OCFS2, NFS etc.) except ext2/ext3 as
it is the common default filesystem for all Linux
distributions. So if a problem happens specific to XFS, the Linux
vendor should be engaged.
This will bring us back to probably take ASM for Oracle data in
future (currently still using EXT3), and choose XFS for all other
user data.
For user data, we would also like to choose BTRFS, as we would
favour the automatic checksumming, but the status of btrfsck (see
above) alone is enough to hdissuade us from that choice for the
time being.
Comments welcome!
Regards, Thomas

Similar Messages

  • Fsck is stuck

    Hello there,
    My work computer - a dinosaur of and eMac - totally flipped out today.
    First it wouldn't boot up, and was stuck on the grey screen with the apple and spinning gear...forever.
    So I tried to reboot and run the /sbin/fsck -fy as per the recommendation on the apple site. And it seemed to be doing fine until the end. It found and fixed a few files, but seems to be stuck on the "Repairing Volume" part and keeps on printing out "disk 0s9: 0x5 (UNDEFINED)." every 10 minutes or so.
    I'm not really sure what to do. Any suggestions?
    Thanks!

    fsck_hfs, is the FileSystemChecK utility for HFS+ formatted volumes.
    Normally the HFS+ file system Journal is used to clean up any file system metadata inconsistancies after a crash, forced power failure (or forced power off), disk drive cable yanked out, etc...
    However, if the Journal recovery is not satisfactory (or the journal has been disabled), then Mac OS X will run fsck_hfs against the file system, and it will walk every directory tree and look at the metadata for every file in the system (there are millions of them generally), and this takes time. A lot of time.
    Generally speaking if fsck_hfs is running, there is a possibility there is something seriously wrong with the file system.  This may be caused by failing hardware (which could be any hardware, including failing RAM, failing PCI bus controller, SATA controller, or the disk itself), or it could be bad software (such as a 3rd party kernel extension that has corrupted something in a file system buffer before it was written to disk).
    You should let fsck_hfs complete (again it may take hours, which is why Journaled file systems were invented, to avoid the fsck run time).

  • Shared Public folders keep on asking for credentials

    Hello
    My problem is less complex than it might look like, it's just difficult to explain correctly. Now:
    I have multiple computers on my home LAN, with various user accounts, without a HomeGroup. They all share some files, have a "Private" network, Public Folder Sharing enabled and "password protected sharing" disabled.
    So their configuration is identical. 
    These computers are 2 Windows 7 PLK computers, one Windows 8.1 ENU, one Windows 8.1 PLK and finally one 8.1 branded by Lenovo. I'll call them 7, 8EN, 8PL and 8B to avoid lenghty phrases. And now the part that makes no sense at all:
    Here's my problem: Win7 computers can easily access Win8 shares. It works both ways: all Win8 computers can access the Win7 shares. But... 8EN cannot access the 8B shares without asking for credentials (?!). Those are the same files that are being accessed
    with no problem by any Win7 or even WinXP machines. I can't share anything in 8 without making other 8's ask for credentials(but 7 works). Moreover - I can provide a random string as a username and no password and I'll get the access to the Public folders.
    So the access is there, but I have to provide any credentials to reach it. Without it, the first try is rejected. It's clearly wrong.
    HomeGroup helps. But I don't want a HomeGroup, I switch places often, HG annoys me and finally - I don't want to sound rude but "a proper way is to use a HomeGroup" is not an answer to "why did the sharing between my 8's stopped working while
    nobody else seem to have such problems with their 8's, and 7's work fine".
    What on earth could possibly make it happen? I reinstalled my Windows 8 and they still cannot communicate with other 8's? Is it the language? but the PLK is just a language pack, the insides are still ENU.
    Thank you for any help and have a nice day!

    Hi,
    Please make sure they are all in same network.
    Then check if everyone computer you also turn on below two settings marked as red:
    Don't remember to click Save changes button.
    Karen Hu
    TechNet Community Support

  • My MacBook Pro is stuck at executing fsck_hfs version hfs-226.1.1

    My Mac will not start up. It was working fine until I tried to start it this morning and it got stuck at the gray screen with the wheel spinning forever. Tried to do a safe boot, but it ends at executing fsck_hfs (version-226.1.1).
    Any thoughts?

    fsck_hfs, is the FileSystemChecK utility for HFS+ formatted volumes.
    Normally the HFS+ file system Journal is used to clean up any file system metadata inconsistancies after a crash, forced power failure (or forced power off), disk drive cable yanked out, etc...
    However, if the Journal recovery is not satisfactory (or the journal has been disabled), then Mac OS X will run fsck_hfs against the file system, and it will walk every directory tree and look at the metadata for every file in the system (there are millions of them generally), and this takes time. A lot of time.
    Generally speaking if fsck_hfs is running, there is a possibility there is something seriously wrong with the file system.  This may be caused by failing hardware (which could be any hardware, including failing RAM, failing PCI bus controller, SATA controller, or the disk itself), or it could be bad software (such as a 3rd party kernel extension that has corrupted something in a file system buffer before it was written to disk).
    You should let fsck_hfs complete (again it may take hours, which is why Journaled file systems were invented, to avoid the fsck run time).

  • A way to avoid a lenghty conversion in iMovie & then another in iDVD?

    When creating a DVD from iMovie, it takes a long time (converting from DV to Apple Intermediate Codec ?); later, before burning, iDVD takes another long time to convert to MPEG2. Is there a way to perform just one lengthy conversion instead of 2? May be using a Reference Movie instead of a Self-contained one?

    Welcome to Apple discussions!
    Is there a way to perform just one lengthy conversion instead of 2?
    For DV I use iMovie 06 with iDVD 11. There is no conversion.
    Your workflow is editing DV clips and making DVDs, iMovie '06 is better suited. Your movie will arrive at iDVD already in DV format, which is an ideal match for making a DVD: same resolution, same pixels, aspect ratio, and original quality.

  • Systemd-fsck complains that my hardware raid is in use and fail init

    Hi all,
    I have a hardware raid of two sdd drives. It seems to be properly recongnized everywhere and I can mount it manually and use it without any problem. The issue is that when I add it to the /etc/fstab My system do not start anymore cleanly.
    I get the following error( part of the journalctl messages) :
    Jan 12 17:16:21 biophys02.phys.tut.fi systemd[1]: Found device /dev/md126p1.
    Jan 12 17:16:21 biophys02.phys.tut.fi systemd[1]: Starting File System Check on /dev/md126p1...
    Jan 12 17:16:21 biophys02.phys.tut.fi systemd-fsck[523]: /dev/md126p1 is in use. <--------------------- THIS ERROR
    Jan 12 17:16:21 biophys02.phys.tut.fi systemd-fsck[523]: e2fsck: Cannot continue, aborting.<----------- THIS ERROR
    Jan 12 17:16:21 biophys02.phys.tut.fi systemd-fsck[523]: fsck failed with error code 8.
    Jan 12 17:16:21 biophys02.phys.tut.fi systemd-fsck[523]: Ignoring error.
    Jan 12 17:16:22 biophys02.phys.tut.fi systemd[1]: Started File System Check on /dev/md126p1.
    Jan 12 17:16:22 biophys02.phys.tut.fi systemd[1]: Mounting /home1...
    Jan 12 17:16:22 biophys02.phys.tut.fi mount[530]: mount: /dev/md126p1 is already mounted or /home1 busy
    Jan 12 17:16:22 biophys02.phys.tut.fi systemd[1]: home1.mount mount process exited, code=exited status=32
    Jan 12 17:16:22 biophys02.phys.tut.fi systemd[1]: Failed to mount /home1.
    Jan 12 17:16:22 biophys02.phys.tut.fi systemd[1]: Dependency failed for Local File Systems.
    Does anybody undersand what is going on. Who is mounting the  /dev/md126p1 previous the systemd-fsck. This is my /etc/fstab:
    # /etc/fstab: static file system information
    # <file system> <dir> <type> <options> <dump> <pass>
    # /dev/sda1
    UUID=4d9f4374-fe4e-4606-8ee9-53bc410b74b9 / ext4 rw,relatime,data=ordered 0 1
    #home raid 0
    /dev/md126p1 /home1 ext4 rw,relatime,data=ordered 0 1
    The issue is that after the error I'm droped to the emergency mode console and just pressing cantrol+D to continues boots the system and the mount point seems okay. This is the output of 'system show home1.mount':
    Id=home1.mount
    Names=home1.mount
    Requires=systemd-journald.socket [email protected] -.mount
    Wants=local-fs-pre.target
    BindsTo=dev-md126p1.device
    RequiredBy=local-fs.target
    WantedBy=dev-md126p1.device
    Conflicts=umount.target
    Before=umount.target local-fs.target
    After=local-fs-pre.target systemd-journald.socket dev-md126p1.device [email protected] -.mount
    Description=/home1
    LoadState=loaded
    ActiveState=active
    SubState=mounted
    FragmentPath=/run/systemd/generator/home1.mount
    SourcePath=/etc/fstab
    InactiveExitTimestamp=Sat, 2013-01-12 17:18:27 EET
    InactiveExitTimestampMonotonic=130570087
    ActiveEnterTimestamp=Sat, 2013-01-12 17:18:27 EET
    ActiveEnterTimestampMonotonic=130631572
    ActiveExitTimestampMonotonic=0
    InactiveEnterTimestamp=Sat, 2013-01-12 17:16:22 EET
    InactiveEnterTimestampMonotonic=4976341
    CanStart=yes
    CanStop=yes
    CanReload=yes
    CanIsolate=no
    StopWhenUnneeded=no
    RefuseManualStart=no
    RefuseManualStop=no
    AllowIsolate=no
    DefaultDependencies=no
    OnFailureIsolate=no
    IgnoreOnIsolate=yes
    IgnoreOnSnapshot=no
    DefaultControlGroup=name=systemd:/system/home1.mount
    ControlGroup=cpu:/system/home1.mount name=systemd:/system/home1.mount
    NeedDaemonReload=no
    JobTimeoutUSec=0
    ConditionTimestamp=Sat, 2013-01-12 17:18:27 EET
    ConditionTimestampMonotonic=130543582
    ConditionResult=yes
    Where=/home1
    What=/dev/md126p1
    Options=rw,relatime,rw,stripe=64,data=ordered
    Type=ext4
    TimeoutUSec=1min 30s
    ExecMount={ path=/bin/mount ; argv[]=/bin/mount /dev/md126p1 /home1 -t ext4 -o rw,relatime,data=ordered ; ignore_errors=no ; start_time=[Sat, 2013-01-12 17:18:27 EET] ; stop_time=[Sat, 2013-
    ControlPID=0
    DirectoryMode=0755
    Result=success
    UMask=0022
    LimitCPU=18446744073709551615
    LimitFSIZE=18446744073709551615
    LimitDATA=18446744073709551615
    LimitSTACK=18446744073709551615
    LimitCORE=18446744073709551615
    LimitRSS=18446744073709551615
    LimitNOFILE=4096
    LimitAS=18446744073709551615
    LimitNPROC=1031306
    LimitMEMLOCK=65536
    LimitLOCKS=18446744073709551615
    LimitSIGPENDING=1031306
    LimitMSGQUEUE=819200
    LimitNICE=0
    LimitRTPRIO=0
    LimitRTTIME=18446744073709551615
    OOMScoreAdjust=0
    Nice=0
    IOScheduling=0
    CPUSchedulingPolicy=0
    CPUSchedulingPriority=0
    TimerSlackNSec=50000
    CPUSchedulingResetOnFork=no
    NonBlocking=no
    StandardInput=null
    StandardOutput=journal
    StandardError=inherit
    TTYReset=no
    TTYVHangup=no
    TTYVTDisallocate=no
    SyslogPriority=30
    SyslogLevelPrefix=yes
    SecureBits=0
    CapabilityBoundingSet=18446744073709551615
    MountFlags=0
    PrivateTmp=no
    PrivateNetwork=no
    SameProcessGroup=yes
    ControlGroupModify=no
    ControlGroupPersistent=no
    IgnoreSIGPIPE=yes
    NoNewPrivileges=no
    KillMode=control-group
    KillSignal=15
    SendSIGKILL=yes
    Last edited by hseara (2013-01-13 19:31:00)

    Hi Hatter, I'm a little confused about your statement not to use raid right now. I'm new to the Mac, awaiting the imminent delivery of my first Mac Pro Quad core with 1tb RAID10 setup. As far as I know, it's software raid, not the raid card (pricey!). My past understanding about raid10 on any system is that it offers you the best combination for speed and safety (backups) since the drives are a striped and mirrored, one drive dies, quick replacement and you're up and running a ton quicker than if you had gone RAID5 (20 mins writes per 5G data?)Or were you suggesting not to do raid with the raid card..?
    I do plan to use an external drive for archival backups of settings, setups etc, because as we all know, if the best fool proof plans can be kicked in the knees by Murhpy.
    My rig is destined to be my video editing machine so the combo of Quad core, 4G+ memory and Raid10 should make this quite the machine.. but I'm curious why you wouldn't suggest raid..
    And if you could explain this one: I see in the forums a lot of people are running Bootcamp Parralels(sp) which I assume is what you use to run mulitple OS on your Mac systems so that you can run MacOS and Windblows on the same machine.. but why is everyone leaning towards Vista when thems of us on Windblows are trying to avoid it like the plague? I've already dumped Vista from two PCs and installed XP for a quicker less bloated PC. Is vista the only MSOS that will co-exist with Mac systems? Just curious..
    Thanks in advance.. Good Holidays

  • Fsck mode-related Question

    Hello, there...
    About a month or two ago, I posted about some problems my iBook G3 Dual (running OS X 10.2.8) was having. I deduced that it stemmed from a Logic Board replacement Apple did, and subsequent repairs. I've already sent the computer in for repair 3 times since September, but even though they've replaced the hard drive and other things, the machine continues to come back with the same or worse problems. I'm trying to avoid calling them again, as it's been a hassle waiting for the machine to be repaired, only to find that it's still no good when I get it back. I'm losing precious hours of work every time this happens, and can't trust installing anything or saving anything for fear of losing it in an instant as I have every time.
    The machine powers up, but I get the flashing folder with the smiley face and question mark. Tried everything from zapping the PRAM, resetting the PMU. Safe mode, Target Disk/Firewire Mode, Verbose mode - none works. Tried putting in the Install CD (came with OS X 10.2.1), but it doesn't recognize the harddrive to either run repairs, nor re-install. Tried fsck as well, but it will only go into fsck mode, when the Install disc is in, therefore, fsck runs only on the Install CD itself, and naturally, says that volume is okay?
    Does anyone out there know enough about fsck to specifically give a method, and/or some commands that will help me redirect the fsck to pinpoint the underlying system? Again, the Install disc currently has to be in the machine for fsck to run, but I need to then know what to put in the command lines to have fsck run on the system itself, instead of checking the CD. All sources I've found pertaining to fsck assumes that the mode is being run without an Install disc put in the computer, but I am unable to make it work this way.
    Thank You

    The machine powers up, but I get the flashing folder
    with the smiley face and question mark. Tried
    everything from zapping the PRAM, resetting the PMU.
    Safe mode, Target Disk/Firewire Mode, Verbose mode -
    none works. Tried putting in the Install CD (came
    with OS X 10.2.1), but it doesn't recognize the
    harddrive to either run repairs, nor re-install.
    Tried fsck as well, but it will only go into fsck
    mode, when the Install disc is in, therefore, fsck
    runs only on the Install CD itself, and naturally,
    says that volume is okay?
    Two things... did you try single-user mode, and did you try holding option on start to see a list of bootable disks?
    Here's the thing... if DiskUtility (on the install disk) doesn't even see your HD, there's something wrong much past what fsck can fix. The first thing to check is probably that the apple engineer who last worked on your comp remembered to plug your HD back in, both to power and to the ATA bus. If that didn't happen, it would very easily explain you not being able to boot.
    Other than that... I can't think of anything else to try

  • Bashrc fsck yosemite

    Hey all I have a script in applescript that modifies the bashrc file in private/etc.
    This works on every system I've tested except 10.10 yosemite.
    What my script does is run various cleans on my systems, and in the end reboots the unit into single user mode and runs FSCK then reboots.
    In Yosemite this does not happen. It reboots the unit in single user mode but then does not thing, sits at single user mode screen.
    Please help. What Changed?
    Part of my script.
    set myname to do shell script ("whoami")
      do shell script " sudo -v" with administrator privileges
      try
      do shell script "mkdir /Users/Shared/bash"
      end try
      try
      do shell script "mkdir /Users/Shared/bash/original"
      end try
      try
      do shell script "mkdir /Users/Shared/bash/modified"
      end try
      try
      do shell script "cp Private/etc/bashrc /Users/Shared/bash/original/"
      end try
      try
      do shell script "cp /Users/Shared/bash/original/bashrc /Users/Shared/bash/modified/"
      end try
      delay 1
      do shell script "chmod 777 /Users/Shared/bash/modified/bashrc" with administrator privileges
      delay 3
      tell application "TextEdit"
      open file "Users:Shared:bash:modified:bashrc"
      end tell
      delay 1
      tell application "TextEdit"
      activate
      delay 5
      repeat 40 times
      tell application "System Events" to key code 125
      end repeat
      delay 1
      tell application "System Events" to keystroke "singleuser=`sysctl -n kern.singleuser`"
      tell application "System Events" to keystroke return
      tell application "System Events" to keystroke "if [[ $singleuser -eq 1 ]]; then"
      tell application "System Events" to keystroke return
      tell application "System Events" to keystroke "nvram boot-args=\"\""
      tell application "System Events" to keystroke return
      tell application "System Events" to keystroke "echo Starting Process -- Repair disk"
      tell application "System Events" to keystroke return
      tell application "System Events" to keystroke "sleep 3"
      tell application "System Events" to keystroke return
      tell application "System Events" to keystroke "/sbin/fsck -fy"
      tell application "System Events" to keystroke return
      tell application "System Events" to keystroke "echo Starting Process -- Mounting the Drive"
      tell application "System Events" to keystroke return
      tell application "System Events" to keystroke "sleep 3"
      tell application "System Events" to keystroke return
      tell application "System Events" to keystroke "sbin/mount -uw /"
      tell application "System Events" to keystroke return
      tell application "System Events" to keystroke "echo Starting Process -- Begin moving proper files back into place"
      tell application "System Events" to keystroke return
      tell application "System Events" to keystroke "sleep 3"
      tell application "System Events" to keystroke return
      tell application "System Events" to keystroke "mv /Private/etc/bashrc /Users/Shared/bash/"
      tell application "System Events" to keystroke return
      tell application "System Events" to keystroke "mv /Users/Shared/bash/original/bashrc /Private/etc/"
      tell application "System Events" to keystroke return
      tell application "System Events" to keystroke "rm -rfv /Users/Shared/bash"
      tell application "System Events" to keystroke return
      tell application "System Events" to keystroke "echo Starting Process -- Boot Computer, Give me a min"
      tell application "System Events" to keystroke return
      tell application "System Events" to keystroke "exit"
      tell application "System Events" to keystroke return
      tell application "System Events" to keystroke "else"
      tell application "System Events" to keystroke return
      tell application "System Events" to keystroke "echo Not in single user mode"
      tell application "System Events" to keystroke return
      tell application "System Events" to keystroke "fi"
      tell application "System Events" to keystroke "s" using command down
      end tell
      delay 10
      do shell script "sudo rm -rfv Private/etc/bashrc" with administrator privileges
      do shell script "sudo mv /Users/Shared/bash/modified/bashrc Private/etc/bashrc" with administrator privileges
      do shell script "sudo nvram boot-args=\"-s\"" with administrator privileges
      try
      do shell script "killall Terminal"
      end try
      try
      do shell script "killall TextEdit"
      end try
      try
      tell applicat
      end try
      try
      tell application "TextEdit" to quit
      end try
      try
      tell application "Terminal" to quit
      end try
      delay 2
      -- restarts machine disabling reopen windows on login. Had to use restart window because without it it always reopen windows.
      do shell script "defaults write com.apple.loginwindow TALLogoutSavesState -bool False"
      do shell script "osascript -e 'tell app \"loginwindow\" to «event aevtrrst»'"
      delay 1
      tell application "System Events" to keystroke return

    There are so many things that need work in your script, it's hard to know where to start....
    I'm guessing I know the specific problem, but the first thing to change is:
      do shell script " sudo -v" with administrator privileges
    In addition to being pointless (it does nothing), it's just wrong - you should not mix 'sudo' and '... with administrator privileges'. In fact, you should never use sudo in a do shell script command at all. 'with administrator privileges' takes care of elevating your privileges, and it needs to be added to each do shell script command, since they are executed as separate processes (i.e. just because one command is elevated, it does not mean the others are).
    The second (probably major) problem is that you're using TextEdit to edit your bashrc, coupled with a slew of UI commands to simulate typing in the text you want. That's cumbersome. It would be far, far, far better to include the entire script as a single text object within the script and just recreate the file, or append to the existing file. You could either use another shell command to append the text, or use native AppleScript commands to write to the file, like:
    property myShellCommands : "singleuser=`sysctl -n kern.singleuser`
       if [[ $singleuser -eq 1 ]]; then
       nvram boot-args=\"\"
       echo Starting Process -- Repair disk
       sleep 3
       /sbin/fsck -fy
    yada yada yada"
    set mybashrc to (open for access file "Users:shared:bash:modified:bashrc" with write permission)
    set curEOF to (get eof mybashrc)
    write (ASCII character 10) & myShellCommands to mybashrc starting at curEOF + 1
    close access mybashrc
    In this way your 60-odd lines of cruft are reduced to 4 lines and a text object.
    The reason why I think TextEdit is the problem is that it doesn't always save plain ASCII files - it may adjust the line endings (CR vs CR/LF vs LF), or may save a RTF version of the file, none of which will work in the shell. Writing to the file directly avoids this problem.

  • Avoiding null and duplicate values using model clause

    Hi,
    I am trying to use model clause to get comma seperated list of data : following is the scenario:
    testuser>select * from test1;
    ID VALUE
    1 Value1
    2 Value2
    3 Value3
    4 Value4
    5 Value4
    6
    7 value5
    8
    8 rows selected.
    the query I have is:
    testuser>with src as (
    2 select distinct id,value
    3 from test1
    4 ),
    5 t as (
    6 select distinct substr(value,2) value
    7 from src
    8 model
    9 ignore nav
    10 dimension by (id)
    11 measures (cast(value as varchar2(100)) value)
    12 rules
    13 (
    14 value[any] order by id =
    15 value[cv()-1] || ',' || value[cv()]
    16 )
    17 )
    18 select max(value) oneline
    19 from t;
    ONELINE
    Value1,Value2,Value3,Value4,Value4,,value5,
    what I find is that this query has duplicate value and null (',,') coming in as data has null and duplicate value. Is there a way i can avoid the null and the duplicate values in the query output?
    thanks,
    Edited by: orausern on Feb 19, 2010 5:05 AM

    Hi,
    Try this code.
    with
    t as ( select substr(value,2)value,ind
            from test1
            model
            ignore nav
            dimension by (id)
            measures (cast(value as varchar2(100)) value, 0 ind)
            rules
            ( ind[any]=  instr(value[cv()-1],value[cv()]),
            value[any] order by id = value[cv()-1] || CASE WHEN value[cv()] IS NOT NULL
                                               and ind[cv()]=0     THEN ',' || value[cv()] END      
    select max(value) oneline
    from t;
    SQL> select * from test1;
            ID VALUE
             1 Value1
             2 Value2
             3 Value3
             4 Value4
             5 Value4
             6
             7 value5
             8
    8 ligne(s) sélectionnée(s).
    SQL> with
      2   t as ( select substr(value,2)value,ind
      3          from test1
      4          model
      5          ignore nav
      6          dimension by (id)
      7          measures (cast(value as varchar2(100)) value, 0 ind)
      8          rules
      9          ( ind[any]=  instr(value[cv()-1],value[cv()]),
    10          value[any] order by id = value[cv()-1] || CASE WHEN value[cv()] IS NOT NULL
    11                                             and ind[cv()]=0     THEN ',' || value[cv()] END 
    12          )
    13        )
    14   select max(value) oneline
    15   from t;
    ONELINE
    Value1,Value2,Value3,Value4,value5
    SQL>

  • How to set text resources avoiding automatic page update with c:set tag

    Hello everyone,
    I'm developing my web application with JDeveloper 11.1.2.3.0 in order to support two language locales (en and de). Following this guide I've performed the following steps:
    Creation of two property files (Resources.properties and Resources_de.properties) with the key-value entries;
    Modify of faces-config.xml file adding these lines:
    <locale-config>
            <default-locale>en</default-locale>
            <supported-locale>de</supported-locale>
      </locale-config>
      <resource-bundle>
          <base-name>view.Resources</base-name>
          <var>res</var>
       </resource-bundle>
    In the project properties > Resources Bundle I've checked:
    Automatically Synchronize Bundle;
    Warn about Hard-coed Translatable Strings;
    Always Prompt for Description.
    In the same place I've set the default project bundle name to view.Resources.
    In a test JSP page I've a outputText with the value #{res['HELLOWORLD']} where HELLOWORLD is the key in the property files. All works fine, and the correct string is shown based on locale browser settings.
    Anyway, when I use the "Select Text Resources..." menu in any text value choosing a value from the default property file, JDev automatically adds the following tag:
    <c:set var="customuiBundle" value="#{adfBundle['view.ViewControllerBundle']}"/>
    setting the value of the text in #{ViewControllerBundle.HELLOWORLD}.
    There is a way to avoid this behavior? Can I manage the resources in a different way? I would to choose a value from the list in order to get the res.KEY value instead of ViewControllerBundle.KEY value.
    Thanks in advance for your help.
    Manuel

    don't select from menu - go to source and write it . The problem with the tools is they have a certain way of doing things and don't think we should spend time customizing jdeveloper rather concentrate on the work in hand.

  • Can a BIG form be served up one page at a time to avoid long load time?

    Tricks I have read for optimizing the load time of large forms are not helping. Linearization causes the first page to render quickly, but you can't interact with the fields until the whole form finishes loading -- no help there. Is there a way to break the form into pages (without creating entirely separate forms) so the user can fill out a page, hit a Next Page button, fill out that page, etc.? Understood that this is an old school idea, but until Reader can download a 1+ MB form in less time than it takes an average user to get ticked off, old school might do the trick.
    Alternatively, is there a way to construct a form so you can start interacting with it without having to wait for it all to load? This question comes from the (uninformed) assumption that maybe there are forward references that can't be satisfied until all the bits have come over the wire. If that's right, can a multipage form be architected so as to avoid this problem?

    No that technology does not exist yet. There are form level events that need to have the entire document there before they can fire. Also you would have to keep track of where you are so that would mean some sort of session information for each user.

  • To avoid writing database code in the front end

    Hello,
    I am working on a database application using 10g database as backend and dotnet as front end. I wish to execute only oracle stored procedure for all the select (to avoid hard parse and use of bind variable), DDL and DML operations; just to avoid writing database code in the front end. Can anyone please give me a little examples of :
    1.Select query's output to be return as resultset by stored procedure.
    2.DML example by stored procedure.
    3.Any DDL example by stored procedure.
    using scott.emp, so that i would just call the stored procedure, rather than giving select,DML and/or DDL commands in the front end. Even though i have read in the documentation, but a clear cut examples will help me to get into clear concept as well.
    Thanks & Regards
    Girish Sharma

    Hi...
    -->Select example
    create or replace procedure get_emp(rc out sys_refcursor)
    is
    begin
    open rc for select * from emp;
    end;
    -->DML example
    create or replace procedure do_dml_emp(pempid in number,
    pempname varchar2,
    result out number)
    is
    begin
    insert into emp(empid,empname) values(pempid,pempname) returning empid into result;
    exception
    when others then
    result:=-1;
    end;
    -->DDL example
    create or replace procedure ddl_emp(colname varchar2,
    coltype varchar2,
    result out number)
    is
    begin
    result:=-1;
    execute immediate 'alter table emp add column ' || colname || ' ' || coltype ;
    result:=1;
    end;

  • Query to populate an alert message to avoid the duplication of Reference no

    Hi Experts,
    SUB:Query to populate an alert message to avoid the duplication of BP reference no.
    In A/R invoice, BP reference (numAtcard) is used to enter sales Order no as the reference number. As human error, double A/R invoice is created to that particular Sales Order no.
    So,I want a formatted search query in that BP reference field, so that when i type the sales order number and give tab, it should populate the alert message if it already exists.
    Moreover i do not want to block it through store procedure method, only warning is required to my scenario.
    Kindly, help me on this ground.
    Regards,
    Dwarak

    Hi there, i think this could work, maybe you'll only need to configure the Formated search to work with the document total, each time it changes
    declare @numatcard varchar(15)
    declare @count int
    set @numatcard=(select $[oinv.numatcard])
    set @count= (select count(numatcard) from oinv where numatcard=@numatcard)
    if @count>1
    select 'There is a duplicated reference'
    select @numatcard
    hope it works

  • Avoiding data memory duplication in subVI calls

    Hi,
    I am on a Quest to better understand some of the subtle ways of the LabVIEW memory manager. Overall, I want to (as much as practically possible) eliminate calls to the memory manager while the code is running.
    (I mainly do RT code that is expected to run "forever", the more static and "quiet" the memory manager activity is, the faster and simpler it is to prove beyond reasonable doubt that your application does not have memory leaks, and that if will not run into memory fragmentation (out of memory) issues etc. What I like to see as much as possible, are near static "used memory" and "largest contiguous block available" stats over days and weeks of deployed RT code.)
    In my first example (attached, "IPE vs non-IPE.png"), I compared IPE buffer allocation (black dots) for doing some of the operations in an IPE structure vs. "the old way". I see fewer dots the old way, and removed the IPE structure.
    Next I went from initializing an array of size x to values y to using a constant array (0 values) with an "array add" to get an array with the same values as my first version of the code. ("constant array.png")
    The length of the constant array is set to my "worst case" of 25 elements (in example). Since "replace sub-array" does not change the size of the input array even when the sub-array is "too long", this saves me from constantly creating small, variable sized arrays at run-time. (not sure what the run-time cpu/memory hit is if you tried to replace the last 4 elements with a sub-array that is 25 elements long...??)
    Once I arrived at this point, I found myself wondering "how exactly the constant array is handled during run-time?". Is it allocated the first time that this sub-vi is called then remains in memory until the main/top VI terminates, or is it unloaded every time the SubVI finishes execution? (I -think- Mac's could unload, while windows and linux/unix it remains in memory until top level closes?)  When thinking (and hopefully answering),  consider that the the code is compiled to an RTEXE runningg on a cRIO-9014 (vxWorks OS).  
    In this case, I could make the constant array a control, and place the constant on the diagram of the caller, and pipe the constant all the way up to the top level VI, but this seems cumbersome and I'm not convinced that the compiler would properly reckognize that at the end of a long chain of sub-sub-sub VI's all those "controls" are actually always tied off to a single constant. Another way would perhaps be to initialize a FG with this constant array and always "read it" out from the FG. (using this cool trick on creating large arrays on a shift register with only one copy which avoids the dual copy (one for shift register, one from "initialize array" function)).
    This is just one example of many cases where I'm trying to avoid creating memory manager activity by making LabVIEW assign memory space once, then only operate on that data "in-place" as much as possible. In another discussion on "in-place element" structures (here), I got the distinct sense that in-place very rarely adds any advantage as the compiler can pick up on and do "in-place" automatically in pretty much any situation. I find the NI documentation on IPE's lacking in that it doesn't really show good examples of when it works and when it doesn't. In particular, this already great article would vastly benefit from updates showing good/bad use of IPE's.
    I've read the following NI links to try and self-help (all links should open in new window/tab):
    cool trick on creating large arrays on a shift register with only one copy
    somewhat dated but good article on memory optimization
    IPE caveats and recommendations
    How Can I Optimize the Memory Use in My LabVIEW VI?
    Determining When and Where LabVIEW Allocates a New Buffer
    I do have the memory profiler tool, but it shows min/max/average allocations, it doesn't really tell me (or I don't know how to read it properly) how many times blocks are allocated or re-allocated.
    Thanks, and I hope to build on this thread with other examples and at the end of the thread, hopefully everyone have found one or two neat things that they can use to memory optimize their own applications.  Next on my list are probably handling of large strings, lots of array math operations on various input arrays to create a result output array etc.
    -Q
    QFang
    CLD LabVIEW 7.1 to 2013
    Attachments:
    IPE vs non-IPE.png ‏4 KB
    constant array.png ‏3 KB

    I sense a hint of frustration on your part, I'm not trying to be dense or difficult, but do realize that this is more towards the "philosophical" side than "practical" side. Code clarity and practicalities are not necessarily the objectives here.
    Also, I have greatly appreciated all your time and input on this and the other thread!
    The answer to your first question is actually "yes, sort of". I had a RT application that developed a small memory leak (through a bug with the "get volume info.vi' from NI), but to isolate it and prove it out took a very long time because the constant large allocation/deallocations would mask out the leak. (Trace's didn't work out either since it was a very very slow leak and the traces would bomb out before showing anythinng conclusive.) The leak is a few bytes, but in addition to short term memory oscilations and  long term (days) cyclical "saw-tooth" ramps in memory usage, made this very hard to see. A more "static" memory landscape would possibly have made this simpler to narrow down and diagnose. or maybe not. 
    Also, you are missing my point entierely, this is not about "running out of memory" (and the size of 25 in my screen-shot may or may not be what that array (and others) end up being). This is about having things allocated in memory ONCE then not de-allocated or moved, and how/when this is possible to accomplish.  Also this is a quest (meaning something  I'm undertaking to improve and expand my knowledge, who said it has to be practical).
    You may find this document really interesting, its the sort of thing you could end up being forced to code to, albeit, I don't see how 100% compliance with this document would ever be possible in LabVIEW, thats not to say its worthless: JPL Institutional Coding Standard for the C Programming Language (while it is directed at C, they have a lot of valid general points in there.)
    Yes, you are right that the IPE would grow the output if the lenght of my replacement array is not the same, and since I can't share the full VI's its a bit of a stretch to expect people to infer from the small screen dummp that the I32 wires on the right guarantee the lengths will match up in the IPE example.
    Once, on recomendation of NI support, I actually did use the Request deallocation primitive during the hunt for what was going on in that RT app I was debugging last year. At that particular time, the symptom was constant fragmentation of memory, until the largest contiguous block would be less than a couple of kB and the app would terminate with 60+MB of free memory space.. (AKA memory leak, though we could not yet prove that from diagnostic memory consumption statistics due to the constant dynamic behavior of the program)  I later removed them. Also, they would run counter to my goal of "allocate once, re-use forever" that I'm chasing. and again, I'm chasing this more as a way to learn than because all my code MUST run this way. 
    I'm not sure I see what you mean by "copying data in and out of some temporary array". Previously (before the constant array) at every call to the containing sub-vi, I used to "initialize array" with x elements of value y (where x depends to a large degree on a configuration parameter, and y is determined by the input data array). Since I would call to "initialize" a new array each time the code was called, and the size of the array could change, I looked for a way that I could get rid of the dynamic size, and get rid of dynamically creating the array from scratch each time the sub-vi was called. What I came up with is perhaps not as clear as the old way I did it, but with some comments, I think its clear enough. In the new way, the array is created as a constant, so I would think that would cause less "movement" in memory as it at that point should be preventing the "source" array from (potentially) moving around in memory?  Considering the alternative of always re-creating a new array, how is this adding an "extra" copy that creating new ones would not create?
    How would you accomplish the task of creating an array of "n" elements, all of value "y" without creating "extra" copies? -auto-indexing using a for loop is certainly a good option, but again, is that sure to reuse the same memory location with each call? Would that not, in a nit-picking way, use more CPU cycles since you are building the array one element at the time instead of just using a primitive array add operation (which I have found to be wicked fast operations) and operate on a constant data structure?
    I cannot provide full VI's without further isolation, maybe down the road (once my weekends clear up a bit). Again, I appreciate your attention and your time!
    QFang
    CLD LabVIEW 7.1 to 2013

  • Avoid printing Header and Footer in the last page

    Hi,
    Could anyone please let me know how to avoid print the header and footer in the last page?
    Note: I'm printing RTF template for publishing the output.
    Looking forward for your valuable inputs/suggestions.
    Thanks in advance,
    Regards,
    Muru

    Hai,
    My report got FROM PO & TO PO parameters and i need to print footer only in first page of each PO. Tried with section but now i am getting first page of all PO contionious and then all lines together.
    Please call me or sent replies to [email protected]

Maybe you are looking for