MS SQL 2017 Express: Weird error on restoring backup - database-backups

I'm getting the following error on restoring backup using MS SQL 2017 Express:
Msg 3287, Level 16, State 1, Line 11
The file ID 2 on device 'C:\Backups\Test180529.bak' is incorrectly formed and can not be read.
Msg 3013, Level 16, State 1, Line 11
RESTORE DATABASE is terminating abnormally.
The test backup was made and was verified on the same MS SQL 2017 Express server instance:
BACKUP DATABASE [Test] TO DISK = N'C:\Backups\Test180529.bak' WITH NOFORMAT, INIT, NAME = N'Test-Full Database Backup', SKIP, NOREWIND, NOUNLOAD, NO_COMPRESSION, STATS = 50, CHECKSUM
GO
declare #backupSetId as int
select #backupSetId = position from msdb..backupset where
database_name=N'Test' and backup_set_id=(select max(backup_set_id) from msdb..backupset where database_name=N'Test' )
if #backupSetId is null begin raiserror(N'Verify failed. Backup information for database ''Test'' not found.', 16, 1) end
RESTORE VERIFYONLY FROM DISK = N'C:\Backups\Test180529.bak' WITH FILE = #backupSetId, NOUNLOAD, NOREWIND
GO
Here are the backup process messages:
52 percent processed.
Processed 304 pages for database 'Test', file 'Test' on file 1.
100 percent processed.
Processed 2 pages for database 'Test', file 'Test_log' on file 1.
BACKUP DATABASE successfully processed 306 pages in 0.115 seconds (20.788 MB/sec).
The backup set on file 1 is valid.
I have used this MS SQL Server 2017 Express instance to successfully restore backups made on other MS SQL Server instances running on other systems.
The problematic MS SQL Server 2017 instance is running on a Windows Server R2 Standard VPS.
Update
select ##version
Microsoft SQL Server 2017 (RTM) - 14.0.1000.169 (X64) Aug 22 2017 17:04:49 Copyright (C) 2017 Microsoft Corporation Express Edition (64-bit) on Windows Server 2012 R2 Standard 6.3 <X64> (Build 9600: ) (Hypervisor)

I have fixed my MS SQL 2017 Express setup's backup/restore subject issue by using the "SQL Server® 2017 for Microsoft® Windows Latest Cumulative Update" (https://www.microsoft.com/en-us/download/details.aspx?id=56128).
The version of my MS SQL Server 2017 Express setup now is:
Microsoft SQL Server 2017 (RTM-CU7) (KB4229789) - 14.0.3026.27 (X64) May 10 2018 12:38:11 Copyright (C) 2017 Microsoft Corporation Express Edition (64-bit) on Windows Server 2012 R2 Standard 6.3 (Build 9600: ) (Hypervisor)

Related

Oracle 19.5 giving ORA-39358 for 19.0 dump

