database-administration

ORA-01658: unable to create INITIAL extent for segment in tablespace TS_DATA

依然范特西╮ 提交于 2019-11-29 01:55:26
When i tried to create a table in my User_DB schema i am getting an error as ORA-01658: unable to create INITIAL extent for segment in tablespace TS_DATA . I run the following query to get all the TABLESPACE_NAME : SELECT * FROM DBA_DATA_FILES; But i really dont know which tablespace i am using and how to extend the tablespace to solve this issue. As the error message indicates, you're using the TS_DATA tablespace. You can extend it by either enlarging one of the existing data files: ALTER DATABASE DATAFILE 'C:\ORACLEXE\APP\ORACLE\ORADATA\XE\TS_DATA.DBF' RESIZE 3000M; Or by adding a second

How do I add an admin user to Mongo in 2.6?

旧街凉风 提交于 2019-11-28 23:35:35
问题 I upgraded from 2.4 to 2.6 and authentication broke. This tutorial seems pretty straightforward but I keep getting locked out of my own database. My situation is pretty simple, I have a single Mongo server and need one user/pwd combination to connect. First I connect via the localhost exception as mentioned. Then I create the admin user as suggested: use admin db.createUser( { user: "myadmin", pwd: "mysecret", roles: [ { role: "userAdminAnyDatabase", db: "admin" } ] } ) Now it's time to add

How can I kill all sessions connecting to my oracle database?

走远了吗. 提交于 2019-11-28 16:42:52
I need to quickly (and forcibly) kill off all external sessions connecting to my oracle database without the supervision of and administrator. I don't want to just lock the database and let the users quit gracefully. How would I script this? BIBD This answer is heavily influenced by a conversation here: http://www.tek-tips.com/viewthread.cfm?qid=1395151&page=3 ALTER SYSTEM ENABLE RESTRICTED SESSION; begin for x in ( select Sid, Serial#, machine, program from v$session where machine <> 'MyDatabaseServerName' ) loop execute immediate 'Alter System Kill Session '''|| x.Sid || ',' || x.Serial# ||

Designing a SQL schema for a combination of many-to-many relationship (variations of products)

蹲街弑〆低调 提交于 2019-11-28 03:12:57
I hope the title is somewhat helpful. I'm using MySQL as my database I am building a database of products and am not sure how to handle storing prices/SKU of variations of a product. A product may have unlimited variations, and each variation combination has its own price/SKU/etc.. This is how I have my products/variations table set up at the moment: PRODUCTS +--------------------------+ | id | name | description | +----+------+--------------+ | 1 | rug | a cool rug | | 2 | cup | a coffee cup | +----+------+--------------+ PRODUCT_VARIANTS +----+------------+----------+-----------+ | id |

Use of FLASHBACK in Oracle

余生颓废 提交于 2019-11-28 02:22:50
I have searched for the flashback command. Somewhere it is written we can rollback the truncate operation, and somewhere it is written we can't rollback. Can the FLASHBACK command in Oracle used to rollback the truncate table operation? Lalit Kumar B You need to have Flashback Data Archive enabled. Then the truncate could be reversed with a statement like this: insert into <truncated_table> select * from <truncated_table> as of timestamp <some time>; Thanks to @ Jon Heller for adding this useful information about the new feature: This requires version 11.2 or higher, which introduced support

ORA -12953: The request exceed the maximum allowed database size of 11GB

自作多情 提交于 2019-11-28 02:08:01
问题 We have oracle express edition 11g i.e. ORACLE XE 64bit. There is 10GB available space in the database. But system tablespace is 98% full, there are 2 system tabalespaces. When we (our startup team) try to ADD or RESIZE the datafile or tablespace using ALTER command we get following error: ORA -12953: The request exceed the maximum allowed database size of 11GB What should be done to add or resize the datafile? 回答1: What should be done to add or resize the datafile? Nothing can be done. The

ORA-01658: unable to create INITIAL extent for segment in tablespace TS_DATA

半世苍凉 提交于 2019-11-27 16:19:02
问题 When i tried to create a table in my User_DB schema i am getting an error as ORA-01658: unable to create INITIAL extent for segment in tablespace TS_DATA . I run the following query to get all the TABLESPACE_NAME : SELECT * FROM DBA_DATA_FILES; But i really dont know which tablespace i am using and how to extend the tablespace to solve this issue. 回答1: As the error message indicates, you're using the TS_DATA tablespace. You can extend it by either enlarging one of the existing data files:

Find out the history of SQL queries

帅比萌擦擦* 提交于 2019-11-27 12:18:38
An update SQL query was executed on the server, which caused many problems later. How can I get the list of update queries executed in last 2 months, so that I can trace the exact problematic SQL query? select v.SQL_TEXT, v.PARSING_SCHEMA_NAME, v.FIRST_LOAD_TIME, v.DISK_READS, v.ROWS_PROCESSED, v.ELAPSED_TIME, v.service from v$sql v where to_date(v.FIRST_LOAD_TIME,'YYYY-MM-DD hh24:mi:ss')>ADD_MONTHS(trunc(sysdate,'MM'),-2) where clause is optional. You can sort the results according to FIRST_LOAD_TIME and find the records up to 2 months ago. For recent SQL: select * from v$sql For history:

How can I kill all sessions connecting to my oracle database?

柔情痞子 提交于 2019-11-27 09:51:50
问题 I need to quickly (and forcibly) kill off all external sessions connecting to my oracle database without the supervision of and administrator. I don't want to just lock the database and let the users quit gracefully. How would I script this? 回答1: This answer is heavily influenced by a conversation here: http://www.tek-tips.com/viewthread.cfm?qid=1395151&page=3 ALTER SYSTEM ENABLE RESTRICTED SESSION; begin for x in ( select Sid, Serial#, machine, program from v$session where machine <>

“Cannot open user default database. Login failed.” after installing SQL Server Management Studio Express

限于喜欢 提交于 2019-11-27 05:17:44
I have a database in a local file that is used by a program. The program has limited functionality and I needed to run some quick queries. I installed SQL Server Management Studio Express 2005 (SSMSE), connected to the SQL Server instance, attached the database file, and ran the queries. Now the original program will no longer connect to the database. I receive the error: Cannot open user default database. Login failed. Login failed for user 'MyComputer\MyUserName'. I've gone back into SSMSE and tried to set the default database. I've opened up Security, Logins, BUILTIN\Administrators and