Manually start Oracle Database - database

I have a Oracle DB in my computer, but when i have this DB my computer start very slowly. I decide to disable Oracle services in msconfig. I disable a follow services:
OracleMTSRecoveryService
OracleServiceXE
OracleXEClrAgent
OracleXETNSListener
But sometimes I need using a Oracle Database. I try run in windows admin tools in services. I run all Oracle services:
OracleJobScheduler
OracleMTSRecoveryService
OracleServiceXE
OracleXEClrAgent
OracleXETNSListener
All services have state set a running.
But when i run SQL Developer and try connect to my database i get this error:
An error was encountered performing the requested operation:
ORA-01033: ORACLE initialization or shutdown in progress
01033. 00000 - "ORACLE initialization or shutdown in progress" Cause: An attempt was made to log on while Oracle is being started up
or shutdown. Action: Wait a few minutes. Then retry the operation. Vendor code 1033
Why? How to correctly run database in manually case?

Login to sqlplus as SYSDBA (for instance with "sqlplus /as SYSDBA" on command line).
It probably says "connected to an idle instance". In that case , you can start the database with "startup".
Because you have been fiddling with the startup services there might be other steps to take. But based on your information anything can be wrong.

Related

MSSQL error: "Script level upgrade for database 'master' failed ... upgrade step 'msdb110_upgrade.sql' encountered error 200, state 7, severity 25."

