Tag Info

Hot answers tagged

8

You created the table in the SYS schema (which you should never, ever do. Really, never). When you log in as teacher1 any statement looks for objects in that schema. But there is no TEACHER1.INSTRUCTORS table, because the real name is SYS.INSTRUCTORS (did I mention what a bad idea it is to create objects in the SYS schema?). You need to run select * from ...


6

State codes and their meaning. 1 'Account is locked out' 2 'User id is not valid' 3-4 'Undocumented' 5 'User id is not valid' 6 'Undocumented' 7 'The login being used is disabled' 8 'Incorrect password' 9 'Invalid password' 10 'Related to a SQL login being bound to Windows domain password policy enforcement. ...


6

You can cycle the error log by calling sp_cycle_errorlog and then that will close the current error log and cycle the log extensions. Basically, it'll create a new error log file that SQL Server will be hitting. Then the archived error log(s) can be treated accordingly (delete/move with caution). This will not technically "truncate" the log, it'll just ...


5

You generally don't want to rely on implicit conversions of strings to dates. That only leads to pain and suffering since different users will have different date formats. Either use ANSI date literals or use the to_date function with an explicit format mask UPDATE bb_product SET salestart = date '2012-06-01', saleend = date '2012-06-15', ...


4

I think the permissions are correct because otherwise you wouldn't have gotten here. My guess is that a modification you have made has caused the problem. This is particularly the case given that it is a segmentation fault. What you really need to do is look at the call stack at the time the core was dumped and see if you can isolate where in the code ...


4

Based on a_horse_with_no_name's comment, I started searching around psql and found the solution: \set VERBOSITY verbose SELECT * FROM tgvbn(); ERROR: 42883: function vfjkb() does not exist ... Now that goes into .psqlrc. Details and further options can be found in the psql documentation.


4

Life has many great mysteries. For the MySQL DBA, one of life's greatest mysteries is your question. It's been this way going on 12 years. In fact, I found a bug report that was resolved when the disappearance of mysql.sock was caused by trying to start mysqld with mysqld already running (a.k.a. Shooting mysqld in the Foot). I have personally addressed ...


4

"MSSQL.1" is not the directory for a SQL Server 2008 R2 instance. You should verify the directory you are trying to place the database in. The default data path for a normal installation is: "C:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLServer\MSSQL\Data". Edit If this is indeed the path of the databases for your SQL Server 2008 R2 instance ...


3

I'm sure there are dba.se and StackOverflow duplicates, but it was far faster for me to post this link: http://connect.microsoft.com/SQLServer/feedback/details/537419/sql-server-should-not-raise-illogical-errors In short, the Query Optimizer is really free to rewrite the plan as it sees best. Sometimes, it means a column is transformed (CAST -> int) close ...


3

The Check Database Integrity Task provided in the maintenance plan issue DBCC CHECKDB WITH NO_INFOMSGS on the database selected. You can view its command by clicking the view-SQL in the task setup. If you doubt the generated SQL command, you can use SQL profiler to see its SQL command. If corruption was found, the agent job with this maintenance task will ...


3

From the Connection.setAutoCommit docs: NOTE: If this method is called during a transaction and the auto-commit mode is changed, the transaction is committed. If setAutoCommit is called and the auto-commit mode is not changed, the call is a no-op. But I don't think it's very readable/obvious in your code. You should probably simply commit before ...


3

Best and most reliable way is to use backup / restore If your database is big and you are on sql server 2008 R2 and up, standard edition also has compression feature to allow you to compress your backups. Dont forget to sync up users after the restore :-)


3

Try like below, it will help you... CREATE TABLE `read` (`order` MEDIUMINT NOT NULL AUTO_INCREMENT, `title` VARCHAR(50) NOT NULL, `url` VARCHAR(50) NOT NULL, PRIMARY KEY(`order`) )DEFAULT CHARSET=UTF8;


2

I have found the problem: Somehow, MySQL decided to create mysql.sock in /private/tmp rather than in /var/mysql. So, my solution was to create a symlink: cd /var sudo mkdir mysql sudo ln -s /private/tmp/mysql.sock mysql.sock Now everything works fine.


2

The solution of the problem is that table MCOUNTRY did not have the primary key. It was only configured with unique constraint that was called is the same way that primary keys. Even when the unique column was used in query Oracle could not provide expected result. Something obvious but still lesson to learn, unique constraint is not the same as primary ...


2

initdb and the server process itself must be run as the same OS user which owns the data directory. Don't forget to set permissions for that directory to only allow that user access (chmod 700). Regarding the segmentation fault -- can you cause it with an unmodified version of PostgreSQL, or is this perhaps a result of bug in some customization you've ...


2

