Langsung ke konten utama

Postingan

Menampilkan postingan dari 2019

“Copying to tmp table” extremely slow

You may need to try setting certain variables within your session tmp_table_size max_heap_table_size These particular values may be too small for your DB Connection to fulfill the query efficiently. These can be set within as follows: To see what values these settings have currently do the following: SHOW VARIABLES LIKE 'max_heap_table_size'; SHOW VARIABLES LIKE 'tmp_table_size'; To set max_heap_table_size to 64M do the following: SET max_heap_table_size = 1024 * 1024 * 64; To set tmp_table_size to 32M do the following: SET tmp_table_size = 1024 * 1024 * 32; If you cannot set these values within your own session, contact your hosting provider to dynamically set them in your my.cnf. Give it a Try !!!

ORA-00257: archiver error. Connect internal only | Automatic archival Disabled

Then as root switch to this user so have to have all the oracle variables in your path, You MUST log on as sysdba that's the only internal user allowed to access the database in such situations. eg if the owner owner/user is oradba # su - oradba Now you can invoke sqlplus $sqlplus /nolog SQL>conn / as sysdba SQL> archive log list; Database log mode        Archive Mode Automatic archival        Enabled Archive destination        USE_DB_RECOVERY_FILE_DEST Oldest online log sequence     482 Next log sequence to archive   482 Current log sequence        487 Check the Archive destination and delete all the logs SQL> shutdown immediate Database closed. Database dismounted. SQL> startup mount ORACLE instance started. Total System Global Area 3240239104 bytes Fixed Size     2217712 bytes Variable Size 2835351824 bytes Database Buffers   385875968 bytes Redo Buffers    16793600 bytes Database mounted. SQL> alter database noar

install php5.3 ubuntu 14.04, 16.04, 18.04 with cgi not fcgi

Halo, kali ini saya akan membagikan tutorial mudah untuk compile dan install php5.3 di ubuntu 14.04, btw.. di 18.04 juga bisa sebenernya, asalakan perinsipnya tahu.  kenapa saya pake cgi tidak fcgi? ya karena lebih enteng dari fcgi, dan fpm. nah biasanya, kita sering dihadapkan dengan kondisi dimana diharuskan memasang aplikasi lama, di server yang OS nya ke-kinian. oke.. bisa dipahami? untuk install php5.3 diubuntu, diperlukan keahlian dalam mengatasi error dan mencarinya di google. yuk mulai 1. Unduh file compile PHP wget -O php-5.3.29.tar.gz http://de1.php.net/get/php-5.3.29.tar.gz/from/this/mirror 2. install depedensi yang dibutuhkan: apt-get install apache2 apt-get install build-essential apt-get install libxml2-dev apt-get install libcurl4-openssl-dev pkg-config apt-get install libbz2-dev apt-get install libjpeg-turbo8-dev apt-get install libpng-dev apt-get install libfreetype6-dev apt-get install libmcrypt-dev libreadline-dev apt-get install libmysqlclient15-de

Membuat auto backup pada sql server

Tidak usah bertele tele.. aku tau pasti langsung scroll script nya Berikut script  T-sql nya: DECLARE @name VARCHAR(50) -- database name  DECLARE @path VARCHAR(256) -- path for backup files  DECLARE @fileName VARCHAR(256) -- filename for backup  DECLARE @fileDate VARCHAR(20) -- used for file name -- specify database backup directory SET @path = 'C:\Backup\'  -- specify filename format SELECT @fileDate = CONVERT(VARCHAR(20),GETDATE(),112) DECLARE db_cursor CURSOR READ_ONLY FOR  SELECT name FROM master.sys.databases WHERE name NOT IN ('master','model','msdb','tempdb')  -- exclude these databases AND state = 0 -- database is online AND is_in_standby = 0 -- database is not read only for log shipping OPEN db_cursor  FETCH NEXT FROM db_cursor INTO @name  WHILE @@FETCH_STATUS = 0  BEGIN     SET @fileName = @path + @name + '_' + @fileDate + '.BAK'     BACKUP DATABASE @name TO DISK = @fileName     FETCH NEXT

How to install OCI8 on Ubuntu 17.10 and PHP 7.1

