| |

VerySource

 Forgot password?
 Register
Search
View: 1744|Reply: 4

Batch problem

[Copy link]

2

Threads

6

Posts

5.00

Credits

Newbie

Rank: 1

Credits
5.00

 China

Post time: 2020-3-11 11:00:02
| Show all posts |Read mode
Due to a virus in the computer, the Oracle database cannot automatically start the database instance after antivirus.
Not resolved for the time being.
I plan to write a batch file to run the windows system on startup
Let it help me open an instance of oracle database

The process of opening the oracle database instance is as follows

Start-run-cmd
c:\> sqlplus / nolog
Enter sql command mode
sql> conn sys / abcdefg @ server as sysdba
Connect oracle database
sql> startup
Start oracle database instance

I created a batch file of ora.bat directly,
The contents are as follows:
@echo off
sqlplus / nolog
conn sys / abcdefg @ server as sysdba
startup

After running, I found that I only went to the sqlplus / nolog step and did not go on, because after running sqlplus / nolog, I entered sql> and waited for the next command.
But the line conn sys / abcdefg @ server as sysdba was not entered.


What should I write?
Thank you for your guidance.
Reply

Use magic Report

0

Threads

21

Posts

19.00

Credits

Newbie

Rank: 1

Credits
19.00

 China

Post time: 2020-6-18 15:45:01
| Show all posts
There is one less automatic answer
Reply

Use magic Report

2

Threads

6

Posts

5.00

Credits

Newbie

Rank: 1

Credits
5.00

 China

 Author| Post time: 2020-7-8 15:30:01
| Show all posts
Thanks brother upstairs
Reply

Use magic Report

2

Threads

6

Posts

5.00

Credits

Newbie

Rank: 1

Credits
5.00

 China

 Author| Post time: 2020-7-9 09:30:01
| Show all posts
Method found
Write oraStartup.bat
@echo off
cd\
sqlplus /nolog @oraStartup.sql>>oraStartup.log

Write oraStartup.sql
conn sys/abcdefg@server as sysdba
startup

Put the oraStartup.bat batch file to the start-Program-Startup. Let the system run oraStartup.bat after login to open the database instance
Reply

Use magic Report

2

Threads

6

Posts

5.00

Credits

Newbie

Rank: 1

Credits
5.00

 China

 Author| Post time: 2020-7-9 11:30:01
| Show all posts
Write oraStartup.bat
@echo off
cd\
sqlplus /nolog @oraStartup.sql>>oraStartup.log
exit

Write oraStartup.sql
conn sys/abcdefg@server as sysdba
startup
exit

This is modified, and the exit exit command is added.
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list