Tag Archives: The database

ERROR 1010 (HY000): Error dropping database (can’t rmdir ‘./myapp’, errno: 39)

ERROR 1010 (HY000): Error dropping database (can’t rmdir ‘./ahte’, errno: 39)
Because the cold backup did not close the database before, the data file was corrupted and the data could not be qufied
Delete database prompt ~
Since it is known that the file is corrupt, the database cannot recognize it, so we go to the corresponding directory to delete the entity file
cd /data/mysql/mysql3318/data/ahte
rm -f *

Arithmetic overflow error converting numeric to data type numeric.


Run the stored procedure when found this error, the stored procedure for thousands of lines of code, scan the stored procedure will find storage process is divided into several parts, the wrong time, I will COPY the original stored procedure, then a part of a part of the add up, and every part of add, will carry out this part of the code, the final positioning in the sixth part, and then a field continue to locate a field, and finally, positioning the two fields has a problem, as shown in figure

After locating this problem, I checked the data:


 
And then look at the table structure:

Importerror of Django error: no module named**

There was a problem testing Django today, and I was badly burned.

D:\pythonCode\django\mysite>django-admin.py startproject mysite

And then I’m going to create my APP, which I’m going to call MB

python manage.py startapp mb

The directory structure is as follows:

D:.
│  manage.py
│
├─mb
│      admin.py
│      models.py
│      models.pyc
│      tests.py
│      views.py
│      __init__.py
│      __init__.pyc
│
└─mysite
        settings.py
        settings.pyc
        urls.py
        wsgi.py
        __init__.py
        __init__.pyc

For testing, I created a very simple model
Modify the MB – & gt; Models.py, with only one field

from django.db import models

# Create your models here.
class Test(models.Model):
    testField = models.TextField()

 
Modify the mysite – & gt; settings.py

INSTALLED_APPS = (
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    'mysite.mb',
)

Note: This is where I want the database to be set to

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.sqlite3',
        'NAME': 'D:\\test.db',
    }
}

 
 
When performing database tests

manage.py sql mb

Error message:

ImportError: No module named mb

Well, I set it in Settings.py, why don’t I have this model?
 
I don’t know, Baidu, will mysite-> Settings. Py

INSTALLED_APPS = (
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    'mb',
)

This time, there it is

BEGIN;
CREATE TABLE "mb_test" (
    "id" integer NOT NULL PRIMARY KEY,
    "testField" text NOT NULL
)
;

COMMIT;

 
It looks like a success, but why?For explanation.

Ora-00257: archiver error. Connect internal only, until free

No configuration environment variable is loaded once
The source/home/oracle 11 g /. Following
Connect super administrator
(1) SQLPLUS/AS SYsdBA;
There are errors under The Times

(2) SQLPLUS SYS/Password as SYsdBA

Look at V$FLASH_RECOVERY_AREA_USAGE to see how the archive directory is being used. Sure enough, the file is full.
SYS@ orcl> select * from V$FLASH_RECOVERY_AREA_USAGE;

Note: As you can see, ARCHIVELOG logs have reached 99.9%. The reason why the archive is full is that a user is doing a lot of add, delete and change operations, which results in a lot of redo logs.
archive logs switch frequently. The solution is to clear out a lot of archived logs!
there are two ways to solve this problem.
1 use RMAN to clear archive logs.
2 modify the size of the flashback recovery area DB_RECOVERY_FILE_DEST_SIZE.

the first method USES RMAN to clear archive logs.
[root@oracle fast_recovery_area]# rman target sys/Huawei12#$
Note: System is Oracle user, MyOracle is Oracle user password, orCL is the database name SID of connection.
RMAN> crosscheck archivelog all;
RMAN> Delete noprompt EXPIRED Archivelog all;
Note: Delete expired archives
This removes the archive. Go into SQLPlus again to see ARCHIVELOG log usage!
 