All of a sudden one day (on my DEV PC) my Microsoft SQL Server 2012 instance (installed as instance name "SQL2012") would not start (all my other installed instances did). Trying to start it manually under Services failed. I don't recall making any recent changes prior to this. The cause of the failure was a mystery.
On inspecting Event Viewer, under System it showed a rather amusing error message [emphasis mine]:
The SQL Server (SQL2012) service terminated with the following service-specific error:
WARNING: You have until SQL Server (SQL2012) to logoff. If you have not logged off at this time, your session will be disconnected, and any open files or devices you have open may lose data.
checking under Application Event Log, I found these 2 error messages (preceded by a number of MSSQL$SQL2012 informational messages):
Script level upgrade for database 'master' failed because upgrade step 'msdb110_upgrade.sql' encountered error 200, state 7, severity 25. This is a serious error condition which might interfere with regular operation and the database will be taken offline. If the error happened during upgrade of the 'master' database, it will prevent the entire SQL Server instance from starting. Examine the previous errorlog entries for errors, take the appropriate corrective actions and re-start the database so that the script upgrade steps run to completion.
followed by:
Cannot recover the master database. SQL Server is unable to run. Restore master from a full backup, repair it, or rebuild it. For more information about how to rebuild the master database, see SQL Server Books Online.
Fearing having lost my system databases (and not having a backup of them to restore - who makes backups of their system dbs anyway??) and needing to access the instance, and attached databases - I was willing to try anything. Even the possible restore of the system databases: Restoring the SQL Server Master Database Even Without a Backup - but that looked quite complex.
Fortunately, I was eventually able to start the instance (thank you to this answer: https://stackoverflow.com/a/59676743/4993856 which I trusted, because Pinal Dave also mentions that particular switch in: SQL SERVER – Script level upgrade for database ‘master’ failed because upgrade step msdb110_upgrade.sql encountered error 926, state 1, severity 25) if I ran:
net start mssqlserver$SQL2012 /T902
This pointed to some issue with the upgrade script... (Remember SQL is installed with instance name: SQL2012, hence the mssqlserver$SQL2012 used above for the named instance).
After some more searching I discovered this post: Installing service pack / cumulative update on SQL Server 2016 / 2017 breaks database engine (not exactly the same SQL version as mine) which pointed to the following possible Region Settings setting (Control Panel [when viewed by 'icons'] > All Control Panel Items > Region > Administrative > "Change system locale..."):
"Beta: Use Unicode UTF-8 for worldwide language support" in Region Settings
THAT WAS IT!!! After de-selecting that option (and possibly restarting my computer), the MSSQL Server 2012 Instance started up without any issue, and I was able to access all my previously attached databases.
I assume the pending upgrade scripts ran successfully. Thinking back about it now, it is possible that I agreed to installing a SQL Update, and never bothered to test access to the instance afterwards.
I also don't recall exactly why I chose to enable that specific setting under Region Settings, possibly due to some Linux compatibility, but it looks like it has become defaulted 'on' in recent Windows builds.
I got the same problem SQL2017 after update Windows Patch Hotfix3391(KB5001228)
after restart server MSSQL Fail to start and event viewer shown error below
Script level upgrade for database 'master' failed because upgrade step 'msdb110_upgrade.sql' encountered error 200, state 7, severity 25. This is a serious error condition which might interfere with regular operation and the database will be taken offline. If the error happened during upgrade of the 'master' database, it will prevent the entire SQL Server instance from starting. Examine the previous errorlog entries for errors, take the appropriate corrective actions and re-start the database so that the script upgrade steps run to completion.
Solution
Fix by remove Beta:Use Unicode UTF-8 for Worldwide lang.. in the Region Settings
Then it require restart server. After restart MSSQL can start as normal.
The problem is the msdb_110.sql update script, the script is a bit of a mess, with mixed tabs and spaces (wtf?).
It tries to run a couple of procedures that fail, on startup of sql-server. They fail when the code-page is 65001 (usually because the BETA utf-8 code page option has been selected) and so SQL server fails to start.
This appears to happen any time a SQL Server update is installed. I only experience this error with SQL Server 2017, not 2019
Why?
Don't know? The script is a mess.
Solution
Deselect the use utd-8 code page option
Restart the machine
Start sql server and let it run the script
(optional) reselect the use utd-8 code page option
Restart machine again and sql server
(optinal but recommended) uninstall windows, install a unix and run postgres

R/3 installation sapinst giving database connection error

I am trying to install SAP R/3 ABAP, where databse instance is on one machine and central instance on different machine.
Database instance installation is finished but when trying to install central instance when sapinst tries to connect from Central Instance to database instance following error comes up
WARNING 2009-05-02 07:53:08.490
CJSlibModule::writeWarning_impl() Execution of the command "/usr/sap/E64/SYS/exe/run/startsap all DVEBMGS00 hpvm-202" finished
with return code 6.
Output: Database B11 must be started on remote
server Log on to remote server and start database
So, I went to database server and verified and database was indeed running (mounted and open).
ghoul3:e64adm 3> lsnrctl start
LSNRCTL for HPUX: Version 10.2.0.4.0 - Production on 02-MAY-2009 07:18:11
Copyright (c) 1991, 2007, Oracle. All rights reserved.
TNS-01106: Listener using listener name LISTENER has already been started
ghoul3:e64adm 4> /oracle/B11/startdb
Trying to start B11 database ...
Log file: /home/e64adm/startdb.log
B11 database started
R3trans –d from adm user runs perfectly
ghoul3:e64adm 8> R3trans -d
This is R3trans version 6.14 (release 701 - 26.01.09 - 12:46:00).
unicode enabled version
R3trans finished (0000).
I tried with shutdown database, restarting both systems but to no avail.
I don’t want to initiate a re-install as its consumes long time and chances are that same error crops up again, so better tackle it the first time itself.
Kindly advise how could we troubleshoot further or resolve this issue.
Just in case anyone faces the same issue, the problem lies with profile files, in profile files- Check for parameter named "SAPDBHOST" in DEFAULT.PFL.
Entry should be as
SAPDBHOST =
if it doesn't exit add hostname of the database instance.
Also, do check DEFAULT.PFL if the file name is "DEFAULT" only then rename it to DEFAULT.PFL.

Oracle - multiple databases on one server, connect issue

I'm new in Oracle Database and so far I was using only MS SQL Server. I created two databases on my laptop (habit from MS), which is running Windows 8.
I stoped those two databases using SQL Plus and "shutdown normal" command. Before stoping those databases, I connected to them using "user/password#database_SID" syntax. After shutdown I can't choose which database I want to connect because when using "#Database_SID" I've got this error:
"ORA-12514: TNS:listener does not currently know of service requested in connect descriptor".
How can I define which database I want to connect whithout "#Database_SID" syntax?
Thanks a lot for help!
Locally on your machine, you use IPC - Inter Process Communication to login to your database in order to do administrative work. (startup, shutdown, mount, etc)
C:\>set ORACLE_SID=DB1
C:\>sqlplus / as sysdba -- make sure you are member of group "ORA_DBA"
SQL>startup
C:\>set ORACLE_SID=DB2
C:\>sqlplus / as sysdba
SQL>startup
ORA-12514 indicates the database has not registered with the listener because database status is shutdown
Note. The Windows Service OracleService<SID> can have status "Running", but the database can be stopped (shutdown)
There is no need to have two physical databases running on your laptop. Waste of resources. In Oracle terms you need two schemas.
Make sure the listener is running.
On Windows, Oracle seems to use the networking layer, even when connecting locally.

ORA-1033: ORACLE initialization or shutdown in progress

I am stuck with a little Oracle problem. My PC was shut down improperly after my graphics card freaked out, which caused Oracle 11g Express to not properly close down. This means that I get the above error when I try to connect. My PC has been on for 3 hours, and I still get the error, so it is safe to assume that there's something wrong.
The usual way of remedying the problem is to use the following sequence of commands from the command line:
sqlplus /nolog
SQL> connect / as sysdba
SQL> shutdown abort
SQL> startup nomount
SQL> alter database mount;
SQL> alter database open;
However, when I give the shutdown command, I get the error
ORA-12560: TNS:protocol adapter error
So now, I can't mount my db. ANy help would be appreciated.
This worked for me:
Open the Start menu --> All Programs
Open folder "Oracle Database 11g Express Edition"
Choose "Start Database"
Wait until you get "C:\Windows\system32"
Open "Run SQL Command Line" and connect to your database
This is probably not necessary or even possible in all cases, but I ended up uninstalling and reinstalling Oracle because I get paid per hour and I'd rather spend that time producing code than wrestling with Oracle.
My guess would be that your listener service is not running.
You can check this by openening the services screen by (in Win7) searching for "services". In the list you should find an Oracle Listener service with status Started.

What state is my SQL server database in when msdeploy fails on user creation?

I am using msdeploy (version 2) to transfer a database from machine A to machine B.
On in the database on machine A there are some users that do not exist on machine B, thus the transfer (partially) fails with the message:
Error Code: ERROR_SQL_EXECUTION_FAILURE
More Information: An error occurred during execution of the database script.
The error occurred between the following lines of the script: "3" and "5".
The verbose log might have more information about the error.
The command started with the following: "CREATE USER [someDomain\someUser] FOR LOGIN [someDomain"
Windows NT user or group 'someDomain\someUser' not found.
Check the name again. http://go.microsoft.com/fwlink/?LinkId=178587
The database seems to be transfered, except for the user creation. Does anyone know what state the database is in after this failure?
Is there any way I can transfer the database without the users (or better without specific users) using msdeploy?
Web Deploy uses SMO (SQL Management Objects) to script out and apply the scripts for SQL databases, and exposes most of the SMO settings with the dbfullsql provider (so, most of these options: http://msdn.microsoft.com/en-us/library/microsoft.sqlserver.management.smo.transfer_properties.aspx). If you want to skip the users due to this kind of login-not-exists or user-not-found error, you should be able to do this by adding the scripting option: copyAllUsers=false to the source of the sync. For example:
msdeploy.exe -verb:sync -source:dbfullsql="Data Source=.\SQLExpress;Initial Catalog=MySourceDb;User Id=localUser;Password=LocalPass",copyAllUsers=false -dest:dbfullsql="Data Source=RemoteSQLServer;Initial Catalog=MyDestDb;User Id=remoteUser;Password=RemotePass"
Incidentally, I am surprised you note the db appears to have been sync'd - I would expect this is not actually the case. If you have the permissions for it, Web Deploy will create the database if it did not already exist when it initially tries to make the connection, but your failure occurred very early in the script execution, and I believe Web Deploy dbfullsql syncs are transacted by default (the db creation is separate from the script execution and is not transacted). Thus the db may exist where it did not pre-sync, but I wouldn't expect the data to be present in it.

Resources