Menu
  • HOME
  • TAGS

Oracle 10g users are expired

Tag: database,oracle10g,sqlplus,ora-12560

I have an Oracle 10g database which is connected to another server with instance client. Problem is all of users(SYS/SYSTEM/SYSMAN/FATASAN/JAVAHER) are expired (I forgot to change expire date) and also sqlpus and instance client are faced with ORA-12560 error (Both servers were good but now I have no connection to data!)

How can I login into my own database when all usernames are expired ?!

Best How To :

Login to database server as the Oracle sofrware owner (or, in case of Windows, as user who is member of ORA_DBA group), set ORACLE_HOME and ORACLE_SID environment variables, then login as:

sqlplus / as sysdba

You should get logged in without having to provide a password.

Hope that helps.

How do I prevent MySQL Database Injection Attacks using vb.net?

mysql,.net,database,vb.net,sql-injection

MySQLCon.Open() Dim SQLADD As String = "INSERT INTO members(member,gamertag,role) VALUES(@memberToAdd, @memberGamingTag, @memberRole)" COMMAND = New MySqlCommand(SQLADD, MySQLCon) COMMAND.Parameters.AddWithValue("@memberToAdd", memberToAdd.Text) COMMAND.Parameters.AddWithValue("@memberGamingTag", membersGamertag.Text) COMMAND.Parameters.AddWithValue("@memberRole", membersRole.Text) COMMAND.ExecuteNonQuery() memberToAdd.Text = "" membersGamertag.Text = "" membersRole.Text = "" MySQLCon.Close() MySQLCon.Dispose() You don't need to use...

Check if value exists in MySQL DB in Java?

java,mysql,database,jdbc

I'd do this check in the where clause and use the Java side to simply check if this query returned any results: Connection con = DatabaseConnection.getConnection(); PreparedStatement ps = con.prepareStatement ("SELECT questid FROM completedQuests WHERE characterid = ? AND questid = ?"); ps.setInt (1, characterId); ps.setInt (2, questId); ResultSet rs...

SQLite: Individual tables per user or one table for them all?

database,sqlite

In an object oriented language, would you make a class for every user? Or would you have an instance of a class for each user? Having one table per user is a really bad design. You can't search messages based on any field that isn't the username. With your current...

MySQL: Select several rows based on several keys on a given column

mysql,sql,database

If you are looking to find the records matching with both the criteria here is a way of doing it select `item_id` FROM `item_meta` where ( `meta_key` = 'category' and `meta_value` = 'Bungalow' ) or ( `meta_key` = 'location' AND `meta_value` = 'Lagos' ) group by `item_id` having count(*)=2 ...

How do I access website databases? [closed]

database

In barely any case would you get direct access to another company's database, even if you are affiliated. The most common way would be an API (which might be public or licensed): https://en.wikipedia.org/wiki/Application_programming_interface If the data is publicly available on a website, some do content parsing although this is not...

Speeding up a SQL query with indexes

sql-server,database,performance

The best thing to do would depend on what other fields the table has and what other queries run against that table. Without more details, a non-clustered index on (code, company, createddate) that included the "price" column will certainly improve performance. CREATE NONCLUSTERED INDEX IX_code_company_createddate ON Products(code, company, createddate) INCLUDE...

select data according to Row in Sqlite

android,database,sqlite,android-sqlite