$ /usr/local/mysql/bin/perror 12 OS error code 12: Cannot allocate memory Sure, you have memory now but MySQL isn't running now. Remove those multi-gigabyte configuration entries and verify that you can start the server without them. I suspect read_buffer_size may be the one that's getting you but they are all unnecessarily large for a new server. The ...


2

I setup a SQL Server 2008 R2 instance and have the following databases: AdventureWorks2008R2 DemoFatalCorruption1 zzOtherDatabase I setup a Maintenance Plan with the Check Database Integrity Task in it. After running the plan it did fail: After reviewing the log it showed that it will continue checking additional databases after hitting one that ...


2

MySQL does not have CTEs. You can (and should) rewrite the query using either a temporary table or a nested subquery (derived table): SET @rank:=0; SELECT CASE WHEN row_id <= 375 THEN 'Training' ELSE 'Test' END AS SomeAlias, t.* FROM ( SELECT @rank := @rank + 1 AS row_id, UUID() as random_value, d.* FROM ...


2

Below will work, as you had syntax error : USE master GO RESTORE DATABASE client_a_database1 FROM DISK = 'G:\database1\***.bak_1', DISK = 'G:\database1\***.bak_2', DISK = 'G:\database1\***.bak_3' WITH MOVE 'database1_data' TO 'G:\database1\***.mdf' MOVE 'database1_log' TO 'G:\database1\***.ldf', REPLACE, Password = 'password' GO ...


2

I'm not sure what authentication method you are using, but I've seen issues when using Windows Authentication when the DC (Domain Controller) is being overwhelmed with requests you can see issues. Usually it is a timeout issue though. If you are using Windows Auth, try switching to SQL Auth to rule that out. Sorry I tried to add a comment but it wouldnt ...


2

My suspicion would be that you are either using external_locking or you have character set issues. It might center around the following bugs Error 11 - can't unlock file when using external_locking Inconsistent use of column alias In ORDER BY clause that specified collation I would suggest upgrading to MySQL 5.6 as this situation is consistent with ...


1

Synonyms have nothing to do with privileges. They are simply a way to simplify naming. The error you are getting appears to indicate that user_app does not have privileges on the user.clients table. You'd need to grant that GRANT SELECT, INSERT, UPDATE, DELETE ON user.clients TO user_app; Of course, in your actual system, I'm guessing that there ...


1

So it appears my SQL Server installation was mucked up. Running a repair on it produced the following output. Setup has detected a non canonical discretionary access control list (DACL) on directory MSAS10_50.MSSQLSERVER. Which is not the folder I was restoring to, but I assume something temporary was needing to be written. Resetting the ACL on the ...


1

It sounds like you may have set Force Encryption on the instance. In SQL Server Configuration Manager, you can see this setting (server-side encrypting enforcement) by expanding SQL Server Network Configuration and then right-clicking on Protocols for YOURINSTANCENAME, and selecting Properties. You will see the option there to toggle Force Encryption, as ...


1

Standard options for me to check would be the following, but this has been done by you or does not match exactly because the backup at least starts: Disk space sufficient? (If possible do a chkdsk) Write Access granted to SQL Server? Next step would be to check throughput of backup drive because SQL Server backup is sensible in this area, some timers in ...


1

The Momentus XT is an "Advanced Format Drive" and I see that you are running Windows 7 SP1. If the drive runs 512e mode this can cause you a problem with SQL Server. This is because it can create sectors in some multiple of 512 byte boundaries, instead of always at 4096 bytes. (Your error was caused by a 6 * 512 byte sector.) If that is the case, then you ...


1

You want to use a stored procedure instead of a stored function You can rewrite it like this DELIMITER $$ CREATE PROCEDURE hierarchy_connect_by_parent_eq_prior_id(IN value INT, IN reqdTable VARCHAR(50), OUT result INT) BEGIN DECLARE _id INT; DECLARE _parent INT; DECLARE _next INT; DECLARE CONTINUE HANDLER FOR NOT FOUND SET @id = NULL; ...


1

If this is just one time issue and CHECKDB run without any errors and you have good backups, do not bother to investigate it (unless you want to spend time and resources to what is not reproducible). If you are able to reproduce the issue, then I would recommend you to Replicate on a test environment and capture whats going using a Profiler. As a ...


1

It really depends which constraints are violated. You neglected to disclose that in your question. To disable triggers (including foreign key constraints): ALTER TABLE tbl DISABLE TRIGGER ALL; Be sure to revert it afterwards: ALTER TABLE tbl ENABLE TRIGGER ALL; More in the manual. However, this does not disable Check, Not-Null, Unique, Primary Key or ...



Only top voted, non community-wiki answers of a minimum length are eligible