I am importing 19.0 dump (exported on Oracle 19.0c) on Oracle 19.5c oracle. But it give strange message as below,
Import: Release 19.0.0.0.0 - Production on Wed Mar 23 05:46:48 2022
Version 19.5.0.0.0
Copyright (c) 1982, 2019, Oracle and/or its affiliates. All rights reserved.
Connected to: Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
ORA-39002: invalid operation
ORA-39358: Export dump file version 19.0.0.0.0 not compatible with target version 12.2.0.0.0
Can anyone explain.
Here is the compatible parameter I have:
\`SQL\> SELECT name, value FROM v$parameter
WHERE name = 'compatible'; 2
NAME
-
VALUE
-
compatible
12\.2.0
\`

VS setup project register search launch condition

Using a Visual Studio setup project (vdproj), I need to add a launch condition that checks for a registry value.
As you can see below I am checking for HKEY_LOCAL_MACHINE\SOFTWARE\Search Company.\Software 2020 (64-bit) and looking for value of Path.
The installer fails and looking at the windows installer log, I see that it is looking for HKEY_LOCAL_MACHINE32 :
MSI (c) (AC:30) [08:11:45:184]: Note: 1: 1402 2: HKEY_LOCAL_MACHINE32\SOFTWARE\Search Company.\Software 2020 (64-bit) 3: 2
Why is it looking for the root HKEY_LOCAL_MACHINE32 and how can I handle this?

My question is about exportdump with a query on oracle 9i

I am getting the following error and i need help.
hcp7 (spar)/tmp $ exp system/puppy parfile=rr.prm
Export: Release 9.2.0.8.0 - Production on Thu Oct 31 13:27:11 2019
Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
Connected to: Oracle9i Enterprise Edition Release 9.2.0.8.0 - 64bit Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.8.0 - Production
Export done in US7ASCII character set and AL16UTF16 NCHAR character set
About to export specified tables via Conventional Path ...
Current user changed to AHS
. . exporting table HB_CONTROL_OUT_DATA
EXP-00056: ORACLE error 933 encountered
ORA-00933: SQL command not properly ended
Export terminated successfully with warnings.
hcp7 (spar)/tmp $
hcp7 (spar)/tmp $ vi rr.prm
"rr.prm" 6 lines, 258 characters
file=raj.dmp
log=raj.log
STATISTICS=none
compress=y
tables=AHS.HB_CONTROL_OUT_DATA
query="[select * from hb_control_out_data where exists (select '1' from hb_control_out where hbod_tran_num = hbo_tran_num and ADD_MO
NTHS(HBO_TO_MIS_DATE,24) >SYSDATE)]"
You need to escape your quotes in the query. See the documentation at https://docs.oracle.com/cd/B10501_01/server.920/a96652/ch01.htm#1005843.
BTW, version 9i belongs in a software museum. It was released 17 years ago and the final patch set was released over 12 years ago.
The error message is
EXP-00056: ORACLE error 933 encountered
ORA-00933: SQL command not properly ended
What SQL are you executing? Well, your parameter file includes a QUERY parameter. It may be a trick of the cut'n'paste into the StackOverflow question box but this looks odd:
ADD_MO NTHS(HBO_TO_MIS_DATE,24)
^
If that space or newline is not an artefact remove and re-run the export.

How to check Oracle patches are installed?

How do I check that all services and patches are installed in Oracle?
I have an Oracle 10.2.0.2.0 db version and want to install patches. Also I want to get a list with all services and patches.
Here is an article on how to check and or install new patches :
To find the OPatch tool setup your database enviroment variables and then issue this comand:
cd $ORACLE_HOME/OPatch
> pwd
/oracle/app/product/10.2.0/db_1/OPatch
To list all the patches applies to your database use the lsinventory option:
[oracle#DCG023 8828328]$ opatch lsinventory
Oracle Interim Patch Installer version 11.2.0.3.4
Copyright (c) 2012, Oracle Corporation. All rights reserved.
Oracle Home : /u00/product/11.2.0/dbhome_1
Central Inventory : /u00/oraInventory
from : /u00/product/11.2.0/dbhome_1/oraInst.loc
OPatch version : 11.2.0.3.4
OUI version : 11.2.0.1.0
Log file location : /u00/product/11.2.0/dbhome_1/cfgtoollogs/opatch/opatch2013-11-13_13-55-22PM_1.log
Lsinventory Output file location : /u00/product/11.2.0/dbhome_1/cfgtoollogs/opatch/lsinv/lsinventory2013-11-13_13-55-22PM.txt
Installed Top-level Products (1):
Oracle Database 11g 11.2.0.1.0
There are 1 products installed in this Oracle Home.
Interim patches (1) :
Patch 8405205 : applied on Mon Aug 19 15:18:04 BRT 2013
Unique Patch ID: 11805160
Created on 23 Sep 2009, 02:41:32 hrs PST8PDT
Bugs fixed:
8405205
OPatch succeeded.
To list the patches using sql :
select * from registry$history;
I understand the original post is for Oracle 10 but this is for reference by anyone else who finds it via Google.
Under Oracle 12c, I found that that my registry$history is empty.
This works instead:
select * from registry$sqlpatch;
Maybe you need "sys." before:
select * from sys.registry$history;

INTERNAL ERROR :Failed assertion [PGE code :90105]

While trying to compile sample code with the Pro*C compiler I am getting:
c:\oracle\product\11.2.0\dbhome_1\BIN>proc iname=C:\Users\Selvaganapathy\Desktop
\pro-c\code\sample.pc
Pro*C/C++: Release 11.2.0.1.0 - Production on Mon Aug 6 01:00:59 2012
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
System default option values taken from: C:\oracle\product\11.2.0\dbhome_1\preco
mp\admin\pcscfg.cfg
INTERNAL ERROR: Failed assertion [PGE Code=90105]
Please help to set up the compiler.
Check if you have the temporary file
C:\Users\Selvaganapathy\Desktop\pro-c\code\sample.c
If it exists, retry after deleting this file or provide write permission to it.

Resources