you can do it just like below code public void rec(int _id){ String query = "SELECT * FROM notesDb WHERE PhoneNumber =" + _id; SQLiteDatabase db = this.getWritableDatabase(); Cursor cursor = db.rawQuery(query, null); if (cursor.moveToFirst()) { do { String temp_address = c.getString(0); String temp_address1 = c.getString(1); System.out.println(temp_address); System.out.println(temp_address1); } while...

Pull information from SQL database and getting login errors

php,sql,database

change $username = "'rylshiel_order"; to $username = "rylshiel_order"; and you should be through. You are passing on an extra single quote here. ...

Why am getting this error?: Unknown column 'firstname' in 'field list'

php,database,mysqli

$query = "INSERT INTO `myDatabaseForAll`.`users` (`id`, `firstname`, `lastname`, `username`, `password`) VALUES (NULL, $firstname, $lastname,$username,$password)"; you need single quote around text feilds in sql queries change above query to $query = "INSERT INTO `myDatabaseForAll`.`users` (`id`, `firstname`, `lastname`, `username`, `password`) VALUES (NULL, '$firstname', '$lastname','$username','$password')"; ...

Complex SQL with Multiple Joins

mysql,database,join

What I think you should take note of here is that each post has a department and a postType. If you take a step back, you can select all posts that belong to a certain department and a certain postType like this: SELECT p.* FROM posts p JOIN department d...

string split and subquery in mysql

php,mysql,database

SELECT id FROM tags WHERE name LIKE ( SELECT CONCAT(SUBSTRING(name,1,5),'__',SUBSTRING(name,8)) FROM tags WHERE id=1 ) Returns 1,4 But Two queries (or a refactor) might be a better option...

How to use existing SQLite database in swift?

ios,database,xcode,sqlite,swift

First add libsqlite3.dylib to your Xcode project (in project settings/Build Phases/Link Binary with Libraries), then use something like fmdb, it makes dealing with SQLite a lot easier. It's written in Objective-C but can be used in a Swift project, too. Then you could write a DatabaseManager class, for example... import...

what is the SQL prepared stament for lo_import in postgreSQL

c++,sql,database,postgresql,odbc

The query to prepare should be insert into test values(?,lo_import(?)); You proposal insert into test values(?,?) can't work because you can't submit a SQL function call (lo_import) as the value for a placeholder (?). Placeholders only fit where a literal value would fit. When you're asking what's the prepared statement...

Dgrid - Display label for number (i.e. 02 = Cat) I want to display Cat - not the number

javascript,database,dojo,dgrid

You need to use the column formatter function for rendering data. check the jsfiddle over here. Check the examples over here I have taken this example and modified as per your needs. require([ 'dgrid/Grid', 'dojo/domReady!' ], function(Grid) { var data = [ { id: 1, number: 7 }, { id:...

Displaying MySQL results in a single table

php,mysql,database

Try getting all the columns out first, then add it to the sql query, no need to loop the database query. $mark = $_POST['mark']; if (isset($_POST['mark']) && is_array($_POST['mark'])) { echo "<table border='1'>"; echo "<tr>"; for ($i = 0; $i < count($mark); $i++) { echo "<th>" . $mark[$i] . "</th>"; }...

Order by count not sorting the records correctly?

php,mysql,database

Try this SELECT count(receiver_id) as total_receiver FROM gr_group_memberships INNER JOIN gr_group on gr_group_memberships.group_id = gr_group.id GROUP BY gr_group_memberships.receiver_id ORDER BY gr_group_memberships.receiver_id DESC I think it will worked what you want...

sql script to find index's tablespace_name only

sql,database,oracle

SELECT DTA.* FROM DBA_TABLESPACES DTA, dba_indexes DI WHERE DI.TABLESPACE_NAME = DTA.TABLESPACE_NAME AND DI.OWNER ='USER' AND NOT EXISTS (SELECT 'x' FROM DBA_TABLES DTT WHERE DTT.TABLESPACE_NAME = DTA.TABLESPACE_NAME AND DTT.OWNER = DI.OWNER ); ...

Multiply time with a decimal value in mysql?

mysql,database,stored-procedures

SEC_TO_TIME( TIME_TO_SEC( '00:04:18' ) * 1.7 ) = '00:07:18.6' SEC_TO_TIME( TIME_TO_SEC( '00:04:18' ) * 1.7 ) = '00:07:44.4'

Difference between dba_SEGMENTS and dba_data_files

mysql,sql,database,oracle11g,oracle-sqldeveloper

Oracle uses "logical" und "physical" structures to store the data. For this case: The extents of a segment can be stored in different datafiles, so just summing up can work but must not work see here: http://docs.oracle.com/cd/E11882_01/server.112/e40540/logical.htm#CNCPT301 Plus: Oracle has a "High Water Mark" so even if your segment size...

PreparedStatement.executeUpdate() doesn't insert in sqlite database

java,database,sqlite

SOLVED: In a Maven Project, all the resources are copied into another directory after the "build" command. I was reading the wrong db.

Database only adds (x) amount of rows before error system resources exceeded

database,vb.net,ms-access

You should change your code to something like the following. Note that Everything that returns an object like OleDbConnection, OleDbCommand, or OleDbDataReader is wrapped in a Using block. These objects all implement the IDisposable interface, which means they should be cleaned up as soon as you're done with them. Also...

Combining two select statements

sql,database,select,where

Try to this var chgAssociationQuery1 = ((from a in sostenuto.PROBLEMS join b in sostenuto.S_ASSOCIATION on a.SERVICEREQNO equals b.FROMSERVICEREQNO join c in sostenuto.Changes on b.TOSERVICEREQNO equals c.SERVICEREQNO where b.FROMSERVICEID == 101001110 && b.TOSERVICEID == 101001109 && a.NAME.Contains(name) select new { ProblemReqNo = a.SERVICEREQNO, ProblemId = a.SERVICEREQID, ChangeReqNo = c.SERVICEREQNO, ChangeId =...

Desktop Database with Server without installation

java,database,server,desktop,h2

Like Jayan told me in a comment to my question embedded mode does accept a location to save the data.

Improving work with SQL DataTime

sql,sql-server,database,tsql

You can do it like this: SELECT IIF(DAY(@A) >= 25, DATEADD(d, 25 - DAY(@A), @A), DATEADD(d, 25, EOMONTH(@A, -2))) Here's a sample fiddle as well: sqlfiddle Note: EOMONTH requires SQL Sever 2012 or above - it returns the End-Of-Month date given a start date and a month offset....

SimpleMembershipProvider WebSecurity.InitializeDatabaseConnection The login from an untrusted domain

asp.net,database,exception,model-view-controller

I think that you are providing in your connection string UserName and password, so you can change from Integrated Security=True to Integrated Security=False and if the user 'DB_9CB321_Szklarnia_admin' has rights to connect it will work. When Integrated Security=True the userID and password will be ignored and attempt will be made...

echo both users

php,mysql,sql,database,loops

Why don't you just do it in one single query? Just replace the necessary table and column name, and variables/values/parameters to be bind in your query: $query = mysqli_query($conn, "SELECT first_name, last_name, description, role FROM `wp_usermeta` WHERE `first_name` = '$first_name' OR `last_name` = '$last_name' OR `description` = '$description' OR `role`...

Why I can't compare dates?

sql,oracle,oracle10g

First, your date comparison is too complicated. If h.time is an internal date format (which it should be), then just do: WHERE h.time BETWEEN DATE '2015-05-07' AND DATE '2015-06-07' Another very important issue with your query is that the WHERE clause is turning the LEFT JOIN into an INNER JOIN....

Id in database using qt

database,qt,sqlite

The method you're looking for is QSqlQuery::lastInsertId(). To quote the documentation: Returns the object ID of the most recent inserted row if the database supports it. An invalid QVariant will be returned if the query did not insert any value or if the database does not report the id back....

Getting Multi Rows in Database and transferring it in a multiline textbox in VB.net WinForms

database,vb.net,winforms,textbox

I don't think you need to first query the db to get the count of records before then going back to the db to get the phonenumbers, you could just do this: mycom.CommandText = "SELECT Cellphone FROM tbl_applicant where Gender='Female';" myr = mycom.ExecuteReader While myr.Read() TextBox1.Text = TextBox1.Text & myr(0)...

Database object with different data

sql,asp.net,asp.net-mvc,database,entity-framework-6

Ideally what you want is a many-to-many relationship between your Shop and Product entities: public class Shop { public int ShopId {get; set;} public virtual ICollection<ShopProduct> ShopProducts {get; set;} } public class Product { public int ProductId {get; set;} public string Name {get; set;} public virtual ICollection<ShopProduct> ShopProducts {get; set;}...

ODBC ISAM_EOF without any reason

c#,database,odbc,cobol

It seems to be Windows UAC reliant. As our application run in compatibility mode, UAC visualization is active and causing may some problems. The reason for this is, that the COBOL databse is a file based database, and the client where are coding for uses these files in ODBC DSN...

C# Storing player cards Database Design

c#,mysql,sql,database,database-design

You can Add another table to reduce repeated data for player name card_table -> [card_id], [cardName] player_table -> [player_id] , [playerName] player_card_table -> [player_id],[card_id],[qty] Hope this will help :)...

creating stored procedure in mysql calculate profit from product table

mysql,sql,database,stored-procedures

You forgot the () after the procedure name. Also, you should set a delimiter: DELIMITER // CREATE PROCEDURE sp_profit() BEGIN SET @v1:= (select sum( cost_price * current_stock) from product); SET @v2:= (select sum( selling_price * current_stock) from product); SELECT (@v2 - @v1); END; // ...

Is there a way to create a primary key and have it cascade into other tables without re-entering data into the new tables?

mysql,database,cascade

You can use a trigger to autofill another table. DELIMITER $$ CREATE TRIGGER init_cross AFTER INSERT ON item FOR EACH ROW BEGIN INSERT INTO `cross`(item,equip) VALUES( NEW.item, NEW.equip ); END; $$ DELIMITER ; ...

Why does the date doesn't match with what I have inserted into the database?

sql,database,oracle

In the TO_DATE function you have to keep the format. The first parameter is the data and the second parameter is the format you are putting it. For example: to_date('29-Oct-09', 'DD-Mon-YY') to_date('10/29/09', 'MM/DD/YY') to_date('120109', 'MMDDYY') to_date('29-Oct-09', 'DD-Mon-YY HH:MI:SS') to_date('Oct/29/09', 'Mon/DD/YY HH:MI:SS') to_date('October.29.2009', 'Month.DD.YYYY HH:MI:SS') So if you put TO_DATE('05-06-2015','yyyy/mm/dd HH24:MI:SS')...

Purging Database - Count purged/not-purged tables

mysql,sql,sql-server,database,stored-procedures

The only way to do this is to manually run a count(*) on all of your tables filtering on the particular date field. The reason for this is because one table might have a column "CreatedDate" that you need to check if it's >30 days old, while another might have...

ElasticSearch asynchronous post

database,post,asynchronous,elasticsearch,get

To ensure data is available, you can make a refresh request to corresponding index before GET/SEARCH: http://localhost:9200/your_index/_refresh Or refresh all indexes: http://localhost:9200/_refresh ...

How I could create a db with the messages that are saved in admin/reports/dblog?

database,drupal,watchdog

Use function hook_watchdog(array $log_entry) { } where $log_entry is an array with all the log data you need. Read more: https://api.drupal.org/api/drupal/modules%21system%21system.api.php/function/hook_watchdog/7...

Foreign key in C#

c#,sql,sql-server,database

You want create relationship in two table Refer this link http://www.c-sharpcorner.com/Blogs/5608/create-a-relationship-between-two-dataset-tables.aspx...

In simple RESTful design, does PATCH imply mapping to CRUD's (ORM's) “update” and PUT to “destroy”+“create” (to replace a resource)?

database,rest,http,orm,crud

Well, Both the actions actually means update, where PUT is full update and PATCH is partial update. In case of PUT you already know the identifier of the resource and the resource already exists, so it is not a create and delete action per se. Infact, you can make do...

What type of database is the best for storing array or object like data [on hold]

database,node.js,sockets

Redis would probably be fastest, especially if you don't need a durability guarantee - most of the game can be played out using Redis' in-memory datastore, which is probably gonna be faster than writing to any disk in the world. Perhaps periodically, you can write the "entire game" to disk....

IBM Cognos _days_between function not working

mysql,database,date,cognos

The Cognos _days_between function works with dates, not with datetimes. Some databases, like Oracle, store all dates with a timestamp. On a query directly to the datasource, try using the database's functions to get this data instead. When possible, this is always preferable as it pushes work to the database,...

How to get node.js to connect to mongolab using mongoose

database,node.js,mongodb,mongoose,mongolab

Try using db = mongoose.connect(uri); instead of db = mongoose.createConnection(uri); ...

CakePHP Unable to insert to database (datetime format)

database,datetime,cakephp,insert

Your problem is in view :) Change report to Report. Now when you are saving $this->request->data its trying to find Report key to be able to save , or report field in your database. If you dont want change this , in controller you can save $this->request->data['report'] Edit Also if...

If I export my database with phpmyadmin will it lock my tables or take my database down?

mysql,database,phpmyadmin

The answer is no, tables won't be locked, database won't be down. But, if your database is large and it takes long time to backup it, you can sometimes expect performance degradation(slow SQL queries from your application).

ER diagram for booking database

database,database-design

typically, you would store the password as some sort of encrypted hash. It is best if this is one-way, so it cannot be decrypted. When authenticating, you check that you can generate the same hash from the provided password; not decypt what is stored. Your hash should also be "salted"...

Creating a generic / abstract “DBContext” Class for shared functionality among different DBs

c#,database,generics,inheritance,abstract-class

The key here is to step back and think about the problem from another angle. You are duplicating lots of code because you are creating instances of the database and command classes within the method. So inject them instead: public class SomeDBClass { static DataTable exec_DT(DBConnection conn, DBCommand cmd) {...

SQL Server: checkident: “[S00014][2560] Parameter 3 is incorrect for this DBCC statement.”

sql-server,database

https://msdn.microsoft.com/en-us/library/ms187745.aspx Turns out the ID field was a smallint which can only go to 32767. It was overflowing....

Pandas sql update efficiently

python,database,pandas

The problem here is not pandas, it is the UPDATE operations. Each row will fire its own UPDATE query, meaning lots of overhead for the database connector to handle. You are better off using the df.to_csv('filename.csv') method for dumping your dataframe into CSV, then read that CSV file into your...

Does Maria DB support ANSI-89 join syntax

sql,database,join,syntax,mariadb

Short answer - yes, both options are supported.