Install Oracle Instant Client and SDK Step 1 Download the latest Oracle Instant Client and SDK from the Oracle website (Yeah, fuck you Oracle, you need to create an account to download the files). http://www.oracle.com/technetwork/topics/linuxx86-64soft-092277.html Look for instantclient-basic-linux.x64-12.2.0.1.0.zip and instantclient-sdk-linux.x64-12.2.0.1.0.zip. Step 2 Create a new folder to store the Oracle Instant Client files on your machine. mkdir /opt/oracle And move your files to /opt/oracle. Step 3 Extract the files cd /opt/oracle unzip instantclient-basic-linux.x64-12.2.0.1.0.zip unzip instantclient-sdk-linux.x64-12.2.0.1.0.zip Step 4 Next, we need to symlink the .so files. ln -s /opt/oracle/instantclient_12_2/libclntsh.so.12.2 /opt/oracle/instantclient_12_2/libclntsh.so ln -s /opt/oracle/instantclient_12_2/libocci.so.12.2 /opt/oracle/instantclient_12_2/libocci.so Step 5 Now lets add the folder to the ldconfig's config folder. echo /opt/oracl

How to check the maximum number of allowed connections to an Oracle database?

The  sessions  parameter is derived from the  processes  parameter and changes accordingly when you change the number of max processes. See the  Oracle docs  for further info. To get only the info about the sessions: select current_utilization , limit_value from v $ resource_limit where resource_name = 'sessions' ; CURRENT_UTILIZATION LIMIT_VALUE ------------------- ----------- 110 792 Try this to show info about both: select resource_name , current_utilization , max_utilization , limit_value from v $ resource_limit where resource_name in ( 'sessions' , 'processes' ); RESOURCE_NAME CURRENT_UTILIZATION MAX_UTILIZATION LIMIT_VALUE ------------- ------------------- --------------- ----------- processes 96 309 500 sessions 104 323 792

How to setup Let's Encrypt certificates on Ubuntu 12.04

Hey yow first, we login has root. and enable mod_ssl a2enmod ssl service apache2 restart Next, we can install python2.7-dev and Git echo "deb http://us.archive.ubuntu.com/ubuntu/ precise-updates main restricted" | sudo tee -a /etc/apt/sources.list.d/precise-updates.list sudo apt-get update sudo apt-get install python2.7-dev git we can installed the letsencrypt client: git clone --branch 0.30.x https://github.com/letsencrypt/letsencrypt cd letsencrypt we can shut down Apache – there is probably a better way, but on a low-traffic test server/domain, that’s entirely okay for me. I then requested a new certificate and started Apache up again. service apache2 stop ./letsencrypt-auto certonly --no-self-upgrade --standalone -d example.com -d www.example.com  service apache2 start Don't forget to add --no-self-upgrade to your renew cron job. Now we went into the config file of virtual host and changed things around a bit. I am sure that

CKAN Datapusher: 500 Server Error

Target WSGI script '/etc/ckan/datapusher.wsgi' can not be loaded as Python module. Exception occurred processing WSGI script '/etc/ckan/datapusher.wsgi'. Traceback (most recent call last): File "/etc/ckan/datapusher.wsgi", line 8, in import ckanserviceprovider.web as web File "/usr/lib/ckan/datapusher/lib/python2.7/site-packages/ckanserviceprovider/web.py", line 13, in <mod $ import flask.ext.login as flogin ImportError: No module named ext.login You have to check if the modules Flask and Flask_login are installed and if necessary install them: pip uninstall flask (if is installed in other version) pip install flask == 0.12 pip install flask-login then you have to check the file /ckanserviceprovider/web.py (possible path): /usr/lib/ckan/datapusher/lib/python2.7/site-packages/ckanserviceprovider/web.py and replace: import flask.ext.login as flogin with: import flask_login as flogin because flask.ext.login is obsolete final

Install Oci8 ubuntu 16.04

First Prerequirements are a working apache2 and php7.2 (Ubuntu 18.04) environment. Download the basic (like instantclient-basic-linux.x64-12.2.0.1.0.zip) and the SDK (instantclient-sdk-linux.x64-12.2.0.1.0.zip) package from the Oracle Website  http://www.oracle.com/technetwork/database/database-technologies/instant-client/downloads/index.html Upload both files to your web server, you can use WinSCP for it Unzip both files on a server, in my case, you will get a new folder named "instantclient_12_2" 4a. Create a destination folder mkdir /opt/oracle 4b. Move and rename the instantclient folder mv instantclient_12_2 /opt/oracle/instantclient 4c. Change rights on the folder chown -R root:www-data /opt/oracle Check if you have the required packages for installing OCI8 apt install php7.2-dev php-pear build-essential libaio1 Create necessary soft links ln -s /opt/oracle/instantclient/libclntsh.so.12.1 /opt/oracle/instantclient/libclntsh.s

