Ocrcheck shows "Logical corruption check failed"
Hi, I have a strange issue, that I am not sure how to recover from...
In a random 'ocrcheck' we found the above 'logical corruption'. In the CRS_HOME/log/nodename/client/ I found the previous ocrcheck was done a month earlier and was successful. So, something in the last month caused a logical corruption. The cluster is functioning ok currently.
So, I tried doing an ocrdump on some backups we have and I am receiving the following error -
#ocrdump -backupfile backup00.ocr <<< any backup I try for the past month
PROT-306: Failed to retrieve cluster registry data
This error occurrs even on the backup file taken just prior to the successful ocrcheck from a month earlier. The log for this ocrdump shows -
cat ocrdump_6494.log
Oracle Database 11g CRS Release 11.1.0.7.0 - Production Copyright 1996, 2007 Oracle. All rights reserved.
2010-08-18 12:57:17.024: [ OCRDUMP][2813008768]ocrdump starts...
2010-08-18 12:57:17.038: [ OCROSD][2813008768]utread:3: Problem reading buffer 7473000 buflen 4096 retval 0 phy_offset 15982592 retry 0
2010-08-18 12:57:17.038: [ OCROSD][2813008768]utread:4: Problem reading the buffer errno 2 errstring No such file or directory
2010-08-18 12:57:17.038: [ OCRRAW][2813008768]gst: Dev/Page/Block [0/3870/3927] is CORRUPT (header)
2010-08-18 12:57:17.039: [ OCRRAW][2813008768]rbkp:2: could not read the free list
2010-08-18 12:57:17.039: [ OCRRAW][2813008768]gst:could not read fcl page 1
2010-08-18 12:57:17.039: [ OCRRAW][2813008768]rbkp:2: could not read the free list
2010-08-18 12:57:17.039: [ OCRRAW][2813008768]gst:could not read fcl page 2
2010-08-18 12:57:17.039: [ OCRRAW][2813008768]fkce:2: problem reading the tnode 131072
2010-08-18 12:57:17.039: [ OCRRAW][2813008768]propropen: Failed in finding key comp entry [26]
2010-08-18 12:57:17.039: [ OCRDUMP][2813008768]Failed to open key handle for key name [SYSTEM] [PROC-26: Error while accessing the physical storage]
2010-08-18 12:57:17.039: [ OCRDUMP][2813008768]Failure when trying to traverse ROOTKEY [SYSTEM]
2010-08-18 12:57:17.039: [ OCRDUMP][2813008768]Exiting [status=success]...
NOTE: an 'ocrdump' of the active ocr does work and creates the ocrdumpfile
The corruption in the ocr seems to be two keynames pointing to the same block.
Oracle Database 11g CRS Release 11.1.0.7.0 - Production Copyright 1996, 2007 Oracle. All rights reserved.
2010-08-18 13:22:54.095: [OCRCHECK][285084544]ocrcheck starts...
2010-08-18 13:22:55.447: [OCRCHECK][285084544]protchcheck: OCR status : total = [262120], used = [15496], avail = [246624]
2010-08-18 13:22:55.545: [OCRCHECK][285084544]LOGICAL CORRUPTION: current_keyname [SYSTEM.css.diskfile2], and keyname [SYSTEM.css.diskfile1.FILENAME] point to same block_number [3928]
2010-08-18 13:22:55.732: [OCRCHECK][285084544]LOGICAL CORRUPTION: current_keyname [SYSTEM.OCR.MANUALBACKUP.ITEMS.0], and keyname [SYSTEM.css.diskfile1] point to same block_number [3927]
2010-08-18 13:23:03.159: [OCRCHECK][285084544]Exiting [status=success]...
Since one of the keynames refers to the votedisk, that is not appearing correctly on a query -
crsctl query css votedisk
0. 0 /oracrsfiles/voting_disk_01
1. 0
2. 0 backup_20100818_103455.ocr <<<<this value changes if I issue a command that writes something to the ocr, in this case a manual backup.
My DBA is opening an SR, but I am wondering if I can use 'ocrconfig -restore' if the backupfile I want to use cannot be 'ocrdump'd?
Also, is anyone familiar with the 'ocrconfig -repair' as a possible solution?
Although this is a developement cluster (two nodes) rebuilding would be a disaster ;)
Any help or thoughts would be much appreciated!
Hi buddy,
My DBA is opening an SRWell.... corruption problems, no doubts that it's better work with support team
, but I am wondering if I can use 'ocrconfig -restore' if the backupfile I want to use cannot be 'ocrdump'd?No, that is not the idea...if Your backup is not good, it's not safe restoring it. ;)
Also, is anyone familiar with the 'ocrconfig -repair' as a possible solution?This is for repairing nodes that were down when some kind of change on the configuration (replace OCR for example) has been executed while it was "off", so, I guess it's not Your case.
Good Luck!
Cerreia
Similar Messages
-
Ocrcheck success on node1 but failed on node2.(11gR2 for Windows)
Hi all , I have installed the Oracle Grid Infrastructure with ASM on windows 2008 x64, Everything is done without any error, but ocrcheck failed on nodde2. detail is below:
checking commnds on node 1:
*>crsctl check crs*
CRS-4638: Oracle High Availability Services is online
CRS-4537: Cluster Ready Services is online
CRS-4529: Cluster Synchronization Services is online
CRS-4533: Event Manager is online
*>srvctl status asm -a*
ASM on rac1,rac2 is running
ASM enable
*>crs_stat -t*
Name Type Target State Host
ora.DATA.dg ora....up.type ONLINE ONLINE rac1
ora....ER.lsnr ora....er.type ONLINE ONLINE rac1
ora....N1.lsnr ora....er.type ONLINE ONLINE rac2
ora.asm ora.asm.type ONLINE ONLINE rac1
ora.eons ora.eons.type ONLINE ONLINE rac1
ora.gsd ora.gsd.type OFFLINE OFFLINE
ora....network ora....rk.type ONLINE ONLINE rac1
ora.oc4j ora.oc4j.type OFFLINE OFFLINE
ora.ons ora.ons.type ONLINE ONLINE rac1
ora....SM1.asm application ONLINE ONLINE rac1
ora....C1.lsnr application ONLINE ONLINE rac1
ora.rac1.gsd application OFFLINE OFFLINE
ora.rac1.ons application ONLINE ONLINE rac1
ora.rac1.vip ora....t1.type ONLINE ONLINE rac1
ora....SM2.asm application ONLINE ONLINE rac2
ora....C2.lsnr application ONLINE ONLINE rac2
ora.rac2.gsd application OFFLINE OFFLINE
ora.rac2.ons application ONLINE ONLINE rac2
ora.rac2.vip ora....t1.type ONLINE ONLINE rac2
ora.scan1.vip ora....ip.type ONLINE ONLINE rac2
*>ocrcheck*
Status of Oracle Cluster Registry is as follows :
Version : 3
Total space (kbytes) : 262120
Used space (kbytes) : 2364
Available space (kbytes) : 259756
ID : 257699632
Device/File Name : +DATA
Device/File integrity check succeeded
Device/File not configured
Device/File not configured
Device/File not configured
Device/File not configured
Cluster registry integrity check succeeded
Logical corruption check succeeded
checking commnds on node 2:
*>crsctl check crs*
CRS-4638: Oracle High Availability Services is online
CRS-4537: Cluster Ready Services is online
CRS-4529: Cluster Synchronization Services is online
CRS-4533: Event Manager is online
*>srvctl status asm -a*
ASM on rac1,rac2 is running
ASM enable
*>crs_stat -t*
Name Type Target State Host
ora.DATA.dg ora....up.type ONLINE ONLINE rac1
ora....ER.lsnr ora....er.type ONLINE ONLINE rac1
ora....N1.lsnr ora....er.type ONLINE ONLINE rac2
ora.asm ora.asm.type ONLINE ONLINE rac1
ora.eons ora.eons.type ONLINE ONLINE rac1
ora.gsd ora.gsd.type OFFLINE OFFLINE
ora....network ora....rk.type ONLINE ONLINE rac1
ora.oc4j ora.oc4j.type OFFLINE OFFLINE
ora.ons ora.ons.type ONLINE ONLINE rac1
ora....SM1.asm application ONLINE ONLINE rac1
ora....C1.lsnr application ONLINE ONLINE rac1
ora.rac1.gsd application OFFLINE OFFLINE
ora.rac1.ons application ONLINE ONLINE rac1
ora.rac1.vip ora....t1.type ONLINE ONLINE rac1
ora....SM2.asm application ONLINE ONLINE rac2
ora....C2.lsnr application ONLINE ONLINE rac2
ora.rac2.gsd application OFFLINE OFFLINE
ora.rac2.ons application ONLINE ONLINE rac2
ora.rac2.vip ora....t1.type ONLINE ONLINE rac2
ora.scan1.vip ora....ip.type ONLINE ONLINE rac2
*>ocrcheck*
PROT-602: Failed to retrieve data from the cluster registry
PROC-26: Error while accessing the physical storage ASM error [SLOS: cat=8, opn=
kgfolclcpi1, dep=204, loc=kgfokge
AMDU-00204: Disk N0002 is in currently mounted diskgroup DATA
AMDU-00201: Disk N0002: '\\.\ORCLDISKDATA1'
] [8]
also, asmca can run on node1 but can not work on node 2.
Can anyone help me to resolve this issue?
Regards.
Edited by: user8306020 on 2010-7-4 下午11:10Thank you for your replay.. I tried to run "cluvfy comp ocr -n all -verbose" on both node, and get the response like below:
Node1:
*>cluvfy comp ocr -n all -verbose*
Verifying OCR integrity
Checking OCR integrity...
Checking the absence of a non-clustered configuration...
All nodes free of non-clustered, local-only configurations
ASM Running check passed. ASM is running on all cluster nodes
Disk group for ocr location "+DATA" available on all the nodes
Checking size of the OCR location "+DATA" ...
rac2:Size check for OCR location "+DATA" successful...
rac1:Size check for OCR location "+DATA" successful...
WARNING:
This check does not verify the integrity of the OCR contents. Execute 'ocrcheck'
as a privileged user to verify the contents of OCR.
OCR integrity check passed
Verification of OCR integrity was successful.
=========================================================================
Node2:
*>cluvfy comp ocr -n all -verbose*
Verifying OCR integrity
Checking OCR integrity...
Checking the absence of a non-clustered configuration...
All nodes free of non-clustered, local-only configurations
ASM Running check passed. ASM is running on all cluster nodes
Disk group for ocr location "+DATA" available on all the nodes
Checking size of the OCR location "+DATA" ...
rac2:Size check for OCR location "+DATA" successful...
rac1:Size check for OCR location "+DATA" successful...
WARNING:
This check does not verify the integrity of the OCR contents. Execute 'ocrcheck'
as a privileged user to verify the contents of OCR.
OCR integrity check passed
Verification of OCR integrity was successful.
But ocrcheck failed on node2 again. the log file in \app\11.2.0\grid\log\rac2\client\orccheck_4844.log:
Oracle Database 11g Clusterware Release 11.2.0.1.0 - Production Copyright 1996, 2009 Oracle. All rights reserved.
2010-07-05 15:52:44.985: [OCRCHECK][4728]ocrcheck starts...
2010-07-05 15:52:45.141: [ GPnP][4728]clsgpnp_Init: [at clsgpnp0.c:406] gpnp tracelevel 1, component tracelevel 0
2010-07-05 15:52:45.141: [ GPnP][4728]clsgpnp_Init: [at clsgpnp0.c:536] 'E:\app\11.2.0\grid' in effect as GPnP home base.
2010-07-05 15:52:45.157: [ GPnP][4728]clsgpnpkwf_initwfloc: [at clsgpnpkwf.c:398] Using FS Wallet Location : E:\app\11.2.0\grid\gpnp\rac2\wallets\peer\
[ CLWAL][4728]clsw_Initialize: OLR initlevel [70000]
2010-07-05 15:52:45.173: [ GPnP][4728]clsgpnp_getCK: [at clsgpnp0.c:1952] <Get gpnp security keys (wallet) for id:1,typ;7. (2 providers - fatal if all fail)
2010-07-05 15:52:45.188: [ GPnP][4728]clsgpnp_getCK: [at clsgpnp0.c:1967] Result: (0) CLSGPNP_OK. Get gpnp wallet - provider 1 of 2 (LSKP-FSW(1))
2010-07-05 15:52:45.188: [ GPnP][4728]clsgpnp_getCK: [at clsgpnp0.c:1984] Got gpnp security keys (wallet).>
2010-07-05 15:52:45.188: [ GPnP][4728]clsgpnp_getCK: [at clsgpnp0.c:1952] <Get gpnp security keys (wallet) for id:1,typ;4. (2 providers - fatal if all fail)
2010-07-05 15:52:45.188: [ GPnP][4728]clsgpnp_getCK: [at clsgpnp0.c:1967] Result: (0) CLSGPNP_OK. Get gpnp wallet - provider 1 of 2 (LSKP-FSW(1))
2010-07-05 15:52:45.188: [ GPnP][4728]clsgpnp_getCK: [at clsgpnp0.c:1984] Got gpnp security keys (wallet).>
2010-07-05 15:52:45.188: [ GPnP][4728]clsgpnp_Init: [at clsgpnp0.c:839] GPnP client pid=4844, tl=1, f=3
2010-07-05 15:53:04.221: [ OCRASM][4728]proprasmo: Failed to open file in dirty mode
2010-07-05 15:53:04.221: [ OCRASM][4728]proprasmo: Error in open/create file in dg [DATA]
[ OCRASM][4728]SLOS : SLOS: cat=8, opn=kgfolclcpi1, dep=204, loc=kgfokge
AMDU-00204: Disk N0002 is in currently mounted diskgroup DATA
AMDU-00201: Disk N0002: '\\.\ORCLDISKDATA1'
2010-07-05 15:53:04.314: [ OCRASM][4728]proprasmo: kgfoCheckMount returned [7]
2010-07-05 15:53:04.314: [ OCRASM][4728]proprasmo: The ASM instance is down
2010-07-05 15:53:04.361: [ OCRRAW][4728]proprioo: Failed to open [+DATA]. Returned proprasmo() with [26]. Marking location as UNAVAILABLE.
2010-07-05 15:53:04.361: [ OCRRAW][4728]proprioo: No OCR/OLR devices are usable
2010-07-05 15:53:04.361: [ OCRASM][4728]proprasmcl: asmhandle is NULL
2010-07-05 15:53:04.361: [ OCRRAW][4728]proprinit: Could not open raw device
2010-07-05 15:53:04.361: [ OCRASM][4728]proprasmcl: asmhandle is NULL
2010-07-05 15:53:04.361: [ default][4728]a_init:7!: Backend init unsuccessful : [26]
2010-07-05 15:53:04.361: [OCRCHECK][4728]Failed to access OCR repository: [PROC-26: Error while accessing the physical storage ASM error [SLOS: cat=8, opn=kgfolclcpi1, dep=204, loc=kgfokge
AMDU-00204: Disk N0002 is in currently mounted diskgroup DATA
AMDU-00201: Disk N0002: '\\.\ORCLDISKDATA1'
] [8]]
2010-07-05 15:53:04.361: [OCRCHECK][4728]Failed to initialize ocrchek2
2010-07-05 15:53:04.361: [OCRCHECK][4728]Exiting [status=failed]... -
Hello,
I am running a backup and checking for any logical corruption -
RMAN> backup check logical database;
Starting backup at 03-MAR-10
allocated channel: ORA_SBT_TAPE_1
channel ORA_SBT_TAPE_1: SID=135 device type=SBT_TAPE
channel ORA_SBT_TAPE_1: Data Protection for Oracle: version 5.5.1.0
allocated channel: ORA_SBT_TAPE_2
channel ORA_SBT_TAPE_2: SID=137 device type=SBT_TAPE
channel ORA_SBT_TAPE_2: Data Protection for Oracle: version 5.5.1.0
allocated channel: ORA_SBT_TAPE_3
channel ORA_SBT_TAPE_3: SID=138 device type=SBT_TAPE
channel ORA_SBT_TAPE_3: Data Protection for Oracle: version 5.5.1.0
channel ORA_SBT_TAPE_1: starting full datafile backup set
channel ORA_SBT_TAPE_1: specifying datafile(s) in backup set
input datafile file number=00014 name=/oracle1/data01/TESTDB/TESTDB_compress_test_01.dbf
input datafile file number=00006 name=/oracle/TESTDB/data01/TESTDB_shau_01.dbf
input datafile file number=00015 name=/oracle/product/11.1/dbs/ILM_TOOLKIT_IML_TEST_TAB_A.f
channel ORA_SBT_TAPE_1: starting piece 1 at 03-MAR-10
channel ORA_SBT_TAPE_2: starting full datafile backup set
channel ORA_SBT_TAPE_2: specifying datafile(s) in backup set
input datafile file number=00003 name=/oracle/TESTDB/data02/TESTDB_undo_01.dbf
input datafile file number=00013 name=/oracle/TESTDB/data01/TESTDB_roop_01.dbf
input datafile file number=00012 name=/oracle/TESTDB/data01/TESTDB_example_01.dbf
input datafile file number=00005 name=/oracle/TESTDB/data01/TESTDB_sysaud_tab_1m_01.dbf
channel ORA_SBT_TAPE_2: starting piece 1 at 03-MAR-10
channel ORA_SBT_TAPE_3: starting full datafile backup set
channel ORA_SBT_TAPE_3: specifying datafile(s) in backup set
input datafile file number=00004 name=/oracle/TESTDB/data01/TESTDB_users_01.dbf
input datafile file number=00001 name=/oracle/TESTDB/data01/TESTDB_system_01.dbf
input datafile file number=00002 name=/oracle/TESTDB/data01/TESTDB_sysaux_01.dbf
input datafile file number=00025 name=/oracle/export_files/TESTDB_users_02.dbf
channel ORA_SBT_TAPE_3: starting piece 1 at 03-MAR-10
channel ORA_SBT_TAPE_3: finished piece 1 at 03-MAR-10
piece handle=5ul7ltsd_1_1 tag=TAG20100303T204356 comment=API Version 2.0,MMS Version 5.5.1.0
channel ORA_SBT_TAPE_3: backup set complete, elapsed time: 00:05:15
channel ORA_SBT_TAPE_2: finished piece 1 at 03-MAR-10
piece handle=5tl7ltsd_1_1 tag=TAG20100303T204356 comment=API Version 2.0,MMS Version 5.5.1.0
channel ORA_SBT_TAPE_2: backup set complete, elapsed time: 00:06:56
channel ORA_SBT_TAPE_1: finished piece 1 at 03-MAR-10
piece handle=5sl7ltsd_1_1 tag=TAG20100303T204356 comment=API Version 2.0,MMS Version 5.5.1.0
channel ORA_SBT_TAPE_1: backup set complete, elapsed time: 00:08:16
Finished backup at 03-MAR-10
Starting Control File and SPFILE Autobackup at 03-MAR-10
piece handle=c-2109934325-20100303-0c comment=API Version 2.0,MMS Version 5.5.1.0
Finished Control File and SPFILE Autobackup at 03-MAR-10
Question: By looking at the output, how can I say that RMAN did an Logical Check for the corruption? This output looks same as a simple backup without logical corruption check. Please advice how to check about this?
Thanks!hi
I think you won't see any summary on this, only when corruption is found.
There is also one related setting that can be incorporated here - see example:
Example 2-25 Specifying Corruption Tolerance for Datafile Backups
This example assumes a database that contains 5 datafiles. It uses the SET MAXCORRUPT command to indicate than no more than 1 corruption should be tolerated in each datafile. Because the CHECK LOGICAL option is specified on the BACKUP command, RMAN checks for both physical and logical corruption.
RUN
+{+
SET MAXCORRUPT FOR DATAFILE 1,2,3,4,5 TO 1;
BACKUP CHECK LOGICAL
DATABASE;
+}+
use this to see clear output:
-- Check for physical corruption of all database files.
VALIDATE DATABASE;
-- Check for physical and logical corruption of a tablespace.
VALIDATE CHECK LOGICAL TABLESPACE USERS;
eg.
List of Datafiles
File Status Marked Corrupt Empty Blocks Blocks Examined High SCN
+1 FAILED 0 3536 57600 637711+
File Name: /disk1/oradata/prod/system01.dbf
Block Type Blocks Failing Blocks Processed
Data 1 41876
Index 0 7721
Other 0 4467 -
Password Check Failed, Fatal Error, System Halted, CNU949701P
Hello!
I have a HP netbook model Mini CQ 10, and I have not switched it on in a while.
I recently went to turn it on to recover some important documents and this error message shows up;
Password check failed
Fatal Error... System Halted
CNU949701P
Canu anyone PLEASE HELP ME! I would be so grateful!
Thank you!
x
This question was solved.
View Solution.Try >> e9lovox132
******Clicking the Thumbs-Up button is a way to say -Thanks!.******
**Click Accept as Solution on a Reply that solves your issue to help others** -
Primary Site Deploy Prerequisite Check Failed
1. Symptom description: check failed
SQL instance when you run the Prerequisite Check SCCM 2012 for a new primary site.
2. Environment: My remote SQL Server 2008 R2 SP1 CU6 and uses
a named instance called INST01 (SRV302 \ INST01). My server will be the primary site watch requirements (SRV501). I
have a VM to test that was used to ratify the SCCM 2012 R2 (vSRV210).This
VM had a primary site that was the basis of data in SRV302 \ INST01, this site has been removed by the Configuration Manager Setup wizard, he correctly remove the database SCCM 2012.
3. The
exact error message: When trying to run the installation of SCCM 2012 server SRV501, filling in as the database and SRV302.domain.com INST01 for instance, it shows the Prerequisite Check Failed one item as:
"Dedicated SQL Server instance: Configuration Manager requires a dedicated SQL Server instance to host excellant site database. You selected the SQL Server instance That site hosts the Configuration Manager
database for another site. Select a different SQL Server instance for this new site to use, or
resolve the conflict by uninstalling The Other excellant site or moving to a different database SQL Server instance. "
In the file ConfigMgrPrereq.log the message is the same:
srv501.domain.com; Dedicated SQL Server instance; Error; Configuration Manager requires a dedicated SQL Server instance to host its site database. You selected a SQL Server instance that hosts the site">"<05/03/2012 10:00:21>
srv501.domain.com; Dedicated SQL Server instance; Error; Configuration Manager requires a dedicated SQL Server instance to host excellant site database. You selected the SQL Server Instance That Hosts the site Configuration
Manager database for another site. Select a different SQL Server instance for this new site to use, or resolves the conflict by uninstalling The Other database excellant site or moving to a different SQL Server instance. "
4. Any
recent relevant configuration change (s): Only completely removed the test site that was with the database in SRV302 \ INST01, rebooted the server and tried to start the installation of the production site using the instance where it was before (no more no
database SCCM it).
5. Tech diagnosis history: Have you tried doing a restart of the server and
the instance of SQL without success. I did a test site to reinstall the test SCCM VM vSRV210, pointing
to the same instance and it works. But the production server 2012 SCCM has to be SRV501. You
can not create a new instance of the database only for the production site.
What can I do to install the SCCM 2012 instance that (SRV302 \ INST01)?
Is there a procedure for cleanup of an instance of SQL for SCCM 2012?
Is there any way to bypass this check in the SQL setup SCCM 2012?
Att. Rodrigo KrugHello,
Beware of the solution, after removingthe key
SMS even passed the Prerequisite
Check, but during the installation,
it stopped with the following error:
Can not write CertBootStrap\SMS_SQL_SERVER\ registry
key on server srv.domain.com.
The operating system Reported error
4
ERROR: Failed to write
to registry certificate configurationon server
srv302.domain.com.
ERROR: Failed to create
SQL Server [srv302.domain.com]certificate
remotely.
I had to recreate the keys from the file. Reg
so that the installation was successful.
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\SMS]
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\SMS\CertBootStrap]
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\SMS\CertBootStrap\SMS_SQL_SERVER]
No values registered.
With that I succeeded in installing the
primary site in that instance
where we had another base before
SCCM 2012.
This was supposed to be your solution?
Att. Rodrigo Krug -
[solved] Filesystem check fail - Cannot access LVM Logical Volumes
I am getting a "File System Check Failed"on startup, I recently did a full system upgrade but I'm not entirely sure that the cause of the issue as I don't reboot very often.
I get the error right before this line is echo'ed out:
/dev/mapper/Arch_LVM-Root:
The super block could not be read or does not describe a correct ext2 filesystem...
this is odd because the only ext2 filesystem I have is on an non-LVM boot partition...
I can log-in and mount / as read/write and I can activate LVM with
modprobe dm-mod
and
vgchange -ay Arch_LVM
and they show up in lvdisplay but their status is "NOT available"
I just need to mount these logical volumes so I can retrieve some personal data in my home directory, I am also hesitant to use LVM again if I can't retrieve my data.
any suggestions?
Last edited by action_owl (2010-08-15 02:15:58)I just popped in the install disk and was able to mount and access the LVM groups as expected, something must have been wonky with my filesystem
-
Database Integrity check failed, how to find an un-corrupted backup for recovery
I got database integrity check task that runs weekly. The job ran March 23rd but failed on March 30th. We have identified that there is a corruption in database and now the task is to restore it from backup (with data loss). We have database backup running
every-night and I need to know how can I find which is the latest backup that's not corrupted.
The MSDN documentation says "RESTORE VERIFYONLY" command does not verify whether the structure of the data contained within the backup set is correct. Does it mean the restore command will not able to detect corruption in the database and I just
need to restore each of the backs starting from the latest to see if integrity check fails after restore ? OR RESTORE VERIFYONLY will confirm if the database is un-corrupted ?The MSDN documentation says "RESTORE VERIFYONLY" command does not verify whether the structure of the data contained within the backup set is correct. Does it mean the restore command will not able to detect corruption in the database and I just need to
restore each of the backs starting from the latest to see if integrity check fails after restore ? OR RESTORE VERIFYONLY will confirm if the database is un-corrupted ?
As the documentation suggests, RESTORE VERIFYONLY checks the structure of the backup but not the database itself. You'll need to restore the backup to check the database consistency.
Dan Guzman, SQL Server MVP, http://www.dbdelta.com -
How to resolve "Performance counter registry hive consistency check" failed?
I want to install SQL Server 2008 November CTP Developer Enu. When "System Configuration Check" it shows:
Rule "Performance counter registry hive consistency check" failed.
The performance counter registry hive is corrupted.
And cannot continue installing. How to solve this problem?I've actually solved the problem for my Vista and Win 7 (traditional chinese version).
After revising %systemroot%\system32\WmiApRpl.ini:
"[info]
drivername=WmiApRpl
symbolfile=WmiApRpl.h
[languages]
004=Chinese (Traditional)
009=English
[objects]
WMI_Objects_004_NAME=WMI Objects
WMI_Objects_009_NAME=WMI Objects
MSiSCSI_ConnectionStatistics_00000_004_NAME=iSCSI Connections
MSiSCSI_ConnectionStatistics_00000_009_NAME=MSiSCSI_ConnectionStatistics
MSiSCSI_InitiatorInstanceStatistics_00001_004_NAME=iSCSI Initiator Instance
MSiSCSI_InitiatorInstanceStatistics_00001_009_NAME=MSiSCSI_InitiatorInstanceStatistics
MSiSCSI_InitiatorLoginStatistics_00002_004_NAME=iSCSI Initiator Login statistics
MSiSCSI_InitiatorLoginStatistics_00002_009_NAME=MSiSCSI_InitiatorLoginStatistics
MSiSCSI_MMIPSECStats_00003_004_NAME=iSCSI HBA Main Mode IPSEC Statistics
MSiSCSI_MMIPSECStats_00003_009_NAME=MSiSCSI_MMIPSECStats
MSiSCSI_NICPerformance_00004_004_NAME=MSiSCSI_NICPerformance
MSiSCSI_NICPerformance_00004_009_NAME=MSiSCSI_NICPerformance
MSiSCSI_QMIPSECStats_00005_004_NAME=iSCSI HBA Quick Mode IPSEC Statistics
MSiSCSI_QMIPSECStats_00005_009_NAME=MSiSCSI_QMIPSECStats
MSiSCSI_RequestTimeStatistics_00006_004_NAME=iSCSI Request Processing Time
MSiSCSI_RequestTimeStatistics_00006_009_NAME=MSiSCSI_RequestTimeStatistics
MSiSCSI_SessionStatistics_00007_004_NAME=iSCSI Sessions
MSiSCSI_SessionStatistics_00007_009_NAME=MSiSCSI_SessionStatistics
ProcessorPerformance_00008_004_NAME=處理器效能
ProcessorPerformance_00008_009_NAME=ProcessorPerformance
Video_Scheduler_Statistics_00009_004_NAME=Video Scheduler
Video_Scheduler_Statistics_00009_009_NAME=Video_Scheduler_Statistics"
I have realized that the code 009 is for english language and 004 for chinese traditional and in my "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows
NT\CurrentVersion\Perflib" did only exist 009 and 0404 key.
Hence, i've created a new 004 key and copied 009 counter and help contents to this newly created key.
Without restarting the OS, I was able to install smoothly MS SQL server express RC2.
I'm so happy to have overcome this problem.
But just out of curiosity does anyone know the syntax for the language codes? (009 for English, 004 for Chinese and 0404? -
Disk order changes, grub problem, filesystem check failed
I'm having some problems installing Archlinux onto a machine with a lot of SATA drives, some connected by SATA cards. I have tried the 2009-08 netinstaller burned to CD, both -x86_64.iso and -x86_64-isolinux.iso, and I have the same problem with both.
I am installing from a USB-connect optical drive to an Intel X25-M 80GB SSD connected to a motherboard SATA port. I also have 2 HDDs connected to motherboard SATA ports, and 4 more HDDs connected to 4 SIL-based PCIe SATA cards. Additionally, I have a 4GB Patriot USB flash drive connected to a motherboard USB port. None of the HDDs have a bootable MBR, I am planning to create an mdadm RAID with the HDDs, but the USB flash drive is bootable. The motherboard is an Asus Z8PE-D18 with the latest BIOS, in AHCI mode.
First thing to note is that I was able to successfully install Fedora 12 linux to this machine in the exact configuration that I am trying to install Archlinux. I just installed Fedora 12 again last night, and it installed and loaded fine when I rebooted from the SSD.
So, the problems I am having with Archlinux. During install, I found that the SSD is showing up as either /dev/sde or /dev/sdf. This is odd since it was /dev/sda with Fedora. It makes sense for it to be /dev/sda, since it is on the first motherboard SATA port. But I proceeded with the Archlinux install, and grub seemed to detect the stage1 location properly -- root was set to (hda4,0) or (hda5,0) depending on whether the SSD was at sde or sdf. The kernel root was configured by UUID, so that does not depend on the drive order. Okay so far.
The problem shows up on reboot. The bootloader immediately complains that there is no such partition sde1 or sdf1. I drop into a grub command line and do
find /boot/grub/stage1
and it replies with (hd0,0), so I modify the boot line to root (hd0,0) and boot. Now it gets pretty far. Lots of boot messages scroll by. Here are some of the last few before the problem:
Waiting 10 seconds for device /dev/disk/by-uuid/22a35aa2-9799-4575-b1eb-456e819a1a26 ...
kjournald starting. Commit interval 5 seconds
EXT3-fs (sde1): mounted filesystem with writeback data mode
INIT: version 2.86 booting
::Starting UDev DAemon
::Triggering UDev uevents
::Loading Modules
::Waiting for UDev uevents to be processed
::Bringing up loopback interface
::Mounting Root Read-only
::Checking Filesystems
/dev/sdf1:
The superblock could not be read or does not describe a correct ext2
filesystem. If the device is valid and it really contains an ext2
filesystem (and not swap or ufs or something else), then the superblock
is corrupt, and you might try running e2fsck with an alternate superblock
**** FILESYSTEM CHECK FAILED
* Please repair manually and reboot. Note that the root file system
* is currently mounted read-only....
Give root password for maintenance
So I logged in as root and did an fdisk -l. The boot SSD was at /dev/sde. The menu.lst has root as (hd5,0), which would be sdf (which was correct during installation, but the disk order apparently changed). The kernel root= in menu.lst used by-uuid, and it at least points to the correct drive, which I suppose is why I was able to boot as far as I did, but when it tries to mount the root filesystem, it fails as shown above.
So, at initial grub boot, the grub stage1 is found at (hd0,0). During installation, the SSD was sdf, but after booting the kernel, the SSD is sde. What is going on?
One other experiment is that I pulled all the drives (including USB flash drive) except the SSD. The HDDs are in hot-swap slots, so that was easy. The PCIe SATA cards are still plugged into the PCIe slots. Then I was able to successfully install and boot Archlinux. But when I plugged the drives back in and rebooted, I had the same problem as detailed above.
Any suggestions on how to fix this?I had the same problem.
Last week I installed Arch onto a new SATA HD. I wanted to make sure the installation worked before I attached the other drives. On booting with the other drives attached, similar messages.
My solution:
Login as root.
Follow the instruction to mount / as read-write so you can make changes to the filesystem.
edit /etc/fstab and eliminate the references to /dev/sdxx and replace them with UUIDs or labels (as suggested above) as these won't change.
in /etc/fstab ...
# external data sources
#data /dev/sdb6
UUID=931d7107-1241-4d82-ad28-fcbe7af8ba69 /data ext3 defaults 0 0
#Documents /dev/sda9
/dev/disk/by-label/Documents /data/Documents ext3 defaults 0 0
Reboot and you should be good.
You can find the UUID of the drives by using
$ blkid
or you can set a drive label with e2label, assuming you are using ext2,3 or 4
Good luck. -
[Solved] Filesystem check failed - manual repair too
Good Evening.
Recently my Arch box hang up and I had to reboot forcefully. I expected to get a filesysem scan. The messages on bootup say, that the filesystem check failed and I have to repair it manually. The exact error message is similar to http://bbs.archlinux.org/viewtopic.php?id=89394.
Then I log into the maintenance shell and try to run fsck -pck /dev/sdXX. But that doesn't work because it complains that the filesystem is no ext2-fs or the superblock is corrupt. I should try one of the backup superblocks. To figure out the backup superblocks, I tried mke2fs -n /dev/sdXX but that does not work either. Now it complains that /dev/sdXX does not exist! I looked in /dev and the partitions really don't show up. Where are they? I mean, the maintenance shell works on the / partition, or does it?
To cut a long story short, I can't check my partitions and I don't know any other way how to fix the problem. The next ArchLive CD is 500 km away.
I appreciate any help.
Greetz,
haunted
EDIT:
Ok, I solved the problem as I got my ArchLive CD. If it's to anybody's use, that's the procedure I went through:
I inserted the CD and booted from it. I ran the e2fsck several times. First I did an overall check (e2fsck -v /dev/sdaX) on my Arch partition which I had to do manually i.e. type "y" to every inconsisteny found, then updated the badblock list (e2fsck -vc /dev/sdaX) and checked the partition again.
I rebooted the system without the CD to look if I succeded repairing the hdd. Eventually I deleted the /sys mountpoint in the procedure and had to create it again via ArchLive CD. After the next reboot it complained that the superblock's timestap was written in the future. Rebooting with the CD again, checking again and rebooting without CD again.
It wasn´t of any use and Arch complained again. Then I simply rebooted the system (without CD) again and on start up it stopped complaining and did a normal check on the Arch partition, completed the check and went on loading as normal. System repaired.
Last edited by hauntergeist (2010-02-08 11:11:59)It went ahead and fixed the filesystem, however some of the files (music files mostly) are corrupted and won't play. I have backups of those so it's no big lose, as long as the file system works now.
-
Invalid Corruption Check During Backup
We're 10.2.0.4 (some 10.2.0.2) on AIX.
Our backups fail if RMAN finds any block corruption in any datafile. The problem is that this so-called corruption is often on blocks that contain no rows, and so, as far as I can see, this is not really corruption at all. My understanding is that Oracle will format a block before adding rows for the first time, and at that point the corruption will be fixed automatically. I don't want to fail backups due to this bogus corruption.
I've found the ability to skip a certain number of corrupt blocks on a datafile-by-datafile basis ("maxcorrupt" parameter, I think), but that's not really what I'm after. For one thing, we often have hundreds of datafiles, and it would be unwieldy to list each datafile number followed by "9999999" or something to tell RMAN to effectively ignore all corruption. RMAN's corruption check is nice, but I'd like to tell it to ignore blocks that have no rows. If I can't do that then is there a clean way to disable the automatic corruption check altogether? If I could decouple the concept of backup from the concept of corruption checking then I'd be happier.My understanding is that Oracle will format a block before adding rows for the first time, and at that point the corruption will be fixed automaticallyAre you sure ? What sort of corruption do you really have in the database files ? Logical corruption might be fixed "automatically" but physical corruption will NOT be fixed automatically.
The proper action is to
a. Review the storage and run diagnostics for errors -- particularly if there is a pattern and/or an increasing number of corrupt blocks
b. Use Oracle's "dbv" to identify corrupt blocks in datafiles
See http://download.oracle.com/docs/cd/B19306_01/server.102/b14215/dbverify.htm#i1006970
c. Use dbms_repair procedures (check_object, skip_corrupt_blocks, fix_corrupt_blocks are likely procedures to use) if corrupt blocks are found in segments
See http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14258/d_repair.htm#BABHJAHI
Hemant K Chitale
http://hemantoracledba.blogspot.com
Edited by: Hemant K Chitale on Feb 4, 2010 10:43 AM
Edited by: Hemant K Chitale on Feb 4, 2010 10:47 AM -
Questions on Logical corruption
Hello all,
My DB version is 10g+ - 11.2.0.3 on various different OS. We are in process of deploying RMAN on our system and i am having a hard time on testing/get a grip around the whole logical corruption... from what i understand(please correct me if i am wrong)
1. I can have a check logical syntax in my backup cmd(and that will check both physical and logical corruption)...But how much overhead dose it have, Seems to be anywhere from 14-20% overhead on backup time.
2. Leaving the maxCorrupt to default(which i beleive is 0)...if there is a physical corruption my backup will break and i should get an email/alert saying backup broke...
3. Would this be same for logical corruption too ??, would RMAN report logical corrution right away like physical corruption would do? Or do i have to query v$database_block_corruption after backup is done to figure out if i have logical corruption
4. how would one test logical corruption ?? (besides the NO_LOGGING operation, as our DB have force logging turned on)
5. Is it a good practice to have check logical corruption in your daily backup? ( i guess i have no problems for it if DB are small, but some of our DB are close to 50TB+ and i think the check logical is going to increase the backup time significantly)
6. If RMAN cannot repair logical corruption, then why would i want to do the check logical (besides knowing i have a problem and the end user have to fix it by reload the data...assuming its a table not index that is corrupt)..
7. any best practices when it comes for checking logical corruption for DB in 50+ TB
I have actually searched on here and on google, but i could not find any way to reproducing logical corrpution(maybe there is none), but i wanted to ask the community about it....
Thank you in advance for your time.General info:
http://www.oracle.com/technetwork/database/focus-areas/availability/maa-datacorruption-bestpractices-396464.pdf
You might want to google "fractured block" for information about it without RMAN. You can simulate that by writing a C program to flip some bits, although technically that would be physical corruption. Also see Dealing with Oracle Database Block Corruption in 11g | The Oracle Instructor
One way to simulate is to use nologging operations and then try to recover (this is why force logging is used, so google corruption force logging). Here's an example: Block corruption after RMAN restore and recovery !!! | Practical Oracl Hey, no simulate, that's for realz!
Somewhere in the recovery docs it explains... aw, I lost my train of thought, you might get better answers with shorter questions, or one question per thread, for this kind of fora. Oh yeah, somewhere in the docs it explains that RMAN doesn't report the error right away, because later in the recovery stream it may decide the block is newly formatted and there wasn't really a problem.
This really is dependent on how much data is changing and how. If you do many nologging operations or run complicated standby, you can run into this more. There's a trade-off between verifying everything and backup windows, site requirements control everything. That said, I've found only paranoid DBA's check enough, IT managers often say "that will never happen." Actually, even paranoid DBA's don't check enough, the vagaries of manual labor and flaky equipment can overshadow anything. -
Logical corruption in datafile
what is logical corruption.
How this can occur in datafile , is it related caused due to disk.
how to avoid this.
Is it possible to check the this on regular interval. with some job script .. any idea what command how to do it .. does dbverify will do.
Any good reading/url is most welcomed.
Thank You Very Much.user642237 wrote:
what is logical corruption.
How this can occur in datafile , is it related caused due to disk.
how to avoid this.
Is it possible to check the this on regular interval. with some job script .. any idea what command how to do it .. does dbverify will do.
Any good reading/url is most welcomed.
Thank You Very Much.What's the db version and o/s? Where did you read the term logical corruption in datafiles? AFAIK, datafiles get physically corrupted only. The logical corruption happens within the blocks , for example some index entry pointing towards a null rowid. I am not sure that I have come across any situation/reference where this corruption is mentioned for files as well. To check it, the best possible tool is RMAN which can do the job by some simple commands.
HTH
Aman.... -
Logical corruption found in the sysaux tablespace
Dear All:
We lately see the logical corruption error when running dbverify command which shows the block corruption. It is always on the the sysaux tablespace. The database is 11g and platform is Linux.
we get the error like:error backing up file 2 block xxxx: logical corruption and this comes to alert.log out of the automated maintenance job like sqltunning advisor running during maintenance window.
Now As far as I know,we can't drop or rename the sysaux tablespace. there is a startup migrate option to drop the SYSAUX but it does not work due to the presence of domain indexes. you may run the rman block media recovery but it ends with not fixing since rman backups are more of physical than maintain the logical integrity.
Any help, advise, suggestion will be highly appreciated.If you let this corruption there then you are likely to face a big issue that will compromise database availability sooner or later. The sysaux is a critical tablespace, so you must proceed with caution.
Make sure you have a valid backup and don't do any thing unless you are sure about what you are doing and you have a fall back procedure.
if you still have a valid backup then you can use rman to perform a db block level recovery, this will help you in fixing the block. Otherwise try to restore and recover the sysaux. In case you cannot fix the block by refreshing the sysaux tablespace then I suggest you to create a new database and use aTransportable Tablespace technique to migrate all tablespaces from your current database to the new one and get rid of this database.
~ Madrid
http://hrivera99.blogspot.com -
How can I stop a task sequence if a custom HTA preflight check fails?
In our currently deployment method, we launch an HTA program before initiating the OSD process. This is only when run from the RAP menu, not via PXE. When a user initiates OSD through that menu, they get a message prompting them to close Outlook, and
a countdown of 5 mins, then OSD starts. They also have the ability to click on an 'OK' button to proceed on their own.
I've created a new script which checks WMI if Outlook and/or OCS are open, and if the machine is running on battery, spit out a "Failed" response and stop the HTA. I've also added a "recheck" button to re-do the check, and an 'OK
button if people jsut want to continue.
I'm curious if there is a way to prevent the task sequence from continuing if any of those conditions arent met. Currently it just pops up and says "Failed, Cannot conitue", but if they close the window, the task sequence thinks the program
has run, and the OSD migration starts. I'd like to be able and get the script to cancel the OSD process if a check fails.
Has anyone had success with this, using WINXP? I'd use the MS pre-flight check but it's only for WIN7.Interesting. Thanks for the response. Is there anybody out there that can assist with VBS part of the solution?
Here's the code I'm working with. Currently the battery piece isnt working as it should but I can figure that our, eventually. I'd like to get Jason's proposed solution in the code. If this isn't the right place, I'll take this somewhere
else.
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>OSD Preflight checks</title>
<HTA:APPLICATION
APPLICATIONNAME="OSD Preflight checks"
ID="objOSDPreReqChecks"
SCROLL="no"
CONTEXTMENU="no"
SINGLEINSTANCE="no"
MAXIMIZEBUTTON="no"
MINIMIZEBUTTON="no"
WINDOWSTATE="normal"/>
<!-- #region STYLEs-->
<style type="text/css">
H1{color:Black;text-align:center;font-family: Arial, Helvetica, sans-serif;font-size: 26px;}
p{font-family:"Arial";font-size:10px;}
fail{color:Red;text-align:center;}
.Version {float:left; font-size:1.0em;font-style:italic;color:#888888;font-weight:bold;}
.Header1 {width: 180px; text-align: right;font-weight:bold;}<!-- '1st column heading -->
H2 {font-family: Arial, Helvetica, sans-serif; text-align: center;}
H3 {font-style: italic;}
.style2 {width: 180px; text-align: left;}
.Header2 {width: 150px; text-align: right;font-weight:bold;}<!-- '2nd column heading -->
.style4 {width: 410px; text-align: left;}
.StatusBar
font-family: Arial, Helvetica, sans-serif;
text-align: center;
.hidden {display: none; visibility: hidden;}
</style><!-- #endregion -->
</head>
<script language="VBScript" type="text/vbscript">
'======================================================================================
' Script
' Version
' Purpose To check a machine is suitable for taking an OS deployment
'======================================================================================
'Features
' Modular design
' Verbose "Debug Mode"
' In-built data validation
' Custom error handling
' Custom error codes - 90x0
' Generic WMI handler
'BUGfix: Change CLng to CDbl to avoid overflow (in GetRAM)
'fixed - moved head section to top to become head > script > body
'fixed - fCheckModel display with leading ,
'fixed - fgetmodels dictionary list
Option Explicit
' #region GLOBAL DECLARATIONS: Persistent fold region
'======================================================================================
'GLOBAL Vars
'Things to just display (in GUI)
Dim strRAM
Dim strCPUInfo
Dim strCPUName
Dim strCPUDesc
Dim iCPUCount
Dim iCPUCoreCount
Dim iRAM
Dim strBIOSver, strBIOSDate, strBIOSInfo
'Time related
Dim TimerInterval 'timer to refresh HTA at start
Dim iTimer 'abort timer
Const iAbortTimeout=300000 'delay before window closes (in milliseconds)
Dim pbTimerID
Dim pbHTML
Dim pbWaitTime
Dim pbHeight
Dim pbWidth
Dim pbBorder
Dim pbUnloadedColor
Dim pbLoadedColor
Dim pbStartTime
'Dictionary
Dim objModelsDict,colKeys,strKey 'models
Dim objApprovedMakesDict
'Misc GLOBAL vars
Dim blnDebug 'set TRUE to trigger debug mode
Dim bAbortBuild 'Boolean flag to abort or not abort
Dim strTemp 'throwaway/scratch
Dim strNamespace 'wmi default namespace for ANY machine
Dim strComputer 'wmi reference to current machine, just .
Dim strService 'WMI service
Dim strQuery 'custom WQL
Dim ErrMsg 'custom error messages
Dim iErrMode 'State machine for error mode
Dim lFlags 'WMI flag
Dim strDisks
'Pre-requisites - things that will cause build to abort if values do not meet spec
Dim strHTAVendor 'Make of hardware
Dim strHTAVendorState
Dim strHTAModel 'Model of hardware
Dim strHTAModelState 'Model state
Dim strHTARAM 'RAM
Dim strHTARAMState 'RAM state
Dim strHTACPUSpeed 'Processor speed
Dim strHTACPUCores 'Number of cores
Dim strHTACPUFullInfo 'CPU + cores
Dim strHTAHDD 'Disk info
Dim strHTAHDDState 'Disk state
Dim strHTACheckRAW 'NTFS check
Dim strHTAArchitecture 'Processor support
Dim strHTAProduct 'Product ID
Dim strHTAOutlook 'Outlook running
Dim strHTAOutlookState 'Outlook state
Dim strHTABattery 'Battery check
Dim strHTABatteryState 'Battery state
'for WQL filters
Dim strWQLPCInfo 'Pre-req - (1) for various inc. domain role (servers)
Dim strWQLRAM 'Pre-req - (2) RAM
Dim strWQLCPU 'Pre-req - CPU speed string (not int)
Dim strWQLBootOrder 'Pre-req - Boot order string
Dim strWQLSATAMode 'Pre-req - HDD mode
Dim strWQLGenericBIOS
Dim strWQLCPUCount 'Pre-req - how many CPUs
Dim strWQLCPUInfo
Dim strWQLFSType 'Pre-req - Check HDD not RAW (i.e. is NTFS)
Dim strWQLDisks 'Disks
Dim strWQLChassis 'Machine type
Dim strWQLID 'Unique code from OEM
Dim strWQLProc 'is Outlook running = False
Dim strWQLBattery 'is on Battery = False
'State
Const cProblem = " Problem!"
Const cRunAgain =" RunCheck: Run System Check Again"
Const cSuccess = " Success!"
Const cPassed=" Pass"
Const cFail=" Fail"
'Pre-requisite to check: SET VALUES HERE vvvvvvvvvvvvvvvv
Const cApprovedOEM="Hewlett-Packard"
Const LegacyOEM1="Dell Inc."
Const LegacyOEM2="IBM"
Const cMinimumMemoryMB = 1000 'RAM in MB
'Const cMinimumMemoryMB = 1000000 'force fail test data RAM in MB
Const cMinFS="NTFS"
' Const cMinFS="HPFS" 'force fail test data
Const iMinCores=1
'Const iMinCores=10099 'force fail cores test data
Const iMinCPUSpeed=2 '20 'in GHz
'Const iMinCPUSpeed=90000 'in GHz
Const iMinCPUArch=32
'Const iMinCPUArch=64
' #endregion
' To hide anything use ID.className = "hidden", to show set to "", e.g. NotFoundArea.className = "hidden"
Sub Window_Onload
Err.Clear
VersionSpan.InnerText = objOSDPreReqChecks.Version 'Get version
self.focus
self.moveTo 100,100 'Move window top left
StatusBar.InnerText="Validating machine..."
document.body.style.cursor = "wait" 'hourglass cursor
'Call PreflightChecks 'use for testing as a VBS only, otherwise HTA timer will call below
TimerInterval = window.setInterval("PreflightChecks",10)
End Sub
Function PreflightChecks
' #region HEADER NOTES: Persistent fold region
'Version history
'ver 5 OCTOBER 2011 - added error handler
'ver 3rd Nov - removed HPonly queries
'// Solution: Custom Script for use with MDT - Adapted from hardwareinfo.vbs Mikael Nystrom – http://deploymentbunny.com
'Typical BIOS content
'Processor Speed = 2133/1066 MHz
'Boot Order = Network Controller,ATAPI CD-ROM Drive,USB device,Hard Drive,Diskette Drive,PnP Device #2,PnP Device #3,PnP Device #4,PnP Device #5,PnP Device #6,PnP Device #7,PnPe #8,PnP Device #9,PnP Device #10,PnP Device #11
'SATA (disk) mode: *IDE,--,RAID,-- or IDE,*AHCI,RAID
'On Error Resume Next
' #endregion
' #region CONSTANTS: Persistent fold region
'======================================================================================
'Fields available in HP BIOS
Const sAsset = "Notebook Asset Tag"
Const sOwner = "Notebook Ownership Tag"
Const sMan = "Manufacturer"
Const sNoteModel = "Notebook Model"
Const sCPU = "Processor Type"
Const sCPUSpeed = "Processor Speed"
Const sRAM = "Memory Size"
Const sModel = "Product Name"
Const sBIOSName ="System BIOS"
Const sBIOSVer = "BIOS Version"
Const sBIOSDate = "BIOS Date"
'Other BIOS stuff you could use too
'Const sOwnerTag = "Enter Ownership Tag"
'Const sBIOS = "PCID"
'Const sBIOS = "Define Custom URL"
'Const sBIOS = "Set Alarm Time"
'Const sBIOS = "PCID Version"
Const TextMode="1" 'text case sensitive for dict obj
'WMI core constants
Const wbemFlagReturnImmediately = 16 'wmi - Causes the call to return immediately.
Const wbemFlagForwardOnly = 32 'wmi - Causes a forward-only enumerator to be returned.
'Forward-only enumerators are generally much faster and
'use less memory than conventional enumerators, but don't allow calls to SWbemObject.Clone_
'Advisory config values - as in "you want to the change these"
Dim strHTABootOrder
Dim strHTASATAMode
'Dim strHTACPU
' #endregion
'======================================================================================
' #region WQL: Persistent fold region
lFlags = wbemFlagReturnImmediately + wbemFlagForwardOnly
'Queries of things to check (HP)
strWQLBootOrder = "select Name, value from HP_BIOSSetting where Name='Boot order'"
strWQLSATAMode = "select Name, value from HP_BIOSSetting where (Name='SATA emulation' or name='SATA device mode')"
strWQLDisks ="SELECT * FROM Win32_DiskDrive where mediatype like 'Fixed%hard disk%'" 'win32_disk only avail after W7
strWQLFSType ="SELECT * from Win32_LogicalDisk where DriveType='3'" 'only bother with HDDs
'Generic WMI query strings
strWQLGenericBIOS="SELECT Manufacturer,SMBIOSBIOSVersion,ReleaseDate FROM Win32_BIOS WHERE PrimaryBIOS = True"
strWQLCPUCount= "SELECT NumberOfProcessors,NumberOfLogicalProcessors from Win32_ComputerSystem"
strWQLCPUInfo="SELECT Name,DataWidth,description,MaxClockSpeed,NumberofCores,NumberOfLogicalProcessors from Win32_Processor"
strWQLPCInfo="SELECT Domain,DomainRole,SystemType,Manufacturer,Model,TotalPhysicalMemory FROM Win32_ComputerSystem"
' strWQLPCInfo="SELECT Domain,DomainRole,SystemType,Manufacturer FROM Win32_ComputerSystem"
strWQLChassis="SELECT ChassisTypes from Win32_SystemEnclosure"
strWQLID="SELECT IdentifyingNumber,UUID from Win32_ComputerSystemProduct"
strWQLRAM="SELECT * FROM Win32_PhysicalMemory"
strWQLProc="SELECT * FROM Win32_Process"
strWQLBattery="SELECT * FROM BatteryStatus Where Voltage > 0"
' #endregion
' #region MAIN algorithm
'=====================================================================================================
' MAIN
'Algorithm
'1) Check make (vendor)
'2) Check model (in list)
'3) Check RAM >x
'4) Check HDD TYPE (HDD is not RAW)
'5) Check CPU architecture
'6) Check outlook
'7) Check battery
'=====================================================================================================
'Initialise
window.clearInterval(TimerInterval) 'Reset timer to 0
' blnDebug=True
blnDebug=False
bAbortBuild=False 'default to DON'T abort
' bAbortBuild=True
'Build list of approved vendors
Set objApprovedMakesDict = CreateObject("Scripting.Dictionary")
objApprovedMakesDict.comparemode=VBTextCompare
objApprovedMakesDict.add cApprovedOEM,"OK"
objApprovedMakesDict.add LegacyOEM1,"OK"
objApprovedMakesDict.add LegacyOEM2,"OK"
objApprovedMakesDict.add "Lenovo","Testdata"
If blnDebug Then Stop
'1) all machines check make
strHTAVendor=fCheckVendor(strWQLGenericBIOS) 'check vendor in BIOS - if vendor not approved ABORT without proceeding
If bAbortBuild=True Then
StatusBar.InnerText=StatusBar.InnerText & VbCrLf & "FATAL ERROR - goodbye cruel world"
iTimer = window.setTimeout("Abort", iAbortTimeout, "VBScript")
Else
StatusBar.InnerText="Vendor: " & strHTAVendor & vbTab & " " & strHTAVendorState
'2) Discover current Model
strHTAModel=fGetModelName(strWQLPCInfo) 'get model name from WMI
strHTAModel=fUniversalCheckData(strHTAModel,"'Discover Model - fGetModelName'") 'validate
Call fGetModels 'get list of all valid models (from text file)
strHTAModel=fCheckModel(strHTAModel)
'2a) Model number (optional)
strHTAProduct=fGetComputerSystemProdIDNumber(strWQLID) 'manufacturer's product ID
strHTAProduct=fUniversalCheckData(strHTAProduct,"'Discover ID - fGetComputerSystemProdIDNumber'")
' StatusBar.InnerText=StatusBar.InnerText & VbCrLf & vbTab & "Product Code: " & vbTab & strHTAProduct
'3) Check installed Memory
strHTARAM=fGetRAM(strWQLRAM) 'find RAM size
strHTARAM=fUniversalCheckData(strHTARAM,"'Detect RAM - fCheckRAM'")
strHTARAM=fCheckRAM(strHTARAM) 'check RAM meets req
If strHTARAMState=cFail Then Exit Function
'4) Disk format IS NTFS
strDisks=fGetDrives(strWQLFSType) 'Get formatting info for all drives
strHTACheckRAW=fUniversalCheckData(strDisks,"'Detect filesystem - fCheckNTFS'") 'Validate data
strHTACheckRAW=fCheckNTFS(strDisks) 'Check FS format is acceptable (not RAW)
If strHTACheckRAW=cFail Then Exit Function
'Generic CPU calls
strHTACPUFullInfo="CPUs:" & fGetCPUInfo(strWQLCPUInfo) & " with CPU cores:" & iCPUCoreCount
strBIOSInfo="BIOS version: " & strBIOSver & ", dated " & strBIOSDate
'5a) CPU Speed check (info from http://www.robvanderwoude.com/wmiexamples.php)
strCPUInfo=WMI(strWQLCPUInfo,strNamespace) 'Get CPU details
strTemp=split(strCPUInfo,"@"): strHTACPUSpeed=strTemp(1)
strHTACPUSpeed=fUniversalCheckData(strHTACPUSpeed,"'Check processor - fCheckCPUSpeed'") 'Validate data
strHTACPUSpeed=fCheckCPUSpeed(strHTACPUSpeed) 'Check CPU clock speed
'5b) cores check
strHTACPUCores=fUniversalCheckData(iCPUCoreCount,"Check core count - fCheckCores") 'Validate data
iCPUCoreCount=fCheckCores(iCPUCoreCount) 'pass or fail?
'5c) CPU address width
strHTAArchitecture=fUniversalCheckData(strHTAArchitecture,"Check core count - fCheckCores") 'Validate data
strHTAArchitecture=fCheckCPUArch(strHTAArchitecture)
'6) Check outlook
strHTAOutlook=fCheckProcess(strWQLProc)
'7) Check Battery
strHTABattery=fCheckBattery(strWQLBattery)
'end checkss
document.body.style.cursor = "default"
'Display hardware values in GUI (in table)
Vendor.innerhtml = strHTAVendor 'Use str...var..STATE if you want Pass/fail text instead
Model.innerhtml = strHTAModel
Product.innerhtml = strHTAProduct
RAM.innerhtml = strHTARAM
CPUspeed.innerhtml = strHTACPUSpeed
CPUInfo.innerhtml = strHTACPUFullInfo
HDDFS.innerhtml = strHTACheckRAW
CapableArchitecture.innerhtml=strHTAArchitecture
BIOSversion.innerhtml = strBIOSver
BIOSDate.innerhtml = strBIOSDate' CPUName.innerhtml = strCPUDesc 'GetCPUName
End If
'======================================================================================
' #endregion
End Function
'generic WMI queries, by field and namespace
Function WMI(strQuery,strNameSpace)
'Aim: generic WMI calls
'return value of BIOS
On Error Resume Next
Dim colItems,objItem
Dim objWMI
Const strService = "winmgmts:{impersonationlevel=impersonate}//" 'binding to WMI
Const strComputer = "." 'this machine
Set objWMI = GetObject(strService & strComputer & strNamespace) 'GLOBAL wmi
Set colItems = objWMI.ExecQuery(strQuery,,lFlags)
For Each objItem In colItems
If Err Then
StatusBar.InnerText=StatusBar.InnerText & VbCrLf & "WMI query: " & strQuery & " in " & strNamespace & objItem.Name
Call ErrHandler("WMI error " & strQuery,1)
Else
WMI=objItem.Name 'Return value
End If
Next
End Function
Function fGetModelName(strWQLPCInfo)
'Aim: Get model name from BIOS - WMI field sometimes varies if laptop, so try two
'Return STRING: Model string from BIOS or "UNKNOWN" if null
On Error Resume Next
Dim colPCInfo,objPCItem
Dim strModel
Set colPCInfo = GetObject("winmgmts:").ExecQuery(strWQLPCInfo,"WQL",lFlags)
If Err Then
Call ErrHandler("fGetModelName: Error querying WMI " & strWQLPCInfo,2)
Else
For Each objPCItem In colPCInfo
If Not IsNull(objPCItem.Model) Then
strModel=objPCItem.Model
' iRAM=objPCItem.TotalPhysicalMemory
Else
If (strHTAVendor=cApprovedOEM And IsLaptop = True) Then ' resort to HP specific query for older laptops
'Notebook
strModel=QueryHPBIOS(sNoteModel)
if strModel="" then strModel=QueryHPBIOS(sModel) 'try alt value
Else
strModel=QueryHPBIOS(sModel)
End If
End If
Next
End If
If strModel = "" Then
fGetModelName = "UNKNOWN"
Model.style.visibility="hidden"
Else
fGetModelName=strModel
End If
End Function
'====================================================
'====================================================
Function fGetRAM(strQuery)
'Aim: get RAM installed. NB Win32_ComputerSystem::TotalPhysicalMemory may not be accurate
'Return integer
On Error Resume Next 'equiv to Err.Clear
Dim colItems, item
Dim iTotalMemory
Set colItems = GetObject("winmgmts:").ExecQuery(strQuery,"WQL",lFlags)
If Err Then
Call ErrHandler("fGetRAM: Error querying " & strQuery,2)
Else
iTotalMemory = 0
For Each item In colItems
iTotalMemory = iTotalMemory + CDBL(item.Capacity)/(1024^2)
Next
End If
If iTotalMemory = "" Then
fGetRAM = "RAM UNKNOWN"
RAM.style.visibility="hidden"
Else
fGetRAM=iTotalMemory
End If
End Function
'====================================================
'====================================================
Function fGetCPUInfo(strQuery)
'Aim: query WMI for CPU info - number and number of cores
'Return: function=CPU count, var for the cores: iCPUCoreCount, strHTAArchitecture, strCPUDesc
On Error Resume Next
Dim colItems, objItem
Dim NumberOfProcessors
Set colItems = GetObject("winmgmts:").ExecQuery(strQuery,"WQL",lFlags)
If Err Then
Call ErrHandler("GetCPUInfo: Error querying " & strQuery,2)
Else
For Each objItem In colItems
If Err Then
Else
If Not IsNull(objItem.NumberOfCores) Then
NumberOfProcessors = Trim(objItem.NumberOfCores) 'NumberOfProcessors
End If
If Not IsNull(objItem.NumberOfLogicalProcessors) Then
iCPUCoreCount = Int(Trim(objItem.NumberOfLogicalProcessors))
End If
If Not IsNull(objItem.DataWidth) Then
strHTAArchitecture=Trim(objItem.DataWidth) & "-bit"
End If
If Not IsNull(objItem.description) Then
strCPUDesc = Trim(objItem.description) 'cpu name
End If
End If
Next
If NumberOfProcessors = "" Then
NumberOfProcessors = "UNKNOWN"
End If
fGetCPUInfo = Int(NumberOfProcessors)
' iCPUCoreCount = Int(NumberOfLogicalProcessors)
End If
End Function
'====================================================
'====================================================
Function fGetComputerSystemProdIDNumber(strWQLID)
'Aim: Get UUID from Win32_ComputerSystemProduct
'Return: great big integer
Dim colSys,objSys
Dim strUUID
On Error resume next
Set colSys = GetObject("winmgmts:").ExecQuery(strWQLID,"WQL",lFlags)
If Err then
Call ErrHandler("fGetComputerSystemProdIDNumber: Error querying " & strWQLID,2)
Else
For Each objSys In colSys
If Not IsNull(objSys.IdentifyingNumber) Then
strUUID = Trim(objSys.IdentifyingNumber)
End If
Next
If strUUID = "" Then
fGetComputerSystemProdIDNumber = "UNKNOWN"
Else
fGetComputerSystemProdIDNumber = strUUID
End If
End If
End Function
'=================================================================================
'=================================================================================
Function fGetDrives(strQuery)
Dim colDisks,objHDD
Dim strDriveType, strDiskSize, strDisk
Dim strDiskFSType
Dim iGBUnits
On Error Resume Next
iGBUnits=1073741824
Dim iRAW
iRAW=0
Set colDisks = GetObject("winmgmts:").ExecQuery(strQuery)
For Each objHDD In colDisks
Select Case objHDD.DriveType
Case 1 strDriveType = "Drive could not be determined."
Case 2 strDriveType = "Removable Drive"
Case 3 strDriveType = "Local hard disk."
Case 4 strDriveType = "Network disk."
Case 5 strDriveType = "Compact disk (CD)"
Case 6 strDriveType = "RAM disk."
Case Else strDriveType = "Drive type Problem."
End Select
strDiskFSType = objHDD.FileSystem
'Find C
If objHDD.Name="C:" Then
If isNull(objHDD.FreeSpace) Then
If blnDebug=True then Call ErrHandler("ALERT!! Volume " & objHDD.Name & "is RAW",1) 'Abort/clean
fCheckDrives="ALERT!! Volume " & objHDD.Name & "is RAW"
End If
End If
strDiskSize = Int(objHDD.Size /iGBUnits) & "GB" 'calc size of disk
strDisk = strDisk & VbCrLf & "Vol " & objHDD.Name & " (" & strDriveType & ") size: " & strDiskSize & " (free: " & Int(objHDD.FreeSpace /iGBUnits) & "GB), " & strDiskFSType
fGetDrives=strDisk
Next
If (Err.Number <>0) Then
Call ErrHandler("WMI Property Query Error: [" & Err.Number & "]",2)
fGetDrives = -1
Exit Function
End If
End Function
'=================================================================================
'=================================================================================
Function fUniversalCheckData(varData,strStage) 'template
'Aim: Check value passed...
'is not blank
'is in range x..y
'spelt OK
'is in a list
'format is text, numeric
'return: string: the original value
On Error Resume Next
Dim Err
if blnDebug Then StatusBar.InnerText = StatusBar.InnerText & VbCrLf & "Validating " & strStage & " data..."
If Err Then
Call ErrHandler("WARNING: Error discovering value in " & strStage,2) '1=Quit,2=Warn
strHTAModel="Unknown"
Else
Select Case varData
Case IsEmpty(varData) Or IsNull(varData)
Call ErrHandler("WARNING: Error in "& strStage,2) '1=Quit,2=Warn
fUniversalCheckData="Unknown"
Case IsNumeric(varData)
If varData<0 Then
Call ErrHandler("WARNING: Value negative"& strStage,2) '1=Quit,2=Warn
fUniversalCheckData="Unknown"
End if
' & varData &
Case IsDate(varData)
Case Else
fUniversalCheckData=varData 'Data OK - return value unchanged
End Select
End If
End Function
'=================================================================================
'Checks - follow if true DO, if false warn/abort
'=================================================================================
Function fCheckBattery(strQuery)
'Aim: Find if battery is running
'Return pass/fail
On Error Resume Next 'equiv to Err.Clear
Const wbemFlagReturnImmediately = &h10
Const wbemFlagForwardOnly = &h20
Dim colItems, item
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\WMI")
Set colItems = objWMIService.ExecQuery("SELECT * FROM BatteryStatus Where Voltage > 0", "WQL", _
wbemFlagReturnImmediately + wbemFlagForwardOnly)
For Each item In colItems
if objItem.PowerOnline = True Then
strHTABattery=objItem.PowerOnline
strHTABatteryState = cFail
Err.Raise 9010,"fCheckBattery",strHTABattery & " Laptop running on battery. OSD Cannot continue."
Call ErrHandler(ucase(strHTABatteryState) & ": " & Err.Description & " (Code: " & Err.Number & " - " & Err.Source & ")",1)
StatusBar.InnerText=StatusBar.InnerText & VbCrLf & "FATAL ERROR - Laptop on Battery. Please plug into an outlet before proceeding."
iTimer = window.setTimeout("Abort", iAbortTimeout, "VBScript")
Else
strHTABatteryState = cPassed
End if
Next
fCheckBattery=strHTABattery
End Function
'====================================================
Function fCheckProcess(strQuery)
'Aim: Find if outlook is running
'Return pass/fail
On Error Resume Next 'equiv to Err.Clear
Dim colItems, item
Set colItems = GetObject("winmgmts:").ExecQuery(strQuery,"WQL",lFlags)
For Each item In colItems
if item.Name = "OUTLOOK.EXE" Then
strHTAOutlook=item.Name
strHTAOutlookState = cFail
Err.Raise 9010,"fCheckOutlook",strHTAOutlook & " running. OSD Cannot continue."
Call ErrHandler(ucase(strHTAOutlookState) & ": " & Err.Description & " (Code: " & Err.Number & " - " & Err.Source & ")",1)
StatusBar.InnerText=StatusBar.InnerText & VbCrLf & "FATAL ERROR - Outlook Running, please close outlook before proceeding."
iTimer = window.setTimeout("Abort", iAbortTimeout, "VBScript")
Elseif item.Name = "communicator.exe" Then
strHTAOutlook=item.Name
strHTAOutlookState = cFail
Err.Raise 9010,"fCheckOutlook",strHTAOutlook & " running. OSD Cannot continue."
Call ErrHandler(ucase(strHTAOutlookState) & ": " & Err.Description & " (Code: " & Err.Number & " - " & Err.Source & ")",1)
StatusBar.InnerText=StatusBar.InnerText & VbCrLf & "FATAL ERROR - Communicator Running, please close OCS before proceeding."
iTimer = window.setTimeout("Abort", iAbortTimeout, "VBScript")
Else
strHTAOutlookState = cPassed
End if
Next
fCheckProcess=strHTAOutlook
End Function
'====================================================
'1 - Make
Function fCheckVendor(strVendor)
'Aim: Check make is one the OS/build is designed For
'Return: STRINGS for "Make", BIOS version and BIOS date (generic): strHTAVendorState pass or fail
On Error Resume Next
Dim colItems,objItem
Set colItems = GetObject("winmgmts:").ExecQuery(strVendor, "WQL", lFlags)
For Each objItem In colItems
strHTAVendor=objItem.Manufacturer
if objApprovedMakesDict.exists(strHTAVendor) then
strBIOSver=objItem.SMBIOSBIOSVersion
strBIOSDate=Mid( objItem.ReleaseDate, 5, 2 ) & "/" & Mid( objItem.ReleaseDate, 7, 2 ) & "/" & Left( objItem.ReleaseDate, 4 )
strHTAVendorState=cPassed
Else
strHTAVendorState=cFail
Err.Raise 9010,"fCheckVendor",strHTAVendor & " found. The build will not work on this make of hardware"
Call ErrHandler(ucase(strHTAVendorState) & ": " & Err.Description & " (Code: " & Err.Number & " - " & Err.Source & ")",1)
bAbortBuild=True
end if
Next
fCheckVendor=strHTAVendor
End Function
'=================================================================================
'=================================================================================
'2 - Models check
Function fCheckModel(strThisModel)
'Aim Check target machine is in list of models
'Return string
On Error Resume Next
StatusBar.InnerText=StatusBar.InnerText & VbCrLf & "Checking model..." & VbCrLf
If objModelsDict.exists(trim(strThisModel)) then ' if current model in objDict then huzzah
strHTAModelState=cPassed
StatusBar.InnerText=StatusBar.InnerText & vbTab & "Model detected: " & vbTab & strHTAModelState
Else
strHTAModelState=cFail
Err.Raise 9010,"fCheckModel",strThisModel & " found. The build will not work on this model of hardware"
Call ErrHandler(ucase(strHTAModelState) & ": " & Err.Description & " (Code: " & Err.Number & " - " & Err.Source & ")",1)
end if
fCheckModel=strHTAModel
End Function
'=================================================================================
'=================================================================================
'3 - RAM
Function fCheckRAM(strRAM)
'Aim: Check installed RAM > x
'Return string digits with units, e.g. 4GB
'use strHTARAM for value
'==================================================================
' Memory Preflight Check (from MDT2012)
'==================================================================
On Error Resume Next
StatusBar.InnerText=StatusBar.InnerText & VbCrLf & "Checking RAM..."
If Err.Number <> 0 Then
Call ErrHandler("Error occurred while calculating computer's memory.",2)
End If
fCheckRAM = Int(strRAM/1024) & "GB" 'format in GB
If Int(strRAM) > cMinimumMemoryMB Then
strHTARAMState=cPassed 'Sufficient memory - show whole number in GB"
StatusBar.InnerText=StatusBar.InnerText & vbTab & "RAM installed: " & vbTab & strHTARAMState
Else
strHTARAMState=cFail
Err.Raise 9030 ,"fCheckRAM","Not enough memory in this machine!" & " Required physical memory is: " & cMinimumMemoryMB & " MB."
Call ErrHandler(ucase(strHTARAMState) & ": " & Err.Description & " (Code: " & Err.Number & " - " & Err.Source & ")",1) 'abort build
End If
End Function
'=================================================================================
'=================================================================================
'4 - NTFS disk
Function fCheckNTFS(strDiskFS)
'Aim: Check HDD is NTFS
'Return string
On Error Resume Next
StatusBar.InnerText=StatusBar.InnerText & VbCrLf & "Checking file system is not RAW..."
If Instr(1,strDiskFS,cMinFS,VBTextCompare)<>0 Then
fCheckNTFS=cMinFS 'disk format is OK (NTFS)
StatusBar.InnerText=StatusBar.InnerText & vbTab & " File system: " & cPassed
Else
fCheckNTFS=cFail
Err.Raise 9040 ,"fCheckNTFS","WARNING: Disk not correct file-system. Type required is: " & cMinFS & "." & VbCrLf & _
"The deployment will fail unless you reformat the target disk immediately."
Call ErrHandler(Err.Description & " (Code: " & Err.Number & " - " & Err.Source & ")",2) 'halt build
End If
End Function
'====================================================
'=================================================================================
'5 - CPU checks
'=================================================================================
Function fCheckCPUSpeed(strCPU) 'any HW
'Aim: Check CPU speed
'Return string = number + appropriate units, e.g. 5HGz (strCPU)
On Error Resume Next
StatusBar.InnerText=StatusBar.InnerText & VbCrLf & "Checking CPU spec..."
Select Case Right(strCPU,3) 'check units
Case "MHz"
strCPU=Left(strCPU,4)/1000 'reformat to GHz
Case "GHz"
strCPU=strCPU 'unit already OK
Case Else
Call ErrHandler("CPU units are unknown",2)
End Select
'Check clock speed
If Int(Left(trim(strCPU),1))>=iMinCPUSpeed Then
fCheckCPUSpeed=strHTACPUSpeed 'CPU is fine i.e don't change value
StatusBar.InnerText=StatusBar.InnerText & vbTab & "CPU Speed: " & cPassed
Else
fCheckCPUSpeed=cFail 'already in GHz
Err.Raise 9050,"fCheckCPUSpeed","CPU speed pre-requisite failed. Minimum processor clock speed is: " & iMinCPUSpeed
Call ErrHandler(Err.Description & " (Code: " & Err.Number & " - " & Err.Source & ")",1) 'halt build
End If
End Function
'=================================================================================
'=================================================================================
Function fCheckCPUArch(strCPUArch) 'any HW
'Aim: Check CPU width
'Return string
On Error Resume Next
StatusBar.InnerText=StatusBar.InnerText & VbCrLf & "Checking CPU bus width..."
'Check clock speed
If Int(Left(trim(strCPUArch),2))>=iMinCPUArch Then
fCheckCPUArch=strHTAArchitecture 'CPU is fine i.e don't change value
StatusBar.InnerText=StatusBar.InnerText & vbTab & "CPU width: " & cPassed
Else
fCheckCPUArch=cFail 'already in GHz
Err.Raise 9052,"fCheckCPUArch","CPU width pre-requisite failed. Minimum processor width required is: " & iMinCPUArch
Call ErrHandler(Err.Description & " (Code: " & Err.Number & " - " & Err.Source & ")",1) 'abort build
End If
End Function
'=================================================================================
Function fCheckCores(iCores)
'Aim: Check hardware (CPU) has a minimum number of cores
'Return Integer
On Error Resume Next
StatusBar.InnerText=StatusBar.InnerText & VbCrLf & "Checking CPU cores..."
If iCores>=iMinCores Then
fCheckCores=iCores
StatusBar.InnerText=StatusBar.InnerText & vbTab & "Core count: " & vbTab & cPassed
'StatusBar.InnerText=StatusBar.InnerText & vbTab & "CPU cores: " & cPassed
Else
fCheckCores=cFail
Err.Raise 9051,"fCheckCores","WARNING: Not enough cores on the CPU to support the build. Minimum CPU cores is: " & iMinCores
Call ErrHandler(Err.Description & " (Code: " & Err.Number & " - " & Err.Source & ")",2) 'halt build
End If
End Function
'=================================================================================
'=================================================================================
Function fCheckHPCPUSpeed 'HP ONLY
'Aim: Check CPU speed
'return: string
'Check CPU speed
On Error Resume Next
strWQLCPU = "processor speed"
strTemp=QueryHPBIOS(strWQLCPU,"")
Select Case Right(strTemp,3)
Case "MHz"
strTemp=Left(strTemp,4)/1000 'reformat to GHz
Case "GHz"
strTemp 'is OK
Case Else
Call ErrHandler("CPU is unknown",2)
End Select
'Check clock speed
If strTemp>=iMinCPUSpeed Then
fCheckCPUSpeed= strTemp & "GHz"
Else
Err.Raise 9050,,"CPU speed pre-requisite failed"
Call ErrHandler("CPU is too slow",1)
fCheckCPUSpeed=cFail 'already in GHz
End If
End Function
'=================================================================================
'=================================================================================
Function fGetModels
'Aim: Read external text file
'return: dictionary object - models as key, integer as value e.g. Dell Optiplex,12
'On Error Resume Next
Dim objFSO
Dim objFile
Dim strFile
Dim strEntry
Dim n
Dim strfilepath
Dim iLineCount 'count lines to avoid listing first item with ,.
Set objModelsDict = CreateObject("Scripting.Dictionary")
set objFSO=CreateObject("Scripting.FileSystemObject")
Const ForReading=1
strfilepath = Left(window.location.pathname,InStrRev(window.location.pathname,"\"))
strFile=strfilepath & "Models.txt"
set objFile=objFSO.OpenTextFile(strFile,ForReading)
iLineCount=0
'read in each line of data until you reach the end of the file
do While objFile.AtEndOfStream<>True
strEntry=objFile.ReadLine
'you can now do what ever you want with the line as referenced with the strEntry variable such as
'echoing it back (e.g. wscript.Echo strEntry) or passing it as a variable to a function of subroutine (e.g. MyFunction strEntry)
objModelsDict.comparemode=VBTextCompare
objModelsDict.Add strEntry,iLineCount
iLineCount=iLineCount+1
If blnDebug then
If iLineCount=1 Then
StatusBar.InnerText=trim(strEntry)
Else
StatusBar.InnerText=StatusBar.InnerText & ", " & trim(strEntry) 'list models
End If
End If
Loop
objFile.Close
End Function
'=================================================================================
'=================================================================================
'====================================================
Function ErrHandler(strErrorMsg,iErrMode)
'Aim: to handle error states
' 1 = Abort
' 2 = Warn
'Return 'Appropriate text message explaining the error
'====================================================
Const msgTitle="SCCM Deployment Preflight Checklist"
'On Error Resume Next '< don't use that as we want to KEEP the error properties
'Abort=1
If iErrMode=1 Then
StatusBar.InnerText=strErrorMsg 'overwrite status with Error message
' StatusBar.InnerText=StatusBar.InnerText & VbCrLf & " " & strHTAOutlook & " " & strHTAVendor & " " & strHTAVendorState & _
' VbCrLf & " " & strHTAModel & strHTAModelState & _
' VbCrLf & " " & strHTARAM & strHTARAMState & _
' VbCrLf & " " & strHTAHDD & strHTAHDDState
iTimer = window.setTimeout("Abort", iAbortTimeout, "VBScript") 'Abort (close) after n seconds
'MsgBox strErrorMsg,vbExclamation,msgTitle
'ErrBar.class=""
ElseIf iErrMode=2 Then
'Warning
StatusBar.InnerText=StatusBar.InnerText & VbCrLf & strErrorMsg & " " '& "(" & Err.Description & " :" & Err.Number & ")"',vbExclamation,msgTitle
Err.Clear
End If
End Function
'====================================================
Sub Abort
'Aim: Quit gracefully
window.close()
End Sub
</script>
<!-- #region BODY -->
<body>
<br />
<div>
<span style="version"> <span id="VersionSpan"></span></div>
<div style="text-align: center;">
<H1 style="font-family: Arial, Helvetica, sans-serif; font-size: large; text-align: center; color: #000000; text-transform: capitalize">System information</H1>
<span>
<table border="1" cellspacing="0" cellpadding="0" style="width: 912px"
id="SysInfoTable">
<tr class="h1">
<td align="right" class="Header1" style="width: 76px; height: 18px">
</td>
<td align="right" class="Header1" style="height: 18px"><em id="VendorCaption">Vendor</em></td>
<td align="left" class="style2" style="height: 18px"><span id="Vendor"></span></td>
<td align="right" class="Header2" style="height: 18px"><em id="ModelCaption">Model</em></td>
<td align="center" class="style4" style="width: 400px; height: 18px"><span id="Model"></span></td>
</tr>
<tr>
<td align="right" class="Header1" style="width: 76px">
</td>
<td align="right" class="Header1"><em id="ProductCaption">Product ID</em></td>
<td align="left" class="style2"><span id="Product"></span></td>
<td align="right" class="Header2"><em id="RAMCaption">Memory(in MB)</em></td>
<td align="left" class="style4" style="width: 400px"><span id="RAM"></span></td>
</tr>`
<tr>
<td align="right" class="Header1" style="width: 76px">
</td>
<td align="right" class="Header1"><em id="CPUCaption">CPU speed (in GHz)</em></td>
<td align="left" class="style2"><span id="CPUspeed"></span></td>
<td align="right" class="Header2"><em id="CPUInfoCaption">No: CPU\Cores</em></td>
<td align="left" class="style4" style="width: 400px"><span id="CPUInfo"></span></td>
</tr>
<tr>
<td align="right" class="Header1" style="width: 76px">
</td>
<td align="right" class="Header1"><em id="DiskFSCaption">Filesystem info</em></td>
<td align="left" class="style2"><span id="HDDFS"></span></td>
<td align="right" class="Header2"><em id="CapableArchCaption">Architecture</em></td>
<td align="left" class="style4" style="width: 400px"><span id="CapableArchitecture"></span></td>
</tr>
<tr>
<td align="right" class="Header1" style="width: 76px">
</td>
<td align="right" class="Header1"><em id="BIOSVerCaption">BIOS version</em></td>
<td align="left" class="style2" ><span id="BIOSVERSION"></span></td>
<td align="right" class="Header2"><em id="BIOSDateCaption">BIOS Date</em></td>
<td align="left" class="style4" style="width: 400px"><span id="BIOSDate"></span></td>
</tr>
</table>
</span>
</div>
<div class="StatusBar">
<br />
<Span id="StatusBar">Loading...please wait.</Span>
</div> <br><br>
<div align="center">
<input type="button" name="btnStop" id="btnStop" value="Continue" onclick="Abort">
<input type="Button" value="Re-Scan Machine" name="button1" onClick="Window_Onload" class="button">
</div>
</body><!-- #endregion -->
</html>
Maybe you are looking for
-
2/4 user computers asking for login info for CR
Hello, I have deployed a VB application built in VS 2008 and my database is MySQL. My crystal reports version is 10.5. I deployed the VB application on 4 user computers and 2 of them I can run the application and the reports show up with no issues.
-
Adobe Reader XI not displaying PDF in IE11
Hello, I'm sure there's a small detail/option I'm missing. I have PDFs that I need displayed within IE11 and the browser displays an x where the file should be. I've verified the Internet options under Preferences are correct in Reader. I've reset th
-
Hello SAP community. Does anyone have a step-by-step code sample for creating either a jsp or web dynpro application in Netweaver to use a java proxy to connect to XI that will calls a RFC or BAPI in SAP R3?
-
SQL PLUSW.EXE Not Supported on oracle 11G
I installed Oracle 11G and am not able to connect the GUI SQL Plus. When SQLPlus.exe is executed, it brings me to a DOS based version of SQL Plus. Is there a way I can get the GUI verison installed with 11G? i ve installed Oracle Database 11g Release
-
Querry regarding overriding static methods
Hi , I m overriding a static method defined in superclass ThreadLocal1 as: public static void mm() System.out.println("bye"); class Thread1 extends ThreadLocal1{ tt(){} public static void mm() System.out.println("hi"); public static void ma