[英]how to connect to a oracle 12C database in SYSOPER or SYSDBA in PRELIM_AUTH mode using node.js
I am trying to start the server from my node.js application using npm's oracledb package.我正在尝试使用 npm 的 oracledb 包从我的 node.js 应用程序启动服务器。 But In order to do that I need to connect to the database in PRELIM_AUTH mode with SYSOPER or SYSDBA privileges.但是为了做到这一点,我需要使用 SYSOPER 或 SYSDBA 权限以 PRELIM_AUTH 模式连接到数据库。
Below is the sample code:下面是示例代码:
var oracledb = require('oracledb');
var dbConfig = require('./dbconfig.js');
oracledb.getConnection(
{
user : dbConfig.user,
password : dbConfig.password,
connectString : dbConfig.connectString
},
async function(err, connection) {
if (err) {
console.error(err.message);
return;
}
console.log('Connection was successful!');
await connection.startup();
connection.close(
function(err) {
if (err) {
console.error(err.message);
return;
}
});
});
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.