show function mysql command

mysql> SHOW create FUNCTION kode_level\G; *************************** 1. row ***************************             Function: kode_level             sql_mode: NO_AUTO_VALUE_ON_ZERO      Create Function: CREATE DEFINER=`lakip2016`@`localhost` FUNCTION `kode_level`(`pkode` VARCHAR(50), `pdelimiter` CHAR, `pLevel` INT) RETURNS varchar(255) CHARSET latin1     DETERMINISTIC     SQL SECURITY INVOKER BEGIN DECLARE hasil VARCHAR(255);   SET hasil = SUBSTRING_INDEX(pkode, '.',pLevel);   RETURN hasil; END character_set_client: utf8 collation_connection: utf8_general_ci   Database Collation: latin1_swedish_ci 1 row in set (0.00 sec)

Remote Port Forwarding

$ ssh -nNT -R 4000:localhost:3000 user@server.com The above command sets up an ssh tunnel between your machine and the server, and forwards all traffic from localhost:3000 (on your machine) to localhost:4000 (in the context of the server). So now you can connect to the locally running service on port 3000 on the server on port 4000. This trick is very useful because it allows you to be able to expose a locally running service through your server to others on the internet without having to deploy it / setup on the server.

Can't Use apt i.e. /boot is 100% full

1. Get the list of kernel images Get the list of kernel images and determine what you can do without. This command will show installed kernels except the currently running one $ sudo dpkg --list 'linux-image*'|awk '{ if ($1=="ii") print $2}'|grep -v `uname -r` You will get the list of images somethign like below: linux-image-3.19.0-25-generic linux-image-3.19.0-56-generic linux-image-3.19.0-58-generic linux-image-3.19.0-59-generic linux-image-3.19.0-61-generic linux-image-3.19.0-65-generic linux-image-extra-3.19.0-25-generic linux-image-extra-3.19.0-56-generic linux-image-extra-3.19.0-58-generic linux-image-extra-3.19.0-59-generic linux-image-extra-3.19.0-61-generic 2. Prepare Delete Craft a command to delete all files in /boot for kernels that don't matter to you using brace expansion to keep you sane. Remember to exclude the current and two newest kernel images. From above Example, it's sudo rm -rf /boot/*-3.19.0-{25,56,58,59,61,65}-*

export mysql to csv with command line

First, I can give you the answer for ONE table: The trouble with all these INTO OUTFILE or --tab=tmpfile (and -T/path/to/directory) answers is that it requires running mysqldump on the same server as the MySQL server, and having those access rights. My solution was simply to use mysql (NOT mysqldump) with the -B parameter, inline the SELECT statement with -e, then massage the ASCII output with sed, and wind up with CSV including a header field row: Example: mysql -B -u root -p dbname -e "SELECT * FROM query;" | sed "s/'/\'/;s/\t/\",\"/g;s/^/\"/;s/$/\"/;s/\n//g" > test.csv output: "id","login","password","folder","email" "8","mariana","xxxxxxxxxx","mariana","" "3","squaredesign","xxxxxxxxxxxxxxxxx","squaredesign","mkobylecki@squaredesign.com" "4","miedziak",

[sshtunnel.py:notify_exception_error:233]: Traceback (most recent call last) | Use module Crypto.Signature.pkcs1_15 instead

Recently I started getting the following error in a script that never had any problems in the past: NotImplementedError: Use module Crypto.Signature.pkcs1_15 instead There wasn’t much information related to this error in regards to Paramiko. Eventually I was able to “fix” it by running: sudo -H pip uninstall paramiko sudo -H pip uninstall pycrypto sudo -H pip install paramiko done

How to recover deleted file held open by Apache

If a file has been deleted but is still open, that means the file still exists in the filesystem (it has an inode) but has a hard link count of 0. Since there is no link to the file, you cannot open it by name. There is no facility to open a file by inode either. Linux exposes open files through special symbolic links under  /proc . These links are called  /proc/12345/fd/42  where 12345 is the  PID  of a process and 42 is the number of a file descriptor in that process. A program running as the same user as that process can access the file (the read/write/execute permissions are the same you had as when the file was deleted). The name under which the file was opened is still visible in the target of the symbolic link: if the file was  /var/log/apache/foo.log , then the target of the link is  /var/log/apache/foo.log (deleted) . Thus you can recover the content of an open deleted file given the  PID  of a process that has it open and the descriptor that it's opened on like thi