Questions tagged [unix]
The unix tag has no usage guidance.
46
questions
0
votes
0
answers
22
views
Unix Powershell script stops after running SQLPlus command within the script
We are trying to create a Unix Powershell (not shell script) script which first runs a SQL to update a couple of tables, psprcsque and psprcsrqst. The function which runs the SQL update gets variables ...
1
vote
1
answer
336
views
Convert column with unix timestamp from UTC to a different time zone
Good afternoon,
I have a column within one of my tables that is stamped with a UNIX timestamp. I would like to have the return in my current timezone, PST. I have the following query and the below ...
1
vote
0
answers
113
views
Critically high website CPU usage very sudden, persistent upon reboots [closed]
Quick summary. Wordpress community website, large userbase. Has caching for guests (WP Super Cache). Always operates around load of 1-2, or 5-6 at peak hours CPU.
As of 4pm EST on Feb 15, the CPU load ...
0
votes
2
answers
169
views
Command line command to read Oracle Database export Success Message In log File
We have several oracle 19c servers with daily exports. I would like to find a way to run a command to read the export log file to find the success message for the day. e.g. I would like to putty into ...
0
votes
1
answer
457
views
Help required to find correct MongoDB size
Please help me to find correct MongoDB size.
db version v3.4.10
I have also executed below command to check if there are any ghost file. The below command output is zero.
lsof | grep deleted | grep ...
1
vote
0
answers
473
views
Independently checking if PostgreSQL server and client are installed
How can I independently determine whether the PostgreSQL server and client are installed in the Unix-based system?
I believe running psql --version checks only for the PostgreSQL client.
Is postgres --...
1
vote
1
answer
33
views
Mysql 8 which linux / Unix Distro would have better performance (2021 topic) [closed]
I want to setup a mysql 8 with MyRocks engine and BUILD from source with my custom parameters.
Is there any recommendation on which linux / unix distro would have better performances ?
CentOS stream
...
1
vote
0
answers
24
views
UNIX timestamp using for storing logs
Would it be feasible to use UNIX timestamp as a primary key to store log records/analytics data of users?
Will there be inconsistencies if a RDBMS is used to store log data?
1
vote
3
answers
276
views
count duplicate records and select first 2
I have troubling issue where I want to only select the first 2 chunks of every dbspace created.
query used:
SELECT
a.dbsnum,
b.chknum,
a.name,
b.fname
FROM
sysdbspaces a, syschunks b where a.dbsnum = ...
0
votes
1
answer
211
views
How can I list all the tablespaces without getting into each instance?
I got around 98 instances in a single AIX server. I need to list all the tablespaces, their path and usage. Is there a way I can do that without getting into each instance, connecting into the ...
0
votes
0
answers
496
views
Import table data using multiple sql file in psql
Local Machine(l1):
Windows 10
psql
Remote Machine(R1):
linux
EDB(postgres)
On my local I have 1000+ sql script containing insert statement . psql is also installed locally .
I need to run this sql ...
-2
votes
1
answer
1k
views
How to resolve error "SQL0104N" when running "db2 prune logfile prior to" command?
I wrote an script to delete transaction log files in db2. I need to delete all the files prior to the active log file.I wrote this code as .sh file
db2 connect to DWHDB
db2 get db cfg | grep '/...
2
votes
1
answer
832
views
How to insert multiple IP addresses in a pg_hba.conf file via unix shell script?
I need to write some IP addresses to the pg_hba.conf file of my Postgresql, in order to allow remote access from those IP to my machine.
I have the following code in shell script to do that for a ...
0
votes
2
answers
45
views
Fetching wrong results on comparing a variable with 0 in unix
I have the following code in unix
#!/bin/bash
user=$1
username=$user'%'
DB_name=$2
userpwd=$4
export PGPASSWORD=$3
psql -h localhost -U postgres -d $DB_name -At -c "SELECT COUNT(*) AS ...
1
vote
1
answer
174
views
Sybase query: How can I sort the extraction (by well formed columns)
community
I built a Sybase query statement in a script (using the isql command/line ) below is the code:
My script contains:
isql -U databasename_dba -P password <<EOF!
select ...
0
votes
1
answer
193
views
how can I divide log files for specific DB queries?
Currently my db has a couple of triggers for some (not all) tables that get executed when a specific number of columns has been updated. I keep track if the triggers for those rows on a boolean column ...
2
votes
1
answer
167
views
Compute Leap Seconds
I use PostgreSQL 11 and have two columns. One is unix timestamp which is not aware of leap seconds and an utc timestamp which is aware of leap seconds.
Is there a way either to find the number of ...
1
vote
1
answer
836
views
Unlock user shell script for Oracle
We have so many user ID locks from the front-end users. We need to provide a shell script to the user which they can run on OS level and unlock the ID themselves when the DBA is not present.
The sys ...
0
votes
3
answers
343
views
Error while exporting data to flat file from database using sqlplus in UNIX
Trying to export data from a table to .dat file in a unix script using the SPOOL command.
However on execution only ~17k data is exported to file out of 91K data with an error in end of the file : ...
1
vote
1
answer
299
views
Automation approach to executing Shell scripts and performing checks on an Oracle DB
I am in the process of producing an automation framework that will:
Check Oracle tables for entries, such as IDs and status numbers
Log onto a UNIX box via Putty and switch to a directory where the ...
1
vote
1
answer
1k
views
sqlplus works specifying the parameters but fails when using tnsnames.ora
I've been turning google upside down and couldn't find an answer. I can connect to my oracle instance like this:
sqlplus 'myuser@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=msoracle.cnujcn8mkxea.us-...
1
vote
2
answers
4k
views
Mongodb not listening on all interface
Infrastructure : I have 3 virtual machines ip in a DMZ on a same lan.
one of them is running mongodb . OS : RHEL
Mongod.conf : I have commented out the bindIP option
But still mongodb is not ...
1
vote
1
answer
1k
views
how to execute unix commands within nzsql?
I'm converting a script from Teradata to Netezza, and I'm stuck at the portion where BTEQ uses the functionality of the OS to check if a file contains any data. If it does, it is deleted. I want to ...
0
votes
2
answers
6k
views
Connecting to SQL Server from R which is Running on Remote UNIX Machine
We have a UNIX machine which includes R engine on it and installed SQL Server ODBC Driver 11.
We need to connect R to SQL Server. SQL Server currently works on another machine, so we tried to connect ...
14
votes
3
answers
39k
views
Execute system commands in postgresql
My requirement is to execute a system command like (ls) or C program when a trigger executes. Is there any way to create a trigger function to solve this problem.
1
vote
2
answers
629
views
How to get readonly access to mysql files via g+w permission 750 or 640?
The data-dir itself has permissions 700 thereby limiting access to the mysql user.
I want other folks who I add to the mysql group to be able to read binlogs and download the *.frm, *.MYI, *.MYD ...
2
votes
2
answers
249
views
I want to change oracle "homedir" how to do?
A good link as answer is ok.
I want to change "homedir" or "basedir" of oracle db from /oracle to
/var/oracle.
How to do?
I have set the oracle unix variables($ORACLE_HOME,$ORACLE_BASE)
with the new ...
2
votes
1
answer
1k
views
How to use a variable date when running a db2 command in a shell script?
I need to use a date variable in a select, like bellow, but I'm getting this error: Expected tokens may include: "". SQLSTATE=42601
How can use these variables in a shell script?
day0_T1=`TZ=CST+...
0
votes
1
answer
1k
views
Determine Which Hard Drive the Database-Files/Transaction-Files are Stored
I have posted the following question in another forum. I was told that this problem is related to Sybase (something to do with our likely use of raw partitions). That's why I re-post this question ...
0
votes
1
answer
251
views
Unix timestamp conversion
How can I output my Unix timestamps to human readable GMT?
SELECT
category
,fullname
,shortname
,idnumber
,startdate
,visible
,timecreated
,...
4
votes
1
answer
1k
views
Can't get Dell PE T420 (Perc H710) perform better than a MacMini with PostgreSQL
It's months that I'm trying to solve a performance issue with PostgreSQL.
SYSTEM CONFIGURATION
Our deployment machine is a Dell PowerEdge T420 with a Perc H710 RAID controller configured in this way:...
24
votes
1
answer
39k
views
What limits the number of connections?
As per https://devcenter.heroku.com/articles/heroku-postgres-legacy-plans the connection limit is 500
As per https://wiki.postgresql.org/wiki/Tuning_Your_PostgreSQL_Server "Generally, PostgreSQL on ...
0
votes
1
answer
840
views
How to call the unix Sendmail from oracle
I know that is possible to send mails using the oracle-db by UTL_SMTP, and there are several examples of such usage everywhere.
My question is: Can I call the GNU/Unix/Linux Sendmail to perform a ...
2
votes
1
answer
8k
views
Amazon RDS - Can't connect to MySQL database server?
So I've been working on this issue for a while now, and I'll explain what I'm trying to do. I'm trying to connect to a MySQL database server, hosted by Amazon Web Services in the Amazon RDS service. ...
2
votes
2
answers
4k
views
Oracle's UTL_FILE when connected locally or through listener has different behaviour
We have a procedure which creates a CSV file with UTL_FILE. (env is Oracle 11.2.0.1 and RHEL 6.4)
Until now, we were storing that CSV file into system oracle (the oracle owner) user home (/home/oracle/...
5
votes
1
answer
1k
views
Does the mysql parameter "max_connections" apply for unix socket connections?
The documentation does not specify if max_connections apply only to TCP connections.
The way it is said, it looks like it does apply for any kind of connection, but I'd like to be sure because ...
0
votes
0
answers
1k
views
mysql died with stack trace
My mysql server died while running select queries.
Status of every table is good. When I went to the error log I found this:
Thread pointer: 0x2ab63e0f49e0
Attempting backtrace. You can use the ...
1
vote
1
answer
264
views
MySQL on Unix, should administrator accounts join the operating system "mysql" group?
When I install MySQL via Yum, it automatically creates the mysql operating system user and group. Then mysqld executes as mysql (instead of as root), and all the files in the data directory are owned ...
5
votes
2
answers
4k
views
How do you find home information for Oracle RAC on Unix?
Need help finding Oracle home path corresponding to a database instance in RAC environment. I am aware of few of the ways to achieve the same. Listing them below to avoid the same answers.
/etc/...
2
votes
4
answers
3k
views
Shell: How to time a script running in SQLPlus and kill it after x amount of minutes?
I have a little tool which automatically runs a series of SQL scripts when and outputs to .XLS when an appropriate request is made. However, some SQL scripts need to be ran on a live database, and I ...
1
vote
1
answer
5k
views
Delete shared memory segments left over by an Oracle instance
We're using Oracle Enterprise 11rR2 running on Solaris.
How can I delete/remove allocated shared memory segments using ipcrm?
I'm getting this error:
ORA-01041: internal error. hostdef extension ...
4
votes
2
answers
60k
views
How to check if Oracle DB process is running in Unix and where Oracle DB is installed
I am new to Unix and trying to find out a command that checks if Oracle DB is installed in my Unix box. I came across commands ps -ef|grep smon and ps -ef|grep pmon in net. But which is the correct ...
1
vote
1
answer
2k
views
DBA group in Linux
When we need to install Oracle database in Linux then the user should be in dba group. What is this group and why the user should be in this group for installing Oracle database. What happens if the ...
0
votes
2
answers
347
views
which process has created a load spike on my server last week?
O.S.:Linux
MYSQL server
we got a load spike last week.
how can I find the process that has created the load spike on my server last week.
2
votes
1
answer
2k
views
Question about Oracle's interpretation of "host cpu utilization" in v$sysmetric view
I am studying the v$sysmetric view from Oracle and trying to understand what is Oracle's interpretation of "Host CPU Utilization"
It says in the metric_unit as % busy/(idle + busy), but what is busy? ...
5
votes
2
answers
1k
views
Perl vs Ksh for Unix Database Administration
I realize this is a somewhat more subjective question, but I am looking to the community for guidance.
Our company is fairly new to having DBAs. We used to use DB2 for i on the IBM's iSeries servers, ...