The second method is to increase the size of the flash recovery area. As follows:
SYS@ orcl> ALTER SYSTEM SET DB_RECOVERY_FILE_DEST_SIZE=8g;
Make a backup strategy in the archived data. To avoid causing the problem.
configure retention policy to recovery window of 15 days;
or delete the log information at backup time. Use rman Target sys/Huawei12#$to execute the following two commands
DELETE ARCHIVELOG ALL COMPLETED BEFORE ‘SYSDATE-7’; // Delete an archive from 7 days ago
DELETE ARCHIVELOG FROM TIME ‘SYSDATE-7’; // Delete seven days to the present archive
After I delete it

SQL Msg 18054, Level 16, State 1

Today I received a seemingly simple task — to modify a piece of data in a database. Sounds simple enough.
A search on the Internet soon pieced together the corresponding SQL statement:

UPDATE [suivi].[dbo].[numSerie]
SET ni_numCible = ‘HF17263N7P13340’
WHERE ni_num = ‘HF17262A1400234’

As you can see from the above statement, the task is simple. In the [suivi].[dbo].[numSerie] table, find the record ni_num = ‘HF17262A1400234’ and set the ni_numCible field for that record to ‘HF17263N7P13340’.
Unexpectedly, after the above statement is executed, the following prompt appears:

Msg 18054, Level 16, State 1, Procedure tg_InsUpdCible, Line 31
Error 50010, severity 16, state 1 was raised, but no message with that error number was found in sys.messages. If error is larger than 50000, make sure the user-defined message is added using sp_addmessage.
Msg 3609, Level 16, State 1, Line 1
The transaction ended in the trigger. The batch has been aborted.

After the execution should not appear “XX Rows Afftectd”, as SQL small white, for this pile of prompts, it means that I do not understand.
Well, Google it, OK, and see the first result.
It looks like I got the same error message, so take a closer look. The following code is found:

/*Check for valid parameter*/
If LEN(@txtbidderid) =0 or ISNULL(@txtbidderid, ") = "
RAISERROR(50002,10, 1,'Error Accessing Bidder Record - Must Provide Bidder ID')
ELSE

The Error 50002 obtained by the author should be output here, then my next work should be to find where the file I output Error 50010 here is, after finding out, why should I throw Error 50010 to me, how to avoid it will be easily solved!
I don’t know what kind of file the author posted. After searching for a few key words in this file, I get trigger. This means that the insert \ UPDATE \ DELETE operation will automatically trigger some operations. But where’s this trigger?Let’s find out.

Check the contents of the highlighted file in the figure above, and sure enough, it says under what conditions Error 50002 will be thrown.
Right-click the file and, alas, there isa Disable menu that appears to Disable the trigger.
After disabling the trigger, go back to the original SQL statement in this article and you’re done! And then the trigger is enabled. OK, mission accomplished!
For those of you who know a little bit about SQL, this little problem today should be very easy to solve. But for someone like me who knows very little about SQL, it can be a real threat. Record the process of solving the problem now, is to provide the solution to the rest of the same problems, more important is to remind yourself, have a problem, the key is to solve the problem, don’t encounter a problem, find a pile of related tutorials to begin again chew, this can’t be sure, there is no doubt that this will give up less than half an hour. Always take the solution of the current problem as the fundamental goal, step by step, the problem will be solved naturally.

Reproduced in: https://www.cnblogs.com/outs/p/7730733.html

SQL Error: 1452, SQLState: 23000

There was a problem when I encountered the modulation code today, that is, After I deleted all the records of the database, I registered through the registration page of the front page.
But SQL Error: 1452, SQLState: 23000; Other errors are as follows:
[tomcat HTTP — – 5] WARN org. Hibernate. Engine. The JDBC. Spi. SqlExceptionHelper – SQL Error: 1452, SQLState: 23000
the 2017-03-31 12:27:35 [tomcat HTTP — – 5] WARN org. Hibernate. Engine. The JDBC. Spi. SqlExceptionHelper – SQL Error: 1452, SQLState: 23000
2017-03-31 12:27:35 [tomcat-http–5] ERROR org.hibernate.engine.jdbc.spi.SqlExceptionHelper – Cannot add or update a child row: a foreign key constraint fails (`chatwork`.`user_role`, CONSTRAINT `FK_02dcca8f72554a62bdec8067a49` FOREIGN KEY (`role_id`) REFERENCES `role` (`id`))
2017-03-31 12:27:35 [tomcat-http–5] ERROR org.hibernate.engine.jdbc.spi.SqlExceptionHelper – Cannot add or update a child row: a foreign key constraint fails (`chatwork`.`user_role`, CONSTRAINT `FK_02dcca8f72554a62bdec8067a49` FOREIGN KEY (`role_id`) REFERENCES `role` (`id`))
2017-03-31 12:27:35 [tomcat-http–5] ERROR org.hibernate.engine.jdbc.batch.internal.BatchingBatch – HHH000315: Exception executing batch [could not perform addBatch]
2017-03-31 12:27:35 [tomcat-http–5] ERROR org.hibernate.engine.jdbc.batch.internal.BatchingBatch – HHH000315: Exception executing batch [could not perform addBatch]
org.springframework.dao.DataIntegrityViolationException: could not perform addBatch; SQL [insert into user_role (nickName, role_id) values (?, ?)] ; constraint [null]; nested exception is org.hibernate.exception.ConstraintViolationException: could not perform addBatch
This error occurs because the foreign key is null, so an error is reported. Because it’s a test database, there’s nothing important in it so I just delete the database and restart the project and create the table.
 
 
Solution: first check the relationship of their own table, can be set in the background through the set method, or directly in the database to add this foreign key; One more thing is not to delete the library!!

[MySQL] the solution of MySQL workbench “error code: 1175”

When performing a batch database update using MySQL Workbench, executing a statement will encounter the following error:
Error Code: 1175 You are using safe… without a WHERE that uses a KEY column
Because MySQL Workbench’s default security Settings do not allow batch table updates. This error is prompted when the SQL statement to be executed is batch update or delete.
The solution is as follows:
Open the Workbench menu [Edit]-> [Preferences…] -> Switch to the [SQL Queries] page -> Remove the [Safe Updates] check -> Click the [OK] button
Finally, just restart the SQL Editor and make a new connection.

Or before I make a query,
Execute the following statement:

SET SQL_SAFE_UPDATES = 0;

ArcGIS desktop experience. Similar to: error 000732 output Geodatabase

Until the release of ArcGIS Desktop 10 SP1
 
1: in the desktop ArcGIS9, inside the Geodatabase (PGDB, FGDB, ArcSDE GDB) create a Table (Table), if the Table name begin with GDB (GDB, gdb1, GDBSDF, gdb_3d, etc.) after creating all could not see the form, and in fact is the existence of this Table, if you create a Table with the same Table will be prompted to exist, can use PGDB open Access to view, create a class there is no problem. There is no problem with ArcGIS10.
Problem analysis: currently, just a guess, because ArcGIS9 GDB Schema are GDB_ table in the beginning, the Schema are invisible to users in ArcCatalog, speculation is likely the GDB to block out the beginning of the table, don’t show, but while streamlining the GDB with ArcGIS10 Schema, but there are still four tables, starting with the GDB ArcGIS10 create tables can be seen, a bit surprised, may ArcGIS10 write these four table table name directly in the dead into the program.
2: when using ArcGIS desktop import export data, because the default using ArcGIS to create objects and other elements of the system will create a ObjectID fields, is a unique identifier, some users will use this ObjectID, may record the corresponding ObjectID to correspond to the specified elements, but in the process of data import and export, especially the import, the user will be very depressed these ObjectID rearrangement, so users will not be able to come here to use the ObjectID, how should do?
The ObjectID is rearranged by the Import/Export tool. It is suggested that users use Copy/Paste directly to the data set or element class object. In this way, ObjectID is not rearranged.
3: In the process of data Import using ArcGIS desktop, take Import as an example, “Output Location” in the Import box prompts a small Red Cross, such path does not exist or error-000732 Error occurs?
Solution: the relative path “Database Connections/Connection to lish. Sde” is modified to the absolute path “C:/Users/gis/AppData/Roaming/ESRI Desktop10.0 ArcCatalog/Connection to lish. Sde”, because the problem some machines have similar problems, some machines have no, the reason is still unknown.
4: When SDE creates or imports data containing the field name “AREA”, the field name is automatically prefixed.
Question: This problem exists in ArcGIS9 software, but not in ArcGIS10, for unknown reasons!
5: When creating a LoadRaster dataset, if the whole Raster was loaded and the InputRaster prompted the Red Cross, the Raster object had to be double-clicked and opened into three bands to be loaded. How could the whole Raster object be loaded without being loaded in the form of bands?
Problem analysis: The default Rand Number selected by the user when creating a RasterDataset was “1”. Setting the Rand Number to “3” would solve the problem.
6: Users are using joins to mount tables (element classes versus normal tables), but sometimes a library cannot be mounted on a non-Windows operating system. What can be done?
Problem analysis: Because the Join is using Ole mechanism for articulated, but the Windows operating system default Ole drive, but not the Windows operating system, so the Windows operating system does not support Ole, which does not support the use of the Join, so users can completely change the way in which different using sde commands to complete (sdetable – o create_view), effect is the same, and taking advantage of sde command to create a view can be saved, read-only, This view can be treated as a read-only element class.
sdetable command reference: http://wenku.baidu.com/view/16c6362acfc789eb172dc8c2.html
7: Use ArcCatalog to export ArcSDE data to PGDB and import it in. Some field ranges change.
Problem analysis: Import field for text, for example, because PGDB is usually Access, the text field’s biggest support for Access to 255, more than the value into the remark field, so if a user ArcSDE text field length is 1000, then imported into the PGDB inside because of greater than 255 into the remark field, then pour into ArcSDE, note field does not record length, directly convert note length to CLOB (in Chinese version is more than 2000 of Oracle database with CLOB storage), so, If the user does not want to encounter this phenomenon during the data import and export, please replace the exported PGDB with FGDB.

8: when using ArcMap or ArcGIS Engine for simple operations such as map enlargement, the following phenomenon occurs: the map is blank, “gsrvr.exe” Error or “Network IO Error” Error is prompted?
Problem analysis: First, check whether the user’s database matches the version of your ArcSDE. This error is typical ArcGIS9.3/9.3.1 and Oracle10.2.0.1 (note the small version number of the database). It is suggested that the database should be Oracle10.2.0.3.
9: In the editing process of using ArcCatalog, when saving data, prompt: “Create: An unexpected failure in Dimension”, OrA-20092: Maximum number of Grids per feature(8000) excplug.Ora-06512: In “SDE_ST_DOMAIN_METHODS” line 1487 and so on.
Problem analysis: ArcGIS defaults that an object cannot exceed 8000 grids, which is a hard and fast rule, so it means that the grid setting of the layer edited by the user is too small or an object edited by the user is too large. Either the user deletes the index, rebuilds the index, or the user edits the grid value and replaces it with a larger grid value.
10: Null character missing at the end of the ArcMap import datagram ORA-01480 STR bound value.
Problem solving: if the user has this problem, the user’s machine configuration should be
operating system: Windows Server 2003/2008 Enterprise x64 SP2
Oracle version 10.2.0.4.0-64bit
ArcSDE version: ArcSDE 9.3.1 for oracle10g64
DeskTop version: 9.3.1
vector storage mode: ST_Geometry
this has no way, if the user’s configuration completely meets the above configuration, congratulations, you are so lucky, this is all encountered by you, as of press ArcGIS9.3.1 also did not solve the problem.
The user could either use a direct connection to derive the data, or use BLOB storage instead of ST_Geometry storage, and presumably more people would choose the first option.
11: ArcMap USES Identify figure to find both length and area are 0?
The user must be using SDO_Geometry geometry to store geometry data. The structure is not at all like the ST_Geometry structure where length and area can be recorded, so this is normal.

Ora-00947: not enough values

Transfer: http://space.itpub.net/21213917/viewspace-607671
ORA-00947: Not enough values
This error occurred while performing the INSERT.
Insert into table 1 values (123,2423,12);
The structure of Table 1 has four columns, and obviously only three values are inserted, so this problem arises.
After the value of the column is added, OK.
If you want to insert only three values:
Insert into table 1(a,b,c) values (123,2423,12);
Just use this statement.

Centos 7 | mariadb/mysql | [ERROR] InnoDB: Unable to lock ./ibdata1 error: 11

The article directories
Error overview solution

Error in

2020-06-29  0:17:42 0 [Note] InnoDB: Check that you do not already have another mysqld process using the same InnoDB data or log files.
2020-06-29  0:17:43 0 [ERROR] InnoDB: Unable to lock ./ibdata1 error: 11
2020-06-29  0:17:43 0 [Note] InnoDB: Check that you do not already have another mysqld process using the same InnoDB data or log files.
2020-06-29  0:17:44 0 [ERROR] InnoDB: Unable to lock ./ibdata1 error: 11
2020-06-29  0:17:44 0 [Note] InnoDB: Check that you do not already have another mysqld process using the same InnoDB data or log files.
2020-06-29  0:17:45 0 [ERROR] InnoDB: Unable to lock ./ibdata1 error: 11
2020-06-29  0:17:45 0 [Note] InnoDB: Check that you do not already have another mysqld process using the same InnoDB data or log files.
2020-06-29  0:17:46 0 [ERROR] InnoDB: Unable to lock ./ibdata1 error: 11
2020-06-29  0:17:46 0 [Note] InnoDB: Check that you do not already have another mysqld process using the same InnoDB data or log files.
2020-06-29  0:17:47 0 [ERROR] InnoDB: Unable to lock ./ibdata1 error: 11
2020-06-29  0:17:47 0 [Note] InnoDB: Check that you do not already have another mysqld process using the same InnoDB data or log files.
2020-06-29  0:17:48 0 [ERROR] InnoDB: Unable to lock ./ibdata1 error: 11
2020-06-29  0:17:48 0 [Note] InnoDB: Check that you do not already have another mysqld process using the same InnoDB data or log files.
2020-06-29  0:17:49 0 [ERROR] InnoDB: Unable to lock ./ibdata1 error: 11
2020-06-29  0:17:49 0 [Note] InnoDB: Check that you do not already have another mysqld process using the same InnoDB data or log files.
2020-06-29  0:17:49 0 [Note] InnoDB: Unable to open the first data file
2020-06-29  0:17:49 0 [ERROR] InnoDB: Operating system error number 11 in a file operation.
2020-06-29  0:17:49 0 [ERROR] InnoDB: Error number 11 means 'Resource temporarily unavailable'
2020-06-29  0:17:49 0 [Note] InnoDB: Some operating system error numbers are described at https://mariadb.com/kb/en/library/operating-system-error-codes/
2020-06-29  0:17:49 0 [ERROR] InnoDB: Cannot open datafile './ibdata1'
2020-06-29  0:17:49 0 [ERROR] InnoDB: Could not open or create the system tablespace. If you tried to add new data files to the system tablespace, and it failed here, you should now edit innodb_data_file_path in my.cnf back to what it was, and remove the new ibdata files InnoDB created in this failed attempt. InnoDB only wrote those files full of zeros, but did not yet use them in any way. But be careful: do not remove old data files which contain your precious data!
2020-06-29  0:17:49 0 [ERROR] InnoDB: Plugin initialization aborted with error Cannot open a file
2020-06-29  0:17:49 0 [Note] InnoDB: Starting shutdown...
2020-06-29  0:17:50 0 [ERROR] Plugin 'InnoDB' init function returned error.
2020-06-29  0:17:50 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2020-06-29  0:17:50 0 [Note] Plugin 'FEEDBACK' is disabled.
2020-06-29  0:17:50 0 [ERROR] Unknown/unsupported storage engine: InnoDB
2020-06-29  0:17:50 0 [ERROR] Aborting

The solution
Website query Error code 11
Operating System Error Codes – MariaDB Knowledge Base
https://mariadb.com/kb/en/operating-system-error-codes

Number Error Code Description
11 EAGAIN Try again

It’s no use trying again
An attempt was made to remove the deleted error file

cd /var/lib/mysql
ll

total 188492
-rw-rw---- 1 mysql mysql    16384 Jun 28 22:43 aria_log.00000001
-rw-rw---- 1 mysql mysql       52 Jun 28 22:43 aria_log_control
-rw-rw---- 1 mysql mysql     7007 Jun 28 22:43 ib_buffer_pool
-rw-rw---- 1 mysql mysql 79691776 Jun 28 22:49 ibdata1
-rw-rw---- 1 mysql mysql 50331648 Jun 28 23:18 ib_logfile0
-rw-rw---- 1 mysql mysql 50331648 Jun 22 09:17 ib_logfile1
-rw-rw---- 1 root  root  12582912 Jun 28 23:18 ibtmp1
-rw-rw---- 1 mysql mysql        0 Jun 22 09:28 multi-master.info
drwx------ 2 mysql mysql     4096 Jun 22 09:17 mysql
-rw-rw---- 1 mysql mysql      351 Jun 28 21:52 mysql-bin.000001
-rw-rw---- 1 mysql mysql      351 Jun 28 22:19 mysql-bin.000002
-rw-rw---- 1 mysql mysql      351 Jun 28 22:31 mysql-bin.000003
-rw-rw---- 1 mysql mysql      351 Jun 28 22:32 mysql-bin.000004
-rw-rw---- 1 mysql mysql      351 Jun 28 22:43 mysql-bin.000005
-rw-rw---- 1 mysql mysql       95 Jun 28 22:32 mysql-bin.index
-rw-rw---- 1 mysql mysql        0 Jun 28 22:43 mysql-bin.state
drwx------ 2 mysql mysql     4096 Jun 22 09:17 performance_schema

Remove or delete the following three files :(note the backup)

ibdata1、ib_logfile0、ib_logfile1

Restart the mariadb/mysql

error while loading shared libraries: requires glibc 2.5 or later dynamic linker

C development environment under Linux setup process
– install glibc
 
Some software may require that your system’s Glibc be higher than a certain version to work, and if your Glibc is lower than the required version, you will have to upgrade your Glibc in order to run the software. Such as:
Error while loading Shared Libraries: Requires glibc 2.5 or later Dynamic Linker
 
You can look for compiled RPM packages or use source code to upgrade Glibc.
 
RPM package glibc
RPM is relatively easy to install, but the dependency problem is difficult to solve. Give a download address:
http://mirrors.jtlnet.com/centos/5.5/os/i386/CentOS/
$ RPM – the ivh glibc 2.5-49.. I386 RPM
 
But I’m using CentOS 4.8 and it doesn’t seem to be compatible…
error: Failed dependencies:
Glibc-common = 2.5-49 is needed by glibC-2.5-49. I386
glibc > 2.3.4 conflicts with glibc – common – 2.3.4-2.43 el4_8. 3. The i386
 
After the installation is complete, you can check whether you have upgraded:
$ ls -l /lib/libc.so.6
lrwxrwxrwx 1 root root 11 10-08 22:08 /lib/libc.so.6 -> Libc – 2.5. So
 
compile and install glibc
Download the glibc
[root@localhost test]# pwd
/test
[root @ localhost test] # wget http://ftp.gnu.org/gnu/glibc/glibc-2.9.tar.bz2
 
Download the glibc – linuxthreads
[root @ localhost test] # wget http://ftp.gnu.org/gnu/glibc/glibc-linuxthreads-2.5.tar.bz2
 
Unpack the
[root-@localhost test]# tar-jvxf glibc-2.9.tar.bz2
[root @ localhost test] # CD glibc 2.9
[root-@localhost glibc-2.9]# tar-jvxf../glibc – linuxthreads – 2.5. Tar..bz2
 
configuration
[root @ localhost glibc 2.9] # CD..
[root@localhost test]# exportCFLAGS=”-g -O2 -march=i486″
[root@localhost test]# mkdir glibc-build
[root@localhost test]# cd glibc-build
[root@localhost glibc-build]# .. /glibc-2.9/configure –prefix=/usr –disable-profile — enabling -add-ons –with-headers=/usr/include –with-binutils=/usr/bin
 
The installation
[root@localhost glibc-build]# make
[root@localhost glibc-build]# make install
 
Three points should be paid attention to during installation and compilation:
1. To unzip glibC-LinuxThreads into glibc directory.
2. Cannot run configure in glibc’s current directory.
Otherwise, if there is an error: error “Glibc cannot be Compiled without optimization”, please add the optimization switch: [root-@localhost test]# export CFLAGS=” -g-O2-March =i486″

Reproduced in: https://blog.51cto.com/rockhooray/787500