ORA-12154: TNS:could not resolve the connect identifier specified with TeamCity - sql

Presently, I am attempting to setup TeamCity. In TeamCity Parameters, I have set the following values:
env.DeployConnectionString: Data Source=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=1521))(CONNECT_DATA=(SERVER=DEDICATED)(SID=mySID)));User ID=sys;Password=mySysPassword;
env.Rdbms: Oracle
env.SqlPlusLogon: #mySID
When I run the TeamCity project, it produces this error:
C:\TeamCity\buildAgent\work\4832a5599bdcf4b9\myProject\myProject.proj(51, 7): error MSB3073: The command "sqlplus "sys/mySysPassword#mySID as sysdba" #KillSessions.sql C:\Database\Oracle" exited with code -1.
Also, when I try to login to sqlplus from the command line, with the same arguments, it fails with the error in the above subject line. When I attempt to login to sqlplus from the command line using this string, it works with no problem:
sqlplus sys/mySysPassword#(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=1521))(CONNECT_DATA=(SERVER=DEDICATED)(SID=mySID))) AS SYSDBA #KillSessions.sql
So my question is, how can I configure TeamCity to use the bottom connection string instead of the top one? I had thought that is what I was doing in setting env.DeployConnectionString. Does anyone have any suggestions? TIA.

I think it's not reading the SID at this command: sys/mySysPassword#mySID.
Why not store the SID in the tnsnames.ora, and replace the mySID part in your command line?

Thank you everyone for your help. Resolved the above problem by changing env.SqlPlusLogon to:
env.SqlPlusLogon: #(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=127.0.0.1)(PORT=1521))(CONNECT_DATA=(SERVER=DEDICATED)(SID=mySID)))

Related

Beeline CLI create txt file command?

I recently have started to use Beelines CLI to interface with a hive server.
The problem is that create file command is failing for me.
I have tried the following:
add FILE[S] 'example.txt';
Which returns this error:
Error: Error while processing statement: null (state=,code=1)
You should remove the quotes from the path. i.e.
beeline> add file example.txt;
Also be sure that you are only adding files to the server hive is running on.

Weblogic server installation error

I launch Oracle installer from the command line. The path is:
C:\Program Files\Java\jdk1.8.0_131\bin\java -jar fmw_12.2.1.3.0_wls.jar.
When the installation is complete сonfig.cmd is launching and this apprears in the command line:
Too long entering line. Unexpected appearance: :process_classpath. C:\Users\User\AppData\Local\Temp\OraInstall2017-12-26_12-32-05PM>
Who faced this and knows any solutions to bypass this?
I'm thinking it might be some privilege issue.
I had similar kind of issue , so I started the installation in admin mode
Instead running from direct java bin path , try to set class path in environment variable then try.

ERROR: invalid token 'verify' after the command "rladmin help verify "

I have installed the redis on my VM. And then I run the commands
[root#vm001jeguan ~]# rladmin help verify
it shows the following error:
[root#dltasvm001jeguan ~]# rladmin help verify
ERROR: invalid token 'verify'
Run the following command it works well
[root#vm001jeguan ~]# rladmin status
Does anyone have met such issue? Thank you very much.
You are probably trying to run a new rladmin command on an older version of RLEC.
For further support please contact us at support#redislabs.com
Verify that you are using correct commands.
You can use rladmin then press "enter" and get an easier view.
Also use 'tab' for command guessing will help you.
[Example from 4.2.1-30 RLEC]
[root#ip-10-0-0-65 ~]# rladmin
RedisLabs Admin CLI
Version 4.2.1-30.rhel6
Use <?> for help at any time, <TAB> for command completion.
rladmin>
rladmin>
cluster Cluster management commands
exit Exit admin shell
failover Fail-over master to slave
help Show available commands, or use help <command> for a specific command
info Show information about tunable parameters
migrate Migrate elements between nodes
node Node management commands
status Show status information
tune Tune system parameters
upgrade Upgrade database version
rladmin>

SQL Server Database Project: Why is command execute not supported

I am trying to copy a file in my Pre Deployment script for a Visual Studio SQL Database project.
:!!copy $(DataFileDirectory)\data.csv $(DataDestinationDirectory)
I found that this generated the error:
SQL72007: The syntax check failed 'Incorrect syntax near .' in the batch near: ':!!copy
So I tried to simplify my testing and tried:
:!! dir
This also failed:
SQL72007: The syntax check failed 'Incorrect syntax near .' in the batch near: ':!! dir
It fails when I try:
!! dir
I am able to execute commands like:
:r .\myfile.sql
I noticed the following error occurs whenever I do :!!,
72006: Fatal scripting error: Command Execute is not supported.
Why is command execute (:!!) not supported?!
This can, of course, only truly be answered by the designers of SSDT, but you can make an educated guess: it would compromise system security too much. It would allow you to run arbitrary commands on the database server's OS, under the account of the user that runs SQL Server itself.
The sqlcmd.exe command allows one to disable the :!! and :ed commands, using the -X command line option, for the same reason.
If you really need to run OS commands in your script, you could still fallback to xp_cmdshell, which of course also has issues, but at least the server's administrator can decide if it should be allowed.
There are a lot more SQLCMD syntax options, that SSDT pre- or post deployment scripts do not support (for example :connect or :on error, it seems). So, another explanation would be, that for the purpose of deployment scripts the :r and :setvar commands were considered sufficient.

DB2 generate DLL error

Earlier this morning I trying to create DLL for my DB2 database but it kept giving the following message:
The DB2 Administration Server encountered a script error. Script
error code "1".
Explanation:
A script error was encountered while the DB2 Administration server was
executing the script. The script exited with error code "".
User response:
Verify that the script is correct.
If you continue to receive this error message after attempting the
suggested response, refer to the DB2 Administration Server's First
Failure Data Capture Log for additional information or contact IBM
Support.
can anyone help me on this?
my user is ROOT and schema is SQLJ
command is db2look -d OBDB -z SQLJ -u ROOT -e -l -x -c ;
Error code is SQL22220.
i once too had this problem. may be you are trying to generate dll for more than 30 tables at a time. reduce the no. of tables and see if this works. worked for me though but errors can be due to other reason as well, plz let me